/* Fonts are bundled so the app looks the same with no internet. */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/poppins-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/poppins-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: italic; font-weight: 500; font-display: swap; src: url("fonts/poppins-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: italic; font-weight: 500; font-display: swap; src: url("fonts/montserrat-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }

/* Layout: app bar, then a two-pane workbench (form left, A5 paper preview right); panes become tabs on phones. */
:root {
  --viz-1: #7A3AA0; --viz-2: #E8711C;
  --bg: #F5F3F7;
  --surface: #FFFFFF;
  --ink: #1F1A24;
  --muted: #645C6E;
  --line: #E2DDE8;
  --field: #FFFFFF;
  --brand: #47195F;
  --btn: #47195F;
  --btn-ink: #FFFFFF;
  --accent: #FF6600;
  --accent-ink: #A84300;
  --soft: #F1EBF5;
  --ok: #1F7A4D;
  --danger: #B3261E;
  --desk: #E7E2EC;
  --font-display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --viz-1: #9A62C4; --viz-2: #D9702A;
    --bg: #141118; --surface: #1E1A24; --ink: #EEE9F2; --muted: #A99FB3; --line: #362F3F; --field: #17131C;
    --brand: #D2B3E8; --btn: #7A3AA0; --btn-ink: #FFFFFF; --accent: #FF8A3D; --accent-ink: #FFB27F; --soft: #2A2233;
    --ok: #5FC795; --danger: #FF8A80; --desk: #0E0C11; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --viz-1: #9A62C4; --viz-2: #D9702A;
  --bg: #141118; --surface: #1E1A24; --ink: #EEE9F2; --muted: #A99FB3; --line: #362F3F; --field: #17131C;
  --brand: #D2B3E8; --btn: #7A3AA0; --btn-ink: #FFFFFF; --accent: #FF8A3D; --accent-ink: #FFB27F; --soft: #2A2233;
  --ok: #5FC795; --danger: #FF8A80; --desk: #0E0C11; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.appbar { position: sticky; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding-inline: 16px; }
.appbar-in { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--brand); }
.brand svg { width: 34px; height: 34px; }
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); min-height: 40px; }
.tab[aria-selected="true"] { background: var(--soft); color: var(--brand); }
.status { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--accent); }

main { max-width: 1320px; margin: 0 auto; padding-inline: 16px; padding-block: 18px 60px; }
.bench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; align-items: start; }
.pane-switch { display: none; gap: 6px; margin-bottom: 12px; }
.pane-switch button { flex: 1; }
@media (max-width: 960px) {
  .bench { grid-template-columns: minmax(0, 1fr); }
  .pane-switch { display: flex; }
  .bench[data-pane="form"] .preview-pane { display: none; }
  .bench[data-pane="preview"] .form-pane { display: none; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.form-pane { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
h2 { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0; color: var(--brand); letter-spacing: 0.2px; text-wrap: balance; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
@media (max-width: 520px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); }
.field textarea { min-height: 60px; resize: vertical; }
.field input:disabled, .field select:disabled, .field textarea:disabled { opacity: 0.75; }
.req { color: var(--accent-ink); }

.item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item-head strong { font-family: var(--font-display); font-size: 13px; color: var(--brand); }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; }

.btn { border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 9px; cursor: pointer; min-height: 42px; font-weight: 600; }
.btn:hover:not(:disabled) { border-color: var(--brand); }
.btn.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.btn.orange { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: 13.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; font-variant-numeric: tabular-nums; background: var(--soft); border-radius: 10px; padding: 12px 14px; }
.totals .big { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--brand); }
.totals .due { color: var(--accent-ink); font-weight: 700; }

.pad { width: 100%; height: 120px; border: 1.5px dashed var(--line); border-radius: 10px; background: #FFFFFF; touch-action: none; cursor: crosshair; display: block; }
.sigimg { height: 70px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; padding: 6px; object-fit: contain; max-width: 100%; }
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; min-height: 42px; }
.choice input { accent-color: var(--btn); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo { display: flex; flex-direction: column; gap: 6px; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); max-width: 100%; }
.photo input { min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); font-size: 13px; width: 100%; }

.banner { border-radius: 10px; padding: 10px 14px; font-size: 14px; background: var(--soft); border: 1px solid var(--line); }
.banner.saved { border-color: var(--ok); }
.banner.void { border-color: var(--danger); }

.preview-pane { position: sticky; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.desk { background: var(--desk); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 18px; max-height: calc(100vh - 190px); overflow: auto; }
@media (max-width: 960px) { .preview-pane { position: static; } .desk { max-height: none; padding: 10px; } }
.paper-wrap { width: 100%; max-width: 600px; }
.paper-scale { transform-origin: top left; width: 600px; }
.paper-shadow { box-shadow: 0 2px 10px rgba(20, 10, 30, 0.18); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 140px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.rec { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px 14px; cursor: pointer; min-height: 56px; }
.rec:hover { border-color: var(--brand); }
.rec .no { font-family: var(--font-display); font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.rec .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec .sum { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.pill { font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--danger); color: var(--danger); margin-left: 6px; }
@media (max-width: 560px) { .rec { grid-template-columns: minmax(0, 1fr) auto; } .rec .no { grid-column: 1 / -1; } }
.stats { display: flex; gap: 22px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-family: var(--font-display); font-size: 20px; color: var(--brand); }
.stats span { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 50; max-width: calc(100% - 32px); }
#export-host { position: fixed; left: -14000px; top: 0; width: 600px; pointer-events: none; }

/* ---------- Standalone app additions ---------- */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
img { max-width: 100%; }
.appbar { top: 0; padding-top: env(safe-area-inset-top, 0px); }
.preview-pane { top: calc(env(safe-area-inset-top, 0px) + 74px); }
.gps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gps b { color: var(--ink); font-weight: 600; }
.gps .dot { flex: none; }
.backup-row { display: flex; gap: 8px; flex-wrap: wrap; }
.notice { border-left: 0; border-radius: 10px; padding: 10px 14px; background: var(--soft); border: 1px solid var(--accent); font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.photo select { min-height: 34px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); font-size: 13px; width: 100%; }
.rc-desc + .rc-sub { font-size: 8px; color: #5B5563; line-height: 1.3; overflow-wrap: anywhere; }
.app-foot { max-width: 1320px; margin: 0 auto; padding-inline: 16px; padding-block: 4px 28px; text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.app-foot b { font-weight: 600; color: var(--ink); }
.about { gap: 10px; }
.about-head { display: flex; align-items: center; gap: 12px; }
.about-head svg { width: 48px; height: 48px; flex: none; }
.about-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--brand); line-height: 1.2; }
.about-ver { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.about-credit { border-top: 1px solid var(--line); padding-top: 10px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(14, 11, 18, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); color: var(--ink); border-radius: 14px; max-width: 440px; width: 100%; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); }
.modal h2 { font-size: 18px; }
.modal ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.idrow { display: flex; gap: 6px; align-items: stretch; }
.idrow input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }
.idhint { font-size: 12.5px; color: var(--muted); min-height: 16px; }
.idhint.ok { color: var(--ok); font-weight: 600; }
.idhint.bad { color: var(--danger); font-weight: 600; }
.scanner { position: fixed; inset: 0; z-index: 200; background: #0E0B12; color: #FFFFFF; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px); text-align: center; }
.scanner-box { position: relative; width: min(100%, 520px); aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #000000; max-width: 100%; }
.scanner-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 8%; right: 8%; top: 30%; bottom: 30%; border: 3px solid #FF8A3D; border-radius: 10px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.scan-msg { margin: 0; font-size: 16px; font-weight: 600; max-width: 520px; }
.scan-tip { margin: 0; font-size: 13.5px; color: #CFC6D8; max-width: 520px; }
.scanner .btn { background: #FFFFFF; color: #1F1A24; min-width: 140px; }
.rc-imei + .rc-imei { margin-top: 1px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
a { color: var(--brand); }

/* ---------- Receipt paper (always printed on white, independent of theme) ---------- */
.rc { width: 600px; height: 849px; box-sizing: border-box; padding: 24px 28px 18px; background: #FFFFFF; color: #1F1A24; font-family: "Poppins", Arial, sans-serif; font-size: 10px; line-height: 1.35; display: flex; flex-direction: column; gap: 7px; position: relative; isolation: isolate; overflow: hidden; }
.rc * { box-sizing: border-box; }
.rc-wm { position: absolute; left: 0; top: 0; width: 600px; height: 849px; z-index: -1; pointer-events: none; display: flex; align-items: center; justify-content: center; opacity: 0.045; }
.rc-wmtext { position: absolute; left: -100px; top: 400px; width: 800px; z-index: -1; transform: rotate(-30deg); text-align: center; font-size: 15px; font-weight: 700; letter-spacing: 6px; color: #47195F; opacity: 0.06; white-space: nowrap; }
.rc-void { position: absolute; left: 0; top: 300px; width: 600px; text-align: center; transform: rotate(-24deg); font-size: 120px; font-weight: 800; letter-spacing: 16px; color: #B3261E; opacity: 0.22; z-index: 5; }
.rc-head { display: flex; justify-content: space-between; align-items: flex-start; }
.rc-logo { display: flex; flex-direction: column; gap: 3px; }
.rc-tag { font-family: "Montserrat", Arial, sans-serif; font-style: italic; font-weight: 500; font-size: 14px; color: #47195F; padding-left: 5px; letter-spacing: 0.1px; }
.rc-title { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-top: 4px; }
.rc-title h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: 1.5px; color: #47195F; }
.rc-no { display: flex; align-items: baseline; gap: 6px; }
.rc-no span { font-size: 11px; color: #5B5563; font-weight: 500; }
.rc-no b { font-size: 19px; color: #C8102E; letter-spacing: 0.5px; }
.rc-small { font-size: 9px; color: #5B5563; }
.rc-contact { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-top: 3px solid #47195F; border-bottom: 1px solid #FF6600; }
.rc-contact .r { display: flex; justify-content: space-between; gap: 10px; }
.rc-handle { font-weight: 600; color: #47195F; }
.rc-cust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.rc-f { display: flex; gap: 6px; align-items: flex-end; min-width: 0; }
.rc-f b { white-space: nowrap; font-weight: 600; }
.rc-f span { flex: 1; border-bottom: 1px solid #9A93A3; min-height: 15px; padding: 0 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rc-table { border: 1px solid #CFC8D6; border-radius: 4px; overflow: hidden; }
.rc-tr { display: grid; grid-template-columns: 26px minmax(0, 1fr) 104px 70px 72px 78px; }
.rc-th { background: #47195F; color: #FFFFFF; font-weight: 600; font-size: 8.5px; }
.rc-th div { padding: 6px 4px; }
.rc-td { border-top: 1px solid #E4DFE9; min-height: 28px; }
.rc-td div { padding: 4px; border-right: 1px solid #E4DFE9; display: flex; flex-direction: column; justify-content: center; min-width: 0; overflow: hidden; }
.rc-td div:last-child { border-right: 0; }
.rc-c { text-align: center; align-items: center; }
.rc-rt { text-align: right; align-items: flex-end; font-variant-numeric: tabular-nums; }
.rc-sub { font-size: 7.5px; color: #6B6474; }
.rc-desc { font-weight: 500; overflow-wrap: anywhere; }
.rc-imei { font-size: 8.5px; overflow-wrap: anywhere; }
.rc-notes { display: flex; gap: 6px; align-items: flex-start; }
.rc-notes b { white-space: nowrap; font-weight: 600; padding-top: 1px; }
.rc-notes span { flex: 1; border-bottom: 1px solid #9A93A3; min-height: 15px; padding: 0 2px 1px; overflow-wrap: anywhere; }
.rc-mid { display: flex; gap: 14px; align-items: stretch; }
.rc-pay { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.rc-lab { font-weight: 600; color: #47195F; font-size: 9px; letter-spacing: 0.5px; }
.rc-paid { display: flex; flex-direction: column; gap: 2px; }
.rc-bank { background: #F5F1F8; border-radius: 4px; padding: 7px 9px; display: flex; flex-direction: column; gap: 2px; }
.rc-bank .r { display: flex; justify-content: space-between; }
.rc-tot { width: 220px; border: 1px solid #CFC8D6; border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.rc-tot .r { display: flex; justify-content: space-between; padding: 5px 10px; border-bottom: 1px solid #E4DFE9; }
.rc-tot .r:last-child { border-bottom: 0; }
.rc-tot .t { background: #47195F; color: #FFFFFF; font-weight: 700; font-size: 11.5px; padding: 7px 10px; border-bottom: 0; }
.rc-tot .due b { color: #C8102E; }
.rc-sign { display: flex; gap: 14px; align-items: flex-end; }
.rc-qr { width: 84px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.rc-qr img { width: 74px; height: 74px; image-rendering: pixelated; }
.rc-qr span { font-size: 7.5px; color: #5B5563; line-height: 1.2; }
.rc-sigs { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rc-sigs .r { display: flex; gap: 12px; }
.rc-sl { flex: 1; display: flex; gap: 6px; align-items: flex-end; min-width: 0; }
.rc-sl b { white-space: nowrap; font-weight: 600; }
.rc-sl span { flex: 1; border-bottom: 1px solid #9A93A3; height: 30px; display: flex; align-items: flex-end; overflow: hidden; padding: 0 2px; white-space: nowrap; }
.rc-sl img { height: 30px; max-width: 100%; object-fit: contain; object-position: left bottom; }
.rc-stamp { width: 150px; height: 100px; border: 1.2px dashed #C9C3D0; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #8A8392; font-size: 9px; }
.rc-stamp img.round { width: 100px; height: 100px; transform: rotate(-8deg); }
.rc-stamp img.rect { width: 144px; transform: rotate(-4deg); }
.rc-foot { margin-top: auto; display: flex; flex-direction: column; gap: 3px; padding-top: 7px; border-top: 1px solid #FF6600; }
.rc-terms { font-size: 8px; color: #4A4452; line-height: 1.45; }
.rc-foot .r { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rc-thanks { font-weight: 600; color: #47195F; font-size: 10px; white-space: nowrap; }
.rc-issued { font-size: 8px; color: #5B5563; text-align: right; }
.rc-ev-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rc-ev { display: flex; flex-direction: column; gap: 4px; }
.rc-ev .ph { height: 196px; border: 1px solid #E4DFE9; border-radius: 4px; background: #FAF8FB; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.rc-ev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rc-ev span { font-size: 9px; color: #4A4452; }

/* ---------- v2: sign-in gate, accounts, team ---------- */
body.gated { overflow: hidden; }
.gate { position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow-y: auto; }
.gate-in { min-height: 100%; display: flex; flex-direction: column; align-items: center; }
.gate-head { width: 100%; background: #47195F; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px 34px; border-radius: 0 0 26px 26px; text-align: center; }
.gate-head svg { width: 64px; height: 64px; background: #fff; border-radius: 50%; padding: 4px; }
.gate-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.gate-sub { font-size: 13.5px; opacity: .8; }
.gate-card { width: min(420px, calc(100% - 32px)); margin: -14px auto 0; background: var(--surface); border-radius: 16px; padding: 20px 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 6px 24px rgba(40, 10, 60, .10); }
.gate-card h2 { margin: 0; font-family: var(--font-display); font-size: 19px; }
.gate-card p { margin: 0; }
.gate-foot { margin: 18px auto 24px; font-size: 12px; color: var(--muted); text-align: center; padding-inline: 16px; }
.gate-msg { min-height: 0; margin: 0; font-size: 14px; }
.gate-msg:empty { display: none; }
.gate-msg.bad { color: var(--danger); }
.gate-msg.ok { color: var(--ok); }
.gate-row { display: flex; justify-content: space-between; align-items: center; margin-top: -4px; }
.gate-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.wide { width: 100%; min-height: 46px; justify-content: center; }
.linkish { border: 0; background: none; padding: 4px 0; color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 64px; }
.pw-show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--brand); font-weight: 600; cursor: pointer; padding: 6px; }
.pin-in { letter-spacing: 6px; font-size: 20px; text-align: center; }
.demo-tag { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 3px 9px; border-radius: 99px; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11.5px; line-height: 18px; text-align: center; margin-left: 2px; }
.badge[hidden] { display: none; }
.count { font-size: 13px; background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 8px; vertical-align: middle; }
.person { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.person:first-of-type { border-top: 0; }
.person label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.person select, .person input { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); padding: 4px 8px; }
.acct { display: flex; gap: 12px; align-items: center; }
.acct-av { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: var(--surface); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 20px; flex: none; }
.fold { border-top: 1px solid var(--line); padding-top: 8px; }
.fold summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.fold > *:not(summary) { margin-top: 8px; }
.fold select { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); padding: 4px 8px; }
.acts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.pill.wait { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink); }
.cloud-ok { margin-left: 6px; font-size: 12px; color: var(--ok); }
@media (max-width: 520px) { .tab { padding: 8px 9px; font-size: 14px; } }

/* ---------- v2.1: stock ---------- */
body.sheet-open { overflow: hidden; }
.modal.sheet { width: min(560px, calc(100% - 20px)); max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.modal.sheet.wide { width: min(680px, calc(100% - 20px)); }
.modal.sheet h3 { margin: 6px 0 0; font-family: var(--font-display); font-size: 15px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: sticky; top: -1px; background: var(--surface); padding-bottom: 6px; z-index: 1; }
.sheet-head h2 { margin: 0; font-family: var(--font-display); font-size: 18px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.sheet-actions .btn { flex: 1 1 200px; }
.stock-top { gap: 10px; }
.seg { display: flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 2px; overflow-x: auto; }
.seg button { flex: 1 0 auto; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button span { font-weight: 400; opacity: .8; }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; min-height: 36px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.stk-list { display: flex; flex-direction: column; gap: 8px; }
.stk { display: flex; justify-content: space-between; gap: 10px; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 12px; cursor: pointer; color: var(--ink); }
.stk:hover { border-color: var(--brand); }
.stk-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stk-main b { font-size: 15.5px; }
.stk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; white-space: nowrap; }
.hint.ok { color: var(--ok); } .hint.bad, .bad { color: var(--danger); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; vertical-align: 1px; white-space: nowrap; }
.t-g { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.t-p { background: var(--soft); color: var(--brand); }
.t-o { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink); }
.t-r { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.t-s { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.notice.warn { border-color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14.5px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.checks { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 14.5px; }
.checks .check-row:first-child { border-top: 0; }
.check-row.must { border: 1.5px solid var(--accent); border-radius: 10px; }
.pi { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex: none; }
.pi button { border: 0; background: var(--surface); padding: 7px 12px; font-weight: 600; cursor: pointer; color: var(--muted); min-height: 36px; }
.pi button.on.ok { background: var(--ok); color: #fff; } .pi button.on.bad { background: var(--danger); color: #fff; }
.total-line { margin: 0; font-weight: 700; color: var(--brand); }
figure.ph { margin: 0; display: inline-flex; flex-direction: column; gap: 4px; }
figure.ph img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
#dt-photos, #ar-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.item-head .row { gap: 6px; }
.modal.sheet { max-width: none; }
.modal.sheet > * { flex-shrink: 0; }
.stk-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.ph-missing { width: 110px; height: 110px; display: flex; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--line); border-radius: 10px; padding: 6px; }
@media (max-width: 520px) { .seg button { padding: 8px 7px; font-size: 13.5px; } }
.perm-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.perm-table th { text-align: center; font-family: var(--font-display); font-size: 13px; color: var(--muted); padding: 6px; }
.perm-table td { border-top: 1px solid var(--line); padding: 9px 6px; vertical-align: middle; }
.perm-table td:not(:first-child) { text-align: center; width: 76px; }
.switch { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font-size: 12px; color: var(--muted); }
.switch input { width: 22px; height: 22px; accent-color: var(--brand); }
.undo-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 300; background: #241B2E; color: #fff; border-radius: 12px; padding: 10px 10px 10px 16px; display: flex; gap: 14px; align-items: center; box-shadow: 0 8px 28px rgba(0,0,0,.3); width: max-content; max-width: calc(100% - 24px); font-size: 14.5px; }
.undo-bar[hidden] { display: none; }
.undo-bar .btn { background: #FF6600; border-color: #FF6600; color: #fff; min-height: 36px; }

/* ---------- v2.2 ---------- */
.ok { color: var(--ok); }
.confirm-list { background: var(--soft); border-radius: 10px; padding: 12px 14px; }
.confirm-list dd { font-weight: 600; overflow-wrap: anywhere; }
.trash-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.stk-list.selecting .stk { position: relative; padding-left: 44px; }
.stk-list.selecting .stk::before { content: ""; position: absolute; left: 13px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border: 2px solid var(--line); border-radius: 6px; background: var(--field); }
.stk-list.selecting .stk.sel { border-color: var(--brand); background: var(--soft); }
.stk-list.selecting .stk.sel::before { content: "✓"; background: var(--btn, var(--brand)); border-color: var(--btn, var(--brand)); color: #FFFFFF; font-size: 14px; font-weight: 700; line-height: 16px; text-align: center; }
.sheet-actions.sticky { position: sticky; bottom: -16px; background: var(--surface); padding-bottom: 8px; }
.pperms { width: 100%; border-top: 1px dashed var(--line); padding-top: 8px; }
.pperms summary { cursor: pointer; font-weight: 600; color: var(--brand); font-size: 14px; padding: 4px 0; }
.pperms .pill { border-color: var(--accent); color: var(--accent-ink, var(--accent)); }
.pp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.pp-row select { max-width: 60%; }
.sale-costs { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; }
.sale-costs summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 4px 0; }
.sale-costs[open] { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.cu-list { display: flex; flex-direction: column; gap: 8px; }
.card.cu { padding: 0; gap: 0; }
.cu-head { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; cursor: pointer; color: var(--ink); }
.cu-head > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cu-side { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.cu-body { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; text-decoration: underline; }
.w-res { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.pf-card h3 { margin: 0; }
.pf-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.pf-table th, .pf-table td { text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.pf-table th:first-child, .pf-table td:first-child { text-align: left; }
.exp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.idrow input[type="search"] { flex: 1 1 auto; min-width: 0; }

/* ---------- v2.2.1 ---------- */
.rc-void.long { font-size: 74px; letter-spacing: 8px; }
.home-hello { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 2px 4px; }
.home-hello h2 { font-size: 20px; }
.h-row { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpi { display: flex; flex-direction: column; gap: 2px; background: var(--soft); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.kpi-l { font-size: 12.5px; color: var(--muted); }
.kpi-v { font-family: var(--font-display); font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-v.ok { color: var(--ok); } .kpi-v.bad { color: var(--danger); } .kpi-v.warn { color: var(--accent-ink, var(--accent)); }
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.alerts li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--soft); font-size: 14.5px; }
.alerts li > span:nth-child(2) { flex: 1; min-width: 0; }
.al-dot { flex: 0 0 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #FFFFFF; background: var(--muted); }
.al-bad .al-dot { background: var(--danger); } .al-warn .al-dot { background: var(--accent); }
.tbl-wrap { overflow-x: auto; }
.pf-table.wide { min-width: 520px; }
.cu-exp { min-height: 42px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chart { display: flex; flex-direction: column; gap: 8px; }
.ch-legend { display: flex; gap: 16px; font-size: 13.5px; color: var(--muted); }
.ch-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.ch-s1, .ch-s1 { fill: var(--viz-1); background: var(--viz-1); }
.sw.ch-s2, .ch-s2 { fill: var(--viz-2); background: var(--viz-2); }
.ch-box { position: relative; }
.ch-box svg { width: 100%; height: auto; display: block; }
.ch-grid { stroke: var(--line); stroke-width: 1; } .ch-grid.zero { stroke: var(--muted); }
.ch-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ch-hit { fill: transparent; cursor: pointer; } .ch-hit.on { fill: var(--ink); fill-opacity: 0.06; }
.ch-tip { position: absolute; top: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.12); pointer-events: none; white-space: nowrap; }
.rt-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.rt-item input { margin-top: 4px; width: 18px; height: 18px; }

/* ---------- v2.2.2 ---------- */
.gk { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.gk-key textarea { width: 100%; font-family: ui-monospace, monospace; font-size: 13px; padding: 8px; border: 1px solid var(--accent); border-radius: 8px; background: var(--field); word-break: break-all; }
.gk-key { display: flex; flex-direction: column; gap: 6px; }

/* ---------- v2.2.5 (notifications) ---------- */
.nt-state { align-items: center; gap: 10px; }
.nt-kinds { display: flex; flex-direction: column; gap: 6px; }
.nt-k { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.nt-k input { width: 20px; height: 20px; flex: 0 0 20px; }
.nt-steps { margin: 6px 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.nt-steps code { background: var(--soft); padding: 1px 6px; border-radius: 4px; }

/* ---------- v2.2.4 (lay-by) ---------- */
.lb-terms { white-space: pre-line; font-size: 13.5px; line-height: 1.5; background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.lb-pad { height: 130px; }
.lb-sigimg { max-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.lb-progress { display: block; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.lb-progress > span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
button.lb-row { text-align: left; cursor: pointer; color: var(--ink); gap: 6px; padding: 12px 14px; }
.lb-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.lb-slip { position: fixed; left: -2000px; top: 0; width: 420px; background: #fff; color: #111; padding: 22px 22px 16px; font: 14px/1.45 Arial, sans-serif; }
.lbs-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #47195F; padding-bottom: 8px; margin-bottom: 10px; }
.lbs-head b { font-size: 20px; color: #47195F; letter-spacing: 1px; } .lbs-head span { color: #555; font-size: 12.5px; }
.lbs-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; } .lbs-row span { color: #555; } .lbs-row.big { font-size: 16px; }
.lbs-pay { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; } .lbs-pay th, .lbs-pay td { border-bottom: 1px solid #ddd; padding: 4px 2px; text-align: left; } .lbs-pay td:last-child, .lbs-pay th:last-child { text-align: right; }
.lbs-terms { white-space: pre-line; font-size: 11.5px; color: #333; background: #f5f2f8; border-radius: 6px; padding: 8px 10px; margin-top: 10px; }
.lbs-sig { display: flex; flex-direction: column; align-items: flex-start; margin-top: 8px; font-size: 11px; color: #555; } .lbs-sig img { max-width: 200px; max-height: 70px; }
.lbs-foot { margin-top: 10px; font-size: 11px; color: #777; text-align: center; }

/* ---------- v2.2.3 ---------- */
.home-search { gap: 8px; padding: 10px 12px; }
.hs-row input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); font-size: 16px; }
.hs-res { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.hs-gt { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin: 2px 2px 4px; }
.hs-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; background: var(--soft); border: 0; border-radius: 10px; padding: 8px 12px; margin-bottom: 4px; cursor: pointer; color: var(--ink); }
.hs-item:hover { outline: 1px solid var(--brand); }
.home-body { display: flex; flex-direction: column; gap: 12px; }
details.hsec { padding: 0; gap: 0; }
.hsec > summary, .hsub > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 14px 16px; }
.hsub > summary { padding: 10px 0; border-top: 1px solid var(--line); }
.hsec > summary::-webkit-details-marker, .hsub > summary::-webkit-details-marker { display: none; }
.hsec > summary::before, .hsub > summary::before { content: "▸"; color: var(--brand); font-size: 13px; width: 12px; transition: transform .15s; }
.hsec[open] > summary::before, .hsub[open] > summary::before { transform: rotate(90deg); }
.hsec-t { font-weight: 700; color: var(--brand); font-family: var(--font-display); font-size: 15px; }
.hsec-s { flex: 1 1 180px; }
.hsec > .hsec-b { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.hsub > .hsec-b { padding-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
table.clip tr.more, ul.clip li.more { display: none; }
.al-sub { display: block; }
.alerts li.al-many { align-items: flex-start; }
.alerts details { flex: 1; min-width: 0; }
.alerts details > summary { cursor: pointer; }
.al-items { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.al-items li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border-radius: 8px; padding: 6px 8px; font-size: 14px; }
.flash { animation: tt-flash 2.6s ease-out; border-radius: 10px; }
@keyframes tt-flash { 0%, 40% { background: color-mix(in srgb, var(--accent) 28%, transparent); } 100% { background: transparent; } }
.switch.nt-k { flex-direction: row; justify-content: flex-start; align-items: center; font-size: 14.5px; color: var(--ink); gap: 10px; }

/* ---------- v2.3 (loans) ---------- */
.ln-calc .confirm-list { margin: 0; }
.lbs-sigs { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; }
.lbs-sigs .lbs-sig { flex: 1; }
.lbs-line { display: block; height: 50px; border-bottom: 1px solid #999; width: 100%; }

/* v2.4 — online loan applications */
.ln-newapps { margin: 10px 0; }
.ap-sig { display: block; max-width: 260px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.ln-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: #fff; color: #111; padding: 22px 18px; border-radius: 12px; border: 1px solid var(--line); max-width: 360px; margin: 0 auto 12px; }
.ln-qr b { font: 800 22px/1.2 "Poppins", Arial, sans-serif; color: #47195F; letter-spacing: .5px; }
.ln-qr span { font-weight: 600; color: #47195F; }
.ln-qr img { width: 240px; height: 240px; image-rendering: pixelated; }
.ln-qr small { color: #555; word-break: break-all; }
.lb-slip .ln-qr { border: 0; margin: 0 auto; }
/* v2.4.1 */
.claim { border: 1px solid var(--accent); background: var(--soft); margin: 10px 0; }
.claim .facts { margin: 8px 0; }
.acc-row { margin: 10px 0; padding: 12px; }
.items li { padding: 8px 0; }
.lbs-lead { margin: 6px 0 12px; font-size: 15px; }
.seg2 { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.sigimg { display: block; max-width: 300px; width: 100%; margin: 8px 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
/* v2.4.3 */
.rp-list li { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; }
.rp-err { white-space: pre-wrap; font-size: 12px; background: var(--soft); padding: 8px; border-radius: 8px; overflow-x: auto; }
.cu-sec { border-top: 1px solid var(--line); padding: 8px 0; }
.cu-list2 { list-style: none; margin: 6px 0; padding: 0; max-height: 50vh; overflow: auto; }
.cu-list2 .check { margin: 6px 0; }

/* ---------- v2.5 navigation ---------- */
.appbar-in { flex-wrap: nowrap; gap: 10px; }
.brand { flex: none; }
.status { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; }
.status span:last-child { overflow: hidden; text-overflow: ellipsis; }
.top-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 21px; border: 0; background: var(--soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn .badge, .me-btn .badge { position: absolute; top: -3px; right: -4px; margin: 0; }
.me-btn { position: relative; width: 42px; height: 42px; border-radius: 21px; border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--brand); background: var(--accent); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.me-dot { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; background: var(--muted); border: 2px solid var(--surface); }
.me-dot.ok { background: var(--ok); } .me-dot.warn { background: var(--accent); }
.tabs { margin-left: 0; flex-wrap: nowrap; gap: 2px; }
.tab { display: inline-flex; align-items: center; gap: 6px; }
.tab svg { width: 18px; height: 18px; flex: none; }
.tab-sell { background: var(--accent) !important; color: #fff !important; padding-inline: 14px; }
.tab-sell .sell-dot { display: inline-flex; }
.tab-sell[aria-selected="true"] { box-shadow: 0 0 0 3px var(--soft); }
#tab-more { display: none; }
@media (min-width: 761px) {
  .appbar-in { flex-wrap: wrap; }
  .tabs { order: 5; margin-left: auto; }
}
@media (max-width: 760px) {
  .brand span { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line);
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 0;
    padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 6px); box-shadow: 0 -4px 16px rgba(20, 10, 30, 0.06); }
  .tab { flex-direction: column; gap: 2px; padding: 4px 2px; min-height: 52px; justify-content: flex-end; font-size: 12px; border-radius: 10px; background: transparent !important; }
  .tab svg { width: 24px; height: 24px; }
  .tab[aria-selected="true"] { color: var(--brand); }
  #tab-more:not([hidden]) { display: inline-flex; }
  .tab-sell { background: transparent !important; color: var(--accent-ink) !important; padding-inline: 2px; }
  .tab-sell .sell-dot { width: 56px; height: 56px; border-radius: 28px; background: var(--accent); color: #fff; align-items: center; justify-content: center; margin-top: -26px; border: 4px solid var(--bg); box-shadow: 0 4px 12px rgba(255, 102, 0, 0.35); }
  .tab-sell .sell-dot svg { width: 28px; height: 28px; stroke-width: 2.5; }
  .tab-sell[aria-selected="true"] { box-shadow: none; }
  main { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 110px); }
  .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); }
  .status { font-size: 12px; }
}
@media (max-width: 380px) { .icon-btn, .me-btn { width: 38px; height: 38px; } .status span:last-child { display: none; } }

/* menu */
.menu-back { align-items: flex-start; justify-content: flex-end; padding: 10px; }
.modal.menu { max-width: 400px; max-height: calc(100vh - 20px); overflow-y: auto; gap: 12px; padding: 16px; }
.menu-head { display: flex; align-items: center; gap: 12px; }
.me-big { width: 48px; height: 48px; border-radius: 24px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 19px; flex: none; }
.menu-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.menu-who b { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.menu-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 4px 6px; }
.menu-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border: 0; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font-size: 15px; width: 100%; }
.menu-list > .menu-item ~ .menu-item { border-top: 1px solid var(--line); }
.menu-item:hover { background: var(--soft); }
.menu-item svg { width: 20px; height: 20px; color: var(--brand); flex: none; }
.menu-item span:not(.badge) { flex: 1; }
.menu-item.danger, .menu-item.danger svg { color: var(--danger); }
.menu .app-foot { padding: 6px 0 0; font-size: 12px; }
@media (max-width: 760px) { .menu-back { align-items: flex-end; justify-content: center; padding: 0; } .modal.menu { max-width: none; border-radius: 18px 18px 0 0; max-height: 88vh; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); } }

/* ---------- v2.5 sell ---------- */
.scan-big { display: flex; align-items: center; gap: 14px; justify-content: flex-start; text-align: left; min-height: 64px; padding: 12px 16px; border-radius: 14px; background: #C24E00; border-color: #C24E00; color: #fff; width: 100%; }
.scan-big span { display: flex; flex-direction: column; }
.scan-big b { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.scan-big small { font-size: 13px; opacity: 0.95; font-weight: 400; }
.scan-big svg { flex: none; }
.sell-start { gap: 10px; }
.model-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.model-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 14px; border: 0; background: var(--surface); color: var(--ink); text-align: left; font-weight: 600; cursor: pointer; }
.model-row + .model-row { border-top: 1px solid var(--line); }
.model-row:hover { background: var(--soft); }
.pay-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-chips .chip { min-height: 42px; padding-inline: 14px; }
.cust-hint { font-size: 13.5px; color: var(--ok); font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- v2.6 money ---------- */
.money { display: flex; flex-direction: column; gap: 12px; }
.money-big { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--soft); }
.money-big b { font-family: var(--font-display); font-size: 28px; color: var(--brand); }
.money-item { gap: 6px; }
.money .kpi-v.ok { color: var(--ok); } .money .kpi-v.bad, .hint.bad { color: var(--danger); }
.money-set summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.acc-row { flex-wrap: nowrap; }
.acc-row select { flex: 0 0 auto; max-width: 140px; }
.acc-row .acc-label { flex: 1; min-width: 0; }
.split-box { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.kpi-go { border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.kpi-go:hover { box-shadow: inset 0 0 0 2px var(--brand); }
.kpi-more { font-size: 12px; color: var(--accent-ink); font-weight: 600; margin-top: 2px; }

/* ---------- v2.6.2 opening screen (no flash of the receipt form on refresh) ---------- */
.splash { display: none; }
body.booting .splash { display: flex; position: fixed; inset: 0; z-index: 90; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); color: var(--muted); font-size: 14px; }
body.booting .splash img { border-radius: 18px; animation: tt-pulse 1.2s ease-in-out infinite; }
body.booting main, body.booting .tabs, body.booting .top-acts { visibility: hidden; }
@keyframes tt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
/* ---------- v2.6.2 graphs ---------- */
.pf-charts { gap: 6px; }
.pf-sec { border-top: 1px solid var(--line); padding: 8px 0; }
.pf-sec > summary { cursor: pointer; padding: 6px 0; list-style-position: outside; }
.pf-sec[open] > summary { margin-bottom: 8px; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.hb-l { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-v { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hb-track { height: 10px; border-radius: 5px; background: var(--soft); margin-top: 4px; overflow: hidden; }
.hb-bar { height: 10px; border-radius: 0 5px 5px 0; }

.rc-remote { font-size: 0.85em; color: #555; font-style: italic; }
.review-btn { border-color: #e0a100; }
/* v2.6.4 pay: deductions, settings, staff agreement */
.ded-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; }
.ded-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line, #e3dfe8); border-radius: 10px; background: var(--bg, transparent); }
.ded-l { flex: 1 1 120px; font-size: 14px; font-weight: 600; }
.ded-row input { min-height: 40px; }
.ded-amt { width: 120px; flex: 0 0 120px; }
.ded-days { width: 72px; flex: 0 0 72px; }
.ded-note { flex: 1 1 160px; min-width: 0; }
.ded-add { max-width: 260px; min-height: 40px; }
[data-net].bad { color: var(--bad, #b3261e); font-weight: 600; }
.pay-set { margin-top: 18px; border-top: 1px solid var(--line, #e3dfe8); padding-top: 10px; }
.pay-set summary { cursor: pointer; padding: 6px 0; }
.pay-set h4 { margin: 14px 0 4px; }
.agree-text { white-space: normal; line-height: 1.5; padding: 12px; border: 1px solid var(--line, #e3dfe8); border-radius: 12px; max-height: 46vh; overflow: auto; margin-bottom: 10px; font-size: 14px; }
.agree-sig img { max-width: 260px; width: 100%; background: #fff; border-radius: 8px; border: 1px solid var(--line, #e3dfe8); }
@media (max-width: 420px) { .ded-amt { flex: 1 1 100px; width: auto; } }
/* v2.6.5 receipts list: month titles, show more, filters */
.rec-filters { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; }
.rf-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rf-row select { flex: 1 1 130px; min-height: 40px; }
details.rec-month { border: 1px solid var(--line, #e3dfe8); border-radius: 14px; margin-bottom: 10px; background: var(--card, #fff); overflow: hidden; }
details.rec-month > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 700; }
details.rec-month > summary::-webkit-details-marker { display: none; }
details.rec-month > summary::after { content: "▾"; transition: transform .2s; color: var(--muted, #6b6475); }
details.rec-month[open] > summary::after { transform: rotate(180deg); }
.rm-t { font-size: 17px; color: var(--brand, #47195F); }
.rm-s { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--muted, #6b6475); text-align: right; }
.rm-list { display: flex; flex-direction: column; gap: 8px; padding: 0 10px 12px; }
.show-more { align-self: center; margin: 6px auto 2px; display: block; }
.rec-count { margin: 0 0 6px; }
.to-top { position: fixed; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 30; border-radius: 999px; padding: 10px 14px; border: 1px solid var(--line, #e3dfe8); background: var(--card, #fff); color: var(--brand, #47195F); font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
/* v2.6.5 quotations, storage */
.q-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.q-item { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.q-table td:nth-child(2), .q-table td:nth-child(3), .q-table th:nth-child(2), .q-table th:nth-child(3) { text-align: right; white-space: nowrap; }
.q-acts { flex-wrap: wrap; }
.hb-bar.st-warn { background: var(--bad, #b3261e); }
#storage-card .hb-track { margin: -4px 0 12px; }
.q-h { margin: 12px 0 2px; }
.q-terms { white-space: pre-line; margin-top: 0; }
.ss-quote { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.q-small { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line, #e3dfe8); }
.q-small .btn { flex: 0 1 auto; }
.modal.sheet > .sheet-head { top: -20px; margin-top: -20px; padding-top: 20px; }
/* v2.6.6 menu: clear Menu button, search, quick actions; search everything */
#tab-loans { display: none !important; }
#tab-more { position: relative; }
#tab-more .tab-badge { position: absolute; top: 2px; right: calc(50% - 22px); }
.menu-search { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; border: 1.5px solid var(--brand); border-radius: 12px; padding: 10px 12px; background: var(--field); color: var(--muted); font-size: 15px; text-align: left; cursor: pointer; }
.menu-search svg { flex: 0 0 22px; color: var(--brand); }
.qa-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.qa-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); color: var(--brand); font-size: 13px; font-weight: 600; text-align: center; padding: 8px 6px; cursor: pointer; }
.qa-tile svg { flex: 0 0 26px; }
.gs-box { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--brand); border-radius: 12px; padding: 4px 12px; background: var(--field); }
.gs-box svg { flex: 0 0 22px; color: var(--brand); }
.gs-box input { flex: 1; border: 0; outline: 0; background: transparent; min-height: 44px; font-size: 16px; }
.gs-res { display: flex; flex-direction: column; }
.sr-g { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 12px 4px 6px; }
.sr { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; background: var(--surface); text-align: left; cursor: pointer; color: var(--ink); }
.sr-t { display: flex; flex-direction: column; min-width: 0; }
.sr-t small { color: var(--muted); font-size: 13px; }
.sr .go { margin-left: auto; color: var(--accent); font-weight: 700; font-size: 20px; }
.sr-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; color: var(--brand); flex: 0 0 36px; }
.bz-bank { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }

/* v2.7.1–2.7.2: counted accessories, restock advisor */
.cnt-batches { gap: 10px; }
.cnt-batch { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.adv-list { display: flex; flex-direction: column; gap: 8px; }
.adv-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.adv-row.late { border-color: var(--bad, #C62828); }
.adv-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.adv-budget { margin: 12px 0; }

/* v2.7.3: bottom button, forward pill, price suggestions, send with, loan clients */
.to-bottom { position: fixed; right: 16px; bottom: calc(140px + env(safe-area-inset-bottom, 0px)); z-index: 30; border-radius: 999px; padding: 10px 14px; border: 1px solid var(--line, #e3dfe8); background: var(--card, #fff); color: var(--brand, #47195F); font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.to-top:not([hidden]) ~ .to-bottom { bottom: calc(140px + env(safe-area-inset-bottom, 0px)); }
.fwd-pill { position: fixed; left: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 31; border: 0; border-radius: 999px; padding: 10px 16px; background: var(--brand, #47195F); color: #FFFFFF; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.22); display: flex; gap: 6px; align-items: baseline; max-width: calc(100vw - 140px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fwd-pill small { font-weight: 400; opacity: .85; overflow: hidden; text-overflow: ellipsis; }
.menu-fwd { margin: 0 0 8px; }
.px-box { margin: 6px 0 10px; }
.px-sugg { border: 1.5px solid var(--brand, #47195F); border-radius: 14px; padding: 12px; background: var(--soft, #F3ECF7); display: flex; flex-direction: column; gap: 8px; }
.px-sugg.px-none { border-style: dashed; background: transparent; }
.px-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.px-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.px-big { font-size: 19px; font-variant-numeric: tabular-nums; }
.px-lines { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; font-size: 13.5px; }
.px-lines dt { color: var(--muted, #6E6177); } .px-lines dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.share-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.share-app { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line, #e3dfe8); border-radius: 12px; padding: 10px 12px; background: var(--card, #fff); color: inherit; cursor: pointer; }
.share-app.on { border-color: var(--brand, #47195F); }
.share-app i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 12px; color: #FFFFFF; flex: none; }
.share-app small { display: block; color: var(--muted, #6E6177); }
#share-sheet { z-index: 90; }
.dup-card { border: 1px dashed var(--accent, #F26B1D); }

/* v2.7.4: scanner on top of everything, several codes at once, read text */
.scan-title { color: #FFFFFF; font-size: 18px; margin: 0; }
.scan-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.scanner .btn.primary { background: #F26B1D; border-color: #F26B1D; color: #FFFFFF; }
.scan-got { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.scan-got span { border: 1px solid rgba(255,255,255,.35); border-radius: 99px; padding: 5px 12px; font-size: 14px; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; }
.scan-got span.ok { border-color: #6FD39B; color: #FFFFFF; background: rgba(111, 211, 155, .18); }
.id-scan { width: 100%; }
.md-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.md-row .grid2 { gap: 8px; }
.md-was { text-decoration: line-through; color: var(--muted); }
