/* Studio: fn and Chat's language (tokens from the approved 1a Gallery prototype, which read them from fn's site and Chat Mac).
   Dark by default; no light theme in v1. */
@font-face { font-family: Geist; src: url(/fonts/Geist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #000; --panel: #0a0a0a; --card: #070707; --raise: #141414; --hover: #1e1e1e; --menu: #1c1c1c;
  --line: #1e1e1e; --edge: #2a2a2a; --edge2: #3a3a3a;
  --ink: #f4f4f2; --sec: #c9c9c5; --mut: #8a8a86; --dim: #6a6a66;
  --mint: #7cf2c4; --amber: #f0a63c; --sky: #8fb8ff; --rose: #ff8f8f;
  --on-accent: #000;  /* text and icons on a mint or ink fill */
  --avatar: #a7dcb9;  /* his initials tile */
  --sans: Geist, system-ui, -apple-system, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
a { color: var(--mint); text-decoration: none; }
.mono { font-family: var(--mono); }
.ml { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--dim); text-transform: uppercase; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* buttons: Chat's capsules */
.mb, .ob, .pb { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.mb { background: var(--mint); color: var(--on-accent); }
.ob { border: 1px solid var(--edge); color: var(--ink); }
.ob:hover:not(:disabled) { background: var(--hover); }
.pb { background: var(--ink); color: var(--on-accent); }
.mb:disabled, .ob:disabled, .pb:disabled { opacity: .45; }
.lg { height: 36px; padding: 0 18px; font-size: 14px; }
.xl { height: 46px; font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip.mint { background: rgba(124,242,196,.16); color: var(--mint); }
.chip.amber { background: rgba(240,166,60,.16); color: var(--amber); }
.chip.sky { background: rgba(143,184,255,.16); color: var(--sky); }
.chip.rose { background: rgba(255,143,143,.16); color: var(--rose); }
.chip.grey { background: var(--hover); color: var(--sec); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.turn { background: rgba(240,166,60,.14); border-radius: 8px; padding: 12px; }
.menu { background: var(--menu); border: 1px solid var(--edge2); border-radius: 8px; box-shadow: 0 6px 28px rgba(0,0,0,.6); }
.mk { flex: none; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 600; }
.vpmk { background: var(--bg); border: 1px solid var(--edge); color: var(--mint); }
.ctmk { background: var(--avatar); color: var(--on-accent); font-family: var(--sans); font-weight: 700; }
.name { font-size: 14px; font-weight: 700; }
.time { font-family: var(--mono); font-size: 11px; color: var(--mut); }
.body { font-size: 14px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* fn's live marks */
.bars { display: inline-flex; align-items: center; gap: 1.5px; height: 12px; }
.bars i { display: block; width: 2px; border-radius: 1px; background: var(--mint); animation: bar 1s ease-in-out infinite; }
.bars i:nth-child(1) { height: 35%; animation-delay: 0s; } .bars i:nth-child(2) { height: 100%; animation-delay: .15s; }
.bars i:nth-child(3) { height: 60%; animation-delay: .3s; } .bars i:nth-child(4) { height: 80%; animation-delay: .45s; } .bars i:nth-child(5) { height: 45%; animation-delay: .6s; }
@keyframes bar { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .bars i { animation: none; } }
.br { position: absolute; width: 20px; height: 20px; border-color: var(--mint); border-style: solid; pointer-events: none; }

/* shell */
#app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.bar { flex: none; height: 48px; border-bottom: 1px solid var(--line); background: var(--bg); display: flex; align-items: flex-end; gap: 18px; padding: 0 16px; position: relative; z-index: 8; }
.bar .pick { display: flex; align-items: center; gap: 8px; height: 46px; max-width: 46vw; }
.bar .pick .nm { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .sep { width: 1px; height: 18px; background: var(--line); margin-bottom: 15px; flex: none; }
.tabs { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tab { display: flex; align-items: baseline; gap: 6px; padding: 8px 0 12px; font-size: 14px; font-weight: 600; color: var(--mut); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.tab .c { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--dim); }
.bar .sp { flex: 1; }
.bar .right { height: 46px; display: flex; align-items: center; gap: 10px; }
.presence { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 5px; border: 1px solid var(--edge); border-radius: 999px; }
.presence .t { font-size: 13px; color: var(--sec); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.iconbtn { width: 30px; height: 30px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--sec); }
.iconbtn:hover { background: var(--hover); }
.main { flex: 1; min-height: 0; display: flex; }
.stage { flex: 1; min-width: 0; position: relative; overflow: hidden; }
.stage .scroll { position: absolute; inset: 0; overflow: auto; }
.chatpane { width: 420px; flex: none; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.backpill { height: 28px; max-width: min(260px, 26vw); } .backpill .bklab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.holder { position: absolute; inset: 0; }

/* walk the queue */
.walk { padding: 32px 40px 120px; max-width: 1200px; }
.walk h1 { font-size: 22px; font-weight: 700; margin: 0; }
.kick { font-size: 13px; color: var(--mut); margin-top: 2px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.view { font-size: 15px; line-height: 23px; color: var(--sec); margin: 14px 0 0; max-width: 760px; white-space: pre-wrap; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 24px; }
.opt { display: block; width: 100%; align-self: start; text-align: left; }
.opt .lab { height: 20px; font-size: 12.5px; color: var(--mut); margin-bottom: 6px; display: flex; gap: 8px; align-items: baseline; }
.opt .lab b { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--sec); }
.opt .lab span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .lab .mine { flex: none; margin-left: auto; color: var(--mint); font-size: 12px; }
.opt .box { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; background: var(--card); border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.opt .box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.opt .box .sum { padding: 16px; font-size: 13.5px; line-height: 20px; color: var(--sec); align-self: flex-start; }
.opt.on .lab { color: var(--mint); } .opt.on .lab b { color: var(--mint); }
.opt.on .box { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--mint); border-color: transparent; }
.opt .meta { font-size: 12.5px; color: var(--mut); margin-top: 8px; line-height: 18px; }
.rules { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.rule { font-family: var(--mono); font-size: 10px; letter-spacing: .5px; border: 1px solid var(--edge); border-radius: 4px; padding: 0 5px; height: 18px; display: inline-flex; align-items: center; color: var(--sec); }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.pairs .box { aspect-ratio: 4 / 3; }
.queue { padding: 32px 40px 80px; max-width: 760px; }
.qrow { display: flex; align-items: baseline; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); width: 100%; }
.qrow:hover { background: var(--panel); }
.qrow .n { font-family: var(--mono); font-size: 12px; color: var(--mut); width: 52px; flex: none; }
.qrow .t { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; }
.qrow .s { font-size: 12.5px; color: var(--mut); }
.empty { padding: 80px 40px; max-width: 560px; }
.empty h1 { font-size: 22px; margin: 0 0 8px; }
.empty p { color: var(--sec); font-size: 14.5px; line-height: 22px; margin: 0 0 16px; }

/* call bar (phone) */
.callbar { display: none; position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); gap: 8px; background: linear-gradient(transparent, var(--bg) 38%); z-index: 5; }
/* fn's floating pill: the undo fuse and agent notices */
.fuse { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px 0 18px; border-radius: 999px; background: var(--panel); border: 1px solid var(--edge); box-shadow: 0 10px 30px rgba(0,0,0,.6); white-space: nowrap; font-size: 14px; font-weight: 600; }

/* chat */
.chead { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex: none; }
.chead .st { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.clist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.clist > .in { margin-top: auto; display: flex; flex-direction: column; gap: 16px; padding: 16px; }
.navline { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--raise); font-size: 12.5px; color: var(--sec); }
.msg { display: flex; gap: 12px; }
.msg .col { flex: 1; min-width: 0; }
.msg .hd { display: flex; align-items: baseline; gap: 8px; }
.deliv { font-size: 12px; color: var(--mut); margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.unv { font-size: 11.5px; color: var(--amber); margin-top: 2px; }
.opts-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.orow { display: flex; align-items: baseline; gap: 10px; padding: 6px 8px; border-radius: 6px; font-size: 13.5px; color: var(--sec); width: 100%; }
.orow:hover { background: var(--hover); }
.orow.on { background: var(--hover); color: var(--ink); font-weight: 600; }
.orow .k { font-family: var(--mono); font-size: 14px; font-weight: 600; width: 14px; color: var(--mut); flex: none; }
.orow.on .k { color: var(--mint); }
.orow .mine { font-size: 12px; color: var(--mint); font-weight: 400; }
.outline { font-size: 13px; color: var(--sec); margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.outline .ok { color: var(--mint); } .outline .bad { color: var(--rose); }
.notice { margin: 0 14px 10px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; line-height: 20px; border: 1px solid var(--edge); background: var(--panel); }
.notice.amber { background: rgba(240,166,60,.12); border-color: transparent; color: var(--ink); }
.notice b { font-weight: 700; }
.composer { padding: 0 14px 14px; flex: none; }
.composer .box { border: 1px solid var(--edge); background: var(--panel); border-radius: 12px; padding: 10px 12px 8px; }
.composer input { width: 100%; background: none; border: 0; outline: none; color: var(--ink); font: inherit; font-size: 14px; }
.composer .tools { display: flex; align-items: center; gap: 14px; margin-top: 10px; color: var(--mut); }

/* sign-in, pairing, sheets */
.gate { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: auto; }
.gate .in { width: 100%; max-width: 480px; }
.gate h1 { font-size: 26px; font-weight: 700; margin: 18px 0 8px; letter-spacing: -.01em; }
.gate p { color: var(--sec); font-size: 14.5px; line-height: 22px; margin: 0 0 16px; }
.appmk { display: block; width: 48px; height: 48px; }
.barmk { display: block; width: 20px; height: 20px; flex: none; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.codebox { border: 1px solid var(--edge); border-radius: 10px; padding: 14px; background: var(--panel); }
.codebox .v { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0; margin-top: 6px; line-height: 22px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sheetbg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-start; justify-content: flex-end; padding: 56px 16px 16px; }
.sheet { width: 380px; max-width: 100%; padding: 16px; max-height: calc(100dvh - 80px); overflow: auto; }
.sheet h2 { font-size: 15px; margin: 0 0 4px; }
.drow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.drow .nm { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; }
.drow .sub { font-size: 12px; color: var(--mut); font-weight: 400; }
.mrow { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: 6px; width: 100%; font-size: 13.5px; color: var(--sec); }
.mrow:hover { background: var(--hover); }
.mrow.on { background: var(--hover); color: var(--ink); font-weight: 600; }
.mrow .r { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.drop { position: absolute; left: 12px; top: 50px; width: 260px; padding: 6px; z-index: 30; }
.toast { position: fixed; left: 50%; top: 60px; transform: translateX(-50%); z-index: 40; }
.mobtabs { display: none; }

/* phone and narrow: one pane at a time, the call bar replaces the chat card's buttons */
@media (max-width: 860px) {
  .main { position: relative; }
  .chatpane { position: absolute; inset: 0; width: auto; border-left: 0; z-index: 4; display: none; }
  body[data-pane="chat"] .chatpane { display: flex; }
  body[data-pane="chat"] .stage { visibility: hidden; }
  .bar { padding: 0 12px; gap: 12px; }
  .bar .presence .t { display: none; }
  .presence { padding: 0 8px 0 5px; }
  .bar .pick { max-width: 56vw; }
  .backpill .bklab { display: none; } .backpill { padding: 0 9px; }
  .walk, .queue { padding: 20px 16px 140px; }
  .qrow { flex-wrap: wrap; row-gap: 4px; }
  .qrow .t { flex: 1 1 calc(100% - 64px); }
  .qrow .s { margin-left: 64px; flex: 1 1 auto; }
  .qrow > .chip { margin-left: auto; }
  .empty { padding: 48px 20px; }
  .opts { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .opts > * { scroll-snap-align: center; }
  .pairs { grid-template-columns: 1fr; }
  .callbar { display: flex; }
  .callbar .mb { flex: 1.4; } .callbar .ob { flex: 1; }
  .turnbtns { display: none !important; }
  .turnhint { display: inline-flex !important; margin-top: 10px; }
  .mobtabs { display: flex; flex: none; border-top: 1px solid var(--line); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); z-index: 9; }
  .mobtabs button { flex: 1; height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--mut); font-weight: 600; font-size: 14px; }
  body[data-pane="stage"] .mobtabs .s, body[data-pane="chat"] .mobtabs .c { color: var(--ink); }
  .codes { grid-template-columns: 1fr; }
  .sheetbg { padding: 56px 0 0; justify-content: center; }
  .sheet { width: 100%; max-width: 100%; border-radius: 12px 12px 0 0; }
  .fuse { bottom: 70px; }
}


.turnhint { display: none; }
@media (max-width: 860px) { .tabs, .bar .sep { display: none; } }
