:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #1b2530;
  --muted: #74808c;
  --border: #e1e6eb;
  --blue: #1f68d5;
  --blue-dark: #164ea4;
  --usage-blue: #2c6edb;
  --green: #23844b;
  --green-soft: #e8f5ed;
  --amber: #a46700;
  --amber-soft: #fff5dc;
  --red: #bf3d3d;
  --red-soft: #fff0f0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
[hidden] { display: none !important; }

.shell { width: min(1500px, calc(100% - 48px)); margin: 0 auto; padding: 32px 0 58px; }
.login-panel { width: min(420px, 100%); margin: 9vh auto 0; padding: 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 16px 40px rgba(29, 45, 56, .08); }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 26px; background: var(--blue); color: #fff; border-radius: 8px; font-weight: 800; letter-spacing: 0; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: 1.2px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 38px; line-height: 1.12; letter-spacing: 0; }
h2 { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: 0; }
.muted { color: var(--muted); }
.login-panel .muted { margin-bottom: 28px; line-height: 1.6; }
.login-form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: #34434e; font-size: 14px; font-weight: 650; }
input { width: 100%; border: 1px solid #cbd5db; border-radius: 6px; padding: 12px 13px; color: var(--text); background: #fff; outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23, 105, 170, .14); }
.primary-button, .secondary-button, .icon-button { border-radius: 6px; border: 1px solid transparent; font-weight: 700; transition: background .15s, border-color .15s, color .15s; }
.primary-button { min-height: 44px; background: var(--blue); color: #fff; }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { min-height: 38px; padding: 0 13px; border-color: var(--border); background: var(--surface); color: #33424d; }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border-color: var(--border); background: var(--surface); color: var(--blue); font-size: 22px; line-height: 1; }
.icon-button:hover { border-color: var(--blue); }
.icon-button.is-spinning { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-error { margin: 0; color: var(--red); font-size: 13px; }

.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.topbar h1 { margin-bottom: 0; }
.toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.toolbar .muted { margin-right: 6px; font-size: 13px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary-card { min-height: 78px; padding: 15px 17px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(30, 45, 62, .04); }
.summary-card span { display: block; color: var(--muted); font-size: 13px; }
.summary-card strong { display: block; margin-top: 7px; font-size: 25px; }
.notice { min-height: 42px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid #cfe0eb; border-radius: 6px; color: #345064; background: #eef7fc; font-size: 13px; line-height: 1.5; }
.compact-notice { display: inline-flex; min-height: 30px; align-items: center; margin: 0 3px 0 0; padding: 5px 9px; border-radius: 5px; font-size: 12px; line-height: 1.25; white-space: nowrap; }
.danger-notice { border-color: #edc4c4; color: #873434; background: var(--red-soft); }
.account-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.account-card { display: flex; min-width: 0; height: 100%; flex-direction: column; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 9px 24px rgba(30, 45, 62, .07); transition: transform .18s ease, box-shadow .18s ease; }
.account-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(30, 45, 62, .12); }
.account-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.account-heading h2 { min-width: 0; overflow-wrap: anywhere; font-size: 18px; line-height: 1.25; }
.status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 11px; border-radius: 99px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 750; white-space: nowrap; }
.status-pill.warning { color: var(--amber); background: var(--amber-soft); }
.status-pill.error { color: var(--red); background: var(--red-soft); }
.account-message { margin: -8px 0 16px; padding: 9px 11px; border: 1px solid #edc4c4; border-radius: 6px; color: #873434; background: var(--red-soft); font-size: 12px; line-height: 1.4; }
.windows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: auto; }
.usage-row { min-width: 0; }
.usage-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 650; }
.usage-label strong { color: var(--text); font-size: 14px; font-weight: 800; }
.progress-track { display: block; width: 100%; height: 10px; padding: 0; overflow: hidden; border: 0; border-radius: 99px; background: #e8edf2; appearance: none; }
.progress-track::-webkit-progress-bar { border-radius: inherit; background: #e8edf2; }
.progress-track::-webkit-progress-value { border-radius: inherit; background: var(--usage-blue); transition: width .25s ease; }
.progress-track::-moz-progress-bar { border-radius: inherit; background: var(--usage-blue); }
.usage-meta { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.25; }
.usage-meta span { overflow-wrap: anywhere; }
.empty-state { margin: 0; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: calc(100% - 44px); padding: 12px 15px; border: 1px solid #cbd5db; border-radius: 6px; color: #263743; background: #fff; box-shadow: 0 8px 26px rgba(29, 45, 56, .15); font-size: 13px; }

@media (max-width: 1280px) {
  .account-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 20px, 560px); padding-top: 18px; }
  .login-panel { margin-top: 5vh; padding: 24px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .toolbar { justify-content: flex-start; width: 100%; }
  .toolbar .muted { flex: 1 1 100%; margin: 0 0 2px; }
  .compact-notice { white-space: normal; }
  .account-list { grid-template-columns: 1fr; }
  .windows { grid-template-columns: 1fr; gap: 10px; }
  .account-card { padding: 12px; }
  .account-heading { align-items: flex-start; }
  h1 { font-size: 30px; }
}

@media (max-width: 430px) {
  .summary-card { min-height: 74px; padding: 13px; }
  .summary-card strong { font-size: 23px; }
  .toolbar .secondary-button { flex: 1; }
}
