/* Agentdock: the dock. Harbour-fog canvas, deep steel ink, petrol brand colour, one signal-orange buoy that marks live things.
   Core: tokens, type, header/footer, buttons, forms, chips, container cards (.ticket), delivery notes (.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: "Sofia Sans"; src: url("/fonts/sofia-sans.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Sofia Sans"; src: url("/fonts/sofia-sans-italic.woff2") format("woff2"); font-weight: 300 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Sofia Sans Condensed"; src: url("/fonts/sofia-condensed.woff2") format("woff2"); font-weight: 500 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Chivo Mono"; src: url("/fonts/chivo-mono.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }

:root {
  --bg: #e7ecec;
  --bg-2: #dbe2e3;
  --surface: #f7f9f9;
  --ink: #12202a;
  --ink-2: #34474f;
  --muted: #5f7178;
  --line: #cbd5d7;
  --line-2: #b3c0c3;
  --petrol: #0e6b80;
  --petrol-ink: #0a5163;
  --petrol-soft: #d3e8ed;
  --buoy: #ff6b2c;
  --night: #0f1b22;
  --night-2: #172833;
  --night-line: #284250;
  --night-ink: #eaf1f2;
  --night-dim: rgba(234, 241, 242, 0.64);
  --good: #1d7f5a;
  --bad: #c2412d;
  --star: #a8620f;
  /* container (category) colours */
  --c-research: #2f6db5;
  --c-trading: #c4532d;
  --c-markets: #6d5bb0;
  --c-onchain: #2c8a6a;
  --c-content: #b8476f;
  /* names inherited from earlier designs: kept as aliases so every stylesheet keeps working */
  --violet: var(--petrol);
  --violet-ink: var(--petrol-ink);
  --violet-soft: var(--petrol-soft);
  --citron: var(--buoy);
  --paper: var(--bg);
  --paper-2: var(--bg-2);
  --paper-3: #ced8d9;
  --card: var(--surface);
  --line-soft: #d9e1e2;
  --stamp: var(--petrol);
  --stamp-ink: var(--petrol-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(--buoy);
  --r: 4px;
  --r-btn: 6px;
  --shadow: 0 1px 0 rgba(18, 32, 42, 0.06), 0 14px 28px -20px rgba(18, 32, 42, 0.35);
  --shadow-lift: 0 1px 0 rgba(18, 32, 42, 0.08), 0 22px 34px -18px rgba(18, 32, 42, 0.42);
  --display: "Sofia Sans Condensed", "Arial Narrow", ui-sans-serif, system-ui, sans-serif;
  --sans: "Sofia Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "Chivo Mono", ui-monospace, "Cascadia Mono", monospace;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --spring: cubic-bezier(0.22, 0.8, 0.24, 1);
  /* corrugation: vertical ribs for container bands */
  --ribs: repeating-linear-gradient(90deg, rgba(10, 20, 28, 0.2) 0 2px, rgba(255, 255, 255, 0.07) 2px 4px, transparent 4px 9px);
}

*, *::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 17px/1.5 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; text-wrap: balance; font-weight: 800; }
h1, h2 { font-family: var(--display); letter-spacing: -0.01em; line-height: 0.98; }
h1 { font-size: clamp(2.7rem, 8vw, 4.7rem); }
h2 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); }
h3 { font-size: 1.12rem; letter-spacing: -0.005em; font-weight: 750; }
h1 em, h2 em, h3 em { font-style: normal; color: var(--petrol); }
p { margin: 0 0 0.8em; }
.h-mid { font-size: clamp(2rem, 5.4vw, 3.1rem); }
.h-small { font: 500 0.7rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; 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: var(--r-btn); z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--buoy); color: var(--ink); }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font: 500 0.7rem/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--petrol-ink); margin: 0 0 0.8rem; }
.eyebrow::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--buoy); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); flex: none; }
.lede { font-size: clamp(1.05rem, 1.7vw, 1.2rem); color: var(--ink-2); max-width: 38rem; text-wrap: pretty; }

/* ---------- buttons: square-shouldered steel, not pills ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.6em; min-height: 46px; padding: 0.6em 1.25em;
  border: 1.5px solid var(--petrol); border-radius: var(--r-btn); background: var(--petrol); 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 2px 0 var(--petrol-ink); touch-action: manipulation; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); background: var(--petrol-ink); border-color: var(--petrol-ink); box-shadow: 0 3px 0 #073a47; }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--petrol-ink); }
.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(--ink); box-shadow: 0 2px 0 var(--ink); }
.btn-ghost:hover { background: #fff; border-color: var(--ink); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.btn-small { min-height: 38px; padding: 0.35em 1em; font-size: 0.92rem; }
.btn-big { min-height: 54px; padding: 0.7em 1.6em; font-size: 1.08rem; }
.btn-block { width: 100%; }
.btn-invert { background: #fff; color: var(--ink); border-color: #fff; box-shadow: 0 2px 0 var(--line-2); }
.btn-invert:hover { background: var(--buoy); border-color: var(--buoy); color: var(--ink); box-shadow: 0 3px 0 #c24d17; }
.btn-citron { background: var(--buoy); color: var(--ink); border-color: var(--buoy); box-shadow: 0 2px 0 #c24d17; }
.btn-citron:hover { background: #ff8149; border-color: #ff8149; color: var(--ink); box-shadow: 0 3px 0 #c24d17; }
.btn-stamp, .btn-send { background: var(--petrol); border-color: var(--petrol); }
.btn-send { justify-content: space-between; }
.btn-price { font: 500 0.86rem var(--mono); background: rgba(255, 255, 255, 0.18); padding: 0.15em 0.6em; border-radius: 3px; }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.link-arrow { font-weight: 700; text-decoration: none; color: var(--petrol-ink); background: linear-gradient(var(--buoy), var(--buoy)) 0 100% / 100% 3px no-repeat; padding-bottom: 2px; transition: background-size 0.2s var(--ease); }
.link-arrow:hover { background-size: 100% 100%; color: var(--ink); }
.link-arrow::after { content: "\a0→"; display: inline-block; transition: transform 0.2s var(--ease); }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- header: the quay edge ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 2px solid var(--ink); }
.top-in { max-width: 1200px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.7rem/1 var(--display); letter-spacing: -0.005em; }
.brand .mark { width: 34px; height: 34px; flex: none; transition: transform 0.25s var(--ease); }
.brand:hover .mark { transform: translateY(-2px); }
.nav { display: flex; gap: 2px; margin: 0 auto 0 12px; }
.nav a { position: relative; text-decoration: none; padding: 20px 14px; font-weight: 650; font-size: 1rem; color: var(--ink-2); transition: color 0.15s; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -2px; height: 4px; background: var(--buoy); }
.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 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-btn); transition: border-color 0.15s; }
.balance::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--buoy); flex: none; }
.balance:hover { border-color: var(--ink); }
.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: 4px; background: var(--petrol); 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: var(--r-btn); }
.menu summary::-webkit-details-marker { display: none; }
.menu-guest { display: none; }
.burger, .burger::before, .burger::after { display: block; width: 22px; height: 2.5px; background: var(--ink); border-radius: 1px; position: relative; transition: transform 0.2s var(--ease); }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -7px; } .burger::after { top: 7px; }
.menu[open] .burger { background: transparent; }
.menu[open] .burger::before { transform: translateY(7px) rotate(45deg); }
.menu[open] .burger::after { transform: translateY(-7px) rotate(-45deg); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 12px); background: var(--surface); border: 1px solid var(--line-2); border-top: 4px solid var(--petrol); border-radius: var(--r); box-shadow: var(--shadow-lift); padding: 8px; min-width: 230px; display: grid; animation: pop 0.18s var(--ease); transform-origin: top right; }
.menu-pop a { padding: 11px 12px; border-radius: 3px; text-decoration: none; font-weight: 650; }
.menu-pop a:hover { background: var(--petrol-soft); }
.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; }
.menu-mobile a[aria-current="page"] { background: var(--petrol-soft); box-shadow: inset 4px 0 0 var(--buoy); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 36px 20px 88px; }
.wrap.wide { max-width: 1200px; }
.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(--buoy); }
.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.1em; color: var(--ink-2); margin-bottom: 14px; min-height: 32px; }
.back:hover { color: var(--petrol-ink); }
.glyph { width: 28px; height: 28px; }
.glyph-s { width: 18px; height: 18px; }
.note { font-size: 0.9rem; color: var(--muted); margin: 10px 0 0; }
.badge { display: inline-block; font: 500 0.68rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; padding: 3px 8px; border-radius: 3px; background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line-2); }
.house { font-weight: 700; color: var(--petrol-ink); }

/* ---------- footer: a dark steel band with a big painted wordmark ---------- */
.foot { position: relative; margin-top: 40px; background: var(--night); color: var(--night-ink); overflow: hidden; border-top: 2px solid var(--ink); }
.foot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: repeating-linear-gradient(90deg, var(--night-line) 0 3px, transparent 3px 11px); }
.foot-in { max-width: 1200px; margin: 0 auto; padding: 52px 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: 800 clamp(5.2rem, 25vw, 20rem)/0.8 var(--display); letter-spacing: -0.01em; color: var(--night-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; flex: none; }
.foot-brand p { margin: 0; font-size: 0.97rem; color: var(--night-dim); }
.foot-brand strong { color: var(--night-ink); font: 800 1.5rem/1.1 var(--display); }
.foot-clock { justify-self: end; display: inline-flex; align-items: center; gap: 9px; font: 500 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--night-dim); }
.foot-clock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--buoy); 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(234, 241, 242, 0.82); font-size: 1rem; padding: 10px 0; transition: color 0.15s; }
.foot-nav a:hover { color: var(--buoy); }
.foot-in > .x-btn { justify-self: end; margin-top: 18px; }
.x-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-btn); background: var(--night-ink); color: var(--night); transition: transform 0.2s var(--ease); }
.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: translateY(-2px); }
@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: 4px;
  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='%2312202a' 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(--petrol); box-shadow: 0 0 0 3px rgba(14, 107, 128, 0.2); }
input::placeholder, textarea::placeholder { color: #7d8e94; }
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.95rem; }
.opt { font-weight: 400; color: var(--muted); font-size: 0.84rem; }
.hint { color: var(--muted); font-size: 0.84rem; }
.form-error { color: #9d2f1f; background: rgba(194, 65, 45, 0.08); border-left: 3px solid var(--bad); border-radius: 3px; padding: 10px 12px; font-size: 0.94rem; margin: 0 0 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 650; font-size: 0.94rem; min-height: 40px; }
.switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 4px; 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: 2px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.22s var(--ease); }
.switch input:checked { background: var(--petrol); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- chips: the bays ---------- */
.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 14px; border-radius: var(--r-btn); border: 1.5px solid var(--line-2); text-decoration: none; font-weight: 650; font-size: 0.95rem; 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(--buoy); }

/* ---------- container cards (agent cards, .ticket) ----------
   A steel box: a ribbed band in the category colour carrying the container code and the emblem, then name, tagline, price, rating and runs. */
.rack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; }
.ticket {
  --cat: var(--c-research);
  position: relative; display: flex; flex-direction: column; min-height: 176px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden;
  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(--ink-2); }
.rc-band {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 74px; padding: 0 14px 0 14px;
  background-color: var(--cat); background-image: var(--ribs); background-size: 9px 100%; background-position: 0 0;
  border-bottom: 3px solid rgba(10, 20, 28, 0.35); color: #fff; transition: background-position 0.4s var(--ease);
}
.ticket:hover .rc-band, .ticket:focus-visible .rc-band { background-position: 2px 0; }
.rc-tab { position: relative; display: inline-flex; align-items: stretch; align-self: flex-start; margin-top: 12px; font: 500 0.72rem/1 var(--mono); letter-spacing: 0.1em; color: #fff; white-space: nowrap; background: rgba(10, 20, 28, 0.42); border-radius: 2px; }
.rc-code { padding: 6px 8px 5px; font-variant-numeric: tabular-nums; }
.rc-check { display: grid; place-items: center; min-width: 22px; padding: 0 4px; font-weight: 600; border-left: 1px solid rgba(255, 255, 255, 0.55); outline: 1px solid rgba(255, 255, 255, 0.55); outline-offset: -1px; }
.is-pick .rc-tab::before { content: ""; position: absolute; left: -5px; top: -5px; width: 11px; height: 11px; border-radius: 50%; background: var(--buoy); box-shadow: 0 0 0 2px var(--surface); }
.rc-portrait { position: relative; display: grid; place-items: center; flex: none; width: 54px; height: 54px; color: #fff; transition: transform 0.3s var(--ease); }
.rc-portrait .emblem { width: 100%; height: 100%; }
.rc-portrait .glyph { width: 34px; height: 34px; }
.ticket:hover .rc-portrait { transform: translateY(-2px); }
.rc-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 14px 16px 14px; }
.rc-top { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.rc-id { min-width: 0; flex: 1; }
.rc-id h3 { font: 800 1.6rem/1 var(--display); letter-spacing: 0; overflow-wrap: anywhere; }
.rc-by { display: block; font-size: 0.86rem; margin-top: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-price { flex: none; font: 600 1.05rem/1 var(--mono); font-variant-numeric: tabular-nums; padding: 7px 9px; border-radius: 3px; background: var(--petrol-soft); color: var(--petrol-ink); border: 1px solid #b6d4dc; }
.rc-price small { font-size: 0.64rem; font-weight: 500; margin-left: 3px; letter-spacing: 0.06em; }
.ticket p { color: var(--ink-2); font-size: 0.97rem; margin: 0; }
.ticket .rc-body > p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-meta { margin-top: auto; padding-top: 11px; border-top: 1px dashed var(--line-2); display: flex; flex-wrap: nowrap; gap: 4px 12px; font-size: 0.86rem; align-items: center; }
.ticket-meta > * { flex: none; }
.ticket-meta > .rc-run { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-cat { display: inline-flex; align-items: center; gap: 6px; font: 500 0.68rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2); }
.rc-cat i { width: 9px; height: 9px; border-radius: 1px; background: var(--cat); }
.ticket-go { margin-left: auto; font-weight: 700; color: var(--petrol-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.64rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); background: var(--buoy); border-radius: 2px; padding: 4px 7px; }
/* 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.1em; 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; }

/* ---------- delivery notes (run output, .slip) ----------
   A clean document: a corrugated edge on top, agent, note number and status; the manifest; tool steps on a mooring line; the delivery. */
.slip { position: relative; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); margin: 12px 0; font-size: 1rem; overflow: hidden; }
.slip::before { content: ""; display: block; height: 8px; background: var(--ink-2) var(--ribs); background-size: 9px 100%; }
.slip.running::before { background-color: var(--petrol); }
.slip.failed::before { background-color: var(--bad); }
.slip-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 14px 22px; background: var(--bg); border-bottom: 1px solid var(--line-2); }
.slip-no { order: 2; font: 500 0.7rem var(--mono); color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.slip-agent { order: 1; font: 800 1.45rem/1 var(--display); }
.slip-head .stamp { order: 3; margin-left: auto; }
/* status stamp; the buoy marks a delivery underway */
.stamp { position: relative; display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font: 600 0.68rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; padding: 7px 11px 7px 9px; border-radius: 3px; border: 1.5px solid currentColor; background: transparent; color: var(--ink-2); white-space: nowrap; }
.stamp::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.stamp-done { background: #e0f1e9; color: var(--good); }
.stamp-failed { background: #f8e4e0; color: #a8321f; }
.stamp-running { background: var(--night); color: #fff; border-color: var(--night); }
.stamp-running::before { background: var(--buoy); animation: node-pulse 1.2s ease-in-out infinite; }
.stamp-s { margin-left: 0; padding: 5px 8px 5px 7px; font-size: 0.62rem; }
.stamp-big { margin: 0 0 14px; font-size: 0.8rem; padding: 10px 14px 10px 12px; }
.stamp.thump { animation: pop-in 0.35s var(--ease); }
@keyframes pop-in { 0% { transform: scale(0.85); 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.84rem/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.06em; 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 mooring line with a bollard per step */
.slip-log { list-style: none; margin: 0; padding: 14px 22px 6px; display: grid; gap: 0; font: 400 0.84rem 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; border-left: 2px dashed 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(--buoy); border-color: var(--buoy); 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: 2px; 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.1em; color: var(--petrol-ink); }
.sw-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--buoy); 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-2); font: 400 0.72rem var(--mono); color: var(--muted); }
.slip-foot:empty { display: none; }
.slip-foot .sample-stamp { margin-left: auto; color: var(--petrol-ink); background: var(--petrol-soft); border-radius: 2px; padding: 3px 8px; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; }
.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(--buoy); 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(--buoy); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.72rem; margin-right: 4px; }
.pv-ico { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--buoy); animation: node-pulse 2s ease-in-out infinite; }
.pv-ico i { display: none; }
.pv-sep { margin-right: 2px; color: var(--buoy); }

/* markdown inside delivery notes: made for reading */
.md { line-height: 1.65; color: var(--ink); }
.md h2, .md h3, .md h4 { font-family: var(--sans); font-weight: 800; letter-spacing: -0.005em; line-height: 1.2; margin: 1.5em 0 0.5em; }
.md h2 { font-size: 1.25rem; padding-top: 0.2em; }
.md h3 { font-size: 1.08rem; }
.md h4 { font-size: 0.98rem; }
.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(--petrol); }
.md strong { font-weight: 700; }
.md code { font: 0.84em var(--mono); background: var(--bg-2); padding: 0.12em 0.4em; border-radius: 3px; overflow-wrap: anywhere; }
.md pre { background: var(--night); color: var(--night-ink); padding: 14px; border-radius: var(--r); 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(--petrol); color: var(--ink-2); }
.md a { color: var(--petrol-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-2); border-radius: var(--r); }
.md table { border-collapse: collapse; font-size: 0.9rem; 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.1em; color: var(--muted); background: var(--bg); }

/* ---------- empty states: an empty berth, two containers waiting ---------- */
.empty { position: relative; text-align: center; padding: 52px 20px 48px; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: rgba(247, 249, 249, 0.6); }
.empty svg { width: 190px; margin: 0 auto 18px; overflow: visible; }
.e-card { fill: var(--petrol-soft); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.e-box { fill: var(--surface); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.e-dim { stroke: var(--line-2); fill: var(--bg-2); }
.e-rib { stroke: var(--ink); stroke-width: 1.6; opacity: 0.55; fill: none; }
.e-dim + .e-rib { stroke: var(--line-2); opacity: 1; }
.e-back { fill: var(--bg-2); stroke: var(--line-2); stroke-width: 1.5; }
.e-tile { fill: var(--petrol-soft); stroke: var(--petrol); stroke-width: 1.5; }
.e-line { stroke: var(--line-2); stroke-width: 3; stroke-linecap: round; fill: none; }
.e-node { fill: var(--buoy); 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; font: 800 1.7rem/1 var(--display); }
.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: 2px; 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 11px 16px; border-radius: var(--r-btn); border-left: 5px solid var(--buoy); font-size: 0.95rem; 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: 16px rise + fade, staggered 70ms via --i (only when JS marks the page ready, so no-JS shows everything) */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.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) * 70ms), 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: 4px; }
svg.avatar-xl.desk-badge { width: 76px; height: 76px; }

/* ---------- responsive (core) ---------- */
@media (max-width: 900px) {
  .nav a { padding: 20px 9px; font-size: 0.95rem; }
  .nav a[aria-current="page"]::after { left: 9px; right: 9px; }
}
@media (max-width: 800px) {
  .nav { display: none; }
  .menu-guest { display: block; }
  .menu-mobile { display: grid; }
  .rack { grid-template-columns: 1fr; }
  .foot-in { padding-top: 44px; 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) {
  body { font-size: 16.5px; }
  .wrap { padding: 24px 20px 64px; }
  .top-in { padding: 6px 16px; gap: 10px; min-height: 56px; }
  .brand { font-size: 1.55rem; }
  .brand .mark { width: 30px; height: 30px; }
  .me .btn-small { padding: 0.35em 0.85em; font-size: 0.88rem; }
  .balance { padding: 5px 10px; }
  .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-band { height: 66px; }
  .rc-portrait { width: 48px; height: 48px; }
  .pv-band { padding: 0 14px; min-height: 30px; max-height: 36px; font-size: 0.7rem; overflow: hidden; justify-content: flex-start; text-align: left; }
  .pv-band p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pv-more { display: none; }
}
@media (max-width: 420px) {
  .ticket-meta { flex-wrap: wrap; }
  .ticket-meta > .rc-run { flex: none; overflow: visible; white-space: nowrap; }
}
@media (max-width: 340px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top-in { padding-left: 12px; padding-right: 12px; }
  .rc-body { padding: 12px 12px 12px; }
  .rc-price { font-size: 0.95rem; padding: 6px 7px; }
  .rc-id h3 { font-size: 1.4rem; }
  .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, .pv-band :focus-visible { outline-color: var(--buoy); }
