/* ==========================================================================
   Zêr — design system
   Warm ivory paper, espresso ink, one gold accent. Green = in / buy / profit,
   red = out / sell / debt, blue = custody (amanat). Mobile first, RTL.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --surface: #fffdf8;
  --surface-2: #f0eadd;
  --surface-3: #e6dece;
  --line: #e7dfcf;
  --line-strong: #d3c7af;
  --text: #1d1811;
  --text-2: #5d5546;
  --text-3: #8a8170;

  --gold-50: #fbf4e2;
  --gold-100: #f4e5bf;
  --gold-300: #e2c06f;
  --gold-500: #c89a36;
  --gold-600: #ad8124;
  --gold-700: #86621a;
  --gold-ring: rgba(200, 154, 54, .22);

  --ink: #1b1710;
  --ink-2: #2a241a;
  --on-ink: #f7f0e0;
  --on-ink-2: #b9ad93;

  --green: #16704a;
  --green-bg: #e1f0e6;
  --red: #b3372b;
  --red-bg: #f8e4e0;
  --blue: #235d8c;
  --blue-bg: #e2ecf5;
  --gray-bg: #ece6da;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-1: 0 1px 2px rgba(60, 45, 20, .06), 0 1px 1px rgba(60, 45, 20, .04);
  --shadow-2: 0 6px 20px rgba(60, 45, 20, .10);
  --shadow-3: 0 18px 50px rgba(30, 20, 5, .22);

  --font: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #100e0a; --surface: #1a1712; --surface-2: #242018; --surface-3: #2f2a20;
    --line: #2d281f; --line-strong: #433b2d; --text: #f3ecdd; --text-2: #b8ad95; --text-3: #847b69;
    --gold-50: #2a2213; --gold-100: #3a2f19; --gold-700: #e3be6c; --gold-ring: rgba(227, 190, 108, .22);
    --ink: #221d14; --ink-2: #2e271b;
    --green: #52c28b; --green-bg: #13281d; --red: #f07e72; --red-bg: #2f1713; --blue: #82b8e4; --blue-bg: #122232; --gray-bg: #29241b;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 6px 20px rgba(0,0,0,.45); --shadow-3: 0 18px 50px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #100e0a; --surface: #1a1712; --surface-2: #242018; --surface-3: #2f2a20;
  --line: #2d281f; --line-strong: #433b2d; --text: #f3ecdd; --text-2: #b8ad95; --text-3: #847b69;
  --gold-50: #2a2213; --gold-100: #3a2f19; --gold-700: #e3be6c; --gold-ring: rgba(227, 190, 108, .22);
  --ink: #221d14; --ink-2: #2e271b;
  --green: #52c28b; --green-bg: #13281d; --red: #f07e72; --red-bg: #2f1713; --blue: #82b8e4; --blue-bg: #122232; --gray-bg: #29241b;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 6px 20px rgba(0,0,0,.45); --shadow-3: 0 18px 50px rgba(0,0,0,.6);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
::selection { background: var(--gold-100); }
[v-cloak] { display: none !important; }
[hidden] { display: none !important; }

.ic { width: 20px; height: 20px; fill: currentColor; flex: none; }
.ic.sm { width: 16px; height: 16px; } .ic.lg { width: 24px; height: 24px; } .ic.xl { width: 30px; height: 30px; }
[dir="rtl"] .ic.flip { transform: scaleX(-1); }

/* numbers: always left-to-right, tabular */
.num { direction: ltr; unicode-bidi: isolate; }
.mix { unicode-bidi: isolate; }
.table .num, .li-amt, .kv .v, .tnum { font-variant-numeric: tabular-nums; }
.privacy .num:not(.nb), .privacy .mix:not(.nb) { filter: blur(7px); user-select: none; }

/* ---------- typography ---------- */
.display { font-size: clamp(30px, 8.4vw, 46px); font-weight: 800; line-height: 1.12; letter-spacing: -.01em; }
.h1 { font-size: 22px; font-weight: 800; line-height: 1.35; }
.h2 { font-size: 18px; font-weight: 700; line-height: 1.4; }
.h3 { font-size: 16px; font-weight: 700; line-height: 1.4; }
.eyebrow { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.muted { color: var(--text-2); } .faint { color: var(--text-3); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.bold { font-weight: 700; } .semi { font-weight: 600; }
.pos { color: var(--green); } .neg { color: var(--red); } .cust { color: var(--blue); } .goldc { color: var(--gold-700); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }
.strike { text-decoration: line-through; opacity: .55; }

/* ---------- layout ---------- */
.shell { min-height: 100dvh; display: flex; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1180px; margin-inline: auto; padding: 6px 16px calc(var(--nav-h) + 36px + var(--safe-b)); }
.content.focus { padding-bottom: 24px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 12px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.gap-6 { gap: 6px; } .gap-16 { gap: 16px; }
.show-lg { display: none !important; }

@media (min-width: 720px) {
  .md-g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md-g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .content { padding: 8px 32px 48px; }
  .lg-g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg-g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hide-lg { display: none !important; }
  .show-lg { display: revert !important; }
  .split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .split-rev { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: start; }
  .sticky-col { position: sticky; top: 76px; }
}

/* ---------- side navigation (desktop) ---------- */
.sidenav { display: none; }
@media (min-width: 1024px) {
  .sidenav {
    display: flex; flex-direction: column; width: 252px; flex: none; position: sticky; top: 0; height: 100dvh;
    background: var(--surface); border-inline-end: 1px solid var(--line); padding: 18px 14px;
  }
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 18px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: linear-gradient(150deg, #ecc86e 0%, #c69631 55%, #9c7419 100%); color: #1b1408;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 12px rgba(160, 118, 25, .3);
}
.brand-name { font-weight: 800; font-size: 15.5px; line-height: 1.3; }
.brand-sub { font-size: 12px; color: var(--text-3); }
.sn-item {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 600; font-size: 14.5px; width: 100%; text-align: start;
}
.sn-item:hover { background: var(--surface-2); color: var(--text); }
.sn-item.active { background: var(--gold-50); color: var(--gold-700); }
.sn-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.sn-foot { margin-top: auto; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px 0 12px; background: var(--gold-50); border-bottom: 1px solid var(--gold-100);
}
@media (min-width: 1024px) { .topbar { padding: 0 32px; height: 68px; } }
.topbar-title { font-weight: 800; font-size: 17px; line-height: 1.25; }
.topbar-sub { font-size: 12px; color: var(--text-3); line-height: 1.2; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: var(--gold-700); background: var(--gold-50); }
.menu-btn .ic { width: 26px; height: 26px; }
.price-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.price-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 0 3px var(--gold-ring); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: var(--ink); color: var(--gold-300); flex: none;
}

/* ---------- bottom navigation (mobile) ---------- */
.bottomnav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
@media (min-width: 1024px) { .bottomnav { display: none; } }
.bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.bn-item.active { color: var(--gold-700); }
.bn-item .ic { width: 23px; height: 23px; }
.bn-fab-wrap { display: flex; justify-content: center; }
.bn-fab {
  width: 60px; height: 60px; margin-top: -20px; border-radius: 20px; display: grid; place-items: center; color: #1b1408;
  background: linear-gradient(150deg, #ecc86e 0%, #c69631 55%, #a47a1c 100%);
  box-shadow: 0 10px 22px rgba(160, 118, 25, .38), 0 0 0 5px var(--bg), inset 0 1px 0 rgba(255,255,255,.5);
}
.bn-fab.sell { background: linear-gradient(150deg, #d2564a 0%, #ab3a30 100%); color: #fff; box-shadow: 0 10px 22px rgba(150, 45, 35, .34), 0 0 0 5px var(--bg); }
.bn-fab .ic { width: 28px; height: 28px; transition: transform .24s cubic-bezier(.2, .9, .3, 1); }
.bn-fab.open .ic { transform: rotate(135deg); }

/* the + opens کڕین / فرۆشتن above it */
.fab-backdrop { position: fixed; inset: 0; z-index: 38; background: rgba(18, 13, 6, .45); animation: fade .16s ease-out; }
.fab-choices {
  position: fixed; inset-inline: 0; z-index: 41; bottom: calc(var(--nav-h) + var(--safe-b) + 40px);
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
.fab-choice {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; height: 52px; padding-inline: 16px 22px;
  border-radius: 16px; font-weight: 700; font-size: 16px; color: #fff; opacity: 0; transform: translateY(16px) scale(.9);
  box-shadow: 0 12px 26px rgba(40, 26, 8, .3); animation: fabIn .26s cubic-bezier(.2, .9, .3, 1) forwards;
}
.fab-choice.buy { background: linear-gradient(150deg, #3f9e6d 0%, #2c7a52 100%); animation-delay: .07s; }
.fab-choice.sell { background: linear-gradient(150deg, #d2564a 0%, #ab3a30 100%); }
.fab-choice .ic { width: 22px; height: 22px; }
.fab-choice:active { transform: scale(.97); }
@keyframes fabIn { to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .fab-choice { animation-duration: .01ms; animation-delay: 0s; }
  .bn-fab .ic { transition: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px;
  border-radius: 12px; font-weight: 700; font-size: 15px; white-space: nowrap; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text); transition: background .15s, box-shadow .15s, transform .06s; user-select: none;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-gold { background: var(--gold-500); color: #1b1408; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.btn-gold:hover { background: var(--gold-600); }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover { background: var(--text-2); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(1.08); background: var(--green); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { filter: brightness(1.08); background: var(--red); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-ghost { background: transparent; color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-bg); }
.btn-lg { height: 58px; font-size: 17px; border-radius: 16px; padding: 0 24px; }
.btn-sm { height: 36px; font-size: 13.5px; padding: 0 12px; border-radius: 10px; gap: 6px; }
.btn-block { width: 100%; }
.btn-icon { width: 46px; padding: 0; }
.btn-sm.btn-icon { width: 36px; }
[dir="rtl"] .btn .ic.flip { transform: scaleX(-1); }
.link { color: var(--gold-700); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.card-flat { background: var(--surface-2); border-radius: var(--radius-lg); padding: 14px; }
.card-tight { padding: 12px 14px; }
.card-click { transition: border-color .15s, box-shadow .15s; cursor: pointer; }
.card-click:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }

.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 20px 20px 18px; color: var(--on-ink);
  background: radial-gradient(120% 140% at 0% 0%, #3a2e17 0%, var(--ink) 55%) , var(--ink);
  box-shadow: 0 16px 40px rgba(27, 23, 16, .18);
}
.hero::after {
  content: ""; position: absolute; width: 300px; height: 300px; inset-inline-end: -120px; top: -150px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(225, 180, 80, .30), transparent 70%);
}
.hero .eyebrow { color: #d9b765; }
.hero .muted { color: var(--on-ink-2); }
/* the cash box hero: the owner's own money and people's money, side by side */
.vault-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.vs-part { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .07); }
.vs-part .vs-k { font-size: 12.5px; font-weight: 600; color: var(--on-ink-2); }
.vs-part b { font-size: 19px; font-weight: 800; text-align: right; }
.vs-part.own b { color: #7fe0ad; }
.vs-part.people b { color: #9cc6ff; }
.vs-part b.neg { color: #ff9b8e; }
.vs-lines { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.vs-lines .kv { padding: 2px 0; font-size: 12.5px; }
.hero-line { height: 1px; background: linear-gradient(90deg, transparent, rgba(217, 183, 101, .35), transparent); margin: 14px 0 12px; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; background: rgba(255,255,255,.08); color: var(--on-ink);
}
.hero-chip.up { background: rgba(82, 194, 139, .16); color: #7fe0ad; }
.hero-chip.down { background: rgba(240, 126, 114, .16); color: #ff9d93; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-head { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.stat-value { font-size: clamp(19px, 5.2vw, 25px); font-weight: 800; line-height: 1.3; margin-top: 6px; }
.stat-sub { font-size: 12.5px; color: var(--text-3); }
.stat .kv { font-size: 13px; padding: 5px 0; }

/* one metal: summary + each item (stock, mine, people's custody, lent out) */
.metal-card { display: flex; flex-direction: column; }
.metal-total { font-size: clamp(22px, 6vw, 28px); font-weight: 800; line-height: 1.3; margin-top: 8px; }
.metal-sum .tiny { text-align: right; }
.metal-sum.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metal-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.metal-sum .bold { font-size: 13.5px; }
.metal-item { display: block; width: 100%; text-align: start; padding: 10px 2px; border-top: 1px solid var(--line); }
.metal-sum + .metal-item { border-top: 0; }
button.metal-item { border-radius: 10px; padding-inline: 8px; }
button.metal-item:hover { background: var(--surface-2); }
.metal-item.active { background: var(--gold-50); box-shadow: inset 0 0 0 1.5px var(--gold-500); }

.bubble { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--gray-bg); color: var(--text-2); }
.bubble.sm { width: 32px; height: 32px; border-radius: 10px; }
.bubble.sm .ic { width: 17px; height: 17px; }
.bubble.lg { width: 48px; height: 48px; border-radius: 14px; }
.t-green { background: var(--green-bg); color: var(--green); }
.t-red { background: var(--red-bg); color: var(--red); }
.t-blue { background: var(--blue-bg); color: var(--blue); }
.t-gold { background: var(--gold-50); color: var(--gold-700); }
.t-gray { background: var(--gray-bg); color: var(--text-2); }

.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; }
.kv + .kv { border-top: 1px dashed var(--line); }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 700; text-align: end; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 2px 10px; }
.section-title { font-size: 16.5px; font-weight: 800; }

/* ---------- tags & chips ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--gray-bg); color: var(--text-2); }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.gold { background: var(--gold-50); color: var(--gold-700); }
.tag.lg { height: 30px; padding: 0 12px; font-size: 13.5px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { font-size: 11.5px; opacity: .7; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.input, .select, .textarea {
  width: 100%; height: 50px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  padding: 0 14px; font-size: 16px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 4px var(--gold-ring); }
.input.ltr { direction: ltr; text-align: right; }
.select {
  appearance: none; -webkit-appearance: none; padding-inline-start: 14px; padding-inline-end: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%238a8170'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: left 14px center;
}
.hint { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.hint b { color: var(--text); font-weight: 700; }
.error-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--red-bg); color: var(--red); font-size: 14px; font-weight: 600; }
.warn-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--gold-50); color: var(--gold-700); font-size: 13.5px; font-weight: 600; }

/* big numeric input with unit */
.bignum {
  display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 8px 0 14px; border-radius: 16px;
  background: var(--surface); border: 1.5px solid var(--line-strong); transition: border-color .15s, box-shadow .15s;
}
.bignum:focus-within { border-color: var(--gold-500); box-shadow: 0 0 0 4px var(--gold-ring); }
.bignum input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none;
  direction: ltr; text-align: right; font-size: 28px; font-weight: 800; padding: 0 6px;
}
.bignum input::placeholder { color: var(--text-3); font-weight: 600; }
.bignum .unit { font-size: 14px; font-weight: 700; color: var(--text-3); padding-inline-end: 6px; white-space: nowrap; }
.bignum.md { height: 54px; } .bignum.md input { font-size: 21px; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { height: 36px; padding: 0 13px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; flex: none; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg.block { display: flex; } .seg.block button { flex: 1; }
.seg.sm button { height: 30px; font-size: 12.5px; padding: 0 10px; }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .btn { width: 64px; height: 64px; border-radius: 16px; font-size: 26px; }

.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .2s; }
.switch input:checked + span { background: var(--gold-500); }
.switch input:checked + span::after { transform: translateX(-18px); }
[dir="ltr"] .switch input:checked + span::after { transform: translateX(18px); }

.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { height: 32px; padding: 0 11px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--text-2); }
.quick button:hover { background: var(--surface-3); color: var(--text); }

.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 60px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); text-align: start; font-weight: 700; font-size: 14px; line-height: 1.35; }
.opt:hover { border-color: var(--line-strong); }
.opt.active { border-color: var(--gold-500); background: var(--gold-50); box-shadow: 0 0 0 3px var(--gold-ring); }
.opt .bubble { width: 34px; height: 34px; border-radius: 10px; }

/* ---------- trade screen ---------- */
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: var(--surface-2); border-radius: 18px; }
.type-toggle button { height: 54px; border-radius: 14px; font-weight: 800; font-size: 16.5px; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, color .15s; }
.type-toggle button.sell.active { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(179, 55, 43, .28); }
.type-toggle button.buy.active { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(22, 112, 74, .28); }

.item-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.item-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; text-align: start; font-size: 14.5px; }
.item-row + .item-row { border-top: 1px solid var(--line); }
.item-row:hover { background: var(--surface-2); }
.item-row.active { background: var(--gold-50); box-shadow: inset 0 0 0 1.5px var(--gold-500); }
.item-row.active .semi { color: var(--gold-700); }

/* POS-style item cards + one-screen till: desktop only, scoped to the trade screen
   so sheets and the other screens keep the plain list. */
.trade-fields { display: flex; flex-direction: column; gap: 20px; }

@media (min-width: 1024px) {
  .trade-pos { gap: 20px; }
  .trade-pos > .stack-lg { gap: 13px; }
  /* weight next to price: the two numbers the shopkeeper types, on one line */
  .trade-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }

    position: relative; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 76px;
    border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 10px 12px;
    transition: border-color .15s, box-shadow .15s, transform .06s;
  }

  /* tighter controls so the till never scrolls */
  .trade-pos .field { gap: 5px; }
  .trade-pos .input { height: 46px; }
  .trade-pos .bignum { height: 54px; border-radius: 14px; }
  .trade-pos .bignum input { font-size: 23px; }
  .trade-pos .stepper .btn { width: 54px; height: 54px; border-radius: 14px; font-size: 22px; }
  /* quick amounts stay on one line next to the narrower inputs */
  .trade-pos .quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 5px; }
  .trade-pos .quick::-webkit-scrollbar { display: none; }
  .trade-pos .quick button { flex: none; height: 28px; padding: 0 9px; font-size: 12.5px; }
  .trade-pos .receipt-card { padding: 12px 14px 4px; }
  .trade-pos .receipt-head { padding-bottom: 10px; margin-bottom: 2px; }
  .trade-pos .total-bar { margin-bottom: 8px; }
}

/* short laptop screens: drop the helpers the receipt panel already shows */
@media (min-width: 1024px) and (max-height: 860px) {
  .trade-pos .field > .hint { display: none; }
  .trade-pos > .stack-lg { gap: 10px; }
}

/* A plain number field that says which currency it holds. The unit is a flex
   sibling rather than an overlay, so however long the currency name is it takes
   its own room and can never sit on top of the digits. */
.numfield {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 50px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  padding: 0 14px; transition: border-color .15s, box-shadow .15s;
}
.numfield:hover { border-color: var(--line-strong); }
.numfield:focus-within { border-color: var(--gold-500); box-shadow: 0 0 0 4px var(--gold-ring); }
.numfield .input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent;
  padding: 0; border-radius: 0;
}
.numfield .input:hover, .numfield .input:focus { border: 0; outline: none; box-shadow: none; }
.numfield-unit { flex: none; font-size: 13px; font-weight: 700; color: var(--text-3); white-space: nowrap; }

/* item combobox: one control that opens its list, like the client picker */
.combo { position: relative; }
.combo-pop { position: absolute; z-index: 20; inset-inline: 0; top: calc(100% + 6px); padding: 6px; box-shadow: var(--shadow-2); }
.combo-pop .item-list { max-height: 260px; overflow-y: auto; }
@media (max-width: 1023px) { .combo-pop { position: static; margin-top: 6px; } }

.item-scroller { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 3px 16px 6px; scroll-snap-type: x proximity; }
.item-scroller::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .item-scroller { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; } }
.item-chip {
  flex: none; min-width: 118px; padding: 10px 13px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  text-align: start; scroll-snap-align: start; transition: border-color .15s, background .15s, box-shadow .15s;
}
.item-chip:hover { border-color: var(--line-strong); }
.item-chip.active { border-color: var(--gold-500); background: var(--gold-50); box-shadow: 0 0 0 3px var(--gold-ring); }
.item-chip .nm { font-weight: 700; font-size: 14px; display: block; }
.item-chip .st { font-size: 12px; color: var(--text-3); display: block; margin-top: 1px; }

.preview { background: var(--surface-2); border-radius: 18px; padding: 6px 16px; }
.preview .kv { font-size: 14px; }
.preview .arrow { color: var(--text-3); margin: 0 4px; }

/* receipt-style cart summary (trade screen) */
.receipt-card { padding: 14px 16px 6px; }
.receipt-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px dashed var(--line-strong); }

/* the number the shopkeeper reads out loud: gold, bordered, bigger than anything near it */
.total-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--gold-50); border: 2px solid var(--gold-300); border-radius: 16px;
  padding: 12px 16px; margin-bottom: 10px;
}
.total-calc { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.total-sum { text-align: end; }
.total-sum b { font-size: 25px; font-weight: 800; color: var(--gold-700); letter-spacing: -.01em; line-height: 1.2; }

.submit-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 35; padding: 14px 16px calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 70%, color-mix(in srgb, var(--bg) 0%, transparent));
}
.content.focus { padding-bottom: calc(150px + var(--safe-b)); }
@media (min-width: 1024px) {
  .submit-bar { position: static; padding: 0; background: none; }
  .content.focus { padding-bottom: 48px; }
}

.success { text-align: center; padding: 8px 0; }
.success-ring { width: 76px; height: 76px; border-radius: 50%; margin: 6px auto 12px; display: grid; place-items: center; background: var(--green-bg); color: var(--green); animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.success-ring .ic { width: 38px; height: 38px; }

/* ---------- quick actions ---------- */
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 720px) { .actions { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.action { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 4px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--text-2); text-align: center; line-height: 1.3; }
.action:hover { border-color: var(--line-strong); color: var(--text); box-shadow: var(--shadow-1); }
.action .bubble { width: 42px; height: 42px; }
/* the six movements: two groups (metal · money), each tile its own action */
.custody-sum .stat-value { font-size: 20px; }
.move-bal { font-size: 12px; color: var(--text-3); white-space: nowrap; margin-top: 2px; }
.move-bal b { color: var(--text-2); font-weight: 600; }
.moves { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .moves { grid-template-columns: 2fr 1fr; } }
.moves-group { padding: 8px 10px 10px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); }
.moves-group .eyebrow { margin: 0 4px 6px; }
.moves-group .tiles { display: grid; gap: 8px; }
.moves-group.metal .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.moves-group.money .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.moves .action { padding: 14px 4px 11px; font-size: 13px; gap: 8px; min-height: 96px; justify-content: center; }
.moves .action .bubble { width: 46px; height: 46px; border-radius: 15px; }
.moves .action .bubble .ic { width: 23px; height: 23px; }
.moves-group.money .action { background: var(--gold-50); border-color: var(--gold-100); }
.moves-group.money .action:hover { border-color: var(--gold-300); }
.acc-preview { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
/* one group on its own (the customer page): no box, no label, two tiles side by side */
.moves.single { grid-template-columns: 1fr; }
.moves.single .moves-group { padding: 0; background: none; border: 0; }
.moves.single .moves-group .eyebrow { display: none; }
.moves.single .moves-group.money .tiles { max-width: 440px; }
.moves.single .action { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 0; padding: 10px 14px; font-size: 14px; }
.moves.single .action .bubble { width: 40px; height: 40px; border-radius: 12px; }
.list .li:disabled { opacity: .45; cursor: default; }


/* ---------- lists ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: start; }
.li + .li { border-top: 1px solid var(--line); }
button.li:hover, a.li:hover, .li.click:hover { background: var(--surface-2); cursor: pointer; }
.li-main { flex: 1; min-width: 0; }
.li-title { display: block; font-weight: 700; font-size: 14.5px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sub { display: block; font-size: 12.5px; color: var(--text-3); line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-end { text-align: end; flex: none; }
.li-amt { font-weight: 800; font-size: 14.5px; line-height: 1.45; }
.li.voided .li-title, .li.voided .li-amt { text-decoration: line-through; opacity: .55; }
/* replaced by a correction — superseded, not cancelled: dimmed but not struck through */
.li.replaced .li-title, .li.replaced .li-amt { opacity: .6; }
.day-head { padding: 14px 4px 8px; font-size: 13px; font-weight: 700; color: var(--text-3); display: flex; justify-content: space-between; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-size: 12.5px; color: var(--text-3); font-weight: 700; padding: 11px 14px; background: var(--surface-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-top: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.table tr.voided td { opacity: .5; }
.table tr.voided td.desc { text-decoration: line-through; }
.table tr.replaced td { opacity: .65; }
.table.tight th, .table.tight td { padding-inline: 10px; }
.table td.wrap-cell { white-space: normal; min-width: 180px; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }

.client-card { display: flex; flex-direction: column; gap: 10px; }
/* the customer list: one clean list, the balance in coloured pills */
.clients-page { max-width: 820px; }
.head-count { font-size: .6em; }
.search-box { position: relative; display: block; }
.search-box .ic { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-box .input { height: 52px; border-radius: 16px; padding-inline-start: 46px; font-size: 15px; }
.client-list { padding: 4px; }
.client-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; background: none; border: 0; border-radius: 14px; text-align: start; font: inherit; color: inherit; cursor: pointer; }
.client-row + .client-row { box-shadow: 0 -1px 0 var(--line); }
.client-row:hover { background: var(--surface-2); }
.cr-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cr-main b { font-size: 15px; }
/* a phone number is never cut or broken: one whole line */
.cr-sub { white-space: nowrap; }
.cr-bal { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 58%; }
.cr-go { flex: none; }
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill.owes { background: var(--red-bg); color: var(--red); }
.pill.holds { background: var(--blue-bg); color: var(--blue); }
.pill.clean { background: var(--green-bg); color: var(--green); }
.pill.more { background: var(--gray-bg); color: var(--text-2); }
.client-head { display: flex; align-items: center; gap: 12px; }
.initial { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 17px; background: var(--gold-50); color: var(--gold-700); flex: none; }
.initial.lg { width: 58px; height: 58px; border-radius: 18px; font-size: 22px; }
.bal-row { display: flex; gap: 6px; flex-wrap: wrap; }

.empty { text-align: center; padding: 34px 16px; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .bubble { width: 56px; height: 56px; border-radius: 18px; }
.empty .ic { width: 26px; height: 26px; }

.skel { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 12px; }

/* ---------- sheet (bottom sheet on mobile, dialog on desktop) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(18, 13, 6, .5); animation: fade .16s ease-out; }
.sheet {
  width: 100%; max-height: 94dvh; display: flex; flex-direction: column; background: var(--surface);
  border-radius: 24px 24px 0 0; box-shadow: var(--shadow-3); animation: up .24s cubic-bezier(.2, .9, .25, 1);
}
@media (min-width: 720px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { max-width: 520px; border-radius: 24px; max-height: 90dvh; animation: zoom .18s ease-out; }
  .sheet.wide { max-width: 760px; }
  .sheet-grip { display: none; }
}
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 9px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px 6px 18px; flex: none; }
.sheet-title { flex: 1; font-size: 18px; font-weight: 800; line-height: 1.4; }
.sheet-sub { font-size: 13px; color: var(--text-3); }
/* A tall sheet must scroll, not hide its last rows. The body is a flex column, so its
   children were being compressed to fit instead of overflowing — the body then never
   learned it had anything to scroll. min-height:0 lets it shrink inside .sheet; the
   flex-shrink:0 on its children is what actually restores the scroll. */
.sheet-body { overflow-y: auto; min-height: 0; padding: 8px 18px 18px; display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
.sheet-body > * { flex-shrink: 0; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 18px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); flex: none; }
@media (min-width: 720px) { .sheet-foot { padding-bottom: 16px; } }

.toast-host { position: fixed; inset-inline: 0; bottom: calc(var(--nav-h) + 14px + var(--safe-b)); z-index: 300; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
@media (min-width: 1024px) { .toast-host { bottom: 28px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 460px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow-3); animation: up .22s ease-out; }
.toast.error { background: var(--red); color: #fff; }
.toast.success .ic { color: #6fdca3; }

.offline-bar { background: var(--red); color: #fff; font-size: 13px; font-weight: 600; text-align: center; padding: 6px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.demo-bar { background: var(--gold-50); color: var(--gold-700); font-size: 12.5px; font-weight: 700; text-align: center; padding: 6px 12px; }

/* ---------- login / setup ---------- */
.auth {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 18px calc(28px + var(--safe-b));
  color: var(--on-ink); background: radial-gradient(90% 60% at 50% 0%, #3b2f17 0%, #16120b 60%) , #16120b;
}
.auth .brand-mark { width: 64px; height: 64px; border-radius: 20px; }
.auth .brand-mark .ic { width: 34px; height: 34px; }
.auth-title { font-size: 22px; font-weight: 800; margin-top: 14px; text-align: center; }
.auth-sub { font-size: 14px; color: var(--on-ink-2); text-align: center; margin-top: 4px; }
.user-tiles { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 22px 0 18px; }
.user-tile { display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 16px 0 8px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: var(--on-ink); font-weight: 700; font-size: 14px; }
.user-tile .avatar { width: 32px; height: 32px; font-size: 13px; background: rgba(217, 183, 101, .18); color: #e8c677; }
.user-tile.active { background: rgba(217, 183, 101, .16); border-color: rgba(217, 183, 101, .55); }
.pindots { display: flex; gap: 16px; justify-content: center; margin: 6px 0 26px; direction: ltr; }
.pindot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid #c89a36; transition: background .12s, transform .12s; }
.pindot.on { background: #d9b765; transform: scale(1.08); }
.pinpad { direction: ltr; display: grid; grid-template-columns: repeat(3, 78px); gap: 14px 22px; justify-content: center; }
.pinkey { height: 78px; border-radius: 50%; font-size: 28px; font-weight: 600; color: var(--on-ink); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); display: grid; place-items: center; transition: background .12s; }
.pinkey:hover { background: rgba(255,255,255,.1); }
.pinkey:active { background: rgba(217, 183, 101, .25); }
.pinkey.ghost { background: transparent; border-color: transparent; }
.pin-error { color: #ff9d93; font-size: 14px; font-weight: 600; text-align: center; min-height: 22px; margin-top: 14px; }
/* fingerprint button: btn-outline is drawn for light cards, this sits on the dark login screen */
.bio-btn { margin-top: 18px; width: min(268px, 100%); justify-content: center; gap: 8px;
  color: var(--on-ink); border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); }
.bio-btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .42); }
.shake { animation: shake .38s; }
.auth-foot { margin-top: 26px; font-size: 13px; color: var(--on-ink-2); text-align: center; }
.auth-foot button { color: #e8c677; font-weight: 700; }

.setup { min-height: 100dvh; background: var(--bg); }
.setup-inner { max-width: 620px; margin: 0 auto; padding: 24px 16px 40px; }
.steps { display: flex; gap: 6px; margin: 16px 0 22px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); }
.steps span.on { background: var(--gold-500); }
.welcome-card { max-width: 440px; width: 100%; text-align: center; }
.welcome-card .btn { width: 100%; }

/* ---------- price board (TV / tablet) ---------- */
.board { min-height: 100dvh; background: radial-gradient(80% 60% at 50% 0%, #33291a 0%, #0e0b07 70%), #0e0b07; color: #f5ecd6; padding: clamp(16px, 3vw, 40px); display: flex; flex-direction: column; gap: clamp(14px, 2.4vw, 28px); }
.board-head { display: flex; align-items: center; gap: 14px; }
.board-title { font-size: clamp(20px, 3.4vw, 40px); font-weight: 800; }
.board-clock { font-size: clamp(20px, 3.4vw, 42px); font-weight: 800; color: #e3bf6d; margin-inline-start: auto; }
.board-grid { display: grid; gap: clamp(10px, 1.6vw, 18px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.board-card { border-radius: 22px; padding: clamp(14px, 2vw, 26px); background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid rgba(227, 191, 109, .22); }
.board-karat { font-size: clamp(15px, 1.8vw, 22px); color: #d9b765; font-weight: 700; }
.board-price { font-size: clamp(30px, 5vw, 64px); font-weight: 800; line-height: 1.15; }
.board-row { display: flex; justify-content: space-between; font-size: clamp(13px, 1.5vw, 19px); color: #c9bb9c; padding-top: 6px; }
.board-row b { color: #f5ecd6; }
.board-foot { margin-top: auto; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: #b3a585; font-size: clamp(13px, 1.4vw, 18px); }

/* ---------- chart (single series: daily net profit, zero baseline) ---------- */
.chart { position: relative; }
.chart-plot { position: relative; display: flex; align-items: stretch; gap: 2px; height: 150px; direction: ltr; }
.chart-base { position: absolute; inset-inline: 0; height: 1px; background: var(--line-strong); pointer-events: none; }
.bar-col { flex: 1; min-width: 0; position: relative; display: flex; justify-content: center; cursor: default; outline: none; }
.bar-col:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 1px; border-radius: 4px; }
.bar { position: absolute; width: 70%; max-width: 24px; background: var(--green); border-radius: 4px 4px 0 0; }
.bar.neg { background: var(--red); border-radius: 0 0 4px 4px; }
.bar.zero { background: var(--line-strong); height: 1px !important; border-radius: 0; }
.bar-col:hover .bar, .bar-col:focus-visible .bar, .bar-col.on .bar { filter: brightness(1.12); }
.chart-x { display: flex; gap: 2px; direction: ltr; margin-top: 6px; }
.chart-x span { flex: 1; min-width: 0; text-align: center; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chart-x span.today { color: var(--text); font-weight: 700; }
.chart-tip {
  position: absolute; z-index: 3; transform: translate(-50%, -100%); margin-top: -8px; pointer-events: none;
  background: var(--text); color: var(--bg); border-radius: 10px; padding: 6px 10px; font-size: 12px; line-height: 1.5;
  white-space: nowrap; box-shadow: var(--shadow-2); direction: rtl;
}
.chart-tip b { font-size: 13px; }

/* ---------- print ---------- */
#print-root { display: none; }
.doc { font-family: var(--font); color: #000; background: #fff; direction: rtl; font-size: 12.5px; line-height: 1.55; }
.doc h1 { font-size: 20px; margin: 0; }
.doc .doc-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 12px; gap: 12px; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.doc th, .doc td { border: 1px solid #999; padding: 5px 7px; text-align: start; }
.doc th { background: #eee; font-weight: 700; }
.doc .doc-foot { margin-top: 14px; font-size: 11px; color: #444; }
.doc .num { direction: ltr; unicode-bidi: isolate; }
.doc .grid-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; margin: 10px 0; }
.doc .grid-kv div { display: flex; justify-content: space-between; border-bottom: 1px dotted #aaa; padding: 3px 0; }
.receipt { width: 72mm; margin: 0 auto; font-size: 12px; }
.receipt .center { text-align: center; }
.receipt .line { border-top: 1px dashed #000; margin: 6px 0; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.receipt .big { font-size: 16px; font-weight: 800; }

@media print {
  @page { margin: 10mm; }
  body.printing { background: #fff !important; }
  body.printing #app { display: none !important; }
  body.printing #print-root { display: block !important; }
  body.printing.receipt-mode { width: 80mm; }
}

/* ---------- account statement: a copy of the exchange office's paper (A4 landscape) ---------- */
.date-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.date-row .date-input { width: auto; min-width: 170px; height: 42px; }
.date-row.past .date-input, .date-kv .v { border-color: var(--gold-500); background: var(--gold-50); color: var(--gold-700); font-weight: 800; }
.acc-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-tab { min-height: 42px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.acc-tab:hover { border-color: var(--gold-500); }
.acc-tab.active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.st-book { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 12px; background: var(--surface); }
.st-book-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 2px 8px; }
.st-book-head b:first-child { font-size: 15px; }
.st-book .md { font-weight: 800; }
.pp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; border-radius: 6px; padding: 4px 6px; }
.pp-scroll .pp-tables { min-width: 980px; }

.pp-tables { color: #000; direction: rtl; font-family: var(--font); }
.pp-tables table { width: 100%; table-layout: fixed; }
.pp-tables th, .pp-tables td { border-bottom: 1px solid #000; border-right: 1px solid #000; padding: 2px 5px; overflow-wrap: anywhere; }
.pp-head { border-collapse: separate; border-spacing: 0; }
.pp-head tr:first-child th { border-top: 1px solid #000; }
.pp-head th.pp-th-last { border-left: 1px solid #000; }
.pp-head th { font-size: 12.5px; font-weight: 800; text-align: center; vertical-align: middle; line-height: 1.2; padding: 3px 4px; background: #fff; }
.pp-head th.pp-th-date { text-align: right; vertical-align: top; }
.pp-head th.pp-th-top { vertical-align: top; }
.pp-body { border-collapse: separate; border-spacing: 0 2px; }
.pp-body td { border-top: 1px solid #000; }
.pp-body tr > :last-child { border-left: 1px solid #000; }
.pp-body td { font-size: 12px; height: 22px; vertical-align: middle; background: #fff; }
.pp-body td.d { text-align: center; font-size: 11.5px; white-space: nowrap; }
.pp-body td.no { text-align: center; font-size: 11.5px; }
.pp-body td.t { text-align: center; font-size: 9.5px; font-weight: 800; line-height: 1.25; }
.pp-body td.n { direction: ltr; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pp-body td.md { text-align: center; font-weight: 800; padding: 2px 0; }
.pp-body td.desc { text-align: right; font-weight: 800; line-height: 1.3; }
.pp-body tr.click td { cursor: pointer; }
.pp-body tr.click:hover td { background: #f6f3ea; }
.pp-body .pp-open td { font-size: 11px; color: #222; text-align: right; padding-right: 8px; }
.pp-body .pp-open td.n { font-size: 12px; }
.pp-body .pp-total td { font-size: 12.5px; height: 24px; }
.pp-body .pp-total td.lbl { background: #ebebeb; font-weight: 800; text-align: right; padding-right: 24px; font-size: 13px; }
.pp-body .pp-total td.fill { background: #ebebeb; }

.paper { width: 1123px; min-height: 794px; box-sizing: border-box; padding: 24px 30px 20px; background: #fff; color: #000; direction: rtl; font-family: var(--font); font-size: 12px; line-height: 1.35; }
.pp-shop { text-align: right; line-height: 1.6; margin-bottom: 16px; }
.pp-shop-name { font-size: 22px; font-weight: 500; }
.pp-shop-line { font-size: 13px; font-weight: 800; }
.pp-phone { padding-right: 60px; }
.ltr-iso { direction: ltr; unicode-bidi: isolate; }
.pp-title { display: flex; align-items: baseline; gap: 14px; padding-bottom: 5px; border-bottom: 3px solid #000; margin-bottom: 4px; font-size: 13px; }
.pp-title b { font-weight: 800; }
.pp-date, .pp-page { flex: 0 0 auto; display: flex; gap: 6px; align-items: baseline; }
.pp-date .ltr-iso, .pp-page .ltr-iso { font-weight: 800; }
.pp-what { flex: 1 1 auto; text-align: center; }
.pp-what b.ltr-iso { font-size: 14.5px; }
.pp-for { margin: 0 10px; }
.pp-dash { margin: 0 8px; }

.pp-screen .pp-bar { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 6px 0; }
.pp-pages { display: flex; flex-direction: column; gap: 14px; }
.pp-fit { width: 100%; overflow: hidden; }
.pp-scale { width: 1123px; transform-origin: top right; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.pp-capture { position: fixed; top: 0; left: -20000px; pointer-events: none; }

@page st { size: A4 landscape; margin: 0; }
.pp-print .paper { page: st; width: 297mm; min-height: 210mm; break-after: page; }
.pp-print .paper:last-child { break-after: auto; }

/* ---------- motion ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes zoom { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.screen-enter { animation: screenIn .22s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
