/* =====================================================================
   Renewly v1.2 "Fresh Start" (design from v1.0) · Stroban design system, sibling of Parcha and Aavak
   Plum for renewals, warm neutrals, device fonts only (Georgia, already on every device, for figures and
   headings), three radii (8/12/20), 8 px rhythm. Amber means soon, red means overdue, green means paid.
   ===================================================================== */
:root {
  color-scheme: light;
  --paper: #F8F6FA; --surface: #FFFFFF; --surface-2: #F0ECF4; --ink: #1E1726; --body: #3E3547; --muted: #625A6C;
  --line: #E5DFEB; --line-strong: #CFC6D9;
  --brand: #6B2C7E; --brand-hover: #56206A; --on-brand: #FFFFFF; --tone: #6B2C7E; --tone-soft: #F2E8F6;
  --good: #11704F; --good-soft: #E2F2EA; --soon: #9A4508; --soon-soft: #FCF0E4; --bad: #B42318; --bad-soft: #FDECEA;
  --shadow: 0 1px 2px rgba(30,23,38,.04), 0 8px 24px rgba(30,23,38,.06);
  --shadow-lift: 0 2px 4px rgba(30,23,38,.05), 0 20px 44px -14px rgba(60,20,70,.28);
  --backdrop: rgba(30,23,38,.44); --toast-bg: #1E1726; --toast-ink: #FFFFFF;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-ui: 14px; --fs-card: 15px; --fs-base: 16px; --fs-lg: 18px; --fs-h3: 22px; --fs-h2: 28px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --ease: cubic-bezier(.2,.7,.2,1); --ease-out: cubic-bezier(.16,1,.3,1);
  --top-h: 60px; --maxw: 1080px; --safe-b: env(safe-area-inset-bottom, 0px); --tab-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141019; --surface: #1C1623; --surface-2: #251D2E; --ink: #F3EEF7; --body: #CFC6D8; --muted: #A79DB2;
    --line: #2F2639; --line-strong: #43384F;
    --brand: #C38BD6; --brand-hover: #D3A2E3; --on-brand: #1E0F26; --tone: #D9AEE8; --tone-soft: #33213D;
    --good: #5BD3A0; --good-soft: #12342A; --soon: #F5B455; --soon-soft: #3A2A14; --bad: #FF8A80; --bad-soft: #3D1A1A;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35); --shadow-lift: 0 2px 4px rgba(0,0,0,.3), 0 22px 44px -14px rgba(0,0,0,.65);
    --backdrop: rgba(5,2,8,.62); --toast-bg: #F3EEF7; --toast-ink: #1E1726;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141019; --surface: #1C1623; --surface-2: #251D2E; --ink: #F3EEF7; --body: #CFC6D8; --muted: #A79DB2;
  --line: #2F2639; --line-strong: #43384F;
  --brand: #C38BD6; --brand-hover: #D3A2E3; --on-brand: #1E0F26; --tone: #D9AEE8; --tone-soft: #33213D;
  --good: #5BD3A0; --good-soft: #12342A; --soon: #F5B455; --soon-soft: #3A2A14; --bad: #FF8A80; --bad-soft: #3D1A1A;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35); --shadow-lift: 0 2px 4px rgba(0,0,0,.3), 0 22px 44px -14px rgba(0,0,0,.65);
  --backdrop: rgba(5,2,8,.62); --toast-bg: #F3EEF7; --toast-ink: #1E1726;
}
html.big { font-size: 112.5%; }
html.big { --fs-xs: 14px; --fs-sm: 15px; --fs-ui: 16px; --fs-card: 17px; --fs-base: 18px; --fs-lg: 20px; --fs-h3: 24px; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: var(--font-sans); font-size: var(--fs-base); line-height: 1.55; color: var(--body); background: var(--paper); min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--tab-h) + 88px + var(--safe-b)); -webkit-tap-highlight-color: transparent; }
html.dlg-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--tone); }
.i { width: 20px; height: 20px; flex: none; display: block; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s4); }
@media (min-width: 640px) { .wrap { padding: 0 var(--s5); } }
.money, .num { font-variant-numeric: lining-nums tabular-nums; }
html.privacy .money { filter: blur(8px); user-select: none; -webkit-user-select: none; }
.money { transition: filter .25s var(--ease); }
.muted { color: var(--muted); font-size: var(--fs-sm); }
.grow { flex: 1; }
.tone-good { color: var(--good) !important; }

/* ---------- Stroban bar ---------- */
.stroban-bar { background: var(--surface-2); border-bottom: 1px solid var(--line); font: 500 12.5px/1 var(--font-sans); position: relative; z-index: 31; }
.stroban-bar a { display: flex; align-items: center; gap: 7px; height: 30px; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s4); color: var(--body); text-decoration: none; }
@media (min-width: 640px) { .stroban-bar a { padding: 0 var(--s5); } }
.stroban-bar .sb-mark { flex: none; display: block; }
.stroban-bar .sb-word { font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.stroban-bar .sb-sep { color: var(--muted); }
.stroban-bar .sb-tm { font-size: .62em; vertical-align: .55em; margin-left: 1px; color: var(--muted); }
.stroban-bar .sb-all { color: #4338CA; }
:root[data-theme="dark"] .stroban-bar .sb-all { color: #A5A8FA; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stroban-bar .sb-all { color: #A5A8FA; } }
.stroban-bar a:hover .sb-all { text-decoration: underline; text-underline-offset: 3px; }
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) { .stroban-bar { display: none; } }
.is-standalone .stroban-bar { display: none; }

/* ---------- Install bar ---------- */
.install-bar { background: var(--tone-soft); border-bottom: 1px solid var(--line); color: var(--ink); font-size: var(--fs-ui); }
.ib-in { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding-top: 6px; padding-bottom: 6px; }
.ib-in > .i { color: var(--tone); width: 22px; height: 22px; }
.ib-text { flex: 1 1 auto; line-height: 1.35; }
.ib-x { width: 36px !important; height: 36px !important; border: 0 !important; background: transparent !important; color: var(--muted); }
.is-standalone .install-bar { display: none !important; }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 88%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); padding-top: env(safe-area-inset-top, 0px); }
.top.scrolled { border-bottom-color: var(--line); }
.top-in { height: var(--top-h); display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-icon { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.brand-line { display: flex; align-items: baseline; gap: 8px; }
.brand-name { font-family: var(--font-serif); font-size: 24px; font-weight: 600; letter-spacing: -.01em; line-height: 1; }
.brand-hi { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; line-height: 1; }
.brand-desc { font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: var(--s2); flex: none; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-md); color: var(--body); border: 1px solid var(--line); background: var(--surface); transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .15s var(--ease); }
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-btn:active { transform: scale(.96); }
.sync-chip { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-sm); font-weight: 500; color: var(--body); white-space: nowrap; max-width: 46vw; position: relative; }
.sync-chip:hover { border-color: var(--line-strong); }
.sync-text { overflow: hidden; text-overflow: ellipsis; }
.sync-ic { display: none; width: 19px; height: 19px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.sync-chip[data-state="synced"] .sync-dot { background: var(--good); }
.sync-chip[data-state="syncing"] .sync-dot { background: var(--tone); animation: pulse 1s var(--ease) infinite; }
.sync-chip[data-state="error"] { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.sync-chip[data-state="error"] .sync-dot { background: var(--bad); }
.sync-chip[data-state="unconfigured"] { color: var(--tone); border-color: color-mix(in srgb, var(--tone) 30%, var(--line)); }
.sync-chip[data-state="unconfigured"] .sync-dot { background: transparent; border: 1.5px solid currentColor; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.6); opacity: .55; } }
@media (max-width: 519px) {
  .sync-chip { width: 44px; padding: 0; justify-content: center; border-radius: var(--r-md); }
  .sync-chip .sync-text { display: none; }
  .sync-ic { display: block; }
  .sync-chip .sync-dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border: 2px solid var(--surface); box-sizing: content-box; }
  .sync-chip[data-state="unconfigured"] .sync-dot { background: var(--soon); border: 2px solid var(--surface); width: 8px; height: 8px; }
}
@media (max-width: 429px) { .brand-hi { display: none; } }
@media (max-width: 359px) { .brand-desc { font-size: 11px; } .brand-icon { width: 32px; height: 32px; } .top-actions { gap: 6px; } .icon-btn, .sync-chip { width: 40px !important; height: 40px; } }

/* ---------- Views and tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 26; background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + var(--safe-b)); }
.tabbar-in { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 560px; margin: 0 auto; }
.tb { display: grid; justify-items: center; gap: 3px; padding: 5px 0 4px; min-height: 52px; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); border-radius: var(--r-sm); }
.tb .i { width: 52px; height: 28px; padding: 3px 15px; border-radius: 999px; transition: background .2s var(--ease); }
.tb[aria-current="page"] { color: var(--tone); font-weight: 600; }
.tb[aria-current="page"] .i { background: var(--tone-soft); }
@media (min-width: 960px) {
  body { padding-bottom: var(--s6); }
  .tabbar { position: sticky; top: var(--top-h); bottom: auto; z-index: 29; background: color-mix(in srgb, var(--paper) 88%, transparent); border-top: 0; border-bottom: 1px solid var(--line); padding: 0; }
  .tabbar-in { display: flex; gap: 4px; max-width: var(--maxw); padding: 6px var(--s5); }
  .tb { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; font-size: var(--fs-ui); }
  .tb .i { width: 20px; height: 20px; padding: 0; background: none !important; }
  .tb[aria-current="page"] { background: var(--tone-soft); }
}
.view { padding-top: var(--s4); }
@media (min-width: 960px) { .view { padding-top: var(--s5); } }
.view.enter { animation: rise .32s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.view-title { font-family: var(--font-serif); font-size: var(--fs-h3); font-weight: 600; color: var(--ink); line-height: 1.2; }

/* ---------- Home layout ---------- */
.layout { display: grid; gap: var(--s4); }
.side { display: grid; gap: var(--s4); align-content: start; }
@media (max-width: 959px) { .side { display: contents; } .summary { order: 1; } .range { order: 2; } .feed { order: 3; } .hints { order: 4; } }
@media (min-width: 960px) { .layout { grid-template-columns: 380px minmax(0, 1fr); gap: var(--s6); align-items: start; } .side { position: sticky; top: calc(var(--top-h) + 52px + var(--s5)); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.summary { padding: var(--s5); position: relative; overflow: hidden; }
.summary::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #4338CA)); }
.sum-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sum-figure { font-family: var(--font-serif); font-size: 46px; font-weight: 500; line-height: 1.05; color: var(--ink); letter-spacing: -.02em; margin-top: var(--s2); }
.sum-sub { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--s1); }
.sum-alerts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.sum-alerts:empty { display: none; }
.alert-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 500; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); color: var(--body); }
.alert-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.alert-chip.is-bad { background: var(--bad-soft); color: var(--bad); }
.alert-chip.is-soon { background: var(--soon-soft); color: var(--soon); }
.alert-chip.is-tone { background: var(--tone-soft); color: var(--tone); }
.sum-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: var(--s5); border-top: 1px solid var(--line); padding-top: var(--s4); }
.sum-stats > div { min-width: 0; padding-right: var(--s2); }
.sum-stats > div + div { border-left: 1px solid var(--line); padding-left: var(--s3); }
.sum-stats dt { font-size: var(--fs-xs); color: var(--muted); }
.sum-stats dd { font-family: var(--font-serif); font-size: 20px; font-weight: 500; color: var(--ink); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 399px) { .sum-figure { font-size: 40px; } .sum-stats dd { font-size: 17px; } }
@media (max-width: 359px) { .summary { padding: 18px; } .sum-figure { font-size: 36px; } .sum-stats dd { font-size: 15px; } .sum-stats > div + div { padding-left: 8px; } }
.hints { display: grid; gap: var(--s3); }
.hints:empty { display: none; }
.hint { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); font-size: var(--fs-ui); }
.hint .badge { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--soon-soft); color: var(--soon); }
.hint b { color: var(--ink); }
.hint .inline-link { color: var(--tone); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 2px 0; }

/* ---------- Segmented control and chips ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); padding: 4px; border-radius: var(--r-md); }
.seg-opt { position: relative; display: flex; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { flex: 1; display: grid; place-items: center; min-height: 40px; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 500; color: var(--muted); transition: background .18s var(--ease), color .18s var(--ease); white-space: nowrap; padding: 0 6px; }
.seg-opt input:checked + span { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(27,27,42,.08), 0 2px 8px rgba(27,27,42,.06); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--tone); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips + .chips { margin-top: var(--s2); }
.view > .chips { margin-bottom: var(--s2); }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip > span, button.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: var(--fs-ui); font-weight: 500; color: var(--body); transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease); white-space: nowrap; }
.chip-sm > span, button.chip-sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); }
.chips-tight { gap: 6px; }
.chips-tight .chip > span { min-height: 40px; padding: 0 12px; font-size: var(--fs-sm); }
.chip:hover > span, button.chip:hover { border-color: var(--tone); color: var(--ink); }
.chip input:checked + span { background: var(--tone-soft); border-color: var(--tone); color: var(--tone); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--tone); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 18px; border-radius: var(--r-md); font-size: var(--fs-ui); font-weight: 600; white-space: nowrap; border: 1px solid transparent; transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .15s var(--ease); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn .i { width: 18px; height: 18px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: var(--fs-sm); }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgba(40,10,50,.2), 0 6px 16px -6px color-mix(in srgb, var(--brand) 60%, transparent); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-tone { background: var(--tone-soft); color: var(--tone); }
.btn-tone:hover { border-color: color-mix(in srgb, var(--tone) 30%, transparent); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--line-strong); }
.btn-danger { background: var(--bad); color: #FFFFFF; }
:root[data-theme="dark"] .btn-danger { color: #2A0B08; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger { color: #2A0B08; } }
.danger-text { color: var(--bad) !important; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.btn-new { display: none; }
@media (min-width: 960px) { .btn-new { display: inline-flex; } }

/* ---------- Due list rows ---------- */
.group-h { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: var(--s5) var(--s1) var(--s2); border-bottom: 1px solid var(--line); margin-bottom: var(--s3); }
.group-h:first-child { padding-top: 0; }
.group-h h2, .group-h-title { font-family: var(--font-serif); font-size: var(--fs-lg); font-weight: 600; color: var(--ink); }
.group-h span { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.list { display: grid; gap: var(--s3); }
.row { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; transition: border-color .2s var(--ease), box-shadow .25s var(--ease); }
.row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.row.is-bad::before { background: var(--bad); }
.row.is-soon::before { background: var(--soon); }
.row.is-off { opacity: .78; }
.row-main { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 2px var(--s3); align-items: center; width: 100%; text-align: left; padding: var(--s4) var(--s4) var(--s2) calc(var(--s4) + 2px); }
.row-main:focus-visible { outline-offset: -3px; }
.av { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--tone-soft); color: var(--tone); font: 600 16px/1 var(--font-sans); }
.av .i { width: 20px; height: 20px; }
.nm { font-size: var(--fs-card); font-weight: 600; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.meta { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.amt { text-align: right; padding-left: var(--s2); }
.amt b { display: block; font: 500 22px/1.1 var(--font-serif); color: var(--ink); white-space: nowrap; }
.amt small { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: 3px; white-space: nowrap; }
.row-foot { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3) var(--s3) calc(var(--s4) + 2px + 40px + var(--s3)); flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; background: var(--surface-2); color: var(--body); white-space: nowrap; }
.pill.is-bad { background: var(--bad-soft); color: var(--bad); }
.pill.is-soon { background: var(--soon-soft); color: var(--soon); }
.pill.is-good { background: var(--good-soft); color: var(--good); }
.pill.is-tone { background: var(--tone-soft); color: var(--tone); }
.btn-paid { min-height: 40px; padding: 0 14px; font-size: var(--fs-sm); }
.btn-more { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); background: var(--surface); flex: none; }
.btn-more:hover { color: var(--ink); border-color: var(--line-strong); }
.row.just-paid { animation: paid .9s var(--ease-out) both; }
@keyframes paid { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.row.leaving { animation: leave .26s var(--ease) both; }
@keyframes leave { to { opacity: 0; transform: translateX(24px); } }
.list .row.enter { animation: rise .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }
@media (max-width: 419px) {
  .row-main { grid-template-columns: minmax(0, 1fr) auto; }
  .av { display: none; }
  .row-foot { padding-left: calc(var(--s4) + 2px); }
  .amt b { font-size: 20px; }
}

/* Empty and first run */
.empty { text-align: center; padding: var(--s7) var(--s5); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty-art { width: 64px; height: 64px; margin: 0 auto var(--s4); border-radius: 16px; display: block; box-shadow: var(--shadow-lift); }
.empty h2 { font-family: var(--font-serif); font-size: var(--fs-h3); font-weight: 600; color: var(--ink); }
.empty p { color: var(--muted); font-size: var(--fs-ui); max-width: 400px; margin: var(--s2) auto 0; }
.empty .btn-row { justify-content: center; margin-top: var(--s5); }
.calm { padding: var(--s5); text-align: center; color: var(--muted); font-size: var(--fs-ui); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.calm b { display: block; font-family: var(--font-serif); font-size: var(--fs-lg); color: var(--ink); margin-bottom: 2px; }
body.is-first .summary, body.is-first .range, body.is-first .hints, body.is-first .fab, body.is-first .btn-new { display: none !important; }
@media (min-width: 960px) { body.is-first #vHome.layout { grid-template-columns: minmax(0, 640px); justify-content: center; } }

/* Notes above the views */
.notes { display: grid; gap: var(--s2); padding-top: var(--s4); }
.notes:empty { display: none; }
.note-card { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); background: var(--tone-soft); color: var(--ink); border-radius: var(--r-md); padding: var(--s3) var(--s3) var(--s3) var(--s4); font-size: var(--fs-sm); }
.note-card strong { color: var(--tone); }
@media (max-width: 479px) { .note-card { flex-wrap: wrap; } }

/* ---------- All items ---------- */
.tool-row { display: flex; gap: var(--s2); margin-bottom: var(--s3); }
.search { flex: 1; position: relative; display: flex; align-items: center; min-width: 0; }
.search > .i { position: absolute; left: 12px; color: var(--muted); pointer-events: none; width: 18px; height: 18px; }
.search input { width: 100%; height: 46px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); padding: 0 14px 0 38px; font-size: var(--fs-ui); color: var(--ink); -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 18%, transparent); }
#allList { margin-top: var(--s4); }
.totals-line { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: var(--fs-sm); color: var(--muted); margin: 0 var(--s1) var(--s3); }
.totals-line b { color: var(--ink); font-weight: 600; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.cal-head .view-title { min-width: 9.5em; text-align: center; white-space: nowrap; }
.cal-layout { display: grid; gap: var(--s5); }
@media (min-width: 960px) { .cal-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.cal-card { padding: var(--s3); }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow span { text-align: center; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); padding: 4px 0 6px; }
.cal-cell { position: relative; aspect-ratio: 1 / 1; min-height: 40px; min-width: 0; border-radius: var(--r-sm); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 6px; gap: 3px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink); background: transparent; border: 1px solid transparent; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.is-out { color: var(--muted); }
.cal-cell.is-out .cal-dots i { opacity: .55; }
.cal-cell.is-today { border-color: var(--tone); }
.cal-cell[aria-pressed="true"] { background: var(--tone-soft); color: var(--tone); font-weight: 700; }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 36px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
.cal-dots i.is-bad { background: var(--bad); }
.cal-dots i.is-soon { background: var(--soon); }
.cal-sum { font-size: 10px; color: var(--muted); line-height: 1; }
@media (max-width: 419px) { .cal-card { padding: 6px; } .cal-dow, .cal-grid { gap: 2px; } .cal-sum { display: none; } .cal-head .view-title { min-width: 0; flex: 1; font-size: var(--fs-lg); } }
.cal-day .list { margin-top: var(--s3); }
.cal-day .group-h-title { padding: 0 var(--s1); }

/* ---------- Recharges ---------- */
.rech-grid { display: grid; gap: var(--s3); }
@media (min-width: 760px) { .rech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rc { padding: var(--s4) var(--s4) var(--s4) calc(var(--s4) + 2px); display: grid; gap: var(--s3); position: relative; overflow: hidden; }
.rc-top { display: flex; justify-content: space-between; gap: var(--s3); align-items: flex-start; }
.rc-left b { display: block; font: 500 26px/1.05 var(--font-serif); color: var(--ink); white-space: nowrap; text-align: right; }
.rc-left small { display: block; text-align: right; font-size: var(--fs-xs); color: var(--muted); }
.rc.is-bad .rc-left b { color: var(--bad); }
.rc.is-soon .rc-left b { color: var(--soon); }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--good); width: 0; transition: width .7s var(--ease-out); }
.rc.is-soon .meter > i { background: var(--soon); }
.rc.is-bad .meter > i { background: var(--bad); }
.cost { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s3); background: var(--surface-2); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.cost dt { font-size: var(--fs-xs); color: var(--muted); }
.cost dd { font: 500 18px/1.3 var(--font-serif); color: var(--ink); }
.cost dd small { font: 400 var(--fs-xs)/1 var(--font-sans); color: var(--muted); margin-left: 4px; }
.cost-note { font-size: var(--fs-xs); color: var(--muted); margin-top: calc(var(--s2) * -1); }
.rc .btn-row .btn { flex: 1 1 auto; }

/* ---------- FAB ---------- */
.fab { position: fixed; z-index: 27; right: max(var(--s4), calc((100vw - var(--maxw)) / 2 + var(--s5))); bottom: calc(var(--tab-h) + var(--s4) + var(--safe-b)); height: 54px; padding: 0 22px 0 18px; display: inline-flex; align-items: center; gap: var(--s2); border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: var(--fs-card); font-weight: 600; box-shadow: 0 2px 4px rgba(40,10,50,.18), 0 14px 32px -8px color-mix(in srgb, var(--brand) 70%, transparent); transition: transform .25s var(--ease-out), background .2s var(--ease); }
.fab:hover { background: var(--brand-hover); transform: translateY(-2px); }
.fab:active { transform: scale(.97); }
.fab .i { width: 22px; height: 22px; }
@media (min-width: 960px) { .fab { display: none; } }

/* ---------- Toast ---------- */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tab-h) + 84px + var(--safe-b)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: var(--s3); max-width: calc(100vw - 32px); width: max-content; background: var(--toast-bg); color: var(--toast-ink); font-size: var(--fs-ui); font-weight: 500; padding: 10px 10px 10px 16px; min-height: 48px; border-radius: var(--r-md); box-shadow: var(--shadow-lift); transition: opacity .25s var(--ease), transform .35s var(--ease-out); }
@media (min-width: 960px) { .toast { bottom: var(--s6); } }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-act { min-height: 36px; padding: 0 12px; border-radius: var(--r-sm); font-weight: 600; color: inherit; background: color-mix(in srgb, var(--toast-ink) 14%, transparent); }

/* ---------- Sheets ---------- */
dialog.sheet { border: 0; padding: 0; color: var(--body); background: var(--surface); width: 100%; max-width: 100%; max-height: calc(100dvh - 24px); margin: auto 0 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-lift); flex-direction: column; overflow: hidden; transform: translateY(100%); transition: transform .38s var(--ease-out); }
dialog.sheet[open] { display: flex; }
dialog.sheet.in { transform: none; }
dialog.sheet::backdrop { background: var(--backdrop); opacity: 0; transition: opacity .3s var(--ease); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
dialog.sheet.in::backdrop { opacity: 1; }
dialog.sheet > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; width: calc(100% - 48px); max-width: 520px; max-height: min(780px, calc(100dvh - 64px)); border-radius: var(--r-lg); transform: translateY(12px) scale(.97); opacity: 0; transition: transform .32s var(--ease-out), opacity .22s var(--ease); }
  dialog.sheet.in { transform: none; opacity: 1; }
  dialog.sheet-tall { max-width: 580px; }
  dialog.sheet-confirm { max-width: 420px; }
}
.sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 22px var(--s5) var(--s3); flex: none; }
.sheet-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-strong); }
@media (min-width: 640px) { .sheet-head::before { display: none; } .sheet-head { padding-top: var(--s5); } }
.sheet-title { font-family: var(--font-serif); font-size: var(--fs-h3); font-weight: 600; color: var(--ink); line-height: 1.2; }
.sheet-x { width: 44px; height: 44px; border: 0; background: var(--surface-2); margin-right: -6px; }
.sheet-body { padding: var(--s2) var(--s5) var(--s5); overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; display: grid; gap: var(--s4); align-content: start; }
.sheet-foot { flex: none; display: flex; gap: var(--s2); padding: var(--s3) var(--s5) calc(var(--s4) + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn-primary, .sheet-foot .btn-danger { flex: 1.6; }
.sheet-confirm .sheet-head::before { display: none; }
.sheet-confirm .sheet-head { padding-top: var(--s5); }
@media (max-width: 359px) { .sheet-body, .sheet-head, .sheet-foot { padding-left: var(--s4); padding-right: var(--s4); } }

/* Fields */
.field { display: grid; gap: 6px; border: 0; min-width: 0; align-content: start; }
.field > label, .field > legend { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); padding: 0; }
.field > legend { margin-bottom: 6px; }
.opt { font-weight: 400; color: var(--muted); margin-left: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 479px) { .field-row { grid-template-columns: 1fr; } }
input[type="text"], input[type="url"], input[type="password"], input[type="date"], input[type="number"], textarea, .select {
  width: 100%; min-height: 46px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); padding: 10px 14px; font-size: var(--fs-base); color: var(--ink); -webkit-appearance: none; appearance: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
input[type="date"] { min-width: 0; }
textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23746A7E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 36px; width: auto; min-width: 130px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, textarea:focus, .select:focus { outline: none; border-color: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 18%, transparent); }
input[aria-invalid="true"] { border-color: var(--bad); }
.err { font-size: var(--fs-sm); color: var(--bad); }
.set-hint { display: block; font-size: var(--fs-sm); color: var(--muted); }
.amount-wrap { position: relative; display: flex; align-items: center; }
.amount-cur { position: absolute; left: 16px; font-family: var(--font-serif); font-size: 28px; color: var(--muted); pointer-events: none; }
.field-amount input { font-family: var(--font-serif); font-size: 34px; font-weight: 500; min-height: 64px; padding-left: 44px; letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums; -moz-appearance: textfield; }
.field-amount input::-webkit-outer-spin-button, .field-amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.own-row { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s2); }
.own-row input { flex: 0 0 96px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.presets { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pre { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 6px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: var(--fs-ui); font-weight: 500; background: var(--surface); color: var(--body); }
.pre i { width: 30px; height: 30px; border-radius: 50%; background: var(--tone-soft); color: var(--tone); display: grid; place-items: center; font: 600 13px/1 var(--font-sans); font-style: normal; }
.pre:hover { border-color: var(--tone); color: var(--ink); }
.pre[aria-pressed="true"] { border-color: var(--tone); background: var(--tone-soft); color: var(--tone); font-weight: 600; }
details.more { border-radius: var(--r-md); background: var(--surface-2); }
details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 48px; padding: var(--s3) var(--s4); font-size: var(--fs-ui); font-weight: 600; color: var(--tone); border-radius: var(--r-md); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .2s var(--ease); flex: none; }
details.more[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.more-in { display: grid; gap: var(--s4); padding: var(--s2) var(--s4) var(--s4); }
.more-in input[type="text"], .more-in input[type="url"], .more-in input[type="date"], .more-in textarea { background: var(--surface); }

/* Detail sheet */
.d-head { display: grid; gap: 4px; }
.d-name { font-family: var(--font-serif); font-size: var(--fs-h2); font-weight: 600; color: var(--ink); line-height: 1.15; overflow-wrap: anywhere; }
.d-meta { font-size: var(--fs-sm); color: var(--muted); }
.d-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.d-pills:empty { display: none; }
.d-figs { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
.d-figs > div { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s3) var(--s4); min-width: 0; }
.d-figs dt { font-size: var(--fs-xs); color: var(--muted); }
.d-figs dd { font: 500 20px/1.3 var(--font-serif); color: var(--ink); overflow-wrap: anywhere; }
.d-figs dd.txt { font: 600 var(--fs-ui)/1.4 var(--font-sans); }
.d-note { font-family: var(--font-serif); font-style: italic; color: var(--body); overflow-wrap: anywhere; }
.set-h { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.timeline { list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; background: var(--line); border-radius: 2px; }
.tl-item { position: relative; display: flex; gap: var(--s3); align-items: center; padding: var(--s2) 0 var(--s2) 22px; }
.tl-item::before { content: ""; position: absolute; left: 0; top: 50%; margin-top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--good); }
.tl-main { flex: 1; min-width: 0; }
.tl-amt { font-family: var(--font-serif); font-size: var(--fs-lg); font-weight: 600; color: var(--ink); }
.tl-meta { font-size: var(--fs-sm); color: var(--muted); }
.tl-del { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--muted); flex: none; }
.tl-del:hover { color: var(--bad); background: var(--bad-soft); }
.tl-del .i { width: 18px; height: 18px; }
.tl-empty { font-size: var(--fs-ui); color: var(--muted); padding: var(--s1) 0; }

/* Confirm and settings */
.cf-text { color: var(--body); font-size: var(--fs-base); }
.set-group { display: grid; gap: var(--s3); padding-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.set-group:last-of-type { border-bottom: 0; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); min-height: 44px; }
.set-row-col { flex-direction: column; align-items: stretch; gap: 6px; }
.set-label { display: block; font-size: var(--fs-ui); font-weight: 600; color: var(--ink); }
.switch-row { cursor: pointer; }
.switch { -webkit-appearance: none; appearance: none; width: 46px; height: 28px; flex: none; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .2s var(--ease); border: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease-out); }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; }
.sheet-status { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-2); }
.sheet-status .i { color: var(--muted); margin-top: 2px; }
.sheet-status strong { display: block; color: var(--ink); font-size: var(--fs-ui); }
.sheet-status span { display: block; color: var(--muted); font-size: var(--fs-sm); }
.sheet-status[data-state="synced"] { background: var(--good-soft); }
.sheet-status[data-state="synced"] .i, .sheet-status[data-state="synced"] strong { color: var(--good); }
.sheet-status[data-state="error"] { background: var(--bad-soft); }
.sheet-status[data-state="error"] .i, .sheet-status[data-state="error"] strong { color: var(--bad); }
.secret-wrap { display: flex; gap: var(--s2); }
.secret-wrap input { flex: 1; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--fs-ui); }
.howto { font-size: var(--fs-sm); color: var(--body); background: var(--surface-2); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.howto summary { cursor: pointer; font-weight: 600; color: var(--tone); min-height: 28px; }
.howto ol { margin: var(--s2) 0 var(--s2) 18px; display: grid; gap: 6px; }
.set-ver { text-align: center; font-size: var(--fs-xs); color: var(--muted); }
.rem-card { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); }
.rem-card > .i { color: var(--tone); margin-top: 2px; }
.rem-card strong { display: block; color: var(--ink); font-size: var(--fs-ui); }
.rem-card span { display: block; color: var(--body); margin-bottom: var(--s2); }
.rem-card .is-on { color: var(--good); font-weight: 600; }
.inst-tick { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--good); white-space: nowrap; }
.inst-tick .i { width: 18px; height: 18px; }
.inst-steps { margin: 0 0 var(--s3) 20px; display: grid; gap: var(--s2); color: var(--ink); }
.inst-steps .i { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin: 0 2px; color: var(--tone); }
.qr-box { display: grid; place-items: center; padding: var(--s4); background: #FFFFFF; border-radius: var(--r-md); border: 1px solid var(--line); justify-self: center; }
.qr svg { display: block; width: min(64vw, 240px); height: auto; }
.warn-note { font-size: var(--fs-sm); color: var(--soon); background: var(--soon-soft); border-radius: var(--r-md); padding: var(--s3) var(--s4); }

/* PIN lock */
#lockOn:not([hidden]) { display: grid; gap: var(--s3); }
.pin-input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 22px !important; letter-spacing: .5em; max-width: 220px; }
html.locked body > *:not(.lock):not(svg):not(script):not(#dlgConfirm):not(.toast) { visibility: hidden; }
html.locked body { overflow: hidden; }
.lock { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: var(--s5) var(--s4) calc(var(--s5) + var(--safe-b)); background: var(--paper); overflow-y: auto; }
.lock-in { width: 100%; max-width: 320px; display: grid; justify-items: center; gap: var(--s3); text-align: center; }
.lock-icon { width: 56px; height: 56px; border-radius: 14px; box-shadow: var(--shadow); }
.lock-title { font-family: var(--font-serif); font-size: var(--fs-h3); font-weight: 600; color: var(--ink); }
.pin-dots { display: flex; gap: 14px; height: 18px; align-items: center; margin-top: var(--s1); }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); transition: background .15s var(--ease), border-color .15s var(--ease); }
.pin-dots i.on { background: var(--tone); border-color: var(--tone); }
.pin-dots.shake { animation: pin-shake .38s var(--ease); }
@keyframes pin-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.lock-msg { min-height: 22px; font-size: var(--fs-sm); color: var(--muted); }
.lock-msg.is-bad { color: var(--bad); font-weight: 500; }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; margin-top: var(--s2); }
.keypad button { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-serif); font-size: 28px; font-weight: 500; color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.keypad button:active { background: var(--tone-soft); transform: scale(.95); }
.keypad button[data-k="del"] { background: transparent; border-color: transparent; color: var(--muted); }
.keypad button[disabled] { opacity: .4; pointer-events: none; }
@media (max-height: 600px) { .keypad { grid-template-columns: repeat(3, 60px); gap: 10px 18px; } .keypad button { width: 60px; height: 60px; font-size: 24px; } .lock-icon { display: none; } }
.lock-forgot { margin-top: var(--s2); font-size: var(--fs-sm); font-weight: 600; color: var(--tone); padding: 10px 12px; border-radius: var(--r-sm); min-height: 44px; }

/* Footer */
.foot { margin-top: var(--s7); padding-top: var(--s4); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); display: grid; gap: var(--s1); }
.stroban-signoff { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; font-weight: 500; vertical-align: middle; padding: 6px 0; }
.stroban-signoff:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }

/* Motion off */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print { .stroban-bar, .top-actions, .tabbar, .fab, .install-bar, .toast { display: none !important; } body { padding: 0; } }

/* ---------- v1.1 "Open Door": Lite and Pro (S1–S4), feedback strip (S7) ---------- */
.kit-strip { padding-top: var(--s4); }
.kit-strip:empty, .kit-strip .sk-strip[style*="none"] { display: none; }
.kit-strip .sk-strip { margin: 0; }
.kit-strip + .pro-bar { margin-top: var(--s2); }
.pro-bar { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: var(--r-md);
  background: color-mix(in srgb, #E7A33D 14%, var(--surface)); border: 1px solid color-mix(in srgb, #E7A33D 55%, var(--line)); font-size: var(--fs-sm); color: var(--ink); }
.pro-bar[hidden] { display: none; }
.pro-bar p { flex: 1; }
.pro-star { color: #B7791F; }
html[data-theme="dark"] .pro-star { color: #F5B455; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .pro-star { color: #F5B455; } }
.btn-pro { background: #E7A33D; color: #1E1726; border-color: #E7A33D; }
.btn-pro:hover { background: #F0B451; }
.btn.is-locked { background: #E7A33D; color: #1E1726; border-color: #E7A33D; }
.btn-buy { display: flex; width: 100%; justify-content: center; background: #4338CA; color: #FFFFFF; text-decoration: none; margin-top: var(--s3);
  box-shadow: 0 1px 2px rgba(20,20,60,.2), 0 6px 16px -6px rgba(67,56,202,.55); }
.btn-buy:hover { background: #3730A3; }
.plan-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; letter-spacing: .04em; background: var(--surface-2); color: var(--body); border: 1px solid var(--line); vertical-align: 1px; }
.plan-badge.is-pro { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.pro-tag { margin-left: 6px; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: none; color: #8A5A12; background: color-mix(in srgb, #E7A33D 20%, var(--surface)); border-radius: 999px; padding: 1px 7px; }
html[data-theme="dark"] .pro-tag { color: #F5C677; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .pro-tag { color: #F5C677; } }
.cur-switch { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin-top: var(--s3); }
.seg-mini { position: relative; }
.seg-mini input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-mini span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.seg-mini input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg-mini input:focus-visible + span { outline: 2px solid var(--tone); outline-offset: 1px; }
.upg-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin: var(--s2) 0; }
.upg-row .cur-switch { margin-top: 0; }
.inline-link { background: none; border: 0; padding: 4px 0; min-height: 32px; font: inherit; font-weight: 600; color: var(--tone); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.key-field { margin-top: var(--s4); }
#keyMsg.is-bad { color: var(--bad); font-weight: 600; }
.pro-ok { display: flex; align-items: center; gap: 8px; color: var(--good); font-weight: 600; font-size: var(--fs-ui); }
.plans-fold { margin-top: var(--s3); }
.plans-fold .sk-cmp { margin-bottom: 0; }
.privacy-note { margin-top: var(--s2); }
.foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.foot-links a, .foot-links .inline-link { color: var(--tone); font-size: var(--fs-xs); font-weight: 600; }
.empty-links { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: var(--s4) !important; }
.empty-links a { font-weight: 600; }
.top-actions .sk-fb-btn { height: 40px; }
@media (max-width: 420px) { .top-actions .sk-fb-btn { width: 40px; } }
.plans-fold summary { list-style: none; }
.plans-fold summary::-webkit-details-marker { display: none; }
.kit-strip .sk-strip button { width: 36px; height: 36px; }
