  :root {
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-h: 'Bricolage Grotesque', 'DM Sans', sans-serif;
    --mono: 'Geist Mono', ui-monospace, monospace;
    --page: #f5f5f5; --card: #ffffff; --soft: #efefef; --tint: #e6e6e6;
    --line: rgba(0,0,0,.09); --line-2: rgba(0,0,0,.055);
    --ink: #0a0a0a; --ink-2: #5c5c5c; --ink-3: #757575;
    --acc: #0f9d76; --acc-soft: rgba(15,157,118,.1); --amber: #b7791f; --amber-soft: rgba(183,121,31,.12);
    --red: #d64545; --red-soft: rgba(214,69,69,.1);
    --grid: rgba(20,23,26,.05);
    --ease: cubic-bezier(.22,1,.36,1); --io: cubic-bezier(.65,0,.35,1); --m: 1;
    --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  }
  html[data-theme="dark"] {
    --page: #0a0a0a; --card: #161616; --soft: #1f1f1f; --tint: #262626;
    --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.055);
    --ink: #f2f2f2; --ink-2: #a3a3a3; --ink-3: #8a8a8a;
    --acc: #22b98c; --acc-soft: rgba(34,185,140,.14); --amber: #e0a43c; --amber-soft: rgba(224,164,60,.14);
    --red: #ef6b6b; --red-soft: rgba(239,107,107,.13);
    --grid: rgba(255,255,255,.045);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; }
  body { background: #2b2b2b; font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; letter-spacing: -.01em; }
  button { font: inherit; color: inherit; }

  /* stage */
  .stage { display: block; }
  html, body { height: 100%; }
  .device { width: 100%; height: 100vh; height: 100dvh; background: var(--page); overflow: hidden; position: relative;
    transition: max-width .45s var(--io), border-radius .45s var(--io); }
  body.phone .device { max-width: 390px; height: 844px; border-radius: 46px; box-shadow: 0 0 0 10px #000, 0 30px 80px rgba(0,0,0,.5); }
  .scroll { height: 100%; overflow-y: auto; position: relative; scrollbar-width: none; }
  .scroll::-webkit-scrollbar { display: none; }
  .scroll::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 460px; pointer-events: none;
    background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 48px 48px; -webkit-mask-image: radial-gradient(80% 100% at 50% 0%, #000 25%, transparent 75%); mask-image: radial-gradient(80% 100% at 50% 0%, #000 25%, transparent 75%); }
  .app { position: relative; max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }

  /* top bar */
  .top { display: flex; align-items: center; justify-content: space-between; height: 64px; position: sticky; top: 0; z-index: 10;
    margin: 0 -16px; padding: 0 16px; background: color-mix(in srgb, var(--page) 82%, transparent);
    backdrop-filter: blur(14px) saturate(180%); -webkit-backdrop-filter: blur(14px) saturate(180%); border-bottom: 1px solid transparent; transition: border-color .2s; }
  .top:empty { display: none; }
  .top:not(.stuck) { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .top.stuck { border-bottom-color: var(--line); }
  .top { height: calc(76px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  body.phone .top { padding-top: 14px; height: 78px; }
  .brand { display: flex; align-items: center; gap: 10px; }
  .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--page); display: grid; place-items: center; }
  .logo svg { width: 16px; height: 16px; }
  .brand .nm { font: 800 17px var(--font-h); letter-spacing: -.02em; }
  .brand .sub { font-size: 12.5px; color: var(--ink-3); }
  .iconbtn { all: unset; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line);
    color: var(--ink-2); transition: background .18s, color .18s, transform .12s var(--ease); }
  .iconbtn:hover { background: var(--soft); color: var(--ink); }
  .iconbtn:active { transform: scale(.94); }
  .iconbtn svg { width: 17px; height: 17px; }
  .vpill { display: none; align-items: center; gap: 8px; }
  body.vendor .vpill { display: flex; }
  body.vendor .lockbtn { display: none; }
  .vtag { font: 600 12.5px var(--font); color: var(--acc); background: var(--acc-soft);
    padding: 6px 10px; border-radius: 999px; display: flex; align-items: center; gap: 6px; }
  .vtag i { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }

  /* cards */
  .card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
  .hero { margin-top: 18px; }
  .bal { font: 800 56px/1 var(--font-h); letter-spacing: -.03em; margin: 2px 0 10px; font-variant-numeric: tabular-nums; transition: color .3s; }
  .bal.low { color: var(--amber); }
  .bal.neg { color: var(--red); }
  .bal-sub { color: var(--ink-2); font-size: 15px; }
  .bal-sub b { color: var(--ink); font-weight: 600; }
  .meter { margin: 20px 0 8px; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
  .meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--acc); transition: width .8s var(--ease), background .3s; }
  .meter.low i { background: var(--amber); }
  .meter-l { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 18px; border-top: 1px solid var(--line-2); padding-top: 16px; }
  .stat + .stat { border-left: 1px solid var(--line-2); padding-left: 14px; }
  .stat .v { font: 800 20px var(--font-h); letter-spacing: -.02em; margin-top: 6px; }
  .stat .k { font-size: 12.5px; color: var(--ink-3); }
  .alert { display: none; margin-top: 14px; padding: 11px 14px; border-radius: 13px; background: var(--amber-soft); color: var(--amber); font-size: 13.5px; font-weight: 600; }
  .alert.show { display: block; }
  .alert.neg { background: var(--red-soft); color: var(--red); }

  .sec { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 4px 12px; }
  .sec h2 { margin: 0; font: 800 19px var(--font-h); letter-spacing: -.02em; }
  .sec .meta { font-size: 13px; color: var(--ink-3); }

  /* vendor: log tiles */
  .vonly { display: none; }
  body.vendor .vonly { display: block; }
  .tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { all: unset; box-sizing: border-box; cursor: pointer; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px;
    display: flex; flex-direction: column; gap: 14px; min-height: 118px; transition: box-shadow .2s var(--io), transform .12s var(--ease); }
  .tile:hover { box-shadow: var(--shadow); }
  .tile:active { transform: scale(.97); }
  .tile .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; }
  .tile .ic svg { width: 19px; height: 19px; }
  .tile .tn { font-weight: 650; font-size: 15.5px; }
  .tile .tp { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
  .vactions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
  .btn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 16px;
    border-radius: 13px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 14px var(--font); cursor: pointer;
    transition: background-color .18s, box-shadow .18s, transform .12s var(--ease), opacity .2s; }
  .btn:hover { background: var(--soft); }
  .btn:active { transform: scale(.97); }
  .btn svg { width: 16px; height: 16px; }
  .btn.green { background: var(--acc); border-color: var(--acc); color: #fff; }
  .btn.green:hover { filter: brightness(1.06); background: var(--acc); }
  .btn.dark { background: var(--ink); border-color: var(--ink); color: var(--page); }
  .btn.red { background: var(--red); border-color: var(--red); color: #fff; }
  .btn.full { width: 100%; }
  .btn[disabled] { opacity: .4; pointer-events: none; }

  /* breakdown + history */
  .list { padding: 6px 18px; }
  .li { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
  .li:last-child { border-bottom: 0; }
  .dot { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--soft); color: var(--ink-2); }
  .dot svg { width: 16px; height: 16px; }
  .dot.plus { background: var(--acc-soft); color: var(--acc); }
  .li .mid { flex: 1; min-width: 0; }
  .li .t { font-size: 14.5px; font-weight: 600; }
  .li .s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
  .li .a { font-weight: 650; font-size: 14.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .li .a.plus { color: var(--acc); }
  .bar2 { height: 5px; border-radius: 99px; background: var(--soft); margin-top: 7px; overflow: hidden; }
  .bar2 i { display: block; height: 100%; background: var(--ink); opacity: .75; border-radius: 99px; }
  .day { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 16px 0 4px; }
  .day:first-child { padding-top: 10px; }
  .rm { all: unset; cursor: pointer; width: 28px; height: 28px; border-radius: 9px; display: none; place-items: center; color: var(--ink-3); transition: background .18s, color .18s; }
  body.vendor .rm { display: grid; }
  .rm:hover { background: var(--red-soft); color: var(--red); }
  .rm svg { width: 14px; height: 14px; }
  .empty { color: var(--ink-3); font-size: 14px; padding: 18px 0; text-align: center; }
  body.vendor .foot { display: none; }
  .foot { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 26px; }

  /* modal */
  .ov { position: absolute; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 400px); place-content: center; place-items: center; padding: 16px; background: rgba(0,0,0,.42);
    opacity: 0; visibility: hidden; transition: opacity calc(.24s * var(--m)) var(--io), visibility 0s linear calc(.24s * var(--m)); }
  .ov.show { opacity: 1; visibility: visible; transition: opacity calc(.24s * var(--m)) var(--io), visibility 0s; }
  .sheet { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.25);
    transform: translateY(12px) scale(.97); transition: transform calc(.32s * var(--m)) var(--ease); }
  .ov.show .sheet { transform: none; }
  .sheet h3 { margin: 0; font: 800 21px var(--font-h); letter-spacing: -.02em; }
  .sheet .lead { color: var(--ink-2); font-size: 14px; margin: 6px 0 0; }
  .sheet .row2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 22px; }
  .x { position: absolute; right: 14px; top: 14px; }
  .sheet { position: relative; }

  .stepper { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; background: var(--soft); border-radius: 18px; padding: 8px; }
  .stepper button { all: unset; cursor: pointer; width: 54px; height: 54px; border-radius: 14px; background: var(--card); display: grid; place-items: center;
    border: 1px solid var(--line); transition: transform .12s var(--ease), opacity .2s; }
  .stepper button:active { transform: scale(.92); }
  .stepper button[disabled] { opacity: .35; pointer-events: none; }
  .stepper svg { width: 20px; height: 20px; }
  .stepper .q { text-align: center; }
  .stepper .q input { all: unset; display: block; width: 3ch; margin: 0 auto; text-align: center; border-radius: 10px; cursor: text; caret-color: var(--acc); font: 800 38px/1 var(--font-h); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
  .stepper .q input:focus { background: var(--soft); }
  .stepper .q span { font-size: 12.5px; color: var(--ink-3); }
  .sum { display: flex; justify-content: space-between; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
  .sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
  .sum + .sum { margin-top: 6px; }

  .field { margin-top: 18px; }
  .field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
  .inp { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--page);
    transition: border-color .18s, box-shadow .18s; }
  .inp:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
  .inp span { color: var(--ink-3); font-weight: 600; }
  .inp input { all: unset; flex: 1; min-width: 0; width: 100%; font: 600 16px var(--font); color: var(--ink); }
  .inp input::placeholder { color: var(--ink-3); font-weight: 400; }
  .inp.big input { font: 800 26px var(--font-h); letter-spacing: -.02em; }
  .inp.big { height: 62px; }
  .chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
  .chip { all: unset; cursor: pointer; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2);
    transition: background .18s, color .18s, border-color .18s; }
  .chip:hover, .chip.on { background: var(--acc-soft); color: var(--acc); border-color: transparent; }

  /* pin pad */
  .pins { display: flex; justify-content: center; gap: 14px; margin: 24px 0 22px; }
  .pins i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink-3); transition: background .15s, border-color .15s, transform .2s var(--ease); }
  .pins i.on { background: var(--ink); border-color: var(--ink); transform: scale(1.1); }
  .pins.bad { animation: shake .4s var(--io); }
  .pins.bad i { border-color: var(--red); background: transparent; }
  @keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
  .pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .pad button { all: unset; cursor: pointer; height: 58px; border-radius: 16px; background: var(--soft); display: grid; place-items: center; font: 600 22px var(--font);
    transition: background .15s, transform .1s var(--ease); }
  .pad button:hover { background: var(--tint); }
  .pad button:active { transform: scale(.94); }
  .pad button.ghost { background: transparent; }
  .pad svg { width: 22px; height: 22px; }
  .perr { text-align: center; color: var(--red); font-size: 13px; height: 18px; margin-top: 12px; }

  /* item manager */
  .irow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
  .irow .inp { height: 44px; }
  .irow .inp input { font-size: 14.5px; }
  .irow .n { flex: 1.4; }
  .irow .p { flex: 1; }
  .items-scroll { max-height: 300px; overflow-y: auto; margin-top: 10px; }

  /* toast */
  .toast { position: absolute; left: 16px; right: 16px; bottom: 22px; z-index: 60; display: flex; align-items: center; gap: 12px; max-width: 420px; margin: 0 auto;
    background: var(--ink); color: var(--page); border-radius: 16px; padding: 12px 12px 12px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.25);
    transform: translateY(140%); opacity: 0; transition: transform .38s var(--ease), opacity .25s var(--io); }
  .toast.show { transform: none; opacity: 1; }
  .toast .tc { width: 26px; height: 26px; border-radius: 50%; background: var(--acc); color: #fff; display: grid; place-items: center; flex: none; }
  .toast .tc svg { width: 14px; height: 14px; }
  .toast span { flex: 1; font-size: 14px; font-weight: 500; }
  .toast button { all: unset; cursor: pointer; font-weight: 700; font-size: 14px; padding: 7px 10px; border-radius: 9px; color: var(--acc); }
  .toast button:hover { background: rgba(255,255,255,.08); }
  html[data-theme="dark"] .toast button:hover { background: rgba(0,0,0,.06); }

  .fade-in { animation: fin .5s var(--ease) both; }
  @keyframes fin { from { opacity: 0; transform: translateY(8px); } }
  @media (max-width: 420px) { .stage { padding: 0; } body:not(.phone) .device { border-radius: 0; } .bal { font-size: 50px; } }

  /* v3: customers, setup, menus */
  .brand .back { margin-right: 2px; }
  .tsum { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border-top: 1px solid var(--line-2); padding-top: 16px; }
  .search { margin-bottom: 10px; }
  .search svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
  .crow { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 0;
    border-bottom: 1px solid var(--line-2); transition: opacity .15s; }
  .crow:last-child { border-bottom: 0; }
  .crow:active { opacity: .6; }
  .av { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; font: 800 16px var(--font-h);
    background: var(--soft); color: var(--ink-2); }
  .crow .mid { flex: 1; min-width: 0; }
  .crow .t { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crow .s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
  .crow .r { text-align: right; }
  .crow .a { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
  .crow .chev { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
  .badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 999px; margin-top: 4px; }
  .badge.low { background: var(--amber-soft); color: var(--amber); }
  .badge.owe { background: var(--red-soft); color: var(--red); }
  .a.low { color: var(--amber); } .a.owe { color: var(--red); }

  .mrow { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 14px;
    transition: background .15s; }
  .mrow:hover { background: var(--soft); }
  .mrow .dot { width: 36px; height: 36px; }
  .mrow .t { flex: 1; font-weight: 600; font-size: 15px; }
  .mrow .s { font-size: 12.5px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
  .mrow .chev { width: 16px; height: 16px; color: var(--ink-3); }
  .mrow.danger { color: var(--red); }
  .mrow.danger .dot { background: var(--red-soft); color: var(--red); }
  .menu { margin-top: 14px; display: grid; gap: 2px; }

  .qrbox { margin-top: 18px; display: grid; justify-items: center; gap: 10px; }
  .qr { width: 196px; height: 196px; padding: 14px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-sizing: content-box; }
  .qr svg { display: block; width: 100%; height: 100%; }
  .qrcap { font-size: 13px; color: var(--ink-3); }
  .linkbox { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 0 6px 0 14px; height: 52px; border-radius: 13px; background: var(--page); border: 1px solid var(--line); }
  .linkbox code { flex: 1; min-width: 0; font: 500 13px var(--mono); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .linkbox .btn { height: 40px; }
  .stack { display: grid; gap: 10px; margin-top: 12px; }

  .landing { min-height: 100vh; min-height: 100dvh; max-width: 400px; margin: 0 auto -48px; display: flex; flex-direction: column; justify-content: center; text-align: left; padding: 40px 0; }
  .landing .lcard { padding: 30px 26px; }
  .landing .lcard .btn.full { margin-top: 26px; }
  .addr { gap: 0; }
  .addr .pre { color: var(--ink-3); font-weight: 500; white-space: nowrap; font-size: 15px; }
  .addr input { padding-left: 1px; }
  .landing .lcard .ferr + .btn.full { margin-top: 10px; }
  .fhint { color: var(--ink-3); font-size: 12.5px; margin-top: 8px; }
  .more { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--acc); }
  .more svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
  .more.on svg { transform: rotate(45deg); }
  .morebox { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
  .morebox > * { overflow: hidden; }
  .morebox.on { grid-template-rows: 1fr; }
  .morebox > div { min-height: 0; padding: 0 3px 3px; margin: 0 -3px; }
  .landing .lcard .note { margin-top: 24px; }
  .landing .lcard .steps { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
  .landing .logo.big { width: 54px; height: 54px; border-radius: 16px; margin-bottom: 24px; }
  .landing .logo.big svg { width: 26px; height: 26px; }
  .landing h1 { font: 800 34px/1.05 var(--font-h); letter-spacing: -.035em; margin: 0; }
  .landing p { color: var(--ink-2); font-size: 16px; margin: 14px 0 0; max-width: 340px; }
  .landing .stack { margin-top: 30px; max-width: 340px; }
  .steps { margin-top: 34px; display: grid; gap: 14px; max-width: 360px; }
  .step { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
  .step b { color: var(--ink); font-weight: 600; display: block; }
  .step .n { width: 24px; height: 24px; border-radius: 8px; background: var(--acc-soft); color: var(--acc); font: 600 12px var(--mono); display: grid; place-items: center; flex: none; }

  /* v4: big customer lists */
  .sec .btn.sm, .btn.sm { height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13.5px; }
  .btn.sm svg { width: 14px; height: 14px; }
  .searchrow { display: flex; gap: 8px; position: sticky; top: 64px; z-index: 6; margin: 0 -16px; padding: 4px 16px 10px;
    background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .searchrow { top: calc(76px + env(safe-area-inset-top)); }
  .searchrow .inp { flex: 1; margin: 0; height: 46px; background: var(--card); }
  .clr { all: unset; cursor: pointer; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); visibility: hidden; }
  .clr:hover { background: var(--soft); color: var(--ink); }
  .clr svg { width: 14px; height: 14px; }
  .fbtn { width: 46px; height: 46px; background: var(--card); position: relative; }
  .fbtn .fdot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); transform: scale(0); transition: transform .25s var(--ease); }
  .fbtn.on .fdot { transform: scale(1); }
  .fnote { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); height: 0; overflow: hidden; opacity: 0;
    transition: height .25s var(--io), opacity .2s, margin .25s var(--io); }
  .fnote.show { height: 30px; opacity: 1; margin-bottom: 6px; }
  .fnote button { all: unset; cursor: pointer; color: var(--acc); font-weight: 600; padding: 4px 6px; border-radius: 8px; }
  .fnote button:hover { background: var(--acc-soft); }
  .statbtn { all: unset; cursor: pointer; border-left: 1px solid var(--line-2); padding-left: 14px; border-radius: 0; transition: opacity .15s; }
  .statbtn:active { opacity: .6; }
  mark { background: var(--acc-soft); color: inherit; border-radius: 4px; padding: 0 1px; }
  .more { all: unset; box-sizing: border-box; cursor: pointer; display: flex; justify-content: center; gap: 8px; width: 100%; padding: 15px 0 12px; font-weight: 600; font-size: 14px; color: var(--ink);
    border-top: 1px solid var(--line-2); transition: color .15s; }
  .more span { color: var(--ink-3); font-weight: 400; }
  .more:hover { color: var(--acc); }
  .crow + .more { border-top: 1px solid var(--line-2); }
  .fgroup { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin: 18px 4px 4px; }
  .opt .tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: transparent; border: 1.5px solid var(--line); transition: background .2s, border-color .2s; }
  .opt .tick svg { width: 12px; height: 12px; opacity: 0; transition: opacity .15s; }
  .opt.on .tick { background: var(--acc); border-color: var(--acc); }
  .opt.on .tick svg { opacity: 1; }
  .opt.on .t { color: var(--ink); }
  .opt { padding: 10px 12px; }

  /* v5: grouped history */
  .evrow { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: opacity .15s; }
  .evrow:last-child, .evrow:has(+ .more) { border-bottom: 0; }
  .evrow:active { opacity: .6; }
  .evrow[disabled] { cursor: default; opacity: 1; }
  .evrow .chev { width: 16px; height: 16px; color: var(--ink-3); flex: none; display: grid; place-items: center; }
  .evrow .chev svg { width: 16px; height: 16px; }
  .evrow .rmhint svg { width: 13px; height: 13px; }
  .evrow.pay .t { color: var(--acc); }
  .ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hscroll { margin-top: 12px; max-height: 470px; overflow-y: auto; scrollbar-width: none; }
  .hscroll::-webkit-scrollbar { display: none; }
  #dyList { padding: 0 2px; }
  .sheet.tall .hscroll { max-height: 600px; }
  .mhead { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-3); margin: 16px 4px 8px; }
  .mhead span:first-child { font: 800 16px var(--font-h); color: var(--ink); letter-spacing: -.01em; }
  .mhead:first-child { margin-top: 4px; }
  .hscroll .card.list { padding: 2px 14px; border-radius: 18px; }
  .backlink { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin: -4px 0 8px -4px; padding: 4px 6px; border-radius: 8px; }
  .backlink:hover { background: var(--soft); color: var(--ink); }
  .backlink svg { width: 15px; height: 15px; }

  /* v6: pagination everywhere */
  .pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 10px; border-top: 1px solid var(--line-2); }
  .pager span { font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
  .pager span b { color: var(--ink); font-weight: 600; }
  .pager button { all: unset; cursor: pointer; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink);
    transition: background .15s, transform .12s var(--ease), opacity .2s; }
  .pager button:hover { background: var(--soft); }
  .pager button:active { transform: scale(.94); }
  .pager button[disabled] { opacity: .3; pointer-events: none; }
  .pager svg { width: 16px; height: 16px; }
  .evrow:has(+ .pager), .crow:has(+ .pager), .li:has(+ .pager) { border-bottom: 0; }
  .mrow2 { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; font-size: 12.5px; color: var(--ink-3); }
  .mrow2 span:first-child { font-size: 13.5px; font-weight: 700; color: var(--ink); }
  .mrow2 + .evrow { padding-top: 10px; }

  /* live app: sync status, recovery code, loading */
  .sync { display: none; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
    background: var(--amber-soft); color: var(--amber); }
  .sync.show { display: inline-flex; }
  .sync i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .sync.busy i { animation: blink 1s var(--io) infinite; }
  @keyframes blink { 50% { opacity: .25; } }
  .pad.off button { opacity: .35; pointer-events: none; }
  .forgot { all: unset; cursor: pointer; display: block; margin: 4px auto 0; font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding: 6px 10px; border-radius: 9px; }
  .forgot:hover { background: var(--soft); color: var(--ink); }
  .codebox { margin-top: 18px; padding: 18px; border-radius: 16px; background: var(--page); border: 1px dashed var(--line); text-align: center;
    font: 600 22px var(--mono); letter-spacing: .08em; user-select: all; }
  .ferr { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }
  .hint2 { color: var(--ink-3); font-size: 12.5px; margin-top: 14px; }
  .center { min-height: 100dvh; margin-bottom: -48px; display: grid; place-items: center; text-align: center; padding: 40px 10px; }
  .center h2 { font: 800 24px var(--font-h); letter-spacing: -.02em; margin: 18px 0 6px; }
  .center p { color: var(--ink-2); font-size: 15px; margin: 0 auto; max-width: 300px; }
  .center .logo { margin: 0 auto; width: 44px; height: 44px; border-radius: 13px; }
  .center .logo svg { width: 22px; height: 22px; }
  .spin { animation: pulse 1.2s var(--io) infinite; }
  @keyframes pulse { 50% { opacity: .35; transform: scale(.92); } }
  .landing .note { margin-top: 30px; max-width: 340px; padding: 12px 14px; border-radius: 13px; background: var(--soft); color: var(--ink-2); font-size: 14px; }
  .pscroll { max-height: min(58vh, 460px); overflow-y: auto; margin: 0 -6px; padding: 0 6px 2px; }
  .inp + .inp { margin-top: 8px; }
  .payc .k { font-size: 13px; color: var(--ink-3); }
  .payrow { display: flex; align-items: center; gap: 12px; }
  .payrow > div { flex: 1; min-width: 0; }
  .acct { font: 800 24px var(--font-h); letter-spacing: .01em; margin-top: 2px; }
  .payc .s { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
  .payc .btn.full { margin-top: 16px; }
  .payrow + .btn.full { margin-top: 18px; }
