/* Resale design system as code: tokens, shell, page shape, components. Used by Money, Returns, Batches. */
:root {
  --page: #000; --surface: #0C0C10; --raised: #15151B; --hover: #1B1B23; --sunk: #07070A;
  --line: rgba(255,255,255,.07); --line-strong: rgba(255,255,255,.14);
  --text: #F3F3F6; --muted: #8E8E9C; --faint: #55555F;
  --accent: #6667AB; --accent-ink: #A5A6F6; --accent-soft: rgba(102,103,171,.18);
  --good: #46D39A; --bad: #FF6B6B; --warn: #F2B84B;
  --sans: "Geist", "Segoe UI", system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, monospace; --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font: 13px/1.45 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .mono { font-family: var(--mono); font-size: 11.5px; } .grow { flex: 1; }
.up { color: var(--good); } .down { color: var(--bad); }

/* shell */
.app { display: grid; grid-template-columns: 64px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0; border-right: 1px solid var(--line); }
.mark { width: 34px; height: 34px; margin-bottom: 14px; display: grid; place-items: center; }
.nav { width: 42px; height: 42px; border-radius: 12px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.nav:hover { background: var(--raised); color: var(--text); }
.nav[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.nav svg { width: 20px; height: 20px; }
.rail .spacer { flex: 1; }
.env { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10.5px; font-weight: 600; color: var(--warn); padding: 8px 3px; border: 1px solid rgba(242,184,75,.35); border-radius: 7px; }
a.nav, a.mark, a.env { text-decoration: none; }
.wrap { max-width: 1344px; width: 100%; margin: 0 auto; padding: 0 32px 80px; min-width: 0; }
.wrap > * { min-width: 0; }
.loading body::after { content: "Loading your sheet\2026"; position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 70; padding: 8px 14px; border-radius: 10px; background: #15151B; border: 1px solid rgba(255,255,255,.14); color: #8E8E9C; font: 12.5px Geist, system-ui, sans-serif; }

/* page shape */
.phead { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px; padding: 30px 0 20px; }
.ph-name { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.ph-line { margin: 0; font: 400 clamp(26px, 2.6vw, 36px)/1.15 var(--serif); letter-spacing: -.015em; max-width: 32ch; text-wrap: balance; }
.figs { display: flex; gap: 28px; }
.figs div { font-size: 12px; color: var(--muted); text-align: right; }
.figs b { display: block; font-size: 20px; font-weight: 300; color: var(--text); letter-spacing: -.03em; margin-bottom: 2px; }
.ph-tools { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; }
.tabs button { border: 0; background: none; padding: 12px 11px 11px; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--accent-ink); }
.tabs button b { font-weight: 400; color: var(--faint); margin-left: 5px; }

/* components */
.card { background: var(--surface); border-radius: 18px; padding: 18px; }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 500; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.btn { border: 0; border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 500; background: var(--accent); color: #fff; white-space: nowrap; }
.btn.quiet { background: var(--raised); color: var(--text); font-weight: 400; }
.btn:hover { filter: brightness(1.12); } .btn:disabled { opacity: .55; cursor: default; filter: none; }
.st { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.st i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.c-good { background: var(--good); } .c-bad { background: var(--bad); } .c-warn { background: var(--warn); } .c-acc { background: var(--accent-ink); } .c-faint { background: var(--faint); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 10px 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:hover td { background: var(--hover); }
th.num, td.num { text-align: right; }
.empty { padding: 28px 10px; color: var(--muted); text-align: center; }
.thumb { width: 30px; height: 36px; border-radius: 6px; background: var(--raised); overflow: hidden; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; z-index: 50; padding: 10px 16px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line-strong); transition: opacity .2s, transform .2s; max-width: 92vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
label.f { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; }
select, input[type=number], input[type=text] { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--sunk); width: 100%; outline: none; }
select:focus, input:focus { border-color: var(--accent-ink); }
.check { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.tl { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line-strong); }
.tl li { position: relative; padding: 0 0 10px 8px; font-size: 12.5px; color: var(--muted); }
.tl li b { color: var(--text); font-weight: 500; }
.tl li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-ink); }
.tl li.now::before { background: var(--warn); box-shadow: 0 0 0 4px rgba(242,184,75,.15); }
.tl li.end::before { background: var(--good); }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(12,12,16,.95); backdrop-filter: blur(12px); border-right: 0; border-top: 1px solid var(--line); z-index: 20; }
  .rail .mark, .rail .spacer, .env { display: none; }
  .wrap { padding: 0 16px 100px; }
  .phead { grid-template-columns: 1fr; gap: 14px; padding-top: 20px; } .figs div { text-align: left; }
  .ph-tools { flex-wrap: nowrap; overflow-x: auto; } .ph-tools > * { flex: none; }
  .hide-s { display: none; } .scrollx { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
