/* =========================================================================
   "Tidewater" design system — ECACH Fast Payment System
   Principles: clarity over decoration · numbers first · one primary action
   per screen · calm, honest status · works one-handed and with a keyboard.
   CSP-safe: no inline styles; JS sets widths from data-w.
   ========================================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* brand */
  --ink: #0A2540;          /* headers, display text */
  --primary: #145DA0;      /* the one action colour (6.3:1 on white) */
  --primary-hover: #0F4C85;
  --primary-soft: #EAF2FB;
  /* neutrals */
  --bg: #F4F6F9; --surface: #FFFFFF; --surface-2: #F8FAFC; --elevated: #FFFFFF;
  --line: #E3E8EF; --line-strong: #CBD3DE;
  --text: #0B1320; --text-2: #445063; --text-3: #5F6B7C; --disabled: #A3ADBA;
  /* status (text colour ≥ 4.5:1 on its soft background) */
  --success: #0B7A4B; --success-soft: #E6F4EC;
  --warning: #8A5100; --warning-soft: #FFF3DC;
  --error: #B42318;   --error-soft: #FDECEA;
  --info: #1D4ED8;    --info-soft: #EBF1FF;
  --violet: #5B45C2;  --violet-soft: #EFECFB;
  /* legacy aliases used by older markup */
  --muted: var(--text-3); --navy: var(--ink); --teal: var(--primary); --teal-soft: var(--primary-soft);
  --good: var(--success); --good-soft: var(--success-soft); --warn: var(--warning); --warn-soft: var(--warning-soft);
  --bad: var(--error); --bad-soft: var(--error-soft); --sky: var(--primary); --sky-soft: var(--primary-soft);
  /* type */
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  /* spacing (4px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 48px;
  /* shape & depth */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 24px;
  --shadow: 0 1px 2px rgba(10, 37, 64, .06), 0 1px 1px rgba(10, 37, 64, .04);
  --shadow-lg: 0 10px 30px rgba(10, 37, 64, .12), 0 2px 6px rgba(10, 37, 64, .06);
  --ring: 0 0 0 3px rgba(20, 93, 160, .28);
  --ease: cubic-bezier(.2, .7, .2, 1); --t-fast: 120ms; --t: 200ms;
  --radius: var(--r);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-underline-offset: 2px; }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.01em; margin: 0; }
h1 { font-size: 20px; line-height: 28px; font-weight: 650; }
h2 { font-size: 22px; line-height: 28px; font-weight: 700; margin-bottom: var(--s1); }
h3 { font-size: 16px; line-height: 24px; font-weight: 650; margin-bottom: var(--s3); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
h4 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 var(--s3); }
small, .small { font-size: 13px; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num, .amount { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.num { text-align: right; white-space: nowrap; }
.center { text-align: center; }
.wide { width: 100%; }
.stack { display: flex; flex-direction: column; gap: var(--s2); }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.neg-t { color: var(--error); } .pos-t { color: var(--success); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: var(--s3); top: -48px; background: var(--ink); color: #fff; padding: var(--s2) var(--s3); border-radius: var(--r-sm); z-index: 50; }
.skip:focus { top: var(--s3); }

/* ---------- 3. Controls ---------- */
button, .btn {
  font: inherit; font-size: 14px; font-weight: 600; line-height: 20px; min-height: 40px; padding: 9px 16px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
button:hover, .btn:hover { border-color: var(--text-3); background: var(--surface-2); }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.violet { background: var(--violet); border-color: var(--violet); color: #fff; }
button.danger, .btn.danger { color: var(--error); border-color: #EBC1BC; }
button.danger:hover { background: var(--error-soft); }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
button.ghost:hover, .btn.ghost:hover { background: var(--primary-soft); }
button.sm, .btn.sm { min-height: 32px; padding: 5px 12px; font-size: 13px; }
button.lg, .btn.lg { min-height: 52px; padding: 14px 20px; font-size: 16px; border-radius: var(--r); }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
button.busy { position: relative; color: transparent !important; pointer-events: none; }
button.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .8s linear infinite; }
button:not(.primary).busy::after { border-color: var(--line); border-top-color: var(--primary); }

input, select, textarea {
  font: inherit; font-size: 15px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input::placeholder, textarea::placeholder { color: #8994A3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input[aria-invalid="true"] { border-color: var(--error); }
input.amt { width: 140px; text-align: right; font-variant-numeric: tabular-nums; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
label.f .hint { font-weight: 400; color: var(--text-3); }
.err-text { color: var(--error); font-size: 14px; min-height: 20px; }
.field-error { color: var(--error); font-size: 13px; }

/* ---------- 4. Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); margin-bottom: var(--s4); min-width: 0; box-shadow: var(--shadow); }
.card .card { box-shadow: none; background: var(--surface-2); }
.card .note, .note { color: var(--text-3); font-size: 13px; margin: var(--s3) 0 0; }
.card h3 .tag, .tag { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 var(--s2); }
.banner { display: flex; gap: var(--s2); align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--violet);
  color: var(--text-2); border-radius: var(--r-sm); padding: var(--s2) var(--s3); font-size: 13px; margin-bottom: var(--s4); }
.banner.readonly { border-left-color: var(--primary); }
.callout { border-radius: var(--r); padding: var(--s3) var(--s4); display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--s4); border: 1px solid; }
.callout.warn { background: var(--warning-soft); border-color: #F2D49B; color: #5C3600; }
.callout.good { background: var(--success-soft); border-color: #A9D8BE; color: #064D2F; }
.callout.info { background: var(--info-soft); border-color: #BCD0FB; color: #1E3A8A; }
.callout.bad { background: var(--error-soft); border-color: #F1B8B2; color: #7A1A12; }
.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--text-3); }
.empty .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; margin-bottom: var(--s2); color: var(--text-3); }
.empty b { display: block; color: var(--text); margin-bottom: var(--s1); }
.warnbox, .okbox, .holdbox, .infobox { border-radius: var(--r); padding: var(--s3) var(--s4); font-size: 14px; }
.warnbox { background: var(--error-soft); color: #7A1A12; }
.okbox { background: var(--success-soft); color: #064D2F; }
.holdbox { background: var(--warning-soft); color: #5C3600; }
.infobox { background: var(--info-soft); color: #1E3A8A; }

/* ---------- 5. Data display ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); box-shadow: var(--shadow); min-width: 0; }
.kpi .l { font-size: 12px; font-weight: 600; color: var(--text-3); }
.kpi .v { font-size: clamp(18px, 1.5vw, 24px); font-weight: 700; color: var(--ink); margin: 2px 0; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.kpi .s { font-size: 13px; color: var(--text-3); }
.kpi.bad .v { color: var(--error); } .kpi.good .v { color: var(--success); } .kpi.warn .v { color: var(--warning); }
.kpi.bad { border-top: 3px solid var(--error); } .kpi.warn { border-top: 3px solid #E0A030; }

.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
td { padding: var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
tr.click { cursor: pointer; }
.kv { display: flex; justify-content: space-between; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--text-2); }
.kv > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 18px; }
.c-good { background: var(--success-soft); color: var(--success); }
.c-warn { background: var(--warning-soft); color: var(--warning); }
.c-bad { background: var(--error-soft); color: var(--error); }
.c-muted { background: #EEF1F5; color: var(--text-2); }
.c-teal, .c-sky { background: var(--primary-soft); color: var(--primary); }
.c-violet { background: var(--violet-soft); color: var(--violet); }
.chip.c-good::before, .chip.c-warn::before, .chip.c-bad::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.g { background: var(--success); } .dot.b { background: var(--error); } .dot.m { background: #9AA7B6; }

.bar { height: 6px; background: #E6EBF1; border-radius: 99px; overflow: hidden; margin-top: 6px; min-width: 90px; }
.bar > span { display: block; height: 100%; background: var(--primary); width: 0; border-radius: 99px; transition: width var(--t) var(--ease); }
.bar.low > span { background: var(--error); }
.hbar { display: grid; grid-template-columns: 150px 1fr 60px; gap: var(--s2); align-items: center; margin: 6px 0; font-size: 13px; }
.hbar .track { height: 12px; background: #E6EBF1; border-radius: 4px; overflow: hidden; }
.hbar .track > span { display: block; height: 100%; background: var(--primary); width: 0; }
svg.chart text { font-size: 11px; fill: var(--text-3); }
svg.chart rect.b { fill: var(--primary); }
svg.chart rect.o { fill: var(--error); }
svg.chart line { stroke: var(--line); }

.rule { border-bottom: 1px solid var(--line); padding: var(--s3) 0; display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.rule:last-child { border-bottom: 0; }
.rule .title { font-weight: 600; }

/* ---------- 6. Feedback ---------- */
#toast { position: fixed; left: 50%; bottom: var(--s5); transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--s2); z-index: 60; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: var(--s3) var(--s4); border-radius: var(--r); font-size: 14px; box-shadow: var(--shadow-lg); animation: rise var(--t) var(--ease); }
.toast.err { background: var(--error); }
.skeleton { background: linear-gradient(90deg, #EDF1F5 0%, #F6F8FA 50%, #EDF1F5 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-sm); color: transparent !important; }
.sk-line { height: 14px; margin: 8px 0; } .sk-amt { height: 40px; width: 60%; margin: 8px 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(20,93,160,.16); } 50% { box-shadow: 0 0 0 9px rgba(20,93,160,.04); } }
@keyframes scanline { 0% { top: 12%; } 50% { top: 84%; } 100% { top: 12%; } }

/* ---------- 7. App shell (operator, institution, ECACH, merchant) ---------- */
header.top { background: var(--ink); color: #fff; padding: var(--s3) var(--s6); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); justify-content: space-between; align-items: center; border-bottom: 3px solid var(--primary); }
header.top > div:first-child { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
header.top h1 { color: #fff; font-size: 17px; line-height: 24px; }
header.top .sub { color: #B4C3D6; font-size: 13px; }
header.top .brandmark { width: 36px; height: 36px; flex: none; border-radius: 10px; }
header.top .meta { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; font-size: 13px; }
header.top button, header.top .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); min-height: 34px; padding: 6px 14px; }
header.top button:hover, header.top .btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); }
header.top #who { color: #D5DFEB; padding: 0 var(--s2); }
header.top .chip { background: rgba(255,255,255,.12); color: #fff; }
header.top .chip.c-good { background: #0E6B44; } header.top .chip.c-warn { background: #8A5100; }
header.top.portal-merchant { border-bottom-color: #C2410C; }
header.top.portal-inst { border-bottom-color: #0F766E; }
header.top.portal-ecach { border-bottom-color: var(--violet); }
header.top.portal-customer { border-bottom-color: var(--primary); }
header.top.portal-public { background: transparent; border-bottom: 0; }
nav.tabs { background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 var(--s5); display: flex; gap: var(--s1); overflow-x: auto; }
nav.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 14px 12px 11px; color: var(--text-3); font-weight: 600; white-space: nowrap; min-height: 48px; }
nav.tabs button.on { color: var(--ink); border-bottom-color: var(--primary); }
nav.tabs a.navlink { margin-left: auto; align-self: center; white-space: nowrap; }
header.top a.navback { background: transparent; color: #fff; }
main { max-width: 1320px; margin: 0 auto; padding: var(--s5) var(--s6) var(--s8); }
.head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-bottom: var(--s4); }
.head p { margin: 0; color: var(--text-2); max-width: 75ch; }
.grid2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s4); }
.grid2e { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.subtabs { display: inline-flex; gap: var(--s1); background: #E6EBF1; border-radius: var(--r); padding: var(--s1); margin-bottom: var(--s4); flex-wrap: wrap; }
.subtabs button { border: 0; background: transparent; border-radius: var(--r-sm); min-height: 36px; padding: 6px 16px; color: var(--text-2); }
.subtabs button:hover { background: rgba(255,255,255,.6); }
.subtabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
@media (max-width: 960px) { .grid2, .grid2e { grid-template-columns: 1fr; } main { padding: var(--s4) var(--s4) var(--s8); } header.top { padding: var(--s3) var(--s4); } }

/* ---------- 8. Process visuals: lifecycle, timeline, netting ---------- */
.flow { display: grid; gap: 0; margin: var(--s2) 0 var(--s3); }
.flow.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .flow.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .flow.n6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.flow .st { position: relative; text-align: center; padding: 0 6px; }
.flow .st::after { content: ""; position: absolute; top: 15px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--line); }
.flow .st:last-child::after { display: none; }
.flow .st.done::after { background: var(--primary); }
.flow .ball { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--surface); color: var(--text-3); border: 2px solid var(--line-strong); }
.flow .st.done .ball { background: var(--primary); color: #fff; border-color: var(--primary); }
.flow .st.now .ball { color: var(--primary); border-color: var(--primary); animation: pulse 1.8s infinite; }
.flow .st.bad .ball { background: var(--error-soft); color: var(--error); border-color: var(--error); }
.flow .t { font-weight: 650; font-size: 13px; color: var(--text); }
.flow .d { font-size: 12px; color: var(--text-3); }
@media (max-width: 700px) { .flow.n4, .flow.n5, .flow.n6 { grid-template-columns: 1fr 1fr; row-gap: var(--s4); } .flow .st::after { display: none; } }
.timeline { list-style: none; margin: var(--s2) 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 var(--s4) 36px; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .mk { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface); color: var(--text-3); border: 2px solid var(--line-strong); }
.timeline li.DONE .mk { background: var(--success); color: #fff; border-color: var(--success); }
.timeline li.WAITING .mk, .timeline li.NEXT .mk { border-color: var(--primary); color: var(--primary); }
.timeline li.DECLINED .mk { background: var(--error); border-color: var(--error); color: #fff; }
.timeline .lb { font-weight: 600; }
.timeline .meta { font-size: 13px; color: var(--text-3); }
.tests { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px; margin-top: 6px; }
.tests div { font-size: 12px; background: var(--success-soft); color: #064D2F; border-radius: 6px; padding: 4px 8px; }
.netbars { display: grid; gap: 6px; }
.netrow { display: grid; grid-template-columns: 170px 1fr 1fr 110px; align-items: center; gap: var(--s2); font-size: 13px; }
.netrow .neg, .netrow .pos { height: 12px; display: flex; }
.netrow .neg { justify-content: flex-end; }
.netrow .neg span { background: var(--error); border-radius: 3px 0 0 3px; height: 100%; opacity: .85; }
.netrow .pos span { background: var(--success); border-radius: 0 3px 3px 0; height: 100%; opacity: .85; }
.netrow .axis { border-left: 2px solid var(--ink); }
@media (max-width: 700px) { .netrow { grid-template-columns: 100px 1fr 1fr 86px; } }

/* ---------- 9. Public pages: welcome, sign-in, sign-up ---------- */
.pub { min-height: 100vh; background: var(--bg); }
.band { background: var(--ink); color: #fff; }
.pub .wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--s6) var(--s8); }
.pub header.top { max-width: 1160px; margin: 0 auto; padding: var(--s4) var(--s6); }
.band .banner { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); border-left-color: #A99BF0; color: #C9D5E3; }
.hero { padding: var(--s7) 0 var(--s8); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s7); align-items: center; }
.hero h2 { color: #fff; font-size: 44px; line-height: 1.08; letter-spacing: -.03em; margin: var(--s3) 0 var(--s4); font-weight: 750; }
.hero h2 em { font-style: normal; color: #8CC8FF; }
.hero p { color: #C9D5E3; font-size: 17px; max-width: 54ch; }
.hero .eyebrow { color: #8CC8FF; }
.hero .cta { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s5); }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; min-height: 48px; padding: 12px 20px; }
.btn.light:hover { background: #E8EEF6; }
.btn.outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); min-height: 48px; padding: 12px 20px; }
.btn.outline-light:hover { background: rgba(255,255,255,.08); }
.stats-glass { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-lg); padding: var(--s5); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.stats-glass .k { font-size: 30px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats-glass .l { font-size: 13px; color: #A9B9CC; }
.trustbar { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); padding: var(--s4) 0 0; color: #C9D5E3; font-size: 13px; }
.trustbar span::before { content: "✓"; color: #7FD9A8; font-weight: 700; margin-right: 6px; }
.journeys { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s4); }
.jcard { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); border: 1px solid var(--line); }
.jcard .ic { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; font-weight: 800; }
.ic.c1 { background: var(--primary); } .ic.c2 { background: #C2410C; } .ic.c3 { background: #0F766E; } .ic.c4 { background: var(--violet); } .ic.c5 { background: #475569; }
.jcard h4 { margin-top: var(--s1); font-size: 16px; }
.jcard p { margin: 0; color: var(--text-2); font-size: 14px; flex: 1; }
.section-title { margin: var(--s8) 0 var(--s4); }
.section-title h3 { font-size: 24px; letter-spacing: -.02em; margin: var(--s1) 0; }
.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s4); }
.howto .card ol { margin: 0; padding-left: 18px; color: var(--text-2); } .howto .card li { margin: 6px 0; }
.footer-note { text-align: center; color: var(--text-3); font-size: 13px; margin-top: var(--s7); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s4); background: var(--ink); }
.login { width: 100%; max-width: 440px; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: var(--s7) var(--s6); }
.login.login-wide { max-width: 520px; }
.login form { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s5); }
.login .brandrow { display: flex; gap: var(--s3); align-items: center; }
.login .brandrow img { width: 44px; height: 44px; border-radius: 12px; }
.login .secure { display: flex; gap: var(--s2); align-items: center; color: var(--text-3); font-size: 13px; margin-top: var(--s3); }
.login details { margin-top: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s3); }
.login summary { cursor: pointer; font-weight: 600; color: var(--primary); min-height: 32px; }
.pwd { position: relative; } .pwd input { width: 100%; padding-right: 72px; }
.pwd button { position: absolute; right: 4px; top: 4px; min-height: 36px; padding: 4px 10px; border: 0; background: transparent; color: var(--primary); font-size: 13px; }

.wizard { max-width: 920px; margin: calc(-1 * var(--s7)) auto 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.pub.signup .band { padding-bottom: var(--s8); }
.steps { list-style: none; margin: 0; padding: var(--s4); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); counter-reset: s; position: sticky; top: var(--s4); }
.steps .meter { font-size: 13px; color: var(--text-3); margin: 0 0 var(--s2); }
.steps li { counter-increment: s; display: flex; gap: var(--s3); align-items: center; padding: var(--s2) 0; color: var(--text-3); font-weight: 600; font-size: 14px; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--line-strong); font-size: 12px; flex: none; }
.steps li.on { color: var(--ink); } .steps li.on::before { border-color: var(--primary); background: var(--primary); color: #fff; }
.steps li.done { color: var(--success); } .steps li.done::before { content: "✓"; background: var(--success); border-color: var(--success); color: #fff; }
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: var(--s6); }
.panel h3 { font-size: 22px; letter-spacing: -.02em; margin-bottom: var(--s1); }
.panel .lead { color: var(--text-2); margin: 0 0 var(--s5); }
.panel .stepno { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: var(--s1); }
.why { display: flex; gap: var(--s2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s3); font-size: 13px; color: var(--text-2); margin-top: var(--s4); }
.why::before { content: "🔒"; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.form .full { grid-column: 1 / -1; }
.form label.f input, .form label.f select { width: 100%; }
.nav-btns { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s6); }
.nav-btns .primary { min-width: 160px; }
.otpbox { display: flex; gap: var(--s3); align-items: end; flex-wrap: wrap; margin-top: var(--s3); }
.otpbox input { font-size: 24px; letter-spacing: .4em; width: 210px; text-align: center; font-family: var(--mono); }
.sms { background: #10161F; color: #E2E8F0; border-radius: var(--r-lg); padding: var(--s3) var(--s4); font-size: 14px; max-width: 360px; margin-top: var(--s4); box-shadow: var(--shadow-lg); animation: rise var(--t) var(--ease); }
.sms .from { color: #94A3B8; font-size: 12px; }
.sms b { color: #8CC8FF; font-size: 17px; letter-spacing: .15em; font-family: var(--mono); }
.review .kv span:first-child { color: var(--text-3); }
.success-hero { text-align: center; padding: var(--s2) 0 var(--s4); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s2); }
.pick-grid button { text-align: left; justify-content: flex-start; flex-direction: column; align-items: flex-start; padding: var(--s3); border-radius: var(--r); font-weight: 500; min-height: 64px; gap: 2px; }
.pick-grid button.on { border-color: var(--primary); box-shadow: var(--ring); background: var(--primary-soft); }
.pick-grid button b { color: var(--ink); }
@media (max-width: 820px) {
  .wizard { grid-template-columns: 1fr; margin-top: calc(-1 * var(--s6)); }
  .steps { position: static; display: flex; overflow-x: auto; gap: var(--s3); padding: var(--s3); }
  .steps li { white-space: nowrap; } .steps li:not(.on) { font-size: 0; gap: 0; } .steps li:not(.on)::before { font-size: 12px; }
  .hero { grid-template-columns: 1fr; padding: var(--s5) 0 var(--s7); } .hero h2 { font-size: 32px; }
  .pub .wrap, .pub header.top { padding-left: var(--s4); padding-right: var(--s4); }
}
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } .panel { padding: var(--s5) var(--s4); } }

/* ---------- 10. Generic result icon ---------- */
.res-icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; margin: var(--s3) auto var(--s2); animation: pop 360ms var(--ease); }
.res-icon.ok { background: var(--success-soft); color: var(--success); }
.res-icon.hold { background: var(--warning-soft); color: var(--warning); }
.res-icon.bad { background: var(--error-soft); color: var(--error); }
.res-icon.info { background: var(--primary-soft); color: var(--primary); }

/* ---------- 11. Customer app (mobile-first) ---------- */
.app-stage { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: var(--s6); align-items: start; max-width: 1180px; margin: 0 auto; padding: var(--s5) var(--s6) var(--s8); }
.device { background: var(--surface); border-radius: 36px; box-shadow: 0 0 0 10px #10161F, 0 0 0 11px #2A3340, var(--shadow-lg); overflow: hidden; height: 820px; display: flex; flex-direction: column; position: relative; margin: 11px; }
.app { display: flex; flex-direction: column; height: 100%; background: var(--bg); }
.app-top { background: var(--surface); padding: var(--s4) var(--s4) var(--s3); display: flex; align-items: center; justify-content: space-between; gap: var(--s2); border-bottom: 1px solid var(--line); min-height: 64px; }
.app-top .who { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.app-top .t1 { font-size: 12px; color: var(--text-3); }
.app-top .t2 { font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-top .back { min-height: 40px; min-width: 40px; padding: 0; border: 0; background: transparent; font-size: 22px; color: var(--ink); }
.app-top .title { font-weight: 650; color: var(--ink); font-size: 17px; flex: 1; text-align: center; }
.icon-btn { min-height: 40px; min-width: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); position: relative; }
.icon-btn .badge { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--error); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.app-body { flex: 1; overflow-y: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); -webkit-overflow-scrolling: touch; }
.app-body.flush { padding: 0; gap: 0; }
.app-foot { padding: var(--s3) var(--s4) var(--s4); background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s2); }
.bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottomnav button { flex-direction: column; gap: 2px; border: 0; background: transparent; min-height: 52px; padding: 4px 2px; font-size: 11px; font-weight: 600; color: var(--text-3); border-radius: var(--r-sm); }
.bottomnav button svg { width: 22px; height: 22px; }
.bottomnav button.on { color: var(--primary); }
.bottomnav button.scan { color: #fff; }
.bottomnav button.scan .disc { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; margin-top: -18px; box-shadow: 0 4px 12px rgba(20,93,160,.35); }
.bottomnav button.scan span.lbl { color: var(--text-3); }

.balance-card { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: var(--s5); position: relative; }
.balance-card .lbl { color: #B4C3D6; font-size: 13px; display: flex; align-items: center; gap: var(--s2); }
.balance-card .amt { font-size: 38px; font-weight: 750; letter-spacing: -.03em; margin: var(--s1) 0; font-variant-numeric: tabular-nums; line-height: 1.1; }
.balance-card .amt .cents { font-size: 22px; color: #B4C3D6; }
.balance-card .meta { display: flex; justify-content: space-between; gap: var(--s2); font-size: 13px; color: #B4C3D6; flex-wrap: wrap; }
.balance-card .hide { position: absolute; right: var(--s3); top: var(--s3); background: transparent; border: 0; color: #B4C3D6; min-height: 36px; font-size: 13px; padding: 4px 8px; }
.balance-card.masked .amt { letter-spacing: .1em; }
.tierpill { display: inline-flex; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.quick button { flex-direction: column; gap: 6px; min-height: 76px; padding: var(--s2) 2px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--ink); }
.quick button .qi { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.quick button svg { width: 20px; height: 20px; }
.section-h { display: flex; justify-content: space-between; align-items: center; }
.section-h h4 { font-size: 15px; }
.section-h button { min-height: 32px; padding: 4px 8px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tx { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border: 0; border-bottom: 1px solid var(--line); background: var(--surface); width: 100%; text-align: left; border-radius: 0; min-height: 64px; font-weight: 400; justify-content: flex-start; }
.tx:last-child { border-bottom: 0; }
.tx:hover { background: var(--surface-2); }
.tx .ava { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; background: #EEF1F5; color: var(--text-2); }
.tx .ava.in { background: var(--success-soft); color: var(--success); }
.tx .ava.m { background: #FFEDE3; color: #B4410C; }
.tx .mid { flex: 1; min-width: 0; }
.tx .nm { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .sb { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .rt { text-align: right; flex: none; }
.tx .am { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); }
.tx .am.in { color: var(--success); }
.tx .am.void { color: var(--text-3); text-decoration: line-through; }
.tx .st { font-size: 12px; margin-top: 2px; }
.daygroup { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: var(--s3) var(--s4) var(--s1); }
.insight { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); }
.insight .ttl { font-size: 13px; color: var(--text-3); }
.insight .big { font-size: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.inout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s3); }
.inout .lab { font-size: 12px; color: var(--text-3); }
.inout .val { font-weight: 650; font-variant-numeric: tabular-nums; }
.minibar { height: 8px; border-radius: 4px; background: #E6EBF1; overflow: hidden; margin-top: 4px; }
.minibar span { display: block; height: 100%; width: 0; border-radius: 4px; }
.minibar.in span { background: var(--success); } .minibar.out span { background: var(--primary); }
.notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.notice .nico { width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.notice.sec .nico { background: var(--warning-soft); color: var(--warning); }
.notice.tier .nico { background: var(--primary-soft); color: var(--primary); }
.notice .nb { flex: 1; font-size: 14px; }
.notice .nb b { display: block; color: var(--ink); }
.notice .row { margin-top: var(--s2); }

.search { position: relative; }
.search input { width: 100%; padding-left: 38px; border-radius: 999px; background: var(--surface); }
.search::before { content: ""; position: absolute; left: 14px; top: 50%; width: 12px; height: 12px; border: 2px solid var(--text-3); border-radius: 50%; transform: translateY(-60%); }
.search::after { content: ""; position: absolute; left: 25px; top: 58%; width: 6px; height: 2px; background: var(--text-3); transform: rotate(45deg); }
.filters { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: 2px; }
.filters button { min-height: 34px; padding: 4px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.payee-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); display: flex; gap: var(--s3); align-items: center; }
.payee-card .ava { width: 48px; height: 48px; font-size: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; flex: none; }
.payee-card .nm { font-weight: 650; font-size: 17px; color: var(--ink); }
.payee-card .sb { font-size: 13px; color: var(--text-3); }
.verified { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--success); }
.verified::before { content: "✓"; width: 16px; height: 16px; border-radius: 50%; background: var(--success); color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; }
.amount-entry { text-align: center; padding: var(--s5) 0 var(--s3); }
.amount-entry .cur { font-size: 24px; color: var(--text-3); font-weight: 600; vertical-align: top; }
.amount-entry input { font-size: 44px; font-weight: 750; border: 0; background: transparent; text-align: center; width: 100%; max-width: 280px; padding: 0; min-height: 60px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.amount-entry input:focus { box-shadow: none; }
.amount-entry .avail { font-size: 13px; color: var(--text-3); }
.amount-entry .limit { font-size: 13px; color: var(--warning); }
.chips-row { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; }
.chips-row button { min-height: 34px; padding: 4px 14px; border-radius: 999px; font-size: 13px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.keypad button { min-height: 52px; font-size: 22px; font-weight: 600; border: 0; background: transparent; border-radius: var(--r); }
.keypad button:hover { background: #E9EEF4; }
.pin-dots { display: flex; gap: var(--s3); justify-content: center; margin: var(--s4) 0; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); display: block; transition: background var(--t-fast); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pin-dots.shake { animation: shake 360ms; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s1) var(--s4); }
.summary .kv span:first-child { color: var(--text-3); }
.summary .total { font-weight: 700; font-size: 17px; }
.sure { text-align: center; font-size: 15px; color: var(--text-2); }
.sure b { color: var(--ink); }
.secure-line { display: flex; gap: 6px; align-items: center; justify-content: center; font-size: 12px; color: var(--text-3); }
.processing { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--s3); padding: var(--s6); }
.spinner { width: 56px; height: 56px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .9s linear infinite; }
.steps-live { list-style: none; padding: 0; margin: var(--s2) 0 0; text-align: left; font-size: 14px; color: var(--text-3); }
.steps-live li { padding: 4px 0; } .steps-live li.done { color: var(--success); } .steps-live li.done::before { content: "✓ "; }
.steps-live li.on { color: var(--ink); font-weight: 600; }
.result { text-align: center; display: flex; flex-direction: column; gap: var(--s2); }
.result .ra { font-size: 34px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.result h3 { justify-content: center; font-size: 20px; margin: 0; }
.result p { color: var(--text-2); margin: 0; }
.answer { text-align: left; border-radius: var(--r); padding: var(--s3) var(--s4); font-size: 14px; }
.answer.safe { background: var(--success-soft); color: #064D2F; }
.answer.wait { background: var(--warning-soft); color: #5C3600; }
.answer.no { background: var(--error-soft); color: #7A1A12; }
.answer b { display: block; }
.scanner { position: relative; flex: 1; min-height: 380px; background: #0B1118; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; gap: var(--s4); padding: var(--s5); }
.scanner .frame { width: 220px; height: 220px; border-radius: var(--r-lg); position: relative; }
.scanner .frame::before { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); border: 3px solid rgba(255,255,255,.9); clip-path: polygon(0 0, 28% 0, 28% 4%, 4% 4%, 4% 28%, 0 28%, 0 72%, 4% 72%, 4% 96%, 28% 96%, 28% 100%, 72% 100%, 72% 96%, 96% 96%, 96% 72%, 100% 72%, 100% 28%, 96% 28%, 96% 4%, 72% 4%, 72% 0, 100% 0, 100% 100%, 0 100%); }
.scanner .line { position: absolute; left: 8%; right: 8%; height: 2px; background: #8CC8FF; box-shadow: 0 0 12px #8CC8FF; animation: scanline 2.4s ease-in-out infinite; }
.scanner .hint { font-size: 16px; font-weight: 600; }
.scanner .sub { font-size: 13px; color: #A9B9CC; }
.codes { padding: var(--s4); background: var(--surface); display: flex; flex-direction: column; gap: var(--s2); }
.codes button { justify-content: flex-start; text-align: left; min-height: 56px; }
.myqr { background: var(--surface); border-radius: var(--r-lg); padding: var(--s5); text-align: center; border: 1px solid var(--line); }
.myqr svg { width: 220px; height: 220px; }
.receipt { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); padding: var(--s5) var(--s4) var(--s3); }
.receipt .hdr { text-align: center; padding-bottom: var(--s3); border-bottom: 1px dashed var(--line-strong); margin-bottom: var(--s2); }
.receipt .hdr .ra { font-size: 30px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.receipt .kv { font-size: 14px; }
.copy { border: 0; background: transparent; color: var(--primary); min-height: 28px; padding: 0 4px; font-size: 13px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.profile-h { text-align: center; padding: var(--s3) 0; }
.profile-h .avatar { width: 64px; height: 64px; font-size: 22px; margin: 0 auto var(--s2); }
.menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.menu > * { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); min-height: 52px; }
.menu > *:last-child { border-bottom: 0; }
.menu button { width: 100%; border: 0; border-radius: 0; background: var(--surface); font-weight: 500; }
.menu .k { color: var(--text-2); } .menu .v { font-weight: 600; text-align: right; }
.contacts { display: flex; gap: var(--s3); overflow-x: auto; padding-bottom: 4px; }
.contacts button { flex-direction: column; border: 0; background: transparent; min-width: 68px; padding: 4px; font-size: 12px; font-weight: 500; gap: 6px; color: var(--text); }
.contacts .avatar { width: 48px; height: 48px; font-size: 15px; }
.contacts .warnava { background: var(--warning-soft); color: var(--warning); }

.side-panel .card { margin-bottom: var(--s4); }
.behind ol { margin: 0; padding-left: 20px; } .behind li { margin: 6px 0; color: var(--text-2); }
.behind li.on { font-weight: 600; color: var(--ink); } .behind li.done { color: var(--success); }

@media (max-width: 900px) {
  .app-stage { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .app-stage > .side-panel { padding: var(--s4); }
  .device { margin: 0; border-radius: 0; box-shadow: none; height: 100vh; height: 100dvh; }
  body.app-mode header.top { display: none; }
  body.app-mode .stage-banner { margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; }
}

/* ---------- 12. Merchant ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); }
.pos .take { display: flex; flex-direction: column; gap: var(--s3); }
.pos .bigamt { display: flex; align-items: baseline; gap: var(--s2); border: 1px solid var(--line-strong); border-radius: var(--r); padding: var(--s2) var(--s4); background: var(--surface); }
.pos .bigamt:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.pos .bigamt span { font-size: 22px; color: var(--text-3); font-weight: 600; }
.pos .bigamt input { border: 0; font-size: 36px; font-weight: 750; padding: 0; width: 100%; min-height: 56px; font-variant-numeric: tabular-nums; color: var(--ink); }
.pos .bigamt input:focus { box-shadow: none; }
.qrbox { display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s2) 0; text-align: center; }
.qrbox svg { width: 240px; height: 240px; }
.qrbox.small svg { width: 150px; height: 150px; }
.qrbox .wait { display: flex; gap: var(--s2); align-items: center; color: var(--text-2); }
.qrbox .wait::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); animation: pulse 1.6s infinite; }
.paidbig { font-size: 30px; font-weight: 750; color: var(--success); font-variant-numeric: tabular-nums; }
.mono-wrap { font-family: var(--mono); font-size: 11px; word-break: break-all; color: var(--text-3); }
.chart7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s2); align-items: end; height: 140px; padding-top: var(--s3); }
.chart7 .c { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart7 .c .b { width: 100%; max-width: 36px; background: var(--primary); border-radius: 6px 6px 2px 2px; min-height: 2px; height: 0; transition: height var(--t) var(--ease); }
.chart7 .c.today .b { background: var(--success); }
.chart7 .c small { color: var(--text-3); font-size: 11px; }
@media (max-width: 900px) { .pos { grid-template-columns: 1fr; } }
.mtx td .who { font-weight: 600; }
@media (max-width: 640px) {
  table.stack-sm thead { display: none; }
  table.stack-sm tr { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
  table.stack-sm td { border: 0; padding: 0; }
  table.stack-sm td.num { grid-row: 1; grid-column: 2; }
  table.stack-sm td.full { grid-column: 1 / -1; }
}

/* ---------- 13. Legacy pieces still used by older screens ---------- */
.journey { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.launcher { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s3); margin-top: var(--s3); }
.launcher .card { margin: 0; }
.act { display: flex; justify-content: space-between; gap: var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pick { text-align: left; width: 100%; justify-content: flex-start; }

/* ---------- 14. Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
@media print {
  body * { visibility: hidden; }
  .receipt, .receipt *, .printable, .printable * { visibility: visible; }
  .receipt, .printable { position: absolute; left: 0; top: 0; width: 100%; border: 0; box-shadow: none; }
  .receipt .noprint, .printable .noprint { display: none; }
}
.big-num { font-size: 30px; font-weight: 750; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.icon-btn-slot { min-width: 40px; display: flex; justify-content: flex-end; }
.myqr .avatar { width: 56px; height: 56px; font-size: 20px; margin: 0 auto var(--s2); }
.myqr h3 { justify-content: center; }
.result .summary { text-align: left; }
.empty .row, .empty > div { justify-content: center; margin-top: var(--s3); }
.codes details summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; }
.codes details textarea { margin: var(--s2) 0; }
.tx .mid { display: flex; flex-direction: column; }
.tx .nm, .tx .sb { display: block; }
.tx .rt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.summary .kv .total { color: var(--ink); }
.app-top .back { font-size: 0; }
.app-top .back::before { content: ""; width: 11px; height: 11px; border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg); margin-left: 4px; }
.amount-entry .amt-field { display: inline-flex; align-items: baseline; gap: 4px; max-width: 100%; }
.amount-entry .amt-field input { width: 5ch; max-width: 260px; text-align: left; }
.amount-entry .cur { font-size: 26px; }
.tx .am.pending { color: var(--text-3); }
header.top .brandmark { box-shadow: 0 0 0 1px rgba(255,255,255,.22); }
.device { height: min(820px, calc(100vh - 110px)); min-height: 640px; }
@media (max-width: 900px) { .device { min-height: 0; } }
@media (max-width: 820px) { .steps .meter { display: none; } }
.card > h2, .card > .section-h > h2 { font-size: 16px; line-height: 24px; font-weight: 650; margin-bottom: var(--s3); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; letter-spacing: -.01em; }
.panel h2 { font-size: 22px; letter-spacing: -.02em; margin-bottom: var(--s1); }
.app-top h1.title { font-size: 17px; line-height: 24px; margin: 0; }
.section-h h2 { font-size: 15px; line-height: 22px; margin: 0; }
.result h3, .processing h3 { font-size: 20px; }
.result h2, .processing h2 { font-size: 20px; justify-content: center; margin: 0; }
.myqr h2, .profile-h h2, .app-body h2.center { font-size: 18px; text-align: center; margin: 0; }
td button, td .btn { min-height: 32px; padding: 5px 10px; font-size: 13px; white-space: nowrap; }
td .amt { min-height: 36px; padding: 6px 10px; }
@media (min-width: 900px) { #toast { left: auto; right: var(--s6); transform: none; } }
@media (max-width: 900px) and (min-width: 600px) {
  .app-body > *, .app-foot > * { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
  .app-body.flush > * { max-width: none; }
}
.app, .app-body, .app-foot { min-width: 0; max-width: 100%; }
.app-body { overflow-x: hidden; }
.app-body > *, .app-foot > * { min-width: 0; max-width: 100%; }

/* Merchant app polish. Keep the same controls and payment flow while giving
   the till, live QR, and payment history a clearer visual hierarchy. */
.merchant-app { --merchant-accent: #168F83; --merchant-accent-soft: #E4F4F0; }
.merchant-app header.top.portal-merchant {
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 4px 18px rgba(10,37,64,.12);
}
.merchant-app header.top.portal-merchant::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--merchant-accent); }
.merchant-app main { max-width: 1160px; padding-top: 28px; }
.merchant-app .banner { border-left-color: var(--merchant-accent); border-radius: 12px; padding: 12px 16px; }
.required-mark, .optional-mark { display: inline-flex; align-items: center; margin-left: 6px; padding: 2px 7px; border-radius: 999px; font: 600 10px/1.5 var(--sans); letter-spacing: .02em; vertical-align: middle; }
.required-mark { background: #FCEBE8; color: #9F352A; }
.optional-mark { background: #EEF2F5; color: #566878; }
.field-label { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.merchant-app .field-error { min-height: 18px; color: #9F352A; font-size: 13px; }
.merchant-app input[aria-invalid="true"] { border-color: #C74639; box-shadow: 0 0 0 3px rgba(199,70,57,.12); }
.merchant-app .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.merchant-app .kpi { border-radius: 16px; padding: 18px; box-shadow: 0 3px 12px rgba(10,37,64,.045); }
.merchant-app .kpi:first-child { border-top: 3px solid var(--merchant-accent); }
.merchant-app .kpi:first-child .v { color: var(--merchant-accent); }
.merchant-app .pos { align-items: start; gap: 16px; }
.merchant-app .pos > .card { border-radius: 20px; padding: 22px; box-shadow: 0 4px 18px rgba(10,37,64,.055); }
.merchant-app .pos > .card:first-child { border-top: 3px solid var(--merchant-accent); }
.merchant-app .pos .bigamt { border-radius: 14px; padding: 10px 16px; }
.merchant-app .pos .bigamt input { min-width: 0; }
.merchant-app #createQr { background: var(--merchant-accent); border-color: var(--merchant-accent); border-radius: 14px; }
.merchant-app #createQr:hover { background: #11766D; border-color: #11766D; }
.merchant-app #qrArea:has(.qrbox:not(:empty)) { margin-top: 12px; }
.merchant-app .qrbox { padding: 16px 8px; }
.merchant-app #h-pays { margin-bottom: 12px; }
.merchant-app main > .card[aria-labelledby="h-pays"] { border-radius: 20px; box-shadow: 0 4px 18px rgba(10,37,64,.05); }
@media (max-width: 760px) {
  .merchant-app main { padding: 16px 14px calc(32px + env(safe-area-inset-bottom)); }
  .merchant-app .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .merchant-app .kpi { padding: 14px; }
  .merchant-app .kpi .v { font-size: 19px; }
  .merchant-app .pos > .card { padding: 18px; border-radius: 18px; }
  .merchant-app header.top.portal-merchant { padding-left: 14px; padding-right: 14px; }
  .merchant-app header.top .meta { gap: 6px; }
}
@media (max-width: 380px) {
  .merchant-app .kpis { grid-template-columns: 1fr 1fr; }
  .merchant-app .kpi { padding: 12px; }
  .merchant-app .kpi .s { font-size: 12px; }
}
.app-stage > * { min-width: 0; }
.notice .row button { flex: 1 1 auto; }
.balance-card .meta span { overflow-wrap: anywhere; }
.app-body > * { flex-shrink: 0; }
.capture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 600px) { .capture-grid { grid-template-columns: 1fr; } }
.capture { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; }
.capture.ok { border-style: solid; border-color: #A9D8BE; background: var(--success-soft); }
.capture.bad { border-style: solid; border-color: #F1B8B2; background: var(--error-soft); }
.capture img, .capture .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm); background: var(--bg); }
.capture .ph { display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--text-3); }
.capture .ct { display: flex; flex-direction: column; gap: 2px; }
.capture label.btn { cursor: pointer; }
.capture label.btn:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.loan-card { display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: left; padding: var(--s4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); font-weight: 400; width: 100%; }
.loan-card.overdue { border-color: #F1B8B2; }
.loan-card .lc-top, .loan-card .lc-bot, .loan-card .lc-mid { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.loan-card .lc-mid { justify-content: flex-start; }
.loan-card .lc-bot { font-size: 13px; color: var(--text-2); }
.balance-card .loanbar { background: rgba(255,255,255,.18); margin: var(--s2) 0; }
.switch { min-height: 32px; min-width: 64px; border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.switch[aria-checked="true"] { background: var(--success); border-color: var(--success); color: #fff; }
.pick-grid button[role="radio"] .amount { font-weight: 650; color: var(--ink); }
.langrow { justify-content: flex-end; margin-top: var(--s3); } .langrow select { min-height: 36px; padding: 4px 8px; }
.menu .switch { width: auto; flex: none; border: 1px solid var(--line-strong); border-radius: 999px; }
