/* TCG Vault. The "Vault" direction from mockups/c-vault.html, made real:
   charcoal with one blue, or the light register. Tokens first, then the
   shell, then each screen in the order you meet it. */
/* ────────────────────────────────────────────────────────────────────────
   C · VAULT
   Dark, cinematic, physical. You land in your vault: the stack on the desk
   that needs filing, and the shelf of boxes and decks your cards live in.
   Click a box to open it. Condensed type, charcoal, one blue accent.
   ──────────────────────────────────────────────────────────────────────── */
:root {
  /* Dark: charcoal, not black, with the same blue as light. The accent
   * tokens are still called brass from the first draft; only the values moved. */
  --bg: #0f1012;
  --bg-2: #15161a;
  --surface: #1b1c21;
  --surface-2: #24262c;
  --line: #2a2c33;
  --line-2: #393c45;
  --text: #f2f2f5;
  --text-2: #a7a9b0;
  --mute: #6f727a;
  --brass: #0a84ff;          /* fills: buttons, borders, rings */
  --brass-2: #6db3ff;        /* text on the page background */
  --brass-hover: #3d9bff;
  --brass-dim: rgba(10, 132, 255, .16);
  --alert: #ff6b5b;
  --good: #34c76a;
  --on-accent: #ffffff;      /* text on a filled accent button */
  --accent-deep: #0058b8;    /* the dark end of the avatar gradient */
  --glass: rgba(15, 16, 18, .82);     /* the sticky bars */
  --veil: rgba(5, 6, 8, .78);         /* behind the modal */
  --glow: rgba(10, 132, 255, .09);
  --W: #efe7c9; --U: #4f8fc9; --B: #8d80a3; --R: #cf6a4f; --G: #4f9a6c; --C: #a9a39a;
  --display: "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .3, 1);
}
/* Light: cool and clean, the Apple / Google register. Near-white grey ground,
 * white surfaces, one blue for the accent and green for "open" and "done".
 * The brass tokens keep their names so the rest of the sheet does not care. */
html.light .box, html.light .desk .card, html.light .desk .small .run { box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -16px rgba(0, 0, 0, .18); }
html.light .box { border-color: var(--line); }
html.light {
  --bg: #f5f5f7;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --line: #e5e6ea;
  --line-2: #d2d4da;
  --text: #1d1d1f;
  --text-2: #5f6368;
  --mute: #8e9196;
  --brass: #0a7aff;
  --brass-2: #0060d0;
  --brass-hover: #2b8dff;
  --brass-dim: rgba(10, 122, 255, .12);
  --on-accent: #ffffff;
  --accent-deep: #0050b0;
  --alert: #d93025;
  --good: #1e8e3e;
  --B: #6b5f7b;
  --glass: rgba(245, 245, 247, .82);
  --veil: rgba(30, 32, 36, .5);
  --glow: rgba(10, 122, 255, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--body); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input { font: inherit; color: inherit; }
a { color: var(--brass-2); }

.app.is-locked { overflow: hidden; }
.app { position: relative; container: app / inline-size; height: 100dvh; overflow: auto; background: var(--bg); }
.app::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 420px at 70% -10%, var(--glow), transparent 60%),
    radial-gradient(600px 300px at 10% 10%, rgba(255, 255, 255, .03), transparent 60%);
}
.app > * { position: relative; z-index: 1; }

/* ─── the account menu ─── */
.me { cursor: pointer; }
.menu {
  position: absolute; top: 58px; right: 24px; z-index: 40; width: 300px; padding: 8px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 30px 60px -24px #000, 0 0 0 1px rgba(0, 0, 0, .3); animation: up .2s var(--ease) both;
}
.menu__who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu__who .av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brass), var(--accent-deep)); color: var(--on-accent); display: grid; place-items: center; font: 600 14px var(--display); }
.menu__who b { display: block; font: 600 15px var(--display); }
.menu__who span { font-size: 12px; color: var(--mute); }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; color: var(--text); text-align: left; }
.menu__item:hover { background: var(--surface-2); }
.menu__item svg { width: 17px; height: 17px; stroke: var(--text-2); fill: none; stroke-width: 1.8; flex: 0 0 auto; }
.menu__k { margin-left: auto; font-size: 11.5px; color: var(--mute); }
.menu__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; font-size: 13.5px; }
.menu__out { border-top: 1px solid var(--line); margin-top: 6px; border-radius: 0 0 9px 9px; color: var(--text-2); }

/* ─── the import modal ─── */
.ibox { width: min(640px, 100%); max-height: 100%; overflow: auto; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line-2); padding: 20px 22px 22px; position: relative; animation: up .3s var(--ease) both; }
.ibox:focus { outline: none; }
.ibox .x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--text-2); }
.ibox h2.sec { margin-right: 44px; }
.ilead { color: var(--text-2); margin: -4px 0 18px; }
.istep { display: flex; gap: 12px; margin-bottom: 18px; }
.istep .n { flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--brass); color: var(--on-accent); display: grid; place-items: center; font: 600 12px var(--display); }
.istep > div { min-width: 0; flex: 1; }
.istep h4 { margin: 2px 0 8px; font: 600 15px var(--display); }
.ipeople { display: flex; gap: 6px; }
.ihint { font-size: 12px; color: var(--mute); margin: 8px 0 0; }
.idrop { display: flex; flex-direction: column; gap: 3px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.idrop:hover, .idrop.is-over { border-color: var(--brass); background: var(--brass-dim); }
.idrop.is-set { border-style: solid; }
.iwhat .muted { color: var(--mute); }
.icta button[disabled] { opacity: .45; cursor: default; }
.idrop b { font-family: var(--mono); font-weight: 500; }
.idrop span { font-size: 12px; color: var(--text-2); }
.iwhat { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.iwhat b { color: var(--text); font-weight: 500; }
.ichoice { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ichoice label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.ichoice label:has(:checked) { border-color: var(--brass); background: var(--brass-dim); }
.ichoice input { margin: 3px 0 0; accent-color: var(--brass); }
.ichoice b { display: block; font-size: 13.5px; }
.ichoice small { font-size: 12px; color: var(--text-2); }
.iscaffold { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--mute); margin: -2px 0 10px; }
.iscaffold .seg button { padding: 2px 8px; }
.diff { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.diff + .diff { margin-top: 8px; }
.diff summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface); font-size: 13px; }
.diff summary::-webkit-details-marker { display: none; }
.diff summary b { font-family: var(--mono); font-weight: 500; min-width: 22px; text-align: right; }
.diff summary .t { flex: 1; }
.diff summary .chev { color: var(--mute); transition: transform .2s; }
.diff[open] summary .chev { transform: rotate(90deg); }
.diff summary.add b { color: var(--good); } .diff summary.rem b { color: var(--alert); } .diff summary.mov b { color: var(--brass-2); } .diff summary.both b { color: var(--alert); }
.drow { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 12.5px; }
.drow .dq { font: 500 12.5px var(--mono); text-align: right; }
.drow .dq.up { color: var(--good); } .drow .dq.down { color: var(--alert); } .drow .dq.mv { color: var(--brass-2); }
.drow .dn small { display: block; color: var(--mute); font-size: 11px; }
.drow .dnote { font-size: 11px; color: var(--text-2); text-align: right; white-space: nowrap; }
.drow .dnote.keep { color: var(--alert); }
.drow .pick { display: flex; gap: 4px; }
.drow .pick button { font: 600 10.5px var(--display); letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-2); }
.drow .pick button.is-on { border-color: var(--brass); color: var(--brass-2); background: var(--brass-dim); }
.dsum { margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.dsum b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.icta { display: flex; gap: 8px; margin-top: 6px; }
.icta button { height: 38px; padding: 0 16px; border-radius: 10px; font: 600 12.5px var(--display); letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--text); }
.icta button.primary { background: var(--brass); color: var(--on-accent); border-color: var(--brass); }

/* ─── who's in view ─── */
.viewbar {
  position: sticky; top: 61px; z-index: 9; display: flex; align-items: center; gap: 10px;
  padding: 8px 36px; background: var(--glass); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.viewbar__k { font: 600 10.5px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
#people { display: flex; gap: 6px; flex-wrap: wrap; }
.person {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 4px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: 12.5px;
  transition: border-color .15s, background .15s, color .15s;
}
.person .av { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 600 10.5px var(--display); background: var(--surface-2); color: var(--text-2); }
.person.is-on { border-color: var(--brass); background: var(--brass-dim); color: var(--text); }
.person.is-on .av { background: var(--brass); color: var(--on-accent); }
.person .k { font: 11px var(--mono); color: var(--mute); }
/* the owner mark on a tile, shown only when more than one person is in view */
.own { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--brass); color: var(--on-accent); font: 600 9.5px var(--display); vertical-align: middle; }
.own[data-o="me"] { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line-2); }
.split { color: var(--text-2); font-size: 12px; }
.split b { font-family: var(--mono); font-weight: 500; color: var(--text); }
.split .own { margin: 0 3px 0 6px; width: 14px; height: 14px; font-size: 8.5px; }

/* ─── top bar ─── */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 26px;
  padding: 14px 36px; background: var(--glass); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.word { font: 600 18px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--brass-2); }
.word:hover { color: var(--brass-hover); }
.word small { color: var(--mute); font-weight: 400; letter-spacing: .1em; margin-left: 8px; font-size: 11px; }
.top nav { display: flex; gap: 4px; }
.top nav button { padding: 7px 12px; border-radius: 8px; color: var(--text-2); font: 500 13px var(--display); letter-spacing: .08em; text-transform: uppercase; }
.top nav button:hover { color: var(--text); background: var(--surface); }
.top nav button.is-on { color: var(--text); background: var(--surface-2); }
.top nav button .n { color: var(--alert); margin-left: 5px; font-family: var(--mono); font-size: 11px; }
.top .search {
  margin-left: auto; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  width: 300px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2);
}
.top .search:focus-within { border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-dim); }
.top .search svg { width: 15px; height: 15px; stroke: var(--mute); fill: none; stroke-width: 2; }
.top .search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; }
.top .search kbd { font: 10.5px var(--mono); color: var(--mute); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; }
.top .me { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brass), var(--accent-deep)); color: var(--on-accent); display: grid; place-items: center; font: 600 13px var(--display); }

.wrap { max-width: 1220px; margin: 0 auto; padding: 30px 36px 90px; }
h2.sec { font: 600 12px var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--mute); margin: 0 0 14px; display: flex; align-items: center; gap: 12px; }
h2.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ─── at a glance: the number, its trend, and four facts ─── */
.glance { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 38px; }
.glance .card { padding: 18px 22px 16px; min-height: 0; }
.glance__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.glance .lbl { font: 600 11px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.seg { display: inline-flex; gap: 2px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; }
.seg button { padding: 3px 9px; border-radius: 6px; font: 600 11px var(--display); letter-spacing: .08em; color: var(--text-2); }
.seg button:hover { color: var(--text); }
.seg button.is-on { background: var(--brass-dim); color: var(--brass-2); }
.glance__num { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.glance__num b { font: 600 38px/1 var(--display); letter-spacing: .01em; }
.delta { font: 500 12.5px var(--mono); padding: 3px 8px; border-radius: 6px; }
.delta.up { color: var(--good); background: rgba(52, 199, 106, .12); }
.delta.down { color: var(--alert); background: rgba(224, 104, 78, .12); }
.delta small { color: var(--mute); font: 11px var(--body); margin-left: 6px; }
.chart { position: relative; height: 118px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .grid text { fill: var(--mute); font: 10.5px var(--mono); }
.chart .axis text { fill: var(--mute); font: 10.5px var(--body); }
.chart .line { fill: none; stroke: var(--brass); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: 1; }
.chart .end { fill: var(--brass); stroke: var(--surface); stroke-width: 2; }
.chart .x { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--brass); stroke: var(--bg-2); stroke-width: 2; }
.chart .tip {
  position: absolute; pointer-events: none; display: none; transform: translate(-50%, calc(-100% - 10px));
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 9px;
  font: 11px var(--body); color: var(--text-2); white-space: nowrap; box-shadow: 0 10px 20px -12px #000;
}
.chart .tip b { display: block; font: 500 12.5px var(--mono); color: var(--text); }
.glance__foot { margin-top: 10px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 12px; color: var(--text-2); }
.glance__foot > span { white-space: nowrap; }
.glance__foot .mono { font-family: var(--mono); color: var(--text); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; height: 100%; }
.tile { padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; justify-content: center; text-align: left; }
.tile[data-i] { cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.tile[data-i]:hover { border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-dim); }
.tile[data-i] .s::after { content: " →"; color: var(--brass-2); }
.tile b { display: block; font: 600 22px/1.1 var(--display); margin: 5px 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile b.up { color: var(--good); } .tile b.down { color: var(--alert); }
.tile .split b { display: inline; font: 500 12px var(--mono); margin: 0; color: var(--text); }
.tile .s .split { white-space: normal; }
.tile .s { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── the desk: what needs you ─── */
.desk {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 38px;
}
.glance .card,
.desk .card {
  position: relative; overflow: hidden; border-radius: 16px; min-width: 0; border: 1px solid var(--line-2);
  background: linear-gradient(160deg, var(--surface-2), var(--bg-2)); padding: 26px 28px; min-height: 210px;
}
.desk .card h3 { font: 600 30px/1 var(--display); letter-spacing: .01em; margin: 0 0 6px; }
.desk .card h3 b { color: var(--brass-2); }
.desk .card p { color: var(--text-2); margin: 0 0 18px; max-width: 34ch; }
.desk .card .act {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px;
  background: var(--brass); color: var(--on-accent); font: 600 13px var(--display); letter-spacing: .08em; text-transform: uppercase;
}
.desk .card .act:hover { background: var(--brass-hover); }
.desk .card .act.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); margin-left: 6px; }
.fan { position: absolute; right: -10px; bottom: -60px; width: 300px; height: 260px; pointer-events: none; }
.fan img {
  position: absolute; left: 50%; bottom: 0; width: 120px; border-radius: 6px;
  transform-origin: 50% 120%; box-shadow: 0 20px 40px -14px rgba(0, 0, 0, .9);
  animation: fanin .8s var(--ease) both;
}
@keyframes fanin { from { opacity: 0; transform: translateX(-50%) rotate(0) translateY(30px); } }
.desk .small h3 { font-size: 22px; }
.desk .small .run { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); margin-top: 10px; min-width: 0; }
.desk .small .run > div { min-width: 0; }
.desk .small .run .k { font: 600 11px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.desk .small .run b { display: block; font: 600 18px var(--display); }
.desk .small .loan { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; border: 1px dashed var(--line-2); margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.desk .small .loan b { font-family: var(--mono); font-weight: 500; color: var(--text); }
.desk .small .run .go { margin-left: auto; color: var(--brass-2); font: 600 12px var(--display); letter-spacing: .1em; text-transform: uppercase; }

/* ─── the Collection tab's quick tiles ─── */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 600px; margin: 0 0 28px; }
.qt {
  min-height: 86px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.qt:hover { transform: translateY(-2px); border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-dim); }
.qt .lbl { font: 600 10.5px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.qt b { font: 600 22px/1.1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qt b.alert { color: var(--alert); }
.qt .s { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qt .s .up { color: var(--good); } .qt .s .down { color: var(--alert); }
/* the status modal: a Home section, moved in whole */
.qbox { width: min(920px, 100%); max-height: 100%; overflow: auto; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line-2); padding: 20px 22px 24px; animation: up .3s var(--ease) both; position: relative; }
.qbox:focus { outline: none; }
.qbox .x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--text-2); }
.qbox h2.sec { margin-right: 44px; }
#qhost { display: block; }
#qhost > .card { min-height: 0; }
#qhost .glance__num b { font-size: 34px; }

/* ─── the shelf ─── */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 16px; margin-bottom: 40px; }
/* A box is two parts: the body (face, label, name) and a footer strip with the
 * numbers. The strip is the same width as the box so the badge has a home. */
.box {
  position: relative; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  text-align: left; display: flex; flex-direction: column; min-width: 0; overflow: hidden; padding: 0;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 30px -24px #000;
}
.box:hover { transform: translateY(-3px); border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-dim), 0 24px 40px -24px #000; }
/* Every box is as tall as a deck box: the face is 56 x 78, plus padding. */
.box__body { display: flex; gap: 12px; align-items: flex-start; padding: 14px; flex: 1; min-height: 106px; }
.box__text { min-width: 0; flex: 1; }
.box .lbl { font: 600 11px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.box .name { font: 600 17px/1.15 var(--display); margin: 4px 0 0; letter-spacing: .01em; }
.box .foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 9px 14px; font-size: 12.5px; color: var(--text-2);
  background: var(--surface-2); border-top: 1px solid var(--line);
}
.box .foot > span { white-space: nowrap; }
.box .foot b { font-family: var(--mono); color: var(--text); font-weight: 500; }
.box .foot .st { margin-left: auto; font: 600 10.5px var(--display); letter-spacing: .12em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; }
.box .foot .st.complete { color: var(--good); border: 1px solid rgba(52, 199, 106, .45); }
.box .foot .st.planning { color: var(--mute); border: 1px solid var(--line-2); }
.box .foot .st.available { color: var(--good); border: 1px solid rgba(52, 199, 106, .45); }
/* A real card: 63 x 88. Sized by width so it never stretches to the box. */
.box--deck .face { flex: 0 0 56px; aspect-ratio: 63 / 88; border-radius: 4.5% / 3.3%; overflow: hidden; background: var(--surface-2); box-shadow: 0 8px 16px -8px #000; }
.box--deck .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.box--deck .face.empty { display: grid; place-items: center; color: var(--mute); font: 600 22px var(--display); border: 1px dashed var(--line-2); }
/* The stack fills the same 78px the deck face does, fanned slightly. */
.box--bulk .stack { position: relative; flex: 0 0 74px; height: 78px; order: 2; }
.box--bulk .stack img { position: absolute; width: 52px; border-radius: 4px; box-shadow: 0 6px 12px -6px #000; }
.box--bulk .stack img:nth-child(1) { left: 0; top: 6px; transform: rotate(-9deg); }
.box--bulk .stack img:nth-child(2) { left: 10px; top: 3px; transform: rotate(2deg); }
.box--bulk .stack img:nth-child(3) { left: 20px; top: 0; transform: rotate(11deg); }
.box--all { border-color: var(--brass); background: linear-gradient(160deg, var(--brass-dim), var(--surface) 70%); }
.box--all .foot .st.all { color: var(--brass-2); border: 1px solid var(--brass); }
.box--new { border-style: dashed; align-items: center; justify-content: center; min-height: 128px; color: var(--mute); font: 600 13px var(--display); letter-spacing: .12em; text-transform: uppercase; }

/* ─── inside a box: the grid ─── */
.inside { display: none; }
.inside.is-on { display: block; }
.crumb { display: flex; align-items: center; gap: 10px; color: var(--mute); font: 600 12px var(--display); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.crumb button { color: var(--brass-2); }
.inside h1 { font: 600 38px/1 var(--display); margin: 0 0 4px; letter-spacing: .01em; }
.inside .meta { color: var(--text-2); margin: 0 0 20px; }
.inside .meta b { font-family: var(--mono); color: var(--text); font-weight: 500; }
.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pill { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.pill:hover { border-color: var(--text-2); color: var(--text); }
.pill.is-on { background: var(--brass-dim); border-color: var(--brass); color: var(--brass-2); }
.pill .dot { width: 10px; height: 10px; border-radius: 50%; }
.bar .sp { flex: 1; }
.bar .more { color: var(--mute); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
/* A card tile is the shelf box again: the picture, then a strip of facts. */
.c {
  position: relative; border-radius: 10px; overflow: hidden; background: var(--surface); border: 1px solid var(--line-2);
  display: flex; flex-direction: column; min-width: 0;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; animation: up .45s var(--ease) both;
}
.c:hover { transform: translateY(-3px); border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-dim), 0 24px 40px -24px #000; z-index: 2; }
.c__img { position: relative; aspect-ratio: 63 / 88; background: var(--surface-2); }
.c__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c .f { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 240, 200, .18) 45%, transparent 60%); pointer-events: none; }
.c__foot {
  padding: 6px 8px 7px; background: var(--surface-2); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; font-size: 11px; color: var(--text-2);
}
.c__foot .set { font: 600 10.5px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.c__foot .qty { font: 500 11px var(--mono); color: var(--text); text-align: right; }
.c__foot .val { font: 500 12px var(--mono); color: var(--text); }
.c__foot .trend { font: 500 11px var(--mono); text-align: right; }
.c__foot .trend.up { color: var(--good); }
.c__foot .trend.down { color: var(--alert); }
.c__foot .trend.flat { color: var(--mute); }
.dots { display: inline-flex; gap: 2px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(128, 128, 128, .35); }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

/* ─── card modal ─── */
/* Fixed, so it covers the viewport however far the list is scrolled. In the
 * phone frame the transform on .app makes "fixed" mean "the frame" instead. */
.modal { position: fixed; inset: 0; z-index: 30; background: var(--veil); backdrop-filter: blur(8px); display: none; place-items: center; padding: 24px; }
.modal.is-on { display: grid; }
.mbox {
  width: min(880px, 100%); max-height: 100%; overflow: auto; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line-2);
  display: grid; grid-template-columns: 300px 1fr; gap: 0; animation: up .3s var(--ease) both;
}
.mbox .art { padding: 26px; background: radial-gradient(400px 300px at 50% 30%, var(--brass-dim), transparent 70%); display: flex; align-items: flex-start; justify-content: center; }
.mbox .art img { width: 100%; border-radius: 5% / 3.6%; box-shadow: 0 30px 60px -20px #000; }
.mbox .info { padding: 26px 28px 26px 8px; }
.mbox:focus { outline: none; }
.mbox .x { position: sticky; top: 0; float: right; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--text-2); }
.mbox h1 { font: 600 32px/1.05 var(--display); margin: 0 0 4px; letter-spacing: .01em; }
.mbox .type { color: var(--text-2); margin: 0 0 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mbox .rules { font-size: 14px; white-space: pre-line; color: var(--text); margin: 0 0 18px; }
.mbox h4 { font: 600 11px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--mute); margin: 18px 0 8px; }
.mbox .kv { display: grid; grid-template-columns: auto auto auto; gap: 14px; }
.mbox .kv div { font-size: 13px; color: var(--text-2); }
.mbox .kv div b { display: block; font: 500 15px var(--mono); color: var(--text); }
.mbox .vhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mbox .vhead h4 { margin: 0; }
.mbox .chart { height: 96px; margin-top: 8px; }
.mbox .vfoot { margin-top: 8px; font-size: 12px; color: var(--text-2); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.mbox .vfoot > span { white-space: nowrap; }
.mbox .vfoot .mono { font-family: var(--mono); color: var(--text); }
.mbox .vfoot .up { color: var(--good); } .mbox .vfoot .down { color: var(--alert); }
.mbox .where { display: flex; flex-direction: column; gap: 6px; }
.mbox .where div { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); }
.mbox .where b { font: 500 14px var(--mono); width: 32px; }
.mbox .where .st { margin-left: auto; font: 600 10.5px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--good); }
.mbox .where .st.alert { color: var(--alert); }
.mbox .cta { display: flex; gap: 8px; margin-top: 20px; }
.mbox .cta button { height: 38px; padding: 0 16px; border-radius: 10px; font: 600 12.5px var(--display); letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--text); }
.mbox .cta button.primary { background: var(--brass); color: var(--on-accent); border-color: var(--brass); }
.pips { display: inline-flex; gap: 2px; vertical-align: middle; }
.pip { width: 17px; height: 17px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 9.5px var(--body); color: #1c1a15; border: 1px solid rgba(128, 128, 128, .3); }
.pip[data-c="W"] { background: var(--W); } .pip[data-c="U"] { background: var(--U); color: #fff; }
.pip[data-c="B"] { background: var(--B); color: #fff; } .pip[data-c="R"] { background: var(--R); color: #fff; }
.pip[data-c="G"] { background: var(--G); color: #fff; } .pip[data-c="C"], .pip[data-c="N"] { background: var(--C); }

/* ─── bottom tabs (phone) ─── */
.tabs { display: none; }

@container app (max-width: 760px) {
  .top { padding: 12px 16px; gap: 12px; }
  .top nav { display: none; }
  .top .search { width: auto; flex: 1; }
  .top .search kbd { display: none; }
  .viewbar { top: 57px; padding: 7px 16px; }
  .menu { top: auto; bottom: 0; left: 0; right: 0; width: auto; border-radius: 18px 18px 0 0; padding: 10px 12px 18px; }
  .ibox { border-radius: 22px 22px 0 0; max-height: 92%; padding: 18px 16px 24px; }
  .wrap { padding: 20px 16px 90px; }
  .glance { grid-template-columns: 1fr; gap: 12px; }
  .glance__num b { font-size: 30px; }
  .chart { height: 96px; }
  .desk { grid-template-columns: 1fr; }
  .desk .card { padding: 20px; min-height: 0; }
  .desk .card h3 { font-size: 24px; }
  .fan { width: 200px; height: 170px; right: -70px; bottom: -80px; opacity: .45; }
  .fan img { width: 90px; }
  .desk .card .act { position: relative; z-index: 1; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quick { gap: 8px; margin-bottom: 20px; }
  .qt { min-height: 92px; padding: 10px 11px; }
  .qt b { font-size: 19px; }
  .qbox { border-radius: 22px 22px 0 0; max-height: 92%; padding: 18px 16px 24px; }
  .box__body { padding: 12px; gap: 10px; min-height: 88px; }
  .box .foot { padding: 8px 10px; gap: 4px 7px; font-size: 11.5px; }
  .box .foot .st { padding: 2px 5px; font-size: 10px; letter-spacing: .08em; }
  .box--deck .face { flex-basis: 46px; }
  .box--bulk .stack { display: none; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .inside h1 { font-size: 28px; }
  .modal { padding: 0; align-items: end; }
  .mbox { grid-template-columns: 1fr; border-radius: 22px 22px 0 0; max-height: 92%; }
  .mbox .art { padding: 20px 60px 0; }
  .mbox .info { padding: 16px 20px 30px; }
  .tabs {
    position: sticky; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--glass); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 8px 4px 12px;
  }
  .tabs button { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 600 10px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
  .tabs button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
  .tabs button.is-on { color: var(--brass-2); }
  .tabs button { position: relative; }
  .tabs button .n { position: absolute; top: -2px; right: 18%; min-width: 15px; height: 15px; border-radius: 8px; background: var(--alert); color: #fff; font: 600 10px/15px var(--mono); font-style: normal; }
}


/* ─── sign in ─── */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.gate__card { width: min(370px, 100%); display: grid; gap: 14px; padding: 30px 28px 24px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 18px; }
.gate__sub { margin: -4px 0 4px; text-align: center; color: var(--text-2); }
.gate .field { display: grid; gap: 5px; }
.gate .field span { font: 600 10.5px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.gate input { height: 38px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
.gate input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-dim); }
.gate button.primary { height: 40px; border-radius: 10px; background: var(--brass); color: var(--on-accent); font: 600 12.5px var(--display); letter-spacing: .1em; text-transform: uppercase; }
.gate button[disabled] { opacity: .5; }
.gate__error { margin: 0; padding: 8px 11px; border-radius: 8px; background: rgba(255, 107, 91, .1); border: 1px solid rgba(255, 107, 91, .4); color: var(--alert); font-size: 12.5px; }
.gate__foot { margin: 2px 0 0; text-align: center; color: var(--mute); font-size: 12px; }

/* ─── things the real app has that the mockup did not ─── */
.chart { position: relative; }
.chart__note { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 0 24px; color: var(--mute); font-size: 12.5px; }
.chart__note:empty { display: none; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60; padding: 10px 16px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); font-size: 13px; box-shadow: 0 20px 40px -20px #000; animation: up .2s var(--ease) both; }
.me { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brass), var(--accent-deep)); color: var(--on-accent); display: grid; place-items: center; font: 600 14px var(--display); }
[data-soon] { opacity: .55; }
.person[disabled] { opacity: .5; cursor: default; }
.empty { padding: 22px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--mute); text-align: center; }
.more-row { display: flex; justify-content: center; margin: 18px 0 40px; }
.more-row button { height: 36px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); font: 600 12px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.iresult { margin-top: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(52, 199, 106, .45); color: var(--text); font-size: 13px; }
.iresult b { font-family: var(--mono); font-weight: 500; }
.ierr { color: var(--alert); }
.busy { opacity: .6; pointer-events: none; }

/* Installed on a phone there is no browser chrome, so the bottom tabs sit
   against the gesture area unless they make room for it. */
.tabs { padding-bottom: env(safe-area-inset-bottom); }
