/* slash.team design studio — shared base. Variants add composition only. */
@font-face { font-family: Display; src: url("/assets/barlow-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Instrument; src: url("/assets/instrument-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Instrument; src: url("/assets/instrument-sans-latin-600-normal.woff2") format("woff2"); font-weight: 500 900; font-display: swap; }
@font-face { font-family: Plex; src: url("/assets/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --sans: Instrument, "Helvetica Neue", Arial, sans-serif;
  --mono: Plex, ui-monospace, Menlo, monospace;
  --serif: ui-serif, "Iowan Old Style", Charter, "Palatino Linotype", Georgia, serif;
  --s: 1;
  --r: 10px;
  --r-sm: 6px;
  --gap: calc(20px * var(--s));
  --pad: calc(20px * var(--s));
  --row: calc(13px * var(--s));
  --scrim: linear-gradient(180deg, #0000 30%, #000c 100%);
  color-scheme: light dark;
  font: 15px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { opacity: 0.55; cursor: default; }
a { color: var(--accent-text); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .big-number, .ledger dd, dd { font-variant-numeric: tabular-nums; }
.kicker { font: 500 10.5px/1.5 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.muted, .empty { color: var(--muted); }
.empty { padding: 10px 0; font-size: 14px; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--rule); position: relative; z-index: 5; }
.top-inner, main { width: min(1200px, calc(100% - 64px)); margin: 0 auto; }
.top-inner { min-height: 58px; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.wordmark { font-weight: 700; font-size: 17px; letter-spacing: -0.04em; display: flex; align-items: center; gap: 6px; }
.chev, .crumb { color: var(--muted); }
#breadcrumb { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.design-switch { margin-left: auto; display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--rule); border-radius: 999px; }
.design-switch span { padding: 0 8px; color: var(--muted); font: 500 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.design-switch a { text-decoration: none; color: var(--muted); padding: 5px 11px; border-radius: 999px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.design-switch a b { font-family: var(--mono); font-weight: 500; margin-right: 4px; }
.design-switch a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.top-right { display: flex; align-items: center; gap: 8px; }
.studio-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); background: var(--surface-2); border-radius: 999px; padding: 6px 13px; font-weight: 600; font-size: 13px; min-height: 36px; }
.studio-btn svg { width: 16px; height: 16px; }
.studio-btn[aria-expanded="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--rule); font-weight: 700; font-size: 13px; }

/* Buttons */
.primary, .outline, .quiet { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-sm); font-weight: 600; font-size: 13.5px; min-height: 40px; text-decoration: none; white-space: nowrap; }
.primary { background: var(--accent); color: var(--accent-ink); padding: 9px 16px; }
.primary:hover { filter: brightness(1.06); }
.outline { border: 1px solid var(--rule); background: var(--surface); color: var(--ink); padding: 8px 14px; }
.outline:hover { border-color: var(--ink); }
.quiet { color: var(--accent-text); padding: 6px 8px; min-height: 36px; }
.block { width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 1px 8px; font: 600 10.5px/1.6 var(--sans); letter-spacing: 0.02em; background: var(--surface-2); color: var(--muted); border: 1px solid var(--rule); white-space: nowrap; }
.chip.st-in-progress { color: var(--live); border-color: currentColor; }
.chip.st-in-review { color: var(--accent-text); border-color: currentColor; }
.chip.st-accepted { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Avatars: initials on palette tones */
.av { flex: none; width: 40px; height: 40px; border-radius: calc(var(--r) * 0.8); display: grid; place-items: center; font: 600 14px var(--sans); letter-spacing: -0.02em; color: var(--tone-ink); background: var(--t0); }
.av.xs { width: 20px; height: 20px; font-size: 9px; border-radius: 5px; }
.av.sm { width: 30px; height: 30px; font-size: 11.5px; border-radius: calc(var(--r) * 0.55); }
.av.lg { width: 52px; height: 52px; font-size: 18px; }
.av.xl { width: 72px; height: 72px; font-size: 26px; }
.av.tone-1 { background: var(--t1); } .av.tone-2 { background: var(--t2); } .av.tone-3 { background: var(--t3); } .av.tone-4 { background: var(--t4); }
.av.ghost { background: none; border: 1px dashed var(--rule); color: var(--muted); }
.av.desk-av { background: var(--surface-2); color: var(--ink); border: 1px solid var(--rule); font-family: var(--mono); font-weight: 500; }

/* Cards & panels */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel-title { font: 600 17px/1.25 var(--sans); letter-spacing: -0.02em; }
.list-title { font: 600 15px/1.3 var(--sans); letter-spacing: -0.01em; }
.treasury, .exchange, .chatbox, .who { padding: var(--pad); }
.big-number { font: 600 clamp(34px, 3.6vw, 44px)/1.05 var(--sans); letter-spacing: -0.04em; margin: 6px 0 2px; }
.ledger { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--rule); margin-top: 12px; padding-top: 10px; }
.ledger dt { font: 500 10px/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.ledger dd { font-weight: 600; font-size: 15px; }

/* Tabs + board (behaviour from app.js) */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--rule); padding: 0 var(--pad); overflow-x: auto; scrollbar-width: none; }
.tabs button { padding: 14px 0 11px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-pressed="true"] { color: var(--ink); border-color: var(--accent); }
#board { padding: calc(14px * var(--s)) var(--pad) var(--pad); }
.board-head, .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.board-head { margin-bottom: 8px; }
.board-head h3 { font-size: 15px; }
.task-row, .desk-button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: var(--row) 2px; border-bottom: 1px solid var(--rule); }
.task-row:last-child, .desk-button:last-child { border-bottom: 0; }
.task-main { flex: 1; min-width: 0; }
.task-main b, .desk-button b { display: block; font-size: 14.5px; }
.task-main small, .desk-button small { display: block; color: var(--muted); font-size: 12.5px; }
.task-icon { display: none; }
.task-price { font-weight: 600; }
.history { max-height: 360px; overflow: auto; }
.item { padding: 10px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.item b { font-size: 14px; }
.item small { color: var(--muted); font-size: 12px; }
.item p { color: var(--muted); font-size: 14px; }
.history .item p { color: var(--ink); }
.chat-form { display: flex; gap: 8px; margin-top: 12px; }
.chat-form input { flex: 1; min-width: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; border-top: 1px solid var(--rule); padding: 7px 0; }
.stats dt, .rank small { color: var(--muted); font-size: 12.5px; }
.stats dd { font-weight: 600; font-size: 13.5px; }
.rank { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--rule); padding: 9px 0; }
.rank span { font: 500 11.5px var(--mono); }
.rank span:last-child { margin-left: auto; }
.document { white-space: pre-wrap; }
.subtle { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--mono); font-size: 11.5px; overflow-wrap: anywhere; }
.evidence { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); padding: 10px; border-radius: var(--r-sm); font: 12px/1.5 var(--mono); }
.details { margin: 9px 0; font-size: 13.5px; }
.details summary { cursor: pointer; color: var(--accent-text); font-weight: 600; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--rule); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.modal-section { margin: 16px 0; padding-top: 13px; border-top: 1px solid var(--rule); }
.modal-section h3 { font-size: 15px; margin-bottom: 6px; }

/* Forms */
.field { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; margin: 11px 0; }
.field input, .field textarea, .field select, .chat-form input, select {
  width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; font-size: 15px; font-weight: 400;
  background: var(--field, var(--surface)); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r-sm);
}
.field textarea { resize: vertical; min-height: 70px; }
.checkbox { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 13.5px; }
.segments { display: flex; gap: 2px; padding: 3px; margin: 12px 0; border-radius: calc(var(--r-sm) + 2px); background: var(--surface-2); }
.segments button { flex: 1; min-height: 38px; border-radius: var(--r-sm); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.segments button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #0003; }
.ticket-note { margin: 8px 0 12px; font-size: 13px; color: var(--muted); }
.exchange .primary { width: 100%; }
.wallet-line { margin-top: 10px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.error, .feedback { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--ink); border-left: 3px solid var(--accent); border-radius: 4px; font-size: 13.5px; padding: 7px 10px; margin-top: 8px; }
.error:empty, .feedback:empty { display: none; }

/* Chat card */
.chat-list { display: grid; gap: 10px; max-height: 300px; overflow: auto; }
.chat-list li { display: flex; gap: 10px; align-items: flex-start; }
.chat-list .who { padding: 0; font-size: 13px; }
.chat-list .who small { color: var(--muted); font-size: 11.5px; }
.chat-list li p:last-child { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }

/* Events */
.events li { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; padding: 9px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.ev-kind { font: 500 10px/2 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.events time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Dialog */
dialog { width: min(560px, calc(100% - 24px)); max-height: 88dvh; padding: 22px; border: 1px solid var(--rule); border-radius: calc(var(--r) + 4px); background: var(--surface); color: var(--ink); box-shadow: 0 18px 70px #0006; }
dialog::backdrop { background: #0008; backdrop-filter: blur(2px); }
dialog:has(.game) { width: min(960px, calc(100% - 24px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.modal-head h2 { font-size: 21px; letter-spacing: -0.02em; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--rule); border-radius: var(--r-sm); font-size: 22px; line-height: 1; }
.game { width: 100%; image-rendering: pixelated; touch-action: none; }
#notice { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; max-width: 90vw; background: var(--ink); color: var(--bg); border-radius: var(--r-sm); padding: 9px 16px; font-size: 13.5px; pointer-events: none; }
#notice:empty { display: none; }

/* Cover art shared */
.cover { width: 100%; height: 100%; object-fit: cover; }
.cover-mark { display: grid; place-items: center; background: var(--surface-2); color: var(--accent-text); }
.cover-mark .mark-svg { width: 38%; height: auto; max-height: 70%; }
.tint { position: relative; }
.mark-svg { width: 100%; height: 100%; display: block; }
.room-foot { display: flex; justify-content: space-between; gap: 10px; margin: 36px 0 28px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); }
.room-foot span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.room-foot .mark-svg { width: 16px; height: 16px; }

/* Draft preview banner */
.preview-banner { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 7px 16px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.preview-banner button { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; min-height: 30px; }
.preview-banner[hidden] { display: none; }

/* Mobile bar (shown under 720px) */
.mobile-bar { display: none; }

@media (max-width: 720px) {
  .top-inner, main { width: calc(100% - 32px); }
  .top-inner { min-height: 52px; gap: 8px; }
  .design-switch span, .design-switch a i { display: none; }
  .design-switch a { padding: 5px 9px; }
  .design-switch a b { margin: 0; }
  #breadcrumb, .crumb { display: none; }
  .studio-btn { padding: 6px 10px; }
  .top-right .avatar { display: none; }
  #notice { bottom: 70px; }
}
/* Compositions respond to the room's own width, which shrinks when Studio is open. */
.room-frame { container: room / inline-size; }
@container room (max-width: 720px) {
  .mobile-bar { display: flex; position: sticky; bottom: 0; z-index: 8; margin: 0 -16px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--rule); padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); }
  .mobile-bar button { flex: 1; min-height: 48px; font-weight: 600; font-size: 13px; color: var(--ink); border-radius: var(--r-sm); }
  .mobile-bar button:active { background: var(--surface-2); }
  .events li { grid-template-columns: 1fr auto; }
  .ev-kind { display: none; }
  .stats { grid-template-columns: 1fr; }
  .room-foot { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
.design-switch a i { font-style: normal; }
@media (max-width: 720px) {
  .preview-banner { flex-wrap: nowrap; justify-content: space-between; padding: 6px 12px; font-size: 12.5px; }
  .pb-count { display: none; }
}
