/* Agentry: the roster. Cool porcelain canvas, indigo-black ink, one violet, and a citron node that marks live things.
   Core: tokens, type, header/footer, buttons, forms, chips, roster cards (.ticket), reports (.slip), empty states, motion helpers.
   Page styles live in /css/home.css, /css/pages.css and /css/work.css. See docs/DESIGN.md. */
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Spline Sans Mono"; src: url("/fonts/spline-mono.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }

:root {
  --bg: #f4f4f8;
  --bg-2: #eaeaf1;
  --surface: #ffffff;
  --ink: #15142b;
  --ink-2: #3d3c57;
  --muted: #6c6b85;
  --line: #dcdce7;
  --line-2: #c9c9d8;
  --violet: #4b3af0;
  --violet-ink: #3527c4;
  --violet-soft: #e9e6ff;
  --citron: #d8f34a;
  --night: #15142b;
  --night-2: #1f1e3a;
  --night-line: rgba(241, 240, 251, 0.12);
  --night-ink: #f1f0fb;
  --night-dim: rgba(241, 240, 251, 0.62);
  --good: #13865f;
  --bad: #d2453a;
  --star: #b9770e;
  /* categories */
  --c-research: #2f5fd0;
  --c-trading: #e2662d;
  --c-markets: #7a3fd0;
  --c-onchain: #0e8f73;
  --c-content: #cf3b7d;
  /* legacy names still used by page stylesheets, mapped onto the new palette */
  --paper: var(--bg);
  --paper-2: var(--bg-2);
  --paper-3: #dfdfea;
  --card: var(--surface);
  --line-soft: #e8e8f0;
  --stamp: var(--violet);
  --stamp-ink: var(--violet-ink);
  --green: var(--good);
  --ochre: var(--star);
  --board: var(--night);
  --board-2: var(--night-2);
  --board-line: var(--night-line);
  --board-ink: var(--night-ink);
  --board-dim: var(--night-dim);
  --flap: var(--citron);
  --r: 14px;
  --shadow: 0 1px 2px rgba(21, 20, 43, 0.06), 0 12px 32px -18px rgba(21, 20, 43, 0.28);
  --shadow-lift: 0 2px 4px rgba(21, 20, 43, 0.06), 0 22px 40px -18px rgba(21, 20, 43, 0.38);
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "Cascadia Mono", monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --perf: radial-gradient(circle at 7px 0, transparent 4.5px, #000 5px) 0 0 / 14px 100% repeat-x;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100svh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.04; margin: 0; letter-spacing: -0.03em; text-wrap: balance; font-weight: 800; }
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.2rem); }
h3 { font-size: 1.1rem; letter-spacing: -0.015em; font-weight: 750; }
h1 em, h2 em, h3 em { font-style: italic; font-weight: 700; }
p { margin: 0 0 0.8em; }
.h-mid { font-size: clamp(1.6rem, 4.6vw, 2.5rem); }
.h-small { font: 500 0.72rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); margin: 1.8rem 0 0.7rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.85em; }
.num-tab { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--citron); color: var(--ink); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 0.7rem/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet-ink); margin: 0 0 0.8rem; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--citron); box-shadow: 0 0 0 1.5px var(--ink); flex: none; }
.lede { font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--ink-2); max-width: 38rem; text-wrap: pretty; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.6em; min-height: 46px; padding: 0.6em 1.3em;
  border: 1.5px solid var(--violet); border-radius: 999px; background: var(--violet); color: #fff;
  font-weight: 700; letter-spacing: -0.005em; text-decoration: none; cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.18s, box-shadow 0.18s, color 0.18s, border-color 0.18s;
  box-shadow: 0 1px 2px rgba(21, 20, 43, 0.12), 0 8px 18px -10px rgba(75, 58, 240, 0.7); touch-action: manipulation; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); background: var(--violet-ink); border-color: var(--violet-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { background: transparent; color: var(--muted); border-color: var(--line-2); cursor: not-allowed; box-shadow: none; transform: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: none; }
.btn-ghost:hover { background: var(--bg-2); border-color: var(--ink-2); color: var(--ink); }
.btn-small { min-height: 38px; padding: 0.35em 1em; font-size: 0.88rem; }
.btn-big { min-height: 54px; padding: 0.7em 1.6em; font-size: 1.04rem; }
.btn-block { width: 100%; }
.btn-invert { background: #fff; color: var(--ink); border-color: #fff; box-shadow: none; }
.btn-invert:hover { background: var(--citron); border-color: var(--citron); color: var(--ink); }
.btn-citron { background: var(--citron); color: var(--ink); border-color: var(--citron); box-shadow: none; }
.btn-citron:hover { background: #e6fb6a; border-color: #e6fb6a; color: var(--ink); }
.btn-stamp, .btn-send { background: var(--violet); border-color: var(--violet); }
.btn-send { justify-content: space-between; }
.btn-price { font: 500 0.86rem var(--mono); background: rgba(255, 255, 255, 0.2); padding: 0.15em 0.65em; border-radius: 999px; }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.link-arrow { font-weight: 700; text-decoration: none; color: var(--violet-ink); background: linear-gradient(var(--citron), var(--citron)) 0 100% / 100% 3px no-repeat; padding-bottom: 2px; transition: background-size 0.2s var(--ease); }
.link-arrow:hover { background-size: 100% 100%; }
.link-arrow::after { content: " →"; display: inline-block; transition: transform 0.2s var(--ease); }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(244, 244, 248, 0.86); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 850; font-size: 1.28rem; letter-spacing: -0.04em; }
.brand .mark { width: 34px; height: 34px; transition: transform 0.3s var(--spring); }
.brand:hover .mark { transform: rotate(-8deg); }
.nav { display: flex; gap: 4px; margin: 0 auto; padding: 4px; border-radius: 999px; background: var(--bg-2); }
.nav a { position: relative; text-decoration: none; padding: 7px 16px; border-radius: 999px; font-weight: 650; font-size: 0.95rem; color: var(--ink-2); transition: background-color 0.15s, color 0.15s; }
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.7); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(21, 20, 43, 0.1); }
.nav a[aria-current="page"]::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--citron); box-shadow: 0 0 0 1.5px var(--ink); margin-right: 8px; vertical-align: 1px; }
.me { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.balance { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 6px 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; transition: border-color 0.15s, background-color 0.15s; }
.balance::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--citron); box-shadow: 0 0 0 1.5px var(--ink); flex: none; }
.balance:hover { border-color: var(--ink-2); }
.cr { font: 500 0.92rem var(--mono); font-variant-numeric: tabular-nums; }
.cr-u { color: var(--muted); }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--violet); color: #fff; font-weight: 800; flex: none; }
.avatar-xl { width: 76px; height: 76px; font-size: 2rem; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 999px; }
.menu summary::-webkit-details-marker { display: none; }
.menu-guest { display: none; }
.burger, .burger::before, .burger::after { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; transition: transform 0.2s var(--ease); }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; } .burger::after { top: 6px; }
.menu[open] .burger { background: transparent; }
.menu[open] .burger::before { transform: translateY(6px) rotate(45deg); }
.menu[open] .burger::after { transform: translateY(-6px) rotate(-45deg); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 10px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lift); padding: 8px; min-width: 220px; display: grid; animation: pop 0.18s var(--ease); transform-origin: top right; }
.menu-pop a { padding: 11px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.menu-pop a:hover { background: var(--bg-2); }
.menu-who { margin: 4px 12px 6px; font: 500 0.76rem var(--mono); color: var(--muted); }
.menu-mobile { display: none; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.menu-guest .menu-mobile { border-top: 0; margin-top: 0; padding-top: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 36px 20px 88px; }
.wrap.wide { max-width: 1180px; }
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.page-head { position: relative; margin: 8px 0 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line-2); }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--citron); box-shadow: 0 0 0 1.5px var(--ink); }
.page-head .lede { margin: 14px 0 0; }
.section { margin-top: 80px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font: 500 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); margin-bottom: 14px; min-height: 32px; }
.back:hover { color: var(--violet-ink); }
.glyph { width: 28px; height: 28px; }
.glyph-s { width: 18px; height: 18px; }
.note { font-size: 0.88rem; color: var(--muted); margin: 10px 0 0; }
.badge { display: inline-block; font: 500 0.68rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line); }
.house { font-weight: 700; color: var(--violet-ink); }

/* ---------- footer: the night band ---------- */
.foot { position: relative; margin-top: 40px; background: var(--night); color: var(--night-ink); overflow: hidden; }
.foot-in { max-width: 1180px; margin: 0 auto; padding: 48px 20px 28px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 26px 32px; align-items: center; }
.foot-word { grid-column: 1 / -1; margin: 0 0 6px; font-weight: 900; font-size: clamp(4.4rem, 20vw, 17rem); line-height: 0.82; letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 1.5px rgba(241, 240, 251, 0.2); user-select: none; white-space: nowrap; text-align: center; }
.foot-brand { display: flex; gap: 14px; align-items: center; }
.foot-brand .mark { width: 44px; height: 44px; }
.foot-brand p { margin: 0; font-size: 0.95rem; color: var(--night-dim); }
.foot-brand strong { color: var(--night-ink); font-size: 1.1rem; letter-spacing: -0.02em; }
.foot-clock { justify-self: end; display: inline-flex; align-items: center; gap: 9px; font: 500 0.7rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--night-dim); }
.foot-clock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--citron); animation: node-pulse 2.4s ease-in-out infinite; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0 24px; padding-top: 18px; border-top: 1px solid var(--night-line); }
.foot-nav a { text-decoration: none; color: rgba(241, 240, 251, 0.8); font-size: 0.97rem; padding: 10px 0; transition: color 0.15s; }
.foot-nav a:hover { color: var(--citron); }
.foot-in > .x-btn { justify-self: end; margin-top: 18px; }
.x-btn { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--night-ink); color: var(--night); transition: transform 0.2s var(--spring); }
.x-btn svg { width: 18px; height: 18px; }
.x-btn.x-top { width: 38px; height: 38px; background: transparent; color: var(--ink); border: 1.5px solid var(--line-2); }
.x-btn.x-top svg { width: 15px; height: 15px; }
.x-btn:hover { transform: rotate(-8deg) scale(1.06); }
@keyframes node-pulse { 50% { opacity: 0.35; } }

/* ---------- forms ---------- */
input[type="text"], input[type="search"], input:not([type]), input[inputmode], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s; font-size: 16px;
}
select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2315142b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 14px center / 12px 8px no-repeat; }
textarea { resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(75, 58, 240, 0.16); }
input::placeholder, textarea::placeholder { color: #9594ab; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.75; cursor: default; }
.mono-input { font: 0.9rem/1.55 var(--mono); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, fieldset legend { font-weight: 700; font-size: 0.92rem; }
.opt { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.hint { color: var(--muted); font-size: 0.8rem; }
.form-error { color: #a8302a; background: rgba(210, 69, 58, 0.08); border-left: 3px solid var(--bad); border-radius: 8px; padding: 10px 12px; font-size: 0.92rem; margin: 0 0 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 650; font-size: 0.92rem; min-height: 40px; }
.switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background-color 0.2s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.22s var(--spring); }
.switch input:checked { background: var(--violet); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line-2); text-decoration: none; font-weight: 650; font-size: 0.92rem; background: var(--surface); transition: border-color 0.15s, transform 0.15s var(--ease), background-color 0.15s; }
.chip span { font: 500 0.72rem var(--mono); color: var(--muted); }
.chip:hover { border-color: var(--ink); transform: translateY(-1px); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on span { color: var(--citron); }

/* ---------- roster cards (agent cards, .ticket) ----------
   A white card with a folder tab on its top-left edge carrying the roster number, a portrait tile in the category colour,
   name, tagline, price, rating and runs. */
.rack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 20px; padding-top: 14px; }
.ticket {
  --cat: var(--c-research);
  position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 176px; padding: 20px 20px 16px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
.ticket:hover, .ticket:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line-2); }
.rc-tab {
  position: absolute; left: 16px; bottom: 100%; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; font: 500 0.66rem/1 var(--mono); letter-spacing: 0.06em; color: var(--ink-2);
  transition: transform 0.25s var(--ease); white-space: nowrap;
}
.rc-tab::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cat); flex: none; }
.ticket:hover .rc-tab, .ticket:focus-visible .rc-tab { transform: translateY(-2px); }
.is-pick .rc-tab::before { background: var(--citron); box-shadow: 0 0 0 1.5px var(--ink); }
.rc-top { display: flex; gap: 14px; align-items: center; min-width: 0; }
.rc-portrait { position: relative; display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 14px; background: var(--cat); color: #fff; overflow: hidden; transition: transform 0.3s var(--spring); }
.rc-portrait::before { content: ""; position: absolute; inset: 0; background: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.4px) 0 0 / 8px 8px; opacity: 0.7; pointer-events: none; }
.ticket:hover .rc-portrait { transform: rotate(-4deg) scale(1.04); }
.rc-id { min-width: 0; flex: 1; }
.rc-id h3 { font-size: 1.14rem; overflow-wrap: anywhere; }
.rc-by { display: block; font-size: 0.82rem; margin-top: 3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-price { flex: none; align-self: flex-start; font: 600 1.15rem/1 var(--mono); font-variant-numeric: tabular-nums; padding: 7px 10px; border-radius: 999px; background: var(--violet-soft); color: var(--violet-ink); }
.rc-price small { font-size: 0.66rem; font-weight: 500; margin-left: 2px; letter-spacing: 0.04em; }
.ticket > p { color: var(--ink-2); font-size: 0.93rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-meta { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.82rem; align-items: center; }
.rc-cat { display: inline-flex; align-items: center; gap: 6px; font: 500 0.66rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.rc-cat i { width: 8px; height: 8px; border-radius: 2px; background: var(--cat); }
.ticket-go { margin-left: auto; font-weight: 700; color: var(--violet-ink); opacity: 0; transform: translateX(-6px); transition: opacity 0.2s, transform 0.2s var(--ease); }
.ticket:hover .ticket-go, .ticket:focus-visible .ticket-go { opacity: 1; transform: none; }
@media (hover: none) { .ticket-go { opacity: 1; transform: none; } }
.stars { color: var(--star); font-weight: 700; white-space: nowrap; }
.stars .dim { color: var(--line-2); }
.cat-research { --cat: var(--c-research); } .cat-trading { --cat: var(--c-trading); } .cat-markets { --cat: var(--c-markets); } .cat-onchain { --cat: var(--c-onchain); } .cat-content { --cat: var(--c-content); }
.pick-stamp { font: 600 0.62rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); background: var(--citron); border-radius: 999px; padding: 4px 8px; }
/* legacy stub pieces (still used by a few page layouts) */
.ticket-stub { --cat: var(--c-research); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px 8px; background: var(--cat); color: #fff; border-radius: var(--r) 0 0 var(--r); }
.ticket-stub .glyph { width: 24px; height: 24px; }
.stub-price { font: 500 1.5rem/1 var(--mono); text-align: center; font-variant-numeric: tabular-nums; }
.stub-price small { display: block; font-size: 0.62rem; letter-spacing: 0.1em; opacity: 0.8; margin-top: 4px; text-transform: uppercase; }
.stub-cat { font: 500 0.58rem/1.25 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; text-align: center; opacity: 0.92; }
.ticket-body { position: relative; padding: 18px 20px 16px; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-radius: 0 var(--r) var(--r) 0; }

/* ---------- reports (run output, .slip) ----------
   A clean document card: header with agent, report number and status pill; the brief; tool steps on a wiring line; the report. */
.slip { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin: 12px 0; font-size: 0.97rem; overflow: hidden; }
.slip-head { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 16px 22px; background: var(--bg); border-bottom: 1px solid var(--line); }
.slip-no { order: 2; font: 500 0.7rem var(--mono); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.slip-agent { order: 1; font-weight: 800; letter-spacing: -0.02em; font-size: 1.05rem; }
.slip-head .stamp { order: 3; margin-left: auto; }
/* status pill; the citron node marks a live report */
.stamp { position: relative; display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font: 600 0.66rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 7px 12px 7px 10px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.stamp::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.stamp-done { background: #e1f4ec; color: var(--good); }
.stamp-failed { background: #fbe6e3; color: #b3372d; }
.stamp-running { background: var(--night); color: #fff; }
.stamp-running::before { background: var(--citron); animation: node-pulse 1.2s ease-in-out infinite; }
.stamp-s { margin-left: 0; padding: 5px 9px 5px 8px; font-size: 0.6rem; }
.stamp-big { margin: 0 0 14px; font-size: 0.78rem; padding: 10px 16px 10px 14px; }
.stamp.thump { animation: pop-in 0.4s var(--ease); }
@keyframes pop-in { 0% { transform: scale(0.8); opacity: 0.2; } 100% { transform: none; opacity: 1; } }
.slip-inputs { margin: 0; padding: 16px 22px 4px; display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 6px 16px; font: 400 0.82rem/1.45 var(--mono); }
.slip-inputs:empty { display: none; }
.slip-inputs div { display: contents; }
.slip-inputs dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.68rem; padding-top: 2px; }
.slip-inputs dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; max-height: 8.5em; overflow: hidden; }
/* tool steps: a vertical wiring line with a node per step */
.slip-log { list-style: none; margin: 0; padding: 14px 22px 6px; display: grid; gap: 0; font: 400 0.82rem var(--mono); }
.slip-log[hidden] { display: none; }
.slip-log li { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 0 0 12px 26px; animation: slide-in 0.3s var(--ease); }
.slip-log li::before { content: ""; position: absolute; left: 0; top: 0.28em; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); z-index: 1; }
.slip-log li::after { content: ""; position: absolute; left: 4px; top: calc(0.28em + 12px); bottom: -0.28em; width: 2px; background: var(--line-2); }
.slip-log li:last-child { padding-bottom: 8px; }
.slip-log li:last-child::after { display: none; }
.slip-log li.ok::before { background: var(--ink); }
.slip-log li.bad::before { border-color: var(--bad); background: var(--bad); }
.slip-log li.pending::before { background: var(--citron); animation: node-pulse 1s ease-in-out infinite; }
.log-tool { font-weight: 500; }
.log-arg { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.log-mark { color: var(--good); }
.slip-log li.bad .log-mark { color: var(--bad); }
.slip-log li.pending .log-mark { color: var(--muted); }
@keyframes slide-in { from { opacity: 0; transform: translateX(-6px); } }
.slip-body { padding: 18px 22px 22px; min-height: 1.5em; border-top: 1px solid var(--line); margin-top: 6px; }
.slip-body:empty { display: none; }
.slip-wait { margin: 6px 22px 0; padding: 16px 0 6px; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.slip-wait i { display: block; height: 10px; border-radius: 999px; background: var(--bg-2); transform-origin: 0 50%; animation: sw-write 1.6s var(--ease) infinite; }
.slip-wait i:nth-of-type(2) { width: 82%; animation-delay: 0.2s; }
.slip-wait i:nth-of-type(3) { width: 58%; animation-delay: 0.4s; }
.sw-label { display: inline-flex; align-items: center; gap: 8px; font: 500 0.68rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--violet-ink); }
.sw-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--citron); box-shadow: 0 0 0 1.5px var(--ink); animation: node-pulse 1.2s ease-in-out infinite; }
@keyframes sw-write { 0% { transform: scaleX(0); opacity: 0.4; } 60%, 100% { transform: scaleX(1); opacity: 1; } }
.rts { padding: 6px 0; }
.rts p { margin: 0; color: var(--ink-2); max-width: 32rem; }
.slip-foot { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; padding: 12px 22px; background: var(--bg); border-top: 1px solid var(--line); font: 400 0.72rem var(--mono); color: var(--muted); }
.slip-foot:empty { display: none; }
.slip-foot .sample-stamp { margin-left: auto; color: var(--violet-ink); background: var(--violet-soft); border-radius: 999px; padding: 3px 9px; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; }
.slip-share { display: flex; gap: 12px; align-items: center; padding: 12px 22px 16px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.cursor::after { content: ""; display: inline-block; width: 0.5em; height: 1em; background: var(--violet); border-radius: 1px; vertical-align: -0.12em; margin-left: 2px; animation: blink 0.9s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* preview band */
.pv-band { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 20px; background: var(--night); color: var(--night-ink); font: 400 0.8rem/1.4 var(--mono); text-align: center; }
.pv-band p { margin: 0; }
.pv-band strong { color: var(--citron); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.72rem; margin-right: 4px; }
.pv-ico { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--citron); animation: node-pulse 2s ease-in-out infinite; }
.pv-ico i { display: none; }
@media (max-width: 520px) { .pv-band { padding: 7px 14px; font-size: 0.72rem; justify-content: flex-start; text-align: left; } .pv-more { display: none; } }

/* markdown inside reports: made for reading */
.md { line-height: 1.65; color: var(--ink); }
.md h2, .md h3, .md h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 1.5em 0 0.5em; }
.md h2 { font-size: 1.2rem; padding-top: 0.2em; }
.md h3 { font-size: 1.05rem; }
.md h4 { font-size: 0.95rem; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md p, .md ul, .md ol { margin: 0 0 0.8em; }
.md ul, .md ol { padding-left: 1.35em; }
.md li { margin: 0.25em 0; }
.md li::marker { color: var(--violet); }
.md strong { font-weight: 700; }
.md code { font: 0.84em var(--mono); background: var(--bg-2); padding: 0.12em 0.4em; border-radius: 5px; overflow-wrap: anywhere; }
.md pre { background: var(--night); color: var(--night-ink); padding: 14px; border-radius: 10px; overflow-x: auto; }
.md pre code { background: none; padding: 0; color: inherit; }
.md blockquote { margin: 0 0 0.8em; padding: 2px 0 2px 14px; border-left: 3px solid var(--violet); color: var(--ink-2); }
.md a { color: var(--violet-ink); overflow-wrap: anywhere; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md-table { overflow-x: auto; margin: 0 0 1em; border: 1px solid var(--line); border-radius: 10px; }
.md table { border-collapse: collapse; font-size: 0.88rem; min-width: 100%; }
.md th, .md td { text-align: left; padding: 8px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md tr:last-child td { border-bottom: 0; }
.md th { font: 500 0.68rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--bg); }

/* ---------- empty states: an empty roster card ---------- */
.empty { position: relative; text-align: center; padding: 52px 20px 48px; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: rgba(255, 255, 255, 0.5); }
.empty svg { width: 190px; margin: 0 auto 18px; overflow: visible; }
.e-card { fill: var(--surface); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.e-back { fill: var(--bg-2); stroke: var(--line-2); stroke-width: 1.5; }
.e-tile { fill: var(--violet-soft); stroke: var(--violet); stroke-width: 1.5; }
.e-line { stroke: var(--line-2); stroke-width: 3; stroke-linecap: round; fill: none; }
.e-node { fill: var(--citron); stroke: var(--ink); stroke-width: 2; }
.e-wire { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 4; fill: none; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 30rem; margin: 0 auto 18px; }
.js .empty .e-float { animation: e-float 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes e-float { 50% { transform: translateY(-4px); } }
.empty-inline { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 20px; border: 1.5px dashed var(--line-2); border-radius: var(--r); }
.empty-inline p { margin: 0; }

/* ---------- loading skeleton ---------- */
.skel { display: block; height: 0.9em; border-radius: 999px; background: linear-gradient(90deg, var(--bg-2) 25%, var(--paper-3) 50%, var(--bg-2) 75%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 0.92rem; z-index: 40; animation: toast 0.25s var(--ease); max-width: calc(100vw - 32px); box-shadow: var(--shadow-lift); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }

/* scroll reveals: 14px rise + fade, staggered 60ms via --i (only when JS marks the page ready, so no-JS shows everything) */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .ticket.reveal.in { transition: opacity 0.6s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s; transition-delay: calc(var(--i, 0) * 60ms), 0s, 0s, 0s; }

/* Agent emblems (built-in agents) and desk badges. Drawn in src/art.ts. */
.emblem { width: 50px; height: 50px; flex: none; overflow: visible; position: relative; }
svg.avatar.desk-badge { padding: 0; background: none; border-radius: 50%; }
svg.avatar-xl.desk-badge { width: 76px; height: 76px; }

/* ---------- responsive (core) ---------- */
@media (max-width: 760px) {
  .nav { display: none; }
  .menu-guest { display: block; }
  .menu-mobile { display: grid; }
  .rack { grid-template-columns: 1fr; }
  .foot-in { padding-top: 40px; gap: 20px 16px; }
  .foot-clock { grid-column: 1 / -1; justify-self: start; grid-row: 3; }
  .foot-nav { grid-column: 1; gap: 0 18px; }
  .foot-in > .x-btn { align-self: start; }
}
@media (max-width: 520px) {
  .wrap { padding: 24px 20px 64px; }
  .top-in { padding: 8px 16px; gap: 10px; min-height: 56px; }
  .brand { font-size: 1.15rem; }
  .brand .mark { width: 30px; height: 30px; }
  .me .btn-small { padding: 0.35em 0.85em; font-size: 0.85rem; }
  .balance { padding: 5px 11px; }
  .slip-head, .slip-inputs, .slip-log, .slip-foot, .slip-share { padding-left: 16px; padding-right: 16px; }
  .slip-body { padding: 16px 16px 18px; }
  .slip-wait { margin-left: 16px; margin-right: 16px; }
  .slip-inputs { grid-template-columns: 1fr; gap: 0; }
  .slip-inputs dd { margin-bottom: 8px; }
  .page-head { margin-bottom: 24px; padding-bottom: 18px; }
  .section { margin-top: 64px; }
  .rc-portrait { width: 56px; height: 56px; }
  .emblem { width: 44px; height: 44px; }
}
@media (max-width: 340px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top-in { padding-left: 12px; padding-right: 12px; }
  .ticket { padding: 18px 14px 14px; }
  .rc-price { font-size: 1rem; padding: 6px 8px; }
  .rc-portrait { width: 48px; height: 48px; }
  .emblem { width: 38px; height: 38px; }
  .me .btn-small { font-size: 0.8rem; padding: 0.3em 0.6em; }
}
@media (max-width: 359px) {
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* focus ring on night surfaces */
.foot :focus-visible { outline-color: var(--citron); }
.ticket-meta { flex-wrap: nowrap; }
.ticket-meta > * { flex: none; }
.ticket-meta > .rc-run { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-go { margin-left: auto; }
@media (max-width: 420px) {
  .ticket-meta { flex-wrap: wrap; }
  .ticket-meta > .rc-run { flex: none; overflow: visible; white-space: nowrap; }
}
.pv-sep { margin-right: 2px; color: var(--citron); }
@media (max-width: 520px) {
  .pv-band { padding: 0 14px; min-height: 30px; max-height: 36px; font-size: 0.7rem; overflow: hidden; }
  .pv-band p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
