@layer reset, tokens, base, components, responsive, accessibility;

@layer tokens {
  :root {
    color-scheme: dark;
    --bg: #080b0e;
    --surface: #10151a;
    --surface-2: #151b21;
    --surface-3: #1b232b;
    --text: #f5f7f8;
    --text-soft: #cbd2d8;
    --muted: #89949f;
    --line: rgba(255, 255, 255, .085);
    --line-strong: rgba(255, 255, 255, .14);
    --accent: #72e8b4;
    --accent-strong: #4ed69b;
    --accent-ink: #05150e;
    --accent-soft: rgba(114, 232, 180, .1);
    --blue: #8ebcff;
    --amber: #f3c96f;
    --danger: #ff8585;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .2);
    --shadow-lg: 0 28px 90px rgba(0, 0, 0, .48);
    --ease-out: cubic-bezier(.2, .8, .2, 1);
    --content: 1180px;
  }
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { min-width: 320px; background: var(--bg); text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p { margin: 0; }
  button, input, textarea, select { font: inherit; }
  button { color: inherit; }
  a { color: inherit; text-decoration: none; }
}

@layer base {
  body {
    min-height: 100dvh;
    overflow-x: hidden;
    background:
      radial-gradient(70rem 42rem at 85% -18%, rgba(48, 145, 107, .17), transparent 62%),
      radial-gradient(55rem 36rem at -15% 35%, rgba(61, 96, 153, .1), transparent 65%),
      var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
  }
  body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    opacity: .022;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  }
  ::selection { background: rgba(114, 232, 180, .3); color: white; }
}

@layer components {
  .boot, .auth-shell {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  }
  .boot { align-content: center; gap: 14px; color: var(--muted); }
  .spinner, .button-spinner {
    border: 2px solid rgba(255,255,255,.16);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .75s linear infinite;
  }
  .spinner { width: 32px; height: 32px; }
  @keyframes spin { to { rotate: 1turn; } }

  .auth-card {
    width: min(100%, 460px);
    padding: clamp(26px, 6vw, 38px);
    border: 1px solid var(--line);
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(21, 27, 33, .94), rgba(12, 16, 20, .96));
    box-shadow: var(--shadow-lg), inset 0 1px rgba(255,255,255,.035);
    backdrop-filter: blur(24px) saturate(125%);
    animation: auth-in .48s var(--ease-out) both;
  }
  @keyframes auth-in { from { opacity: 0; translate: 0 18px; scale: .98; } }
  .mark {
    width: 52px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, #8af1c3, var(--accent-strong));
    color: var(--accent-ink);
    box-shadow: 0 12px 28px rgba(78,214,155,.18), inset 0 1px rgba(255,255,255,.45);
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -.1em;
  }
  .auth-card h1 { margin-block: 24px 10px; font-size: clamp(28px, 7vw, 34px); letter-spacing: -.045em; }
  .auth-card > p { margin-block-end: 24px; color: var(--muted); line-height: 1.6; }
  .auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-block: 20px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(5, 8, 11, .58);
  }
  .auth-tab {
    min-height: 44px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 750;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease;
  }
  .auth-tab.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }

  .field { display: grid; gap: 8px; margin-block: 15px; }
  .field > span { color: var(--text-soft); font-size: 13px; font-weight: 680; }
  .field small { color: var(--muted); font-size: 11px; line-height: 1.5; }
  input, textarea, select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(5, 8, 11, .66);
    color: var(--text);
    outline: 0;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  }
  input::placeholder, textarea::placeholder { color: #626d77; }
  input:focus, textarea:focus, select:focus { border-color: rgba(114,232,180,.7); background: #0b1014; box-shadow: 0 0 0 4px rgba(114,232,180,.09); }
  textarea { min-height: 100px; resize: vertical; }
  .fine { color: var(--muted); font-size: 12px; line-height: 1.5; }
  .error-text { color: var(--danger) !important; font-size: 13px; }

  .button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    padding: 10px 15px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 740;
    line-height: 1.15;
    text-align: center;
    transition: translate .18s var(--ease-out), border-color .18s ease, background .18s ease, box-shadow .18s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .button.primary { border-color: transparent; background: linear-gradient(145deg, #82edbe, var(--accent-strong)); color: var(--accent-ink); box-shadow: 0 9px 24px rgba(78,214,155,.13); }
  .button.ghost { background: rgba(255,255,255,.025); }
  .button.danger { color: var(--danger); }
  .button.full { width: 100%; margin-block-start: 8px; }
  .button.small { min-height: 36px; padding: 7px 11px; border-radius: 11px; font-size: 12px; }
  .button:disabled { opacity: .52; cursor: wait; }
  .button > span, .button > b, .button > i { flex: 0 0 auto; }

  .shell { width: min(var(--content), calc(100% - 32px)); margin-inline: auto; padding-block: max(12px, env(safe-area-inset-top)) max(48px, env(safe-area-inset-bottom)); }
  .topbar {
    position: sticky;
    top: max(8px, env(safe-area-inset-top));
    z-index: 10;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(10, 14, 18, .76);
    box-shadow: 0 10px 38px rgba(0,0,0,.2);
    backdrop-filter: blur(22px) saturate(135%);
  }
  .brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
  .brand .mark { width: 42px; border-radius: 13px; font-size: 13px; flex: 0 0 auto; }
  .brand-copy { display: grid; min-width: 0; }
  .brand-copy span { font-weight: 830; letter-spacing: -.035em; }
  .brand-copy small { margin-block-start: 2px; color: var(--muted); font-size: 10px; }
  .top-actions, .row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .top-action-button > span { color: var(--accent); font-size: 15px; line-height: 1; }
  .top-action-button > b { font-size: inherit; font-weight: inherit; }
  .live { min-height: 36px; display: inline-flex; align-items: center; gap: 8px; padding-inline: 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; white-space: nowrap; }
  .live-dot { width: 7px; aspect-ratio: 1; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); animation: live-pulse 2.5s ease-in-out infinite; }
  @keyframes live-pulse { 50% { box-shadow: 0 0 0 8px rgba(114,232,180,0); } }

  .hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr); gap: 14px; margin-block: 30px 36px; }
  .aggregate, .summary-card, .account-card, .vault-panel {
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(18,24,29,.92), rgba(13,17,21,.9));
    box-shadow: inset 0 1px rgba(255,255,255,.025);
  }
  .aggregate { position: relative; isolation: isolate; overflow: hidden; min-height: 300px; padding: clamp(24px, 4vw, 34px); border-radius: var(--radius-lg); }
  .aggregate::after { position: absolute; z-index: -1; width: 310px; aspect-ratio: 1; top: -190px; right: -80px; border-radius: 50%; background: rgb(var(--limit-rgb, 114 232 180) / .1); filter: blur(2px); content: ""; transition: background .35s ease; }
  .aggregate-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
  .aggregate-head > div:first-child { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
  .eyebrow, .section-kicker { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
  .pulse-icon { width: 38px; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid rgba(114,232,180,.18); border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
  .big-number { display: flex; align-items: baseline; gap: 11px; margin-block: 42px 8px; }
  .big-number strong { font-size: clamp(62px, 10vw, 92px); line-height: .78; letter-spacing: -.08em; font-variant-numeric: tabular-nums; }
  .big-number span { color: var(--limit-color, var(--accent)); font-size: 15px; font-weight: 760; transition: color .3s ease; }
  .aggregate-sub { max-width: 570px; margin-block: 17px 26px; color: var(--muted); line-height: 1.5; }
  progress.meter { width: 100%; height: 10px; display: block; overflow: hidden; appearance: none; -webkit-appearance: none; border: 1px solid rgba(255,255,255,.055); border-radius: 999px; background: rgba(0,0,0,.35); color: var(--limit-color, var(--accent-strong)); }
  progress.meter::-webkit-progress-bar { border-radius: inherit; background: rgba(0,0,0,.35); }
  progress.meter::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, var(--limit-color, var(--accent-strong)), var(--limit-end, #a7f08c)); box-shadow: 0 0 18px rgb(var(--limit-rgb, 114 232 180) / .25); transform-origin: left; }
  progress.meter::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, var(--limit-color, var(--accent-strong)), var(--limit-end, #a7f08c)); box-shadow: 0 0 18px rgb(var(--limit-rgb, 114 232 180) / .25); transform-origin: left; }
  .initial-meter-animation progress.meter::-webkit-progress-value { animation: meter-fill-in .65s var(--ease-out) both; }
  .initial-meter-animation progress.meter::-moz-progress-bar { animation: meter-fill-in .65s var(--ease-out) both; }
  @keyframes meter-fill-in { from { scale: 0 1; } }
  .limit-good { --limit-color: #63e6a7; --limit-end: #a5f28d; --limit-rgb: 99 230 167; }
  .limit-warning { --limit-color: #f0bd4e; --limit-end: #ffe486; --limit-rgb: 240 189 78; }
  .limit-critical { --limit-color: #ff646f; --limit-end: #ff9a78; --limit-rgb: 255 100 111; }
  .limit-unknown { --limit-color: #89949f; --limit-end: #aab2b9; --limit-rgb: 137 148 159; }
  .aggregate.limit-warning { border-color: rgb(var(--limit-rgb) / .24); background: linear-gradient(145deg, rgb(var(--limit-rgb) / .1), rgba(13,17,21,.94) 66%); }
  .aggregate.limit-critical { border-color: rgb(var(--limit-rgb) / .28); background: linear-gradient(145deg, rgb(var(--limit-rgb) / .12), rgba(18,13,16,.95) 66%); }
  .aggregate.limit-good { border-color: rgb(var(--limit-rgb) / .2); }
  .aggregate-meta { display: flex; justify-content: space-between; gap: 12px; margin-block-start: 10px; color: var(--muted); font-size: 11px; }
  .reset-info { min-width: 0; display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
  .reset-date { color: var(--muted); white-space: nowrap; }
  .reset-eta { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 7px; border: 1px solid rgb(var(--limit-rgb, 114 232 180) / .2); border-radius: 8px; background: rgb(var(--limit-rgb, 114 232 180) / .09); color: var(--limit-color, var(--accent)); font-size: 9px; font-weight: 690; line-height: 1; white-space: nowrap; }
  .reset-eta strong { color: inherit; font-size: 11px; font-weight: 860; letter-spacing: .015em; font-variant-numeric: tabular-nums; }
  .next-reset-forecast { min-width: 0; display: inline-flex; align-items: center; justify-content: flex-end; gap: 9px; }
  .next-reset-date, .next-reset-change { min-width: 0; display: grid; gap: 2px; }
  .next-reset-date { text-align: right; }
  .next-reset-date b { color: var(--text-soft); font-size: 9px; font-weight: 790; }
  .next-reset-date span { color: var(--muted); font-size: 9px; white-space: nowrap; }
  .next-reset-change { padding-inline-start: 9px; border-left: 1px solid var(--line); }
  .next-reset-change small { color: var(--muted); font-size: 8px; line-height: 1; }
  .next-reset-change strong { display: inline-flex; align-items: center; gap: 5px; color: var(--limit-color); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .next-reset-change strong b { font-weight: 860; }
  .next-reset-change strong i { color: var(--muted); font-style: normal; font-weight: 500; }
  .summary-card { display: grid; align-content: stretch; gap: 1px; padding: 8px; border-radius: var(--radius-lg); }
  .stat { min-height: 128px; display: flex; align-items: center; gap: 15px; padding: 18px; border-radius: 20px; }
  .stat + .stat { border-top: 1px solid var(--line); }
  .stat-icon { width: 38px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 9px; }
  .token-icon { background: rgba(142,188,255,.09); color: var(--blue); }
  .stat span { color: var(--muted); font-size: 12px; }
  .stat strong { display: block; margin-block-start: 7px; font-size: clamp(25px, 4vw, 32px); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }

  .dashboard-section { content-visibility: auto; contain-intrinsic-size: auto 420px; margin-block: 34px; }
  .section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-block-end: 15px; }
  .section-head h2 { margin-block: 6px 0; font-size: clamp(21px, 3vw, 25px); letter-spacing: -.04em; }
  .section-head p { margin-block-start: 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
  .add-button span, #add-secret > span { font-size: 19px; font-weight: 500; line-height: .8; }
  .account-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 11px 18px; margin-block: 2px 14px; padding: 11px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.018); }
  .account-filters { min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .account-filters::-webkit-scrollbar { display: none; }
  .filter-chip { min-height: 38px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 11px; padding-inline: 12px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 760; line-height: 1; text-align: center; white-space: nowrap; transition: color .18s ease, border-color .18s ease, background .18s ease; }
  .filter-chip b { min-width: 20px; padding: 3px 6px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--text-soft); font-size: 9px; text-align: center; }
  .filter-chip.active { border-color: rgba(114,232,180,.18); background: rgba(114,232,180,.08); color: var(--accent); }
  .account-sort { display: flex; align-items: center; gap: 9px; }
  .account-sort > span { color: var(--muted); font-size: 10px; }
  .sort-control { position: relative; min-width: 196px; }
  .sort-trigger { width: 100%; min-height: 40px; display: grid; grid-template-columns: 22px minmax(0, 1fr) 12px; align-items: center; gap: 9px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(7,11,14,.72); color: var(--text-soft); cursor: pointer; text-align: left; transition: border-color .18s ease, background .18s ease; }
  .sort-trigger b { overflow: hidden; font-size: 11px; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
  .sort-trigger[aria-expanded="true"] { border-color: rgba(114,232,180,.34); background: rgba(12,18,20,.98); }
  .sort-chevron { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; rotate: 45deg; translate: 0 -2px; transition: rotate .18s ease, translate .18s ease; }
  .sort-trigger[aria-expanded="true"] .sort-chevron { rotate: 225deg; translate: 0 2px; }
  .sort-menu { position: absolute; z-index: 12; top: calc(100% + 7px); right: 0; width: max(100%, 220px); overflow: hidden; padding: 6px; border: 1px solid var(--line-strong); border-radius: 15px; background: rgba(14,19,23,.98); box-shadow: 0 18px 48px rgba(0,0,0,.42); backdrop-filter: blur(20px); transform-origin: top right; animation: sort-menu-in .18s var(--ease-out) both; }
  .sort-menu[hidden] { display: none; }
  @keyframes sort-menu-in { from { opacity: 0; translate: 0 -5px; scale: .98; } }
  .sort-option { width: 100%; min-height: 42px; display: grid; grid-template-columns: 24px minmax(0,1fr) 18px; align-items: center; gap: 10px; padding: 7px 9px; border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); cursor: pointer; font-size: 11px; font-weight: 700; text-align: left; }
  .sort-option:hover, .sort-option:focus-visible { outline: 0; background: rgba(255,255,255,.055); }
  .sort-option.selected { background: rgba(114,232,180,.075); color: var(--accent); }
  .sort-check { position: relative; width: 13px; height: 8px; opacity: 0; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: -45deg; translate: 0 -2px; }
  .sort-option.selected .sort-check { opacity: 1; }
  .sort-icon { position: relative; width: 20px; height: 20px; display: block; color: currentColor; opacity: .82; }
  .sort-icon-free-desc::before, .sort-icon-free-asc::before { position: absolute; left: 4px; top: 3px; width: 2px; height: 14px; border-radius: 2px; background: currentColor; content: ""; }
  .sort-icon-free-desc::after, .sort-icon-free-asc::after { position: absolute; left: 1px; width: 6px; height: 6px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; content: ""; }
  .sort-icon-free-desc::after { top: 2px; rotate: 135deg; }
  .sort-icon-free-asc::after { bottom: 2px; rotate: -45deg; }
  .sort-icon-free-desc, .sort-icon-free-asc { background: linear-gradient(currentColor,currentColor) 12px 5px / 7px 2px no-repeat, linear-gradient(currentColor,currentColor) 12px 9px / 5px 2px no-repeat, linear-gradient(currentColor,currentColor) 12px 13px / 3px 2px no-repeat; }
  .sort-icon-free-asc { transform: scaleY(-1); }
  .sort-icon-number { background: radial-gradient(circle, currentColor 0 2px, transparent 2.5px) 1px 4px / 5px 6px repeat-y, linear-gradient(currentColor,currentColor) 8px 5px / 11px 2px no-repeat, linear-gradient(currentColor,currentColor) 8px 13px / 8px 2px no-repeat; }
  .sort-icon-recent, .sort-icon-reset { border: 1.7px solid currentColor; border-radius: 50%; }
  .sort-icon-recent::before, .sort-icon-reset::before { position: absolute; left: 8px; top: 3px; width: 1.7px; height: 6px; border-radius: 2px; background: currentColor; transform-origin: 50% 100%; rotate: -38deg; content: ""; }
  .sort-icon-recent::after, .sort-icon-reset::after { position: absolute; left: 8px; top: 8px; width: 5px; height: 1.7px; border-radius: 2px; background: currentColor; content: ""; }
  .sort-icon-reset { color: var(--amber); box-shadow: inset 0 0 0 3px rgba(243,201,111,.06); }
  .accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr)); gap: 13px; }
  .account-card { position: relative; width: 100%; container-type: inline-size; overflow: hidden; padding: 0; border-radius: var(--radius-md); cursor: pointer; perspective: 1200px; -webkit-tap-highlight-color: transparent; transition: border-color .3s ease, background .3s ease, translate .2s var(--ease-out), box-shadow .3s ease; }
  .account-card::before { position: absolute; width: 180px; aspect-ratio: 1; top: -120px; right: -80px; border-radius: 50%; background: rgba(255,255,255,.025); filter: blur(2px); content: ""; transition: background .35s ease; pointer-events: none; }
  .account-card.online { border-color: rgb(var(--limit-rgb) / .27); background: linear-gradient(145deg, rgb(var(--limit-rgb) / .16), rgba(12,18,18,.95) 66%); box-shadow: inset 0 1px rgba(255,255,255,.035), 0 14px 40px rgb(var(--limit-rgb) / .07); }
  .account-card.online::before { background: rgb(var(--limit-rgb) / .13); }
  .account-card.offline { border-color: rgba(255,255,255,.075); background: linear-gradient(145deg, rgba(25,29,33,.9), rgba(13,17,20,.94)); }
  .account-card-stage { display: grid; min-height: 324px; transform-style: preserve-3d; }
  .account-face { grid-area: 1 / 1; min-width: 0; min-height: 100%; padding: 20px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transform-style: preserve-3d; transition: transform .58s cubic-bezier(.2,.75,.2,1), opacity .28s ease; }
  .account-front { position: relative; z-index: 1; display: flex; min-width: 0; flex-direction: column; transform: rotateY(0); }
  .account-back { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; background: linear-gradient(145deg, rgba(12,18,21,.97), rgba(7,11,14,.98)); transform: rotateY(-180deg); pointer-events: none; }
  .account-card.flipped .account-front { transform: rotateY(180deg); pointer-events: none; }
  .account-card.flipped .account-back { transform: rotateY(0); pointer-events: auto; }
  .account-card.in-use { border-color: rgba(142,188,255,.7); box-shadow: inset 0 1px rgba(255,255,255,.045), 0 0 0 1px rgba(142,188,255,.16), 0 0 28px rgba(75,140,255,.24); animation: active-card-glow 2.6s ease-in-out infinite; }
  .account-card.in-use::after { position: absolute; z-index: 4; inset: 0; border: 1px solid rgba(142,188,255,.42); border-radius: inherit; box-shadow: inset 0 0 22px rgba(75,140,255,.08); content: ""; pointer-events: none; }
  .account-card.in-use .account-front { padding-block-start: 49px; }
  .in-use-ribbon { position: absolute; z-index: 3; top: 15px; left: 20px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid rgba(142,188,255,.28); border-radius: 999px; background: rgba(142,188,255,.1); color: var(--blue); font-size: 9px; font-weight: 840; letter-spacing: .07em; text-transform: uppercase; }
  .in-use-ribbon i { width: 6px; aspect-ratio: 1; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(142,188,255,.1); animation: active-dot 1.8s ease-in-out infinite; }
  @keyframes active-card-glow { 50% { border-color: rgba(142,188,255,.95); box-shadow: inset 0 1px rgba(255,255,255,.05), 0 0 0 1px rgba(142,188,255,.22), 0 0 42px rgba(75,140,255,.34); } }
  @keyframes active-dot { 50% { opacity: .55; box-shadow: 0 0 0 7px rgba(142,188,255,0); } }
  .account-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px 12px; }
  .account-top > :first-child { min-width: 0; display: contents; }
  .account-controls { position: relative; z-index: 1; grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 9px; }
  .account-name { grid-column: 1 / -1; grid-row: 1; min-width: 0; overflow: hidden; font-weight: 810; line-height: 1.16; letter-spacing: -.018em; text-overflow: ellipsis; white-space: nowrap; }
  .account-name.email-size-default { font-size: 16px; }
  .account-name.email-size-small { font-size: 13.5px; }
  .account-name.email-size-tight { font-size: 11px; }
  .account-name.email-size-micro { font-size: 9px; }
  .account-name.email-size-nano { font-size: 7.5px; }
  .account-email { grid-column: 1; grid-row: 2; min-width: 0; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .badge { flex: 0 0 auto; height: fit-content; padding: 6px 9px; border-radius: 999px; background: rgb(var(--limit-rgb, 114 232 180) / .1); color: var(--limit-color, var(--accent)); font-size: 10px; font-weight: 820; letter-spacing: .04em; text-transform: uppercase; }
  .badge.wait { background: rgba(243,201,111,.1); color: var(--amber); }
  .badge.error { background: rgba(255,133,133,.1); color: var(--danger); }
  .badge.off { background: rgba(255,255,255,.055); color: #89939c; }
  .badge.blocked { background: rgba(255,92,102,.14); color: #ff747e; }
  .power-button { position: relative; width: 44px; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid rgba(255,91,103,.55); border-radius: 14px; background: rgba(213,52,67,.2); color: #ff6571; cursor: pointer; font-size: 20px; box-shadow: 0 0 0 5px rgba(255,91,103,.045), 0 0 24px rgba(255,75,90,.15), inset 0 1px rgba(255,255,255,.08); transition: color .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease, scale .18s ease; }
  .power-button > span { display: grid; place-items: center; line-height: 1; }
  .power-button::after { position: absolute; inset: 6px; border: 1px solid transparent; border-radius: 10px; content: ""; }
  .power-button.on { border-color: rgba(99,230,167,.58); background: rgba(55,193,127,.2); color: #63e6a7; box-shadow: 0 0 0 5px rgba(99,230,167,.055), 0 0 28px rgba(99,230,167,.24), inset 0 1px rgba(255,255,255,.1); animation: power-glow 2.4s ease-in-out infinite; }
  .power-button.switching span { animation: power-switch .75s var(--ease-out) infinite; }
  @keyframes power-glow { 50% { box-shadow: 0 0 0 8px rgba(99,230,167,0), 0 0 38px rgba(99,230,167,.31), inset 0 1px rgba(255,255,255,.1); } }
  @keyframes power-switch { 50% { rotate: .5turn; scale: .82; opacity: .55; } }
  .limit-row { margin-block-start: 24px; }
  .limit-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-block-end: 10px; }
  .limit-label span { color: var(--muted); font-size: 11px; }
  .limit-label span em { margin-inline-start: 5px; color: var(--limit-color); font-size: 9px; font-style: normal; font-weight: 760; white-space: nowrap; }
  .limit-label strong { font-size: 13px; }
  .limit-row .meter { height: 7px; }
  .account-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; align-items: center; gap: 10px; margin-block-start: auto; padding-block-start: 15px; border-top: 1px solid var(--line); }
  .synced { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
  .flip-prompt { color: var(--limit-color); font-size: 9px; font-weight: 760; white-space: nowrap; }
  .account-back-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
  .account-back-head h3 { margin-block-start: 5px; font-size: 17px; letter-spacing: -.03em; }
  .account-back-head p { margin-block-start: 5px; color: var(--muted); font-size: 10px; }
  .flip-back-button { width: 42px; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 1px solid rgb(var(--limit-rgb) / .22); border-radius: 13px; background: rgb(var(--limit-rgb) / .08); color: var(--limit-color); cursor: pointer; font-size: 19px; line-height: 1; }
  .credential-list { display: grid; gap: 9px; }
  .credential-row { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(3,7,9,.5); color: var(--text); cursor: pointer; text-align: left; transition: border-color .18s ease, background .18s ease, scale .18s ease; }
  .credential-row > span { grid-column: 1; color: var(--muted); font-size: 9px; font-weight: 790; letter-spacing: .1em; text-transform: uppercase; }
  .credential-row > strong { grid-column: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text-soft); font: 650 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
  .credential-row > i { grid-column: 2; grid-row: 1 / 3; align-self: center; padding: 6px 8px; border-radius: 8px; background: rgb(var(--limit-rgb) / .1); color: var(--limit-color); font-size: 9px; font-style: normal; font-weight: 760; }
  .credential-row:disabled { opacity: .42; cursor: not-allowed; }
  .account-back-foot { display: flex; justify-content: space-between; gap: 12px; padding-block-start: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
  .access-alert { display: grid; gap: 6px; margin-block-start: 22px; padding: 14px; border: 1px solid rgba(255,91,103,.22); border-radius: 14px; background: rgba(194,38,54,.1); }
  .access-alert strong { color: #ff747e; font-size: 12px; }
  .access-alert span { color: var(--muted); font-size: 10px; line-height: 1.5; }
  .subscription-life { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-block: 13px 12px; padding: 9px 11px; border: 1px solid rgb(var(--limit-rgb) / .15); border-radius: 13px; background: rgb(var(--limit-rgb) / .05); color: inherit; cursor: pointer; font: inherit; text-align: left; transition: border-color .18s ease, background .18s ease, translate .18s ease; }
  .subscription-life:hover, .subscription-life:focus-visible { outline: 0; border-color: rgb(var(--limit-rgb) / .34); background: rgb(var(--limit-rgb) / .09); }
  .subscription-life:active { translate: 0 1px; }
  .subscription-life > div { min-width: 0; display: grid; gap: 3px; }
  .subscription-life > div > span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 8.5px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
  .subscription-life > div > strong { color: var(--text-soft); font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
  .subscription-life small { color: var(--muted); font-size: 8px; font-weight: 700; }
  .subscription-cycles { justify-items: end; text-align: right; }
  .subscription-cycles strong { color: var(--limit-color) !important; font-size: 11px !important; }
  .subscription-cycles strong b { font-size: 14px; font-variant-numeric: tabular-nums; }
  .subscription-cycles strong i { font-size: 9px; font-style: normal; }
  .subscription-life.unset { border-style: dashed; border-color: rgba(255,255,255,.09); background: rgba(255,255,255,.018); }
  .subscription-life.unset > div > strong { color: #717c85; font-size: 11px; }
  .subscription-life.expired { border-color: rgba(255,91,103,.22); background: rgba(194,38,54,.08); }
  .subscription-life.expired .subscription-weeks, .subscription-life.expired .subscription-cycles strong { color: #ff747e !important; }
  .ios-install-banner { width: 100%; display: none; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-block-start: 13px; padding: 11px 12px; border: 1px solid rgba(114,232,180,.18); border-radius: 16px; background: linear-gradient(135deg, rgba(114,232,180,.1), rgba(20,27,31,.94)); color: var(--text); text-align: left; cursor: pointer; }
  .ios-app-mark { width: 40px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #8af1c3, var(--accent-strong)); color: var(--accent-ink); font-size: 12px; font-weight: 900; letter-spacing: -.08em; }
  .ios-install-banner > span:nth-child(2) { display: grid; gap: 3px; }
  .ios-install-banner strong { font-size: 12px; }
  .ios-install-banner small { color: var(--muted); font-size: 9px; }
  .ios-install-banner > i { padding: 7px 9px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-style: normal; font-weight: 800; }
  .empty { grid-column: 1 / -1; min-height: 230px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 34px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: rgba(255,255,255,.014); color: var(--muted); text-align: center; }
  .empty.compact { min-height: 190px; border: 0; }
  .empty-icon { width: 48px; aspect-ratio: 1; display: grid; place-items: center; margin-block-end: 6px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface-2); color: var(--accent); font-size: 23px; }
  .empty strong { color: var(--text-soft); font-size: 15px; }
  .empty p { max-width: 390px; font-size: 12px; line-height: 1.5; }

  .vault-panel { overflow: hidden; border-radius: var(--radius-md); }
  .vault-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(120px, 1fr) auto; align-items: center; gap: 16px; padding: 17px 20px; border-bottom: 1px solid var(--line); transition: background .18s ease; }
  .vault-row:last-child { border-bottom: 0; }
  .vault-title { font-weight: 760; }
  .vault-email { margin-block-start: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
  .secret { color: var(--text-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; letter-spacing: .08em; overflow-wrap: anywhere; }

  .modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: end center; padding: 18px; background: rgba(0,0,0,.72); backdrop-filter: blur(10px); animation: backdrop-in .2s ease both; }
  .modal { width: min(100%, 530px); max-height: min(88dvh, 780px); overflow: auto; overscroll-behavior: contain; padding: 25px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: linear-gradient(145deg, #141a20, #0e1317); box-shadow: var(--shadow-lg); animation: modal-in .34s var(--ease-out) both; }
  @keyframes backdrop-in { from { opacity: 0; } }
  @keyframes modal-in { from { opacity: 0; translate: 0 24px; scale: .975; } }
  .modal-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
  .modal h3 { font-size: 22px; letter-spacing: -.04em; }
  .close:not(.button) { min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; line-height: 1; text-align: center; }
  .device-code { margin-block: 22px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(4,7,9,.55); text-align: center; }
  .device-code strong { display: block; margin-block: 9px 18px; font: 800 28px ui-monospace, monospace; letter-spacing: .12em; }
  .modal.oauth-modal { width: min(100%, 600px); }
  .modal.ios-install-modal { width: min(100%, 480px); }
  .modal.history-modal { width: min(100%, 920px); max-height: min(92dvh, 900px); padding: clamp(18px, 3vw, 28px); }
  .history-head .fine { max-width: 620px; margin-block-start: 5px; }
  .history-range-tabs { width: fit-content; max-width: 100%; display: flex; gap: 4px; margin-block: 22px 14px; padding: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(4,8,11,.5); scrollbar-width: none; }
  .history-range-tabs::-webkit-scrollbar { display: none; }
  .history-range-tabs button { min-height: 38px; flex: 0 0 auto; padding-inline: 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 780; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
  .history-range-tabs button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 6px 18px rgba(0,0,0,.2); }
  .history-content { min-height: 360px; }
  .history-loading, .history-empty { min-height: 240px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); text-align: center; }
  .history-loading .spinner { width: 28px; height: 28px; }
  .history-empty strong { color: var(--text-soft); font-size: 13px; }
  .history-empty span { max-width: 360px; font-size: 11px; line-height: 1.5; }
  .history-empty.compact { min-height: 100px; border: 1px dashed var(--line); border-radius: 14px; }
  .history-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-block-end: 10px; }
  .history-stats > div { min-width: 0; display: grid; gap: 6px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
  .history-stats span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .history-stats strong { font-size: 19px; letter-spacing: -.04em; }
  .history-chart-shell { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, rgba(7,12,15,.78), rgba(10,15,19,.48)); }
  .history-chart { width: 100%; height: 340px; display: block; touch-action: pan-y; }
  .history-tooltip { position: absolute; z-index: 2; width: 160px; display: grid; gap: 4px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 11px; background: rgba(12,18,22,.94); box-shadow: var(--shadow-sm); pointer-events: none; backdrop-filter: blur(12px); }
  .history-tooltip strong { color: var(--text); font-size: 12px; }
  .history-tooltip span { color: var(--muted); font-size: 9px; }
  .history-tooltip em { color: var(--blue); font-size: 9px; font-style: normal; line-height: 1.35; }
  .history-chart-empty { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 5px; pointer-events: none; color: var(--muted); text-align: center; }
  .history-chart-empty strong { color: var(--text-soft); font-size: 13px; }
  .history-chart-empty span { font-size: 10px; }
  .history-chart-legend { display: flex; align-items: center; gap: 18px; margin-block: 10px 22px; color: var(--muted); font-size: 9px; }
  .history-chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
  .history-chart-legend span::before { width: 18px; height: 2px; border-radius: 2px; background: var(--accent); content: ""; }
  .history-chart-legend .forecast::before { height: 0; border-top: 2px dashed var(--blue); background: transparent; }
  .forecast-section { padding-block-start: 18px; border-top: 1px solid var(--line); }
  .forecast-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-block-end: 10px; }
  .forecast-head h4 { margin-block-start: 4px; font-size: 16px; letter-spacing: -.03em; }
  .forecast-head > span { min-width: 28px; padding: 5px 8px; border-radius: 999px; background: rgba(142,188,255,.1); color: var(--blue); font-size: 10px; font-weight: 820; text-align: center; }
  .forecast-list { display: grid; gap: 7px; }
  .forecast-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.016); }
  .forecast-row > i { width: 10px; aspect-ratio: 1; border: 2px solid var(--blue); border-radius: 50%; box-shadow: 0 0 0 5px rgba(142,188,255,.07); }
  .forecast-row > div { min-width: 0; display: grid; gap: 3px; }
  .forecast-row strong { font-size: 11px; }
  .forecast-row span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .forecast-row > b { color: var(--blue); font-size: 12px; }
  .history-footnote { margin-block-start: 13px; color: var(--muted); font-size: 9px; line-height: 1.55; }
  .ios-install-steps { display: grid; gap: 9px; margin-block-start: 22px; }
  .ios-install-steps > div { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
  .ios-install-steps i { width: 30px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-style: normal; font-weight: 850; }
  .ios-install-steps p { color: var(--muted); font-size: 12px; line-height: 1.5; }
  .ios-install-steps strong { color: var(--text-soft); }
  .ios-install-note { margin-block-start: 12px; padding: 12px; border-radius: 12px; background: rgba(142,188,255,.07); color: var(--muted); font-size: 10px; line-height: 1.5; }
  .oauth-flow { display: grid; gap: 14px; margin-block-start: 22px; }
  .oauth-step { display: grid; grid-template-columns: auto 1fr; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.018); }
  .oauth-step > i { width: 30px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-style: normal; font-weight: 850; }
  .oauth-step strong { color: var(--text-soft); font-size: 13px; }
  .oauth-step p { margin-block-start: 5px; color: var(--muted); font-size: 12px; line-height: 1.55; }
  .oauth-step code { padding: 2px 5px; border-radius: 5px; background: var(--surface-3); color: var(--text-soft); font: 11px ui-monospace, monospace; }
  .oauth-open { margin-block-start: 13px; }
  .callback-form textarea { min-height: 104px; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
  .oauth-privacy { display: grid; grid-template-columns: auto 1fr; gap: 9px; padding: 11px 12px; border: 1px solid rgba(114,232,180,.13); border-radius: 12px; background: rgba(114,232,180,.04); }
  .oauth-privacy span { margin-block-start: 3px; color: var(--accent); font-size: 8px; }
  .oauth-privacy p { color: var(--muted); font-size: 10px; line-height: 1.5; }
  .callback-submit.loading .button-label { display: none; }
  .callback-submit.loading .button-spinner { display: inline-block; }
  .limit-sync { display: grid; justify-items: center; padding-block: 8px 2px; text-align: center; }
  .sync-animation { position: relative; width: 82px; aspect-ratio: 1; display: grid; place-items: center; margin-block: 4px 20px; }
  .sync-animation::before, .sync-animation::after { position: absolute; inset: 0; border: 1px solid rgba(114,232,180,.25); border-radius: 50%; content: ""; animation: sync-ripple 2s ease-out infinite; }
  .sync-animation::after { animation-delay: 1s; }
  .sync-animation > i { position: absolute; inset: 10px; border: 2px solid rgba(255,255,255,.09); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
  .sync-animation > span { width: 47px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(145deg, #82edbe, var(--accent-strong)); color: var(--accent-ink); box-shadow: 0 0 28px rgba(114,232,180,.2); font-size: 13px; font-weight: 900; letter-spacing: -.08em; }
  @keyframes sync-ripple { 70%, 100% { scale: 1.38; opacity: 0; } }
  .sync-title h4, .sync-result h4 { margin-block: 6px; font-size: 22px; letter-spacing: -.04em; }
  .sync-title p, .sync-result p { color: var(--muted); font-size: 12px; line-height: 1.55; }
  .sync-steps { width: 100%; display: grid; gap: 8px; margin-block-start: 23px; text-align: left; }
  .sync-step { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.015); opacity: .48; transition: opacity .25s ease, border-color .25s ease, background .25s ease; }
  .sync-step > i { width: 30px; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 12px; font-style: normal; }
  .sync-step > i b { width: 12px; aspect-ratio: 1; border: 2px solid var(--line-strong); border-top-color: var(--text-soft); border-radius: 50%; animation: spin .8s linear infinite; }
  .sync-step strong { display: block; color: var(--text-soft); font-size: 12px; }
  .sync-step span { display: block; margin-block-start: 3px; color: var(--muted); font-size: 10px; }
  .sync-step.active { border-color: rgba(142,188,255,.2); background: rgba(142,188,255,.045); opacity: 1; }
  .sync-step.done { border-color: rgba(114,232,180,.18); background: rgba(114,232,180,.045); opacity: 1; }
  .sync-step.done > i { border-color: rgba(114,232,180,.3); background: var(--accent-soft); color: var(--accent); }
  .sync-result { display: grid; justify-items: center; padding-block: 8px 2px; text-align: center; }
  .sync-gauge { position: relative; width: 142px; aspect-ratio: 1; display: grid; place-items: center; margin-block: 3px 24px; border-radius: 50%; background: conic-gradient(var(--accent) var(--sync-angle), rgba(255,255,255,.07) 0); box-shadow: 0 0 40px rgba(114,232,180,.12); animation: gauge-in .7s var(--ease-out) both; }
  .sync-gauge::before { position: absolute; width: 116px; aspect-ratio: 1; border-radius: 50%; background: var(--surface); content: ""; }
  .sync-gauge > div { position: relative; z-index: 1; display: grid; }
  .sync-gauge strong { font-size: 35px; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
  .sync-gauge span { color: var(--accent); font-size: 10px; font-weight: 760; }
  @keyframes gauge-in { from { opacity: 0; rotate: -.25turn; scale: .85; } }
  .sync-result > p { max-width: 430px; margin-block: 2px 17px; }
  .sync-failed-icon { width: 70px; aspect-ratio: 1; display: grid; place-items: center; margin-block: 3px 22px; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; background: rgba(255,255,255,.045); color: var(--muted); font-size: 27px; font-weight: 800; }
  .sync-result-actions { width: 100%; justify-content: center; margin-block-start: 5px; }
  .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-block-start: 22px; }
  .toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 50; max-width: calc(100% - 28px); padding: 12px 16px; border: 1px solid rgba(255,255,255,.4); border-radius: 13px; background: #ecf7f1; color: #08170f; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; translate: -50% 18px; font-size: 13px; font-weight: 760; transition: opacity .2s ease, translate .2s var(--ease-out); }
  .toast.show { opacity: 1; translate: -50% 0; }

  .modal.account-wizard { place-self: center; width: min(100%, 630px); padding: 0; overflow: hidden; border-color: var(--line-strong); }
  .account-wizard-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 27px 29px 22px; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 12% 0, rgba(114,232,180,.15), transparent 48%); }
  .account-wizard-head h3 { margin-block: 5px; font-size: 24px; }
  .account-wizard-head p { color: var(--muted); font-size: 13px; line-height: 1.5; }
  .account-wizard-icon { width: 52px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 17px; background: linear-gradient(145deg, #8af1c3, var(--accent-strong)); color: var(--accent-ink); box-shadow: 0 12px 28px rgba(78,214,155,.17); }
  .account-wizard-icon span { font-size: 28px; line-height: 1; }
  .power-orbit { position: relative; isolation: isolate; animation: orbit-breathe 2.5s ease-in-out infinite; }
  .power-orbit i { position: absolute; z-index: -1; inset: -8px; border: 1px solid rgba(114,232,180,.25); border-radius: 22px; animation: orbit-ring 2.5s ease-out infinite; }
  @keyframes orbit-breathe { 50% { translate: 0 -2px; box-shadow: 0 16px 34px rgba(78,214,155,.28); } }
  @keyframes orbit-ring { 70%, 100% { inset: -17px; opacity: 0; } }
  .account-wizard-head .close { align-self: start; }
  .wizard-progress { display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: 21px 30px 6px; }
  .wizard-progress-item { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 750; transition: color .25s ease; }
  .wizard-progress-item i { width: 26px; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); font-style: normal; transition: .25s ease; }
  .wizard-progress-item.active { color: var(--text); }
  .wizard-progress-item.active i { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 5px var(--accent-soft); }
  .wizard-progress-line { height: 1px; margin-inline: 12px; overflow: hidden; background: var(--line-strong); }
  .wizard-progress-line i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .35s var(--ease-out); }
  .wizard-progress-line.active i { width: 100%; }
  .account-wizard form { padding: 5px 30px 29px; }
  .account-form-body { padding-block-start: 17px; animation: wizard-page-in .32s var(--ease-out) both; }
  .automatic-number { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-block: 2px 20px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.024); }
  .automatic-number > span { width: 34px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: var(--surface-3); color: var(--accent); font-weight: 850; }
  .automatic-number div { display: grid; gap: 3px; }
  .automatic-number strong { color: var(--text-soft); font-size: 12px; }
  .automatic-number small { color: var(--muted); font-size: 10px; }
  .automatic-number > i { padding: 5px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-style: normal; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
  .account-menu-info { display: grid; gap: 6px; margin-block-start: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.02); }
  .account-menu-info span { color: var(--muted); font-size: 11px; }
  .account-menu-info strong { color: var(--text-soft); font-size: 13px; overflow-wrap: anywhere; }
  .subscription-form { margin-block-start: 8px; }
  .subscription-source-note { margin-block: 10px 14px; padding: 11px 13px; border: 1px solid rgba(142,188,255,.12); border-radius: 12px; background: rgba(142,188,255,.04); color: var(--muted); font-size: 10px; line-height: 1.5; }
  .subscription-form-preview { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 3px 12px; margin-block-start: 10px; padding: 12px 14px; border: 1px solid rgba(114,232,180,.13); border-radius: 13px; background: rgba(114,232,180,.04); }
  .subscription-form-preview span, .subscription-form-preview small { color: var(--muted); font-size: 10px; }
  .subscription-form-preview strong { color: var(--accent); font-size: 15px; font-variant-numeric: tabular-nums; }
  .subscription-form-preview small { grid-column: 1 / -1; }
  .account-settings-actions { display: grid; grid-template-columns: auto 1fr auto auto; }
  .wizard-page { display: none; }
  .wizard-page.active { display: block; animation: wizard-page-in .28s var(--ease-out) both; }
  @keyframes wizard-page-in { from { opacity: 0; translate: 14px 0; } }
  .wizard-copy { margin-block: 16px 18px; }
  .wizard-copy h4 { margin-block-end: 5px; font-size: 19px; letter-spacing: -.03em; }
  .wizard-copy p { color: var(--muted); font-size: 13px; }
  .featured-field input { min-height: 52px; font-size: 16px; }
  .weight-input, .password-input { position: relative; }
  .weight-input input { padding-inline-end: 42px; }
  .weight-input em { position: absolute; right: 15px; top: 50%; translate: 0 -50%; color: var(--muted); font-style: normal; }
  .password-input input { padding-inline-end: 96px; }
  .password-toggle { position: absolute; right: 7px; top: 50%; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; translate: 0 -50%; padding-inline: 10px; border: 0; border-radius: 9px; background: var(--surface-3); color: var(--text-soft); cursor: pointer; font-size: 11px; font-weight: 760; line-height: 1; text-align: center; }
  .account-delete { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; border-radius: 50%; }
  .account-delete > span { width: 100%; height: 100%; display: grid; place-items: center; font-size: 0; line-height: 0; }
  .account-delete > span::before { width: 3px; height: 3px; border-radius: 50%; background: currentColor; box-shadow: -5px 0 currentColor, 5px 0 currentColor; content: ""; }
  .security-note { display: grid; grid-template-columns: auto 1fr; gap: 11px; margin-block-start: 16px; padding: 14px; border: 1px solid rgba(114,232,180,.17); border-radius: 14px; background: rgba(114,232,180,.055); }
  .security-note > span { margin-block-start: 4px; color: var(--accent); font-size: 10px; }
  .security-note p { color: var(--muted); font-size: 11px; line-height: 1.55; }
  .security-note strong { color: var(--text-soft); }
  .wizard-actions { margin-block-start: 25px; }
  .next-step span { margin-inline-start: 3px; transition: translate .18s ease; }
  .button-spinner { display: none; width: 15px; height: 15px; border-color: rgba(5,21,14,.25); border-top-color: var(--accent-ink); }
  .save-account.loading .button-label { display: none; }
  .save-account.loading .button-spinner { display: inline-block; }
}

@layer responsive {
  @media (width <= 760px) {
    .shell { width: min(100% - 20px, var(--content)); }
    .topbar { top: max(5px, env(safe-area-inset-top)); min-height: 62px; border-radius: 17px; }
    .brand-copy small, .top-actions .live { display: none; }
    .top-actions { flex-wrap: nowrap; }
    .top-actions .button { min-width: 44px; padding-inline: 10px; }
    .top-action-button > b { display: none; }
    .top-actions .ios-install-trigger { display: none; }
    .ios-install-banner { display: grid; }
    .hero { grid-template-columns: 1fr; margin-block: 20px 30px; }
    .aggregate { min-height: 280px; }
    .summary-card { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .stat { min-height: 105px; padding: 15px; }
    .stat + .stat { border-top: 0; border-left: 1px solid var(--line); }
    .stat-icon { display: none; }
    .section-head { align-items: center; }
    .section-head p { max-width: 28rem; }
    .section-head .button { flex: 0 0 auto; }
    .account-toolbar { grid-template-columns: 1fr; padding: 9px; }
    .account-sort { justify-content: space-between; }
    .sort-control { min-width: 0; width: min(220px, 64vw); }
    .vault-row { grid-template-columns: 1fr auto; }
    .vault-row .vault-email { grid-column: 1; }
    .vault-row .secret { display: none; }
    .vault-row .row-actions { grid-column: 2; grid-row: 1 / 3; }
    .modal-backdrop { align-items: end; padding: 0; }
    .modal { max-height: 92dvh; padding-block-end: max(24px, env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; }
    .modal.account-wizard { place-self: end center; max-height: 94dvh; border-radius: 26px 26px 0 0; }
    .modal.history-modal { border-radius: 26px 26px 0 0; }
    .history-chart { height: 300px; }
    .account-wizard-head { grid-template-columns: auto 1fr auto; padding: 22px 20px 18px; }
    .account-wizard-icon { width: 44px; border-radius: 14px; }
    .account-wizard-head h3 { font-size: 20px; }
    .account-wizard-head p { display: none; }
    .wizard-progress { padding: 18px 22px 4px; }
    .account-wizard form { padding: 4px 22px max(24px, env(safe-area-inset-bottom)); }
  }
  @media (width <= 520px) {
    .auth-shell { padding-inline: 12px; }
    .auth-card { border-radius: 25px; }
    .big-number { margin-block-start: 38px; }
    .big-number strong { font-size: clamp(58px, 22vw, 78px); }
    .aggregate-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
    .reset-info { justify-content: flex-start; }
    .next-reset-forecast { width: 100%; justify-content: flex-start; flex-wrap: wrap; margin-block-start: 4px; }
    .next-reset-date { text-align: left; }
    .next-reset-forecast .reset-eta { margin-inline-start: auto; }
    .section-head { align-items: stretch; flex-direction: column; }
    .section-head .button { width: 100%; }
    .account-card { padding: 0; }
    .account-card-stage { min-height: 318px; }
    .account-face { padding-inline: 17px; }
    .account-card.in-use .account-front { padding-block-start: 49px; }
    .in-use-ribbon { left: 17px; }
    .account-top { gap: 9px; }
    .account-controls { gap: 6px; }
    .badge { display: none; }
    .limit-label { align-items: flex-start; }
    .limit-label span { display: grid; gap: 3px; }
    .limit-label span em { margin-inline-start: 0; }
    .subscription-life { margin-block-start: 11px; }
    .account-settings-actions { grid-template-columns: 1fr 1fr; }
    .account-settings-actions > span { display: none; }
    .account-settings-actions .delete-account { grid-column: 1 / -1; order: 3; }
    .summary-card { gap: 0; }
    .stat { min-width: 0; }
    .stat strong { font-size: 24px; }
    .wizard-actions .button { flex: 1; }
    .history-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .history-chart { height: 270px; }
    .history-range-tabs { width: 100%; }
    .history-range-tabs button { flex: 1; padding-inline: 10px; }
    .forecast-row { grid-template-columns: auto minmax(0,1fr); }
    .forecast-row > b { grid-column: 2; }
  }
}

@supports (-webkit-touch-callout: none) {
  html, body { min-height: -webkit-fill-available; }
  body { -webkit-text-size-adjust: 100%; }
  button, a, .account-card { touch-action: manipulation; }
  input, textarea, select { font-size: 16px; }
  .shell { padding-block-end: max(64px, calc(env(safe-area-inset-bottom) + 34px)); }
  .modal { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .account-filters { scroll-snap-type: x proximity; }
  .filter-chip { scroll-snap-align: start; }
}

@layer accessibility {
  :focus-visible { outline: 3px solid rgba(142,188,255,.8); outline-offset: 3px; }
  @media (hover: hover) {
    .button:not(:disabled):hover { translate: 0 -2px; border-color: rgba(255,255,255,.2); background-color: var(--surface-3); }
    .button.primary:not(:disabled):hover { box-shadow: 0 12px 30px rgba(78,214,155,.2); }
    .account-card:hover { translate: 0 -3px; border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
    .account-card.online:hover { border-color: rgb(var(--limit-rgb) / .42); box-shadow: 0 18px 48px rgb(var(--limit-rgb) / .13); }
    .power-button:hover { scale: 1.05; }
    .credential-row:not(:disabled):hover { border-color: rgb(var(--limit-rgb) / .38); background: rgba(255,255,255,.075); scale: 1.015; }
    .vault-row:hover { background: rgba(255,255,255,.022); }
    .close:hover, .password-toggle:hover { background: var(--surface-3); color: var(--text); }
    .next-step:hover span { translate: 3px 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  }
  @media (prefers-contrast: more) {
    :root { --line: rgba(255,255,255,.22); --line-strong: rgba(255,255,255,.38); --muted: #aab4bd; }
  }
}
