/* Moneta Web v0.2.0 — app styles. Brand: ink + emerald (matches annmarstudio.co.uk/moneta). */
@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url(/fonts/Manrope-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap; src: url(/fonts/Manrope-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap; src: url(/fonts/Manrope-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap; src: url(/fonts/Manrope-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-display: swap; src: url(/fonts/InstrumentSerif-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-display: swap; src: url(/fonts/InstrumentSerif-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url(/fonts/JetBrainsMono-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url(/fonts/JetBrainsMono-500-normal.woff2) format('woff2'); }

:root {
  --bg: #f3f5f4; --bg-2: #e9eeec; --card: #ffffff; --card-2: #f6f8f7; --line: rgba(5, 8, 10, .09); --line-2: rgba(5, 8, 10, .16);
  --text: #0b0f0e; --muted: #56655f; --faint: #85928d;
  --accent: #0a9a6a; --accent-soft: rgba(10, 154, 106, .12); --accent-ink: #ffffff;
  --pos: #0a8a5f; --neg: #d22f3c; --neg-soft: rgba(210, 47, 60, .1); --warn: #a86a08; --warn-soft: rgba(245, 166, 35, .16);
  --s1: #0A9A6A; --s2: #3F6FD8; --s3: #B87A12; --grid: rgba(5, 8, 10, .07);
  --shadow: 0 1px 2px rgba(5, 8, 10, .04), 0 8px 24px rgba(5, 8, 10, .05);
  --radius: 18px; --radius-s: 12px;
  --serif: 'Instrument Serif', Georgia, serif; --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #05080a; --bg-2: #0a1012; --card: #0d1416; --card-2: #121b1e; --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .15);
    --text: #eef3f1; --muted: #93a39e; --faint: #64736e;
    --accent: #10b981; --accent-soft: rgba(16, 185, 129, .14); --accent-ink: #03130d;
    --pos: #2fd39a; --neg: #ff6370; --neg-soft: rgba(240, 68, 82, .14); --warn: #f5b041; --warn-soft: rgba(245, 166, 35, .14);
    --s1: #0FA877; --s2: #5B8DEF; --s3: #B87A12; --grid: rgba(255, 255, 255, .06);
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #05080a; --bg-2: #0a1012; --card: #0d1416; --card-2: #121b1e; --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .15);
  --text: #eef3f1; --muted: #93a39e; --faint: #64736e;
  --accent: #10b981; --accent-soft: rgba(16, 185, 129, .14); --accent-ink: #03130d;
  --pos: #2fd39a; --neg: #ff6370; --neg-soft: rgba(240, 68, 82, .14); --warn: #f5b041; --warn-soft: rgba(245, 166, 35, .14);
  --s1: #0FA877; --s2: #5B8DEF; --s3: #B87A12; --grid: rgba(255, 255, 255, .06);
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font: 500 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.b { font-weight: 700; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.center { text-align: center; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 12px; }
.row.top { align-items: flex-start; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.s { gap: 8px; }
.stack.l { gap: 20px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.cols3 { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg.tabs { flex-wrap: nowrap; white-space: nowrap; }
.grid3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2.wide-left { grid-template-columns: 1.4fr 1fr; } }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; min-height: 100vh; grid-template-columns: 1fr; }
.side { display: none; }
.main { min-width: 0; padding: 0 16px 104px; }
.page { max-width: 1120px; margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 60px; margin: 0 -16px 8px; padding: 0 16px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 17px; font-weight: 800; letter-spacing: -.02em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; font-size: 17px; }
.brand-mark { width: 28px; height: 28px; border-radius: 9px; flex: none; background: radial-gradient(circle at 50% 50%, transparent 36%, var(--accent) 38%, var(--accent) 58%, transparent 60%), #0e1a17; }
.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 12px; text-decoration: none; color: var(--faint); font-size: 11px; font-weight: 700; background: none; border: 0; }
.tab.on { color: var(--accent); }
.tab svg { width: 22px; height: 22px; }
@media (min-width: 960px) {
  .shell { grid-template-columns: 248px 1fr; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--bg-2); overflow-y: auto; }
  .side .brand { padding: 6px 10px 18px; }
  .nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; }
  .nav-item:hover { background: var(--card); color: var(--text); }
  .nav-item.on { background: var(--accent-soft); color: var(--accent); }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
  .nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 6px 12px 2px; font-weight: 800; }
  .main { padding: 0 32px 48px; }
  .topbar { margin: 0 -32px 16px; padding: 0 32px; height: 68px; }
  .topbar h1 { font-size: 20px; }
  .tabbar, .only-mobile { display: none !important; }
}
@media (max-width: 959px) { .only-desktop { display: none !important; } }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.soft { background: var(--card-2); box-shadow: none; }
.card.accent { background: linear-gradient(140deg, #13644d, #0b1f19 72%); color: #eef7f3; border-color: transparent; }
.card.accent .muted { color: rgba(238, 247, 243, .72); }
.card.accent .faint { color: rgba(238, 247, 243, .55); }
.card.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--card)); }
.card.danger { border-color: color-mix(in srgb, var(--neg) 45%, transparent); background: color-mix(in srgb, var(--neg) 6%, var(--card)); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-h h2, .h2 { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.hero-num { font-family: var(--sans); font-weight: 800; font-size: clamp(34px, 7vw, 52px); letter-spacing: -.04em; line-height: 1.02; font-variant-numeric: tabular-nums; }
.big-num { font-weight: 800; font-size: 26px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.section-title { font-family: var(--serif); font-size: 30px; line-height: 1.1; letter-spacing: -.01em; margin: 10px 0 2px; }
.section-title em { color: var(--accent); }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; text-decoration: none; border-top: 1px solid var(--line); min-width: 0; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; width: 100%; }
.li:first-child { border-top: 0; }
a.li:hover, button.li:hover { background: var(--card-2); }
.li .t { font-weight: 700; font-size: 14px; }
.li .s { color: var(--muted); font-size: 12.5px; }
.chev { color: var(--faint); width: 16px; height: 16px; flex: none; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--card-2); border-radius: var(--radius-s); min-width: 0; }
.stat .v { font-weight: 800; font-size: 19px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap; transition: transform .08s ease, background .15s; }
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--card-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 40%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--card-2); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 17px; height: 17px; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--card); flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.field small { color: var(--faint); font-size: 12px; }
.input, select.input, textarea.input { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); outline: none; font-weight: 600; font-size: 15px; }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.money { font-family: var(--mono); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 1px; flex: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 13px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); font-size: 13px; font-weight: 700; color: var(--muted); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.neg { background: var(--neg-soft); color: var(--neg); }
.pill svg { width: 12px; height: 12px; }
.toggle { position: relative; width: 46px; height: 28px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; margin: 0; }
.toggle i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: .2s; pointer-events: none; }
.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.toggle input:checked + i { background: var(--accent); }
.toggle input:checked + i::after { transform: translateX(18px); }
.toggle input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- icons, avatars ---------- */
.ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; color: #fff; }
.ic svg { width: 20px; height: 20px; }
.ic.sm { width: 32px; height: 32px; border-radius: 10px; }
.ic.sm svg { width: 16px; height: 16px; }
.ic.lg { width: 52px; height: 52px; border-radius: 16px; }
.ic.lg svg { width: 24px; height: 24px; }
.ic.soft { background: var(--accent-soft); color: var(--accent); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.xl { width: 72px; height: 72px; font-size: 26px; }

/* ---------- bars, rings, charts ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; position: relative; }
.card.soft .bar, .stat .bar { background: var(--line); }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--accent); }
.bar > i.warn { background: var(--warn); }
.bar > i.neg { background: var(--neg); }
.bar.thick { height: 12px; }
.card.accent .bar { background: rgba(255, 255, 255, .14); }
.card.accent .bar > i { background: #5eead4; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); font-size: 11px; fill: var(--faint); font-weight: 600; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .s1 { fill: var(--s1); }
.chart .s2 { fill: var(--s2); }
.chart .s3 { fill: var(--s3); }
.chart .l1 { stroke: var(--s1); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .l2 { stroke: var(--s2); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .l3 { stroke: var(--s3); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 5 4; }
.chart .area { fill: var(--s1); opacity: .12; }
.chart .cross { stroke: var(--line-2); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.s1 { background: var(--s1); } .legend i.s2 { background: var(--s2); } .legend i.s3 { background: var(--s3); }
.legend i.dash { height: 3px; border-radius: 2px; vertical-align: 3px; }
.tip { position: absolute; pointer-events: none; z-index: 5; background: var(--text); color: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.tip .num { font-weight: 500; }
.chart-wrap { position: relative; }
.gauge-wrap { position: relative; width: 100%; max-width: 260px; margin: 0 auto; }

/* ---------- sheets / modals ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(2, 5, 6, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0; padding: 8px 18px calc(20px + env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2, .8, .2, 1); border: 1px solid var(--line); }
.sheet-h { display: flex; align-items: center; gap: 12px; position: sticky; top: -8px; background: var(--card); padding: 14px 0 12px; z-index: 2; }
.sheet-h h3 { flex: 1; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.grabber { width: 40px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 4px auto 0; }
@media (min-width: 700px) { .overlay { align-items: center; padding: 24px; } .sheet { border-radius: 22px; padding-bottom: 22px; } .grabber { display: none; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; z-index: 99; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: up .2s ease; max-width: calc(100% - 32px); }
.toast.err { background: var(--neg); color: #fff; }
@media (min-width: 960px) { .toast { bottom: 28px; } }

/* ---------- misc ---------- */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-s); background: var(--accent-soft); font-size: 14px; }
.banner.warn { background: var(--warn-soft); }
.banner.neg { background: var(--neg-soft); }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--accent); }
.banner.warn svg { color: var(--warn); }
.banner.neg svg { color: var(--neg); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty .ic { margin: 0 auto 12px; }
.divider { height: 1px; background: var(--line); margin: 6px 0; }
.kbd-copy { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); border: 1px dashed var(--line-2); font-family: var(--mono); font-size: 13px; word-break: break-all; }
.kbd-copy .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paydetail { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 14px; align-items: center; }
.paydetail dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.paydetail dd { font-family: var(--mono); font-weight: 500; font-size: 15px; }
.letter { white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; background: var(--card-2); border-radius: 12px; padding: 16px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 800; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); }
.table td.num, .table th.num { text-align: right; }
.scroll-x { overflow-x: auto; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; padding: 6px 0 12px; }
.tl::before { content: ''; position: absolute; left: -20px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); }
.tl.neutral::before { border-color: var(--faint); }
.tl.warn::before { border-color: var(--warn); }
.tl.neg::before { border-color: var(--neg); }
.who { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .who { grid-template-columns: repeat(3, 1fr); } }
.who .card { padding: 16px; }
.who ul { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 13.5px; }
.who li { display: flex; gap: 8px; align-items: flex-start; }
.who li svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.who li.yes svg { color: var(--accent); }
.who li.no svg { color: var(--neg); }

/* ---------- auth / public ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(40% 35% at 15% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
  radial-gradient(35% 30% at 90% 20%, rgba(94, 234, 212, .10), transparent 70%), var(--bg); }
.auth-box { width: 100%; max-width: 440px; }
.auth h1 { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1.02; letter-spacing: -.015em; margin: 22px 0 8px; }
.auth h1 em { color: var(--accent); }
.public { min-height: 100vh; padding: 20px 16px 48px; background: radial-gradient(50% 30% at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%), var(--bg); }
.public .inner { max-width: 560px; margin: 0 auto; }
.public h1 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.05; letter-spacing: -.015em; }
.ref-code { font-family: var(--mono); font-size: 28px; font-weight: 500; letter-spacing: .06em; padding: 14px 18px; border-radius: 14px; background: var(--card-2); border: 2px dashed var(--accent); text-align: center; }
.footer-note { font-size: 12px; color: var(--faint); line-height: 1.6; }

/* ---------- print (letters → PDF) ---------- */
@media print {
  body { background: #fff; color: #000; }
  .side, .tabbar, .topbar, .no-print, .overlay .sheet-h, .btn { display: none !important; }
  .main { padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .overlay { position: static; background: none; backdrop-filter: none; display: block; }
  .sheet { max-height: none; overflow: visible; border: 0; padding: 0; max-width: none; }
  .print-letter { font-family: Georgia, serif; font-size: 12pt; line-height: 1.55; white-space: pre-wrap; color: #000; background: none; padding: 0; }
  body.printing-letter .shell { display: none; }
}
@media screen { .print-letter { display: none; } }

/* v0.2.0 — logos, receipts, cards, scanner */
.ic.logo { background: #fff; border: 1px solid var(--line); overflow: hidden; padding: 0; }
.ic.logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.ic.logo.sm img { padding: 4px; }
.rcpt-dot { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--accent); }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick a, .quick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 800; font-size: 13px; box-shadow: var(--shadow); }
.quick svg { width: 22px; height: 22px; color: var(--accent); }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.rcard { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow); min-width: 0; }
.rcard .thumb { aspect-ratio: 3 / 4; background: #f3f3f1 center top / cover no-repeat; position: relative; overflow: hidden; }
.rcard .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.rcard .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rcard .badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.scan-stage { position: relative; width: 100%; background: #111; border-radius: 14px; overflow: hidden; touch-action: none; user-select: none; }
.scan-stage canvas, .scan-stage img { width: 100%; height: auto; display: block; }
.scan-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scan-stage .h { fill: var(--accent); stroke: #fff; stroke-width: 3; cursor: grab; }
.scan-stage .q { fill: rgba(16, 185, 129, .14); stroke: #10b981; stroke-width: 2.5; }
.scan-result { max-height: 60vh; overflow: auto; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.scan-result img, .scan-result canvas { width: 100%; height: auto; display: block; }
.receipt-img { width: 100%; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: block; max-height: 78vh; object-fit: contain; }
.items-table input { height: 36px; font-size: 13.5px; padding: 0 8px; border-radius: 9px; }
.lcard { position: relative; border-radius: 18px; padding: 16px; min-height: 120px; color: #fff; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 8px 22px rgba(0, 0, 0, .18); border: 0; text-align: left; overflow: hidden; }
.lcard::after { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.barcode-box { background: #fff; color: #000; border-radius: 16px; padding: 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.barcode-box svg { width: 100%; max-width: 420px; height: auto; }
.barcode-box .num { font-size: 18px; letter-spacing: .12em; color: #000; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.sub-row .right { flex: none; }
@media (max-width: 760px) { .grid2 > .stack > a > .receipt-img { max-height: 55vh; } }
/* v0.3.0 — travel tax refund */
.tf-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.tf-list li::marker { color: var(--accent); font-weight: 800; }
.tf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tf-country { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.tf-country .grow { display: flex; flex-direction: column; min-width: 0; }
.tf-country:hover { background: var(--card-2); }
.tf-flag { font-size: 26px; line-height: 1; width: 34px; text-align: center; flex: none; }
.nowrap { white-space: nowrap; }
