@font-face {
  font-family: "Fraunces River";
  src: url("/assets/fonts/fraunces.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Outfit River";
  src: url("/assets/fonts/outfit.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #101614;
  --panel: #1c2822;
  --line: #31423a;
  --text: #f4efe4;
  --muted: #c9c0ae;
  --brass: #e0b15a;
  --ink: #14201b;
  --sage: #8fbfa8;
  --sans: "Outfit River", "Segoe UI", sans-serif;
  --serif: "Fraunces River", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 18px; line-height: 1.45; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.app { display: flex; min-height: 100vh; }
.rail { width: 270px; padding: 18px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; background: #121a17; position: sticky; top: 0; height: 100vh; }
.mark strong { font-family: var(--serif); font-size: 32px; display: block; line-height: 0.9; }
.mark small { letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); font-size: 12px; }
.who, .hint, .pill { color: var(--muted); font-size: 15px; }
.pill.on { color: var(--sage); }
.pill.off { color: var(--brass); }
.button { background: var(--brass); color: var(--ink); border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 650; }
.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.rail-links { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.rail-links button, .bot { text-align: left; background: transparent; border: 0; color: var(--text); border-radius: 12px; padding: 8px 10px; }
.bot.is-on, .rail-links button:hover, .bot:hover { background: var(--panel); }
main { flex: 1; padding: 22px 26px 40px; min-width: 0; }
h1 { font-family: var(--serif); font-weight: 560; font-size: 40px; margin: 0; }
.eyebrow { color: var(--brass); letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; margin: 0 0 4px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; border-bottom: 3px solid var(--bot, var(--brass)); padding-bottom: 10px; }
#bot-title { color: var(--bot, var(--text)); display: flex; align-items: center; gap: 10px; }
.bot { display: flex; align-items: center; gap: 8px; width: 100%; }
.bot-open { flex: 1; display: flex; align-items: center; gap: 8px; background: transparent; border: 0; color: inherit; text-align: left; padding: 0; }
.bot-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.bot-mark { width: 22px; text-align: center; }
.bot-mark img, .header-icon, .icon-preview img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; vertical-align: middle; }
.header-icon { width: 36px; height: 36px; }
.gear { margin-left: auto; background: transparent; border: 0; color: var(--muted); padding: 2px 6px; }
.emoji-row, .swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-row button, .swatches button { border-radius: 10px; border: 1px solid var(--line); background: transparent; min-width: 36px; min-height: 36px; }
.emoji-row button.is-on, .swatches button.is-on { outline: 2px solid var(--bot, var(--brass)); }
.bubble.assistant { border-left: 3px solid var(--bot, var(--sage)); background: color-mix(in srgb, var(--bot, #8fbfa8) 22%, #18211c); }
.chat-layout { display: grid; grid-template-columns: 200px 1fr; gap: 14px; margin-top: 16px; min-height: 70vh; }
.conv-list, .transcript-wrap, .stack, .card, dialog { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.conv-list { padding: 8px; }
.conv { width: 100%; text-align: left; background: transparent; border: 0; color: var(--muted); padding: 8px; border-radius: 10px; }
.conv.is-on { background: #24312a; color: var(--text); }
.transcript-wrap { display: flex; flex-direction: column; min-height: 70vh; }
.transcript { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 70ch; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; }
.bubble.user { align-self: end; background: #31483c; }
.bubble.assistant { align-self: start; border-left: 3px solid var(--sage); }
.bubble .by { display: block; color: var(--brass); font-size: 13px; margin-bottom: 4px; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
textarea, input { width: 100%; background: #101614; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.stack { padding: 14px; display: grid; gap: 8px; margin: 12px 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.card { padding: 10px; }
.card img, model-viewer { width: 100%; border-radius: 10px; background: #0c1210; }
model-viewer { height: 240px; }
.gate { max-width: 460px; margin: 10vh auto; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.gate h1 { font-size: 36px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.once { border: 1px solid var(--brass); padding: 10px; border-radius: 12px; }
dialog { color: var(--text); padding: 16px; max-width: 520px; }
dialog label, .stack label { display: grid; gap: 4px; margin: 6px 0; }
#toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); border: 1px solid var(--brass); padding: 10px 14px; border-radius: 12px; display: none; max-width: 520px; }
#toast.show { display: block; }
@media (max-width: 860px) {
  .app { display: block; }
  .rail { width: auto; height: auto; position: static; }
  .chat-layout, .composer { display: block; }
  .composer button { margin-top: 8px; }
}
