/* AHS Show: light, Apple style, ruby accent from the AHS logo */
:root {
  --ruby: #B40000;
  --ruby-dark: #8E0000;
  --ruby-soft: #FBEAEA;
  --ink: #1D1D1F;
  --ink-2: #535353;
  --ink-3: #86868B;
  --line: #E5E5EA;
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --green: #1E8E3E;
  --green-soft: #E7F5EC;
  --amber: #B25E00;
  --amber-soft: #FFF4E5;
  --blue: #0A66D8;
  --radius: 16px;
  --radius-s: 11px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; -webkit-font-smoothing: antialiased; }
body { overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
input, select, textarea { -webkit-appearance: none; appearance: none; }
img { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
#app { min-height: 100%; }
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.side { width: 270px; flex: 0 0 270px; background: rgba(250,250,252,.9); border-right: 1px solid var(--line); padding: calc(18px + var(--safe-t)) 14px 18px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.side .brand img { height: 46px; }
.side .nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: var(--ink); font-weight: 500; font-size: 16px; text-align: left; width: 100%; }
.side .nav svg { width: 22px; height: 22px; color: var(--ink-2); flex: 0 0 22px; }
.side .nav.on { background: var(--ruby); color: #fff; }
.side .nav.on svg { color: #fff; }
.side .nav .badge { margin-left: auto; }
.side .grow { flex: 1; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 22px 10px; background: rgba(245,245,247,.82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(0,0,0,.06); min-height: 58px; }
.topbar h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { color: var(--ruby); font-size: 17px; display: flex; align-items: center; gap: 2px; font-weight: 500; }
.topbar .back svg { width: 22px; height: 22px; }
.content { padding: 22px; padding-bottom: calc(110px + var(--safe-b)); max-width: 1100px; width: 100%; margin: 0 auto; }
.tabbar { display: none; }

@media (max-width: 820px) {
  .side { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(250,250,252,.9); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid rgba(0,0,0,.08); padding: 6px 4px calc(6px + var(--safe-b)); }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--ink-3); position: relative; padding: 3px 0; }
  .tabbar button svg { width: 25px; height: 25px; }
  .tabbar button.on { color: var(--ruby); }
  .tabbar .badge { position: absolute; top: -2px; left: calc(50% + 6px); }
  .topbar { padding: calc(8px + var(--safe-t)) 16px 8px; }
  .topbar h1 { font-size: 20px; }
  .content { padding: 16px; padding-bottom: calc(100px + var(--safe-b)); }
}

/* ---------- status pills in top bar ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.pill.pending .dot { background: #F5A623; }
.pill.offline .dot { background: var(--ink-3); }
.pill.user { color: var(--ink); }
.pill.user .av { width: 22px; height: 22px; border-radius: 50%; background: var(--ruby); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-left: -6px; }
.cm-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.switch { width: 51px; height: 31px; border-radius: 99px; background: #E9E9EB; position: relative; transition: background .2s; flex: 0 0 51px; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .22s cubic-bezier(.3,.7,.4,1); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(20px); }
@media (max-width: 820px) { .topbar .pill.user .nm, .cm-toggle .lbl { display: none; } }

/* ---------- home ---------- */
.hello { margin: 4px 2px 18px; }
.hello .k { font-size: 15px; color: var(--ink-3); font-weight: 500; }
.hello .t { font-size: 30px; font-weight: 700; letter-spacing: -.025em; margin-top: 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { background: var(--card); border-radius: 20px; padding: 18px; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; box-shadow: var(--shadow); position: relative; transition: transform .12s ease, box-shadow .12s ease; }
.tile:active { transform: scale(.975); }
.tile .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--ruby-soft); color: var(--ruby); }
.tile .ic svg { width: 26px; height: 26px; }
.tile.primary { background: linear-gradient(160deg, #C40C0C 0%, #9A0000 100%); color: #fff; }
.tile.primary .ic { background: rgba(255,255,255,.18); color: #fff; }
.tile.primary .sub { color: rgba(255,255,255,.8); }
.tile .nm { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin-top: 14px; }
.tile .sub { font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.tile .badge { position: absolute; top: 16px; right: 16px; }
@media (max-width: 820px) { .tiles { grid-template-columns: 1fr 1fr; gap: 12px; } .tile { min-height: 118px; padding: 15px; } .tile .nm { font-size: 16.5px; } }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--ruby); color: #fff; font-size: 13px; font-weight: 700; display: inline-grid; place-items: center; }
.tile.primary .badge { background: #fff; color: var(--ruby); }

/* ---------- cards, lists ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, .card + .sec, .sec + .card { margin-top: 18px; }
.sec { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: 26px 6px 8px; display: flex; align-items: center; gap: 8px; }
.sec .r { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; min-height: 56px; position: relative; width: 100%; text-align: left; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line); }
.row.with-thumb + .row.with-thumb::before { left: 86px; }
button.row:active, a.row:active { background: #F2F2F4; }
.row .m { flex: 1; min-width: 0; }
.row .t { font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 14.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .v { font-size: 16px; font-weight: 600; text-align: right; white-space: nowrap; }
.row .v small { display: block; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.row .chev { color: #C7C7CC; width: 14px; flex: 0 0 14px; }
.thumb { width: 56px; height: 56px; border-radius: 12px; background: #F2F2F4 center/cover no-repeat; flex: 0 0 56px; display: grid; place-items: center; color: #C7C7CC; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 26px; height: 26px; }
.empty { text-align: center; color: var(--ink-3); padding: 36px 20px; font-size: 16px; }
.empty b { display: block; color: var(--ink); font-size: 19px; margin-bottom: 4px; font-weight: 600; }

.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 13px; font-weight: 600; background: #F2F2F4; color: var(--ink-2); white-space: nowrap; }
.tag.red { background: var(--ruby-soft); color: var(--ruby); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.blue { background: #E8F1FD; color: var(--blue); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: 14px; background: var(--ruby); color: #fff; font-size: 17px; font-weight: 600; transition: transform .1s, opacity .1s; white-space: nowrap; }
.btn:active { transform: scale(.97); opacity: .9; }
.btn.block { display: flex; width: 100%; }
.btn.grey { background: #E9E9EB; color: var(--ink); }
.btn.ghost { background: var(--ruby-soft); color: var(--ruby); }
.btn.green { background: #25D366; color: #fff; }
.btn.blue { background: #0A64D2; color: #fff; }
.btn.small { height: 38px; padding: 0 14px; font-size: 15px; border-radius: 11px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn svg { width: 21px; height: 21px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btns > .btn { flex: 1; }
.link-btn { color: var(--ruby); font-weight: 600; font-size: 16px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); flex: 0 0 40px; }
.icon-btn svg { width: 22px; height: 22px; }
.heart { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #C7C7CC; flex: 0 0 46px; transition: transform .15s; }
.heart svg { width: 27px; height: 27px; }
.heart.on { color: var(--ruby); }
.heart:active { transform: scale(.85); }

/* ---------- forms ---------- */
.form { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.field { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 54px; position: relative; }
.field + .field::before, .field + .fieldcol::before, .fieldcol + .field::before, .fieldcol + .fieldcol::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line); }
.field label, .fieldcol label { width: 135px; flex: 0 0 135px; font-size: 16px; color: var(--ink-2); }
.field input, .field select, .field textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 15px 0; text-align: right; }
.field input::placeholder { color: #C7C7CC; }
.field select { text-align-last: right; color: var(--ink); }
.fieldcol { padding: 12px 16px; position: relative; }
.fieldcol label { display: block; width: auto; margin-bottom: 6px; font-size: 14px; color: var(--ink-3); }
.fieldcol textarea { width: 100%; border: 0; outline: 0; font-size: 17px; resize: vertical; min-height: 64px; background: transparent; }
.seg { display: inline-flex; background: #EEEEF0; border-radius: 10px; padding: 2px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 8px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.search { display: flex; align-items: center; gap: 8px; background: #E9E9EB; border-radius: 12px; padding: 0 12px; height: 42px; }
.search svg { width: 18px; height: 18px; color: var(--ink-3); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 17px; }
.note { font-size: 14px; color: var(--ink-3); margin: 8px 6px 0; line-height: 1.4; }

/* ---------- lookup keypad ---------- */
.lookup { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 22px; align-items: start; }
.lookup .pad-wrap { position: sticky; top: 80px; }
.display { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); height: 86px; display: flex; align-items: center; justify-content: center; font-size: 46px; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--ink); }
.display.empty-d { color: #C7C7CC; font-size: 22px; font-weight: 500; letter-spacing: 0; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pad button { height: 70px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); font-size: 30px; font-weight: 500; display: grid; place-items: center; transition: background .08s; }
.pad button:active { background: #E5E5EA; }
.pad button.fn { font-size: 17px; font-weight: 600; color: var(--ink-2); background: #EBEBEE; box-shadow: none; }
.pad button svg { width: 28px; height: 28px; }
@media (max-width: 820px) {
  .lookup { grid-template-columns: 1fr; gap: 14px; }
  .lookup .pad-wrap { position: static; }
  .display { height: 70px; font-size: 38px; }
  .pad { gap: 8px; margin-top: 10px; }
  .pad button { height: 58px; font-size: 26px; border-radius: 15px; }
}

/* ---------- stone page ---------- */
.stone { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .stone { grid-template-columns: 1fr; } }
.gallery { background: #fff; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.gallery .stage { aspect-ratio: 1 / 1; background: #F7F7F8; position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery .stage::-webkit-scrollbar { display: none; }
.gallery .slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: grid; place-items: center; position: relative; }
.gallery .slide img, .gallery .slide video { width: 100%; height: 100%; object-fit: contain; }
.gallery .slide .doc { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--ink-2); text-align: center; padding: 20px; }
.gallery .slide .doc svg { width: 64px; height: 64px; color: var(--ruby); }
.gallery .slide .doc b { font-size: 18px; color: var(--ink); }
.gallery .noimg { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-3); font-size: 15px; text-align: center; padding: 20px; }
.gallery .noimg svg { width: 56px; height: 56px; color: #D1D1D6; }
.gallery .strip { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.gallery .strip button { width: 62px; height: 62px; border-radius: 10px; flex: 0 0 62px; background: #F2F2F4 center/cover; display: grid; place-items: center; color: var(--ink-2); box-shadow: inset 0 0 0 2px transparent; }
.gallery .strip button.on { box-shadow: inset 0 0 0 2.5px var(--ruby); }
.gallery .strip button svg { width: 26px; height: 26px; }
.gallery .strip .lbl { font-size: 10.5px; font-weight: 700; }
.gallery .fs { position: absolute; right: 12px; top: 12px; z-index: 2; background: rgba(255,255,255,.9); }
.st-head { display: flex; align-items: flex-start; gap: 12px; }
.st-head .lot { font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.st-head .desc { font-size: 18px; color: var(--ink-2); margin-top: 8px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-top: 18px; }
.facts > div { background: var(--card); padding: 13px 16px; }
.facts .k { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.facts .v { font-size: 19px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.facts .wide { grid-column: span 2; }
.prices .v { color: var(--ruby-dark); }
.customer [data-price], .customer .price-only { display: none !important; }
.customer .facts > div[data-price] { display: none !important; }

/* ---------- sheets (modals) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet { background: var(--bg); width: 100%; max-width: 680px; max-height: 94vh; max-height: 94dvh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .32s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
@media (min-width: 821px) { .scrim { align-items: center; } .sheet { border-radius: 22px; max-height: 90vh; } .sheet.wide { max-width: 980px; } }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid rgba(0,0,0,.06); background: rgba(250,250,252,.95); }
.sheet-h h2 { flex: 1; text-align: center; font-size: 17px; font-weight: 600; margin: 0; }
.sheet-h .link-btn { min-width: 70px; }
.sheet-h .link-btn.r { text-align: right; }
.sheet-b { overflow-y: auto; padding: 18px; padding-bottom: calc(24px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.full { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; flex-direction: column; }
.full .fbar { display: flex; justify-content: flex-end; padding: calc(10px + var(--safe-t)) 14px 10px; }
.full .fbar button { color: #fff; font-size: 17px; font-weight: 600; }
.full .fbody { flex: 1; display: grid; place-items: center; overflow: hidden; }
.full img, .full video { max-width: 100%; max-height: 100%; object-fit: contain; }
.full iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* ---------- send / selection ---------- */
.sel-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; position: relative; }
.sel-item + .sel-item::before { content: ""; position: absolute; top: 0; left: 86px; right: 0; border-top: 1px solid var(--line); }
.sel-item .m { flex: 1; min-width: 0; }
.sel-item .t { font-size: 17px; font-weight: 600; }
.sel-item .s { font-size: 14.5px; color: var(--ink-3); margin-top: 2px; }
.ppc { display: flex; align-items: center; gap: 4px; background: #F2F2F4; border-radius: 11px; padding: 0 10px; height: 44px; }
.ppc span { color: var(--ink-3); font-size: 16px; }
.ppc input { width: 110px; border: 0; outline: 0; background: transparent; font-size: 18px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.ppc em { font-style: normal; color: var(--ink-3); font-size: 13px; }
.preview { background: #E7FFDB; border-radius: 14px; padding: 12px 14px; font-size: 15.5px; white-space: pre-wrap; line-height: 1.4; word-break: break-all; box-shadow: var(--shadow); }
.preview.mail { background: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 14px; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ruby); color: #fff; box-shadow: none; }

/* ---------- ledgers ---------- */
.lines { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.line { padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; position: relative; }
.line + .line::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line); }
.line .t { font-weight: 600; font-size: 17px; }
.line .s { color: var(--ink-3); font-size: 14.5px; }
.line .a { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.line .acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.line .inputs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.line .inputs label { font-size: 12px; color: var(--ink-3); display: flex; flex-direction: column; gap: 3px; }
.line .inputs input, .line .inputs select { height: 42px; border-radius: 10px; background: #F2F2F4; border: 0; outline: 0; padding: 0 10px; font-size: 16px; font-weight: 600; width: 100%; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .line .inputs { grid-template-columns: 1fr 1fr; } }
.total-bar { display: flex; align-items: center; justify-content: space-between; padding: 16px; font-size: 18px; font-weight: 700; }
.total-bar .big { font-size: 26px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sig { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); position: relative; }
.sig canvas { width: 100%; height: 200px; display: block; touch-action: none; border-radius: var(--radius); }
.sig .sig-line { position: absolute; left: 24px; right: 24px; bottom: 46px; border-top: 1.5px solid #D1D1D6; pointer-events: none; }
.sig .sig-lbl { position: absolute; left: 24px; bottom: 20px; font-size: 13px; color: var(--ink-3); pointer-events: none; }
.sig .clear { position: absolute; right: 12px; top: 10px; }
.legal { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; margin: 10px 6px; }
.docno { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ---------- summary ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-align: left; }
.kpi .k { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
@media (max-width: 820px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi .v { font-size: 23px; } }
.group-h { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 6px; }
.group-h b { font-size: 17px; }
.group-h span { color: var(--ink-3); font-size: 14px; }
.group-h .tot { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- calculator ---------- */
.calc { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .calc { grid-template-columns: 1fr; } }
.calc-out { background: linear-gradient(160deg, #2B2B2E, #1D1D1F); color: #fff; border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.calc-out .k { font-size: 14px; color: rgba(255,255,255,.6); }
.calc-out .v { font-size: 44px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; word-break: break-all; }
.calc-out .row2 { display: flex; gap: 22px; margin-top: 14px; flex-wrap: wrap; }
.calc-out .row2 .v { font-size: 22px; }
.tape { font-variant-numeric: tabular-nums; }

/* ---------- QR ---------- */
.qr-wrap { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; padding-bottom: 6px; scrollbar-width: none; }
.qr-wrap::-webkit-scrollbar { display: none; }
.qr-card { flex: 0 0 100%; scroll-snap-align: center; background: #fff; border-radius: 26px; box-shadow: var(--shadow); padding: 28px 22px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.qr-card .lg { height: 46px; }
.qr-card .qr { width: min(72vw, 400px); aspect-ratio: 1; margin: 22px 0 18px; }
.qr-card .qr svg { width: 100%; height: 100%; }
.qr-card .nm { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.qr-card .ph { font-size: 17px; color: var(--ink-3); margin-top: 4px; }
.qr-card .cta { margin-top: 14px; font-size: 15px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.qr-card .cta svg { width: 20px; height: 20px; color: #25D366; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #D1D1D6; }
.dots i.on { background: var(--ruby); }

/* ---------- unlock ---------- */
.lock { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 20px; background: radial-gradient(1200px 600px at 50% -10%, #fff 0%, var(--bg) 60%); }
.lock .lg { height: 92px; margin-bottom: 8px; }
.lock .ttl { font-size: 15px; color: var(--ink-3); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 30px; }
.lock .users { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.lock .u { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.lock .u .av { width: 96px; height: 96px; border-radius: 50%; background: linear-gradient(160deg, #C40C0C, #8E0000); color: #fff; display: grid; place-items: center; font-size: 38px; font-weight: 600; box-shadow: 0 10px 30px rgba(180,0,0,.25); transition: transform .12s; }
.lock .u:active .av { transform: scale(.94); }
.lock .u.grey .av { background: linear-gradient(160deg, #6E6E73, #3A3A3C); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.pin-dots { display: flex; gap: 16px; margin: 18px 0 26px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.pin-dots i.on { background: var(--ink); box-shadow: none; }
.pinpad { display: grid; grid-template-columns: repeat(3, 80px); gap: 16px; }
.pinpad button { width: 80px; height: 80px; border-radius: 50%; background: rgba(0,0,0,.06); font-size: 32px; font-weight: 400; }
.pinpad button:active { background: rgba(0,0,0,.14); }
.pinpad button.fn { background: none; font-size: 16px; font-weight: 500; }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }

/* ---------- banners & toast ---------- */
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 15.5px; }
.banner.red { background: var(--ruby); color: #fff; }
.banner.amber { background: var(--amber-soft); color: var(--amber); }
.banner.green { background: var(--green-soft); color: var(--green); }
.banner .m { flex: 1; }
.banner b { display: block; font-size: 16.5px; }
.banner .btn { height: 38px; font-size: 15px; background: #fff; color: var(--ruby); }
#toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: rgba(29,29,31,.92); color: #fff; padding: 12px 20px; border-radius: 14px; font-size: 15.5px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .25s; z-index: 400; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translateX(-50%); }
.progress { height: 10px; background: #E5E5EA; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ruby); border-radius: 99px; transition: width .3s; }
.ready { display: flex; align-items: center; gap: 14px; }
.ready .big-ic { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: 0 0 60px; }
.ready .big-ic.no { background: #F2F2F4; color: var(--ink-3); }
.ready .big-ic svg { width: 32px; height: 32px; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.right { text-align: right; }
.sp { height: 14px; }
.photo-row { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 16px; }
.photo-row .ph { width: 84px; height: 84px; border-radius: 12px; background: #F2F2F4 center/cover; position: relative; }
.photo-row .ph button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; line-height: 1; }
.photo-row .add { width: 84px; height: 84px; border-radius: 12px; background: #F2F2F4; display: grid; place-items: center; color: var(--ink-2); font-size: 13px; text-align: center; font-weight: 600; }
.photo-row .add svg { width: 26px; height: 26px; margin: 0 auto 2px; }
