:root {
  --bg: #07060a;
  --surface: rgba(16, 13, 14, 0.72);
  --solid: #141112;
  --ink: #f3ece2;
  --muted: #b9afa3;
  --faint: #8f867b;
  --line: rgba(255, 236, 214, 0.12);
  --accent: #ff6a3d;
  --accent-2: #ffb36b;
  --accent-ink: #1a0904;
  --accent-soft: rgba(255, 106, 61, 0.18);
  --ok: #5ccf8c;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  --serif: "Bricolage Grotesque", "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --w: 760px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--accent-soft); }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font: 26px/1 var(--serif); letter-spacing: -0.01em; text-decoration: none;
}
.mark {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffb08f, var(--accent) 55%, #9c2c0e);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.net {
  display: inline-flex; align-items: center; gap: 6px;
  font: 12px/1 var(--mono); color: var(--muted);
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px;
}
.net .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.net.live .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 25%, transparent); }
.spacer { flex: 1; }
.icon-btn, .ghost-btn, .wallet-btn {
  border: 1px solid transparent; background: none; border-radius: 10px;
  height: 34px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, border-color .15s, transform .1s;
}
.icon-btn { width: 34px; padding: 0; justify-content: center; color: var(--muted); }
.icon-btn:hover, .ghost-btn:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); color: var(--ink); }
.ghost-btn { color: var(--muted); font-size: 14px; }
.ghost-btn.danger { color: var(--accent); }
.wallet-btn {
  border-color: var(--line); font: 13px/1 var(--mono); padding: 0 12px;
}
.wallet-btn:hover { border-color: var(--ink); }
.wallet-btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.wallet-btn.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
button:active { transform: scale(0.97); }

/* ---------- main column ---------- */
main {
  flex: 1; width: 100%; max-width: var(--w); margin: 0 auto;
  padding: 0 16px 24px; display: flex; flex-direction: column;
}
.hero { padding: 14vh 0 28px; }
.hero h1 {
  font: 400 clamp(44px, 8vw, 76px)/0.98 var(--serif); letter-spacing: -0.025em; margin: 0;
}
.hero h1 em { color: var(--accent); }
.hero .sub { color: var(--muted); max-width: 44ch; margin: 18px 0 0; font-size: 16px; }

main:not(.is-empty) .hero,
main:not(.is-empty) .chips { display: none; }
main.is-empty .thread { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips button {
  border: 1px solid var(--line); background: none; border-radius: 99px;
  padding: 7px 13px; font-size: 13.5px; color: var(--muted);
  transition: color .15s, border-color .15s;
}
.chips button:hover { color: var(--ink); border-color: var(--ink); }
.foot { margin: auto 0 0; padding-top: 18px; font-size: 12px; color: var(--faint); text-align: center; }
main:not(.is-empty) .foot { padding-top: 8px; }

/* ---------- composer ---------- */
.composer {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 14px 10px; box-shadow: var(--shadow);
  transition: border-color .15s;
}
.composer:focus-within { border-color: color-mix(in oklab, var(--ink) 35%, var(--line)); }
main:not(.is-empty) .composer { position: sticky; bottom: 12px; margin-top: 12px; }
.composer textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: none; color: var(--ink);
  font: 16px/1.5 var(--sans); max-height: 40vh; padding: 0 2px;
}
.composer textarea::placeholder { color: var(--faint); }
.composer-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.model-chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 60%;
  border: 1px solid var(--line); background: var(--bg); border-radius: 99px;
  padding: 5px 10px; font-size: 13px;
}
.model-chip span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-chip:hover { border-color: var(--ink); }
.mc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.price { font: 11.5px/1 var(--mono); color: var(--faint); white-space: nowrap; }
.send {
  width: 36px; height: 36px; border-radius: 12px; border: 0;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; transition: opacity .15s, transform .1s;
}
.send:disabled { opacity: .35; cursor: default; }
.send .i-stop { display: none; }
.busy .send .i-send { display: none; }
.busy .send .i-stop { display: block; }
.busy .send { background: var(--ink); color: var(--bg); opacity: 1; }

/* ---------- thread ---------- */
.thread { display: flex; flex-direction: column; gap: 26px; padding-top: 24px; }
.msg { animation: rise .25s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.msg.user {
  align-self: flex-end; max-width: 85%;
  background: var(--ink); color: var(--bg);
  padding: 10px 15px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; word-wrap: break-word;
}
.msg.ai .who {
  display: flex; align-items: center; gap: 8px;
  font: 12px/1 var(--mono); color: var(--faint); margin-bottom: 8px;
}
.msg.ai .who .mark { width: 9px; height: 9px; box-shadow: none; }
.msg.ai .body { overflow-wrap: anywhere; }
.msg.ai .body > :first-child { margin-top: 0; }
.msg.ai .body > :last-child { margin-bottom: 0; }
.msg.ai .body h1, .msg.ai .body h2, .msg.ai .body h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; }
.msg.ai .body h1 { font-size: 30px; } .msg.ai .body h2 { font-size: 25px; } .msg.ai .body h3 { font-size: 21px; }
.msg.ai .body code { font: 13px/1.5 var(--mono); background: color-mix(in oklab, var(--ink) 7%, transparent); padding: 1px 5px; border-radius: 5px; }
.msg.ai .body pre { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow-x: auto; }
.msg.ai .body pre code { background: none; padding: 0; }
.msg.ai .body table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.msg.ai .body th, .msg.ai .body td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.msg.ai .body blockquote { margin: 0; padding: 2px 0 2px 14px; font-style: italic; color: var(--muted); }
.msg.ai .body a { color: var(--accent); }
.msg.ai .meta { display: flex; gap: 4px; align-items: center; margin-top: 8px; font: 11.5px/1 var(--mono); color: var(--faint); }
.msg.ai .meta button { border: 0; background: none; color: var(--faint); padding: 5px 7px; border-radius: 7px; font: inherit; }
.msg.ai .meta button:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 6%, transparent); }
.msg.ai.err .body { color: var(--accent); }
.caret::after {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-left: 4px; vertical-align: middle;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }

/* ---------- drawer ---------- */
.drawer {
  position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 20;
  background: var(--surface); border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; padding: 14px;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 12px; }
.history { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.history li {
  display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 10px;
  cursor: pointer; font-size: 14px;
}
.history li span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.history li small { font: 11px var(--mono); color: var(--faint); }
.history li:hover, .history li.active { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.history .empty { color: var(--faint); cursor: default; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 15; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }

/* ---------- dialogs ---------- */
.sheet {
  width: min(560px, calc(100vw - 32px)); max-height: min(640px, 80vh);
  border: 1px solid var(--line); border-radius: 18px; padding: 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.sheet.small { width: min(440px, calc(100vw - 32px)); }
.sheet::backdrop { background: rgba(10, 9, 7, .35); backdrop-filter: blur(2px); }
.sheet[open] { display: flex; flex-direction: column; animation: rise .2s ease-out; }
.sheet-head { display: flex; gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.sheet-head input[type=search] {
  flex: 1; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 10px; padding: 9px 12px; font: inherit; outline: none;
}
.sheet-head input[type=search]:focus { border-color: var(--ink); }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.models { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.models li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
}
.models li:hover, .models li.sel { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.models li.sel .n { color: var(--accent); }
.models .n { font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.models .id { font: 11.5px var(--mono); color: var(--faint); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.models .p { font: 11.5px var(--mono); color: var(--muted); text-align: right; grid-row: span 2; }
.models .tag { font: 10.5px/1 var(--mono); color: var(--ok); border: 1px solid currentColor; border-radius: 5px; padding: 3px 5px; }
.settings { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.settings h2 { font: 400 30px/1 var(--serif); margin: 0 0 4px; }
.settings label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }
.settings label.row { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.settings input[type=password], .settings textarea {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 10px; padding: 9px 12px; font: 14px var(--mono); outline: none; resize: vertical;
}
.settings textarea { font-family: var(--sans); }
.settings input:focus, .settings textarea:focus { border-color: var(--ink); }
.settings small { color: var(--faint); font-size: 12px; }
.settings-actions { display: flex; justify-content: flex-end; }
.primary { background: var(--ink); color: var(--bg); border: 0; border-radius: 10px; padding: 9px 18px; font-weight: 500; }
input[type=checkbox] { accent-color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: .2s; z-index: 30; max-width: calc(100vw - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .net #netText { display: none; }
  .net { padding: 6px; }
  #newBtn { display: none; }
  .hero { padding-top: 9vh; }
  .price { display: none; }
  .model-chip { max-width: 75%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =========================================================
   Scene — "Elysian eclipse": a black sun rising over a
   molten ridge, embers drifting up through a star field.
   ========================================================= */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: #07060a; transition: opacity 1s ease, filter 1s ease; }
body:has(main:not(.is-empty)) .scene { opacity: .38; filter: saturate(.8); }

.sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 70% at 50% 108%, #ff7a3a 0%, #c23a1c 18%, #5a1a24 36%, #1d0f22 58%, #07060a 80%),
    #07060a;
}
#stars { position: absolute; inset: 0; width: 100%; height: 100%; }

/* the eclipse */
.eclipse {
  --d: min(54vmin, 560px);
  position: absolute; left: 50%; top: 40%;
  width: var(--d); height: var(--d);
  transform: translate(-50%, -50%);
  animation: rise 2.6s cubic-bezier(.16,1,.3,1) both;
}
@keyframes rise { from { transform: translate(-50%, -38%); opacity: 0; } }
.halo {
  position: absolute; inset: -60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,140,80,.38) 0%, rgba(255,90,50,.16) 28%, rgba(120,40,80,.08) 45%, transparent 62%);
  animation: breathe 9s ease-in-out infinite;
}
.corona {
  position: absolute; inset: -14%;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(255,190,120,.0), rgba(255,170,100,.85), rgba(255,90,50,.15), rgba(255,210,150,.9),
    rgba(255,110,60,.1), rgba(255,180,110,.75), rgba(255,80,40,.05), rgba(255,200,140,.85), rgba(255,190,120,.0));
  -webkit-mask: radial-gradient(circle, transparent 44%, #000 47%, rgba(0,0,0,.5) 56%, transparent 70%);
          mask: radial-gradient(circle, transparent 44%, #000 47%, rgba(0,0,0,.5) 56%, transparent 70%);
  filter: blur(6px);
  animation: spin 80s linear infinite;
}
.corona.c2 { inset: -24%; opacity: .55; filter: blur(14px); animation-duration: 120s; animation-direction: reverse; }
.disk {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #050304 62%, #0d0708 100%);
  box-shadow:
    0 0 0 1.5px rgba(255, 214, 170, .9),
    0 0 18px 2px rgba(255, 150, 90, .85),
    0 0 60px 8px rgba(255, 100, 50, .45),
    inset 0 0 40px rgba(255, 120, 60, .12);
}
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes breathe { 50% { transform: scale(1.06); opacity: .8; } }

/* molten ridge */
.ridge { position: absolute; left: -5%; width: 110%; bottom: 0; display: block; }
.ridge.far  { height: 34vh; color: #2a1218; animation: sway 40s ease-in-out infinite alternate; }
.ridge.near { height: 24vh; color: #0b0608; animation: sway 28s ease-in-out infinite alternate-reverse; }
.ridge path { fill: currentColor; }
.ridge.far path.rim { fill: none; stroke: rgba(255,140,80,.55); stroke-width: 1.2; filter: drop-shadow(0 0 6px rgba(255,120,60,.8)); }
@keyframes sway { to { transform: translateX(-3%); } }

.mist {
  position: absolute; left: -50%; right: -50%; bottom: 14vh; height: 22vh;
  background:
    radial-gradient(40% 60% at 20% 60%, rgba(255,150,110,.16), transparent 70%),
    radial-gradient(35% 50% at 60% 50%, rgba(255,120,90,.12), transparent 70%),
    radial-gradient(30% 50% at 90% 60%, rgba(200,110,160,.10), transparent 70%);
  filter: blur(10px);
  animation: mist 50s linear infinite;
}
@keyframes mist { to { transform: translateX(25%); } }

.vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 50%, rgba(0,0,0,.65) 100%); }
.grain {
  position: absolute; inset: 0; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- foreground on top of the scene ---------- */
body { background: #07060a; }
.bar { background: linear-gradient(to bottom, rgba(7,6,10,.7), transparent); backdrop-filter: none; }
main.is-empty { justify-content: center; }
main.is-empty .hero { padding: 0 0 26px; text-align: center; margin-top: auto; }
.hero h1 {
  font-size: clamp(48px, 9vw, 96px); line-height: .95; color: #fff7ee;
  text-shadow: 0 2px 30px rgba(0,0,0,.6);
}
.hero h1 em {
  font-style: italic;
  color: #ff9a62;
}
.hero .sub { margin: 18px auto 0; color: rgba(255,240,225,.82); text-shadow: 0 1px 12px rgba(0,0,0,.7); }
main.is-empty .chips { justify-content: center; }
.composer {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-color: rgba(255,214,170,.18);
}
.composer:focus-within { border-color: rgba(255,170,110,.5); box-shadow: var(--shadow); }
.model-chip { background: rgba(255,255,255,.05); }
.chips button { background: rgba(14,11,12,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--muted); border-color: var(--line); font-family: var(--mono); font-size: 12.5px; }
.chips button:hover { color: #fff; border-color: rgba(255,170,110,.5); }
.msg.user { background: rgba(255,240,225,.92); color: #160d08; }
.msg.ai .body pre { background: var(--solid); }
.drawer, .sheet { background: var(--solid); }
.sheet-head input[type=search], .settings input[type=password], .settings textarea { background: rgba(255,255,255,.04); }
.foot { color: rgba(255,240,225,.72); }
.wallet-btn { background: rgba(14,11,12,.4); }
.wallet-btn.on { background: var(--ink); color: #120c09; }

@media (max-width: 560px) {
  .eclipse { --d: 78vmin; top: 34%; }
  .ridge { width: 220%; left: -60%; }
  .ridge.far { height: 22vh; }
  .ridge.near { height: 15vh; }
  .hero h1 { font-size: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .corona, .halo, .ridge, .mist, .eclipse { animation: none !important; }
}

/* ---------- display type (Bricolage) ---------- */
.brand { font: 700 23px/1 var(--serif); letter-spacing: -0.04em; font-variation-settings: "opsz" 96; }
.hero h1 {
  font-family: var(--serif); font-weight: 700; letter-spacing: -0.045em; line-height: .92;
  font-variation-settings: "opsz" 96; font-size: clamp(46px, 8.4vw, 98px);
}
.hero h1 em { font-style: normal; font-weight: 300; letter-spacing: -0.04em; }
.msg.ai .body h1, .msg.ai .body h2, .msg.ai .body h3, .settings h2 { font-weight: 650; letter-spacing: -0.03em; }

/* ---------- nav ---------- */
.nav { display: flex; gap: 4px; margin-right: 6px; }
.nav button, .tabs button {
  background: none; border: 0; height: 34px; padding: 0 12px; border-radius: 8px;
  font: 500 12.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: rgba(243, 236, 226, .58); transition: color .15s;
}
.nav button:hover, .tabs button:hover { color: var(--ink); }
.signin {
  height: 38px; padding: 0 18px; border: 0; border-radius: 10px;
  background: #fbf3e6; color: #120c09;
  font: 500 13px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px; transition: background .15s, transform .1s;
}
.signin:hover { background: #fff; }
.signin.on { letter-spacing: .02em; text-transform: none; }
.signin.on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2f9e62; }
body:has(main.is-empty) #newBtn { display: none; }

/* ---------- info panel ---------- */
.sheet.info { width: min(680px, calc(100vw - 32px)); max-height: min(720px, 86vh); }
.info-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 8px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; overflow-x: auto; }
.tabs button[aria-selected="true"] { color: var(--ink); background: rgba(255,255,255,.06); }
.info-body { padding: 22px 24px 26px; overflow-y: auto; font-size: 14.5px; }
.info-body h2 { font: 700 30px/1.05 var(--serif); letter-spacing: -0.035em; margin: 0 0 6px; }
.info-body h3 { font: 500 11.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin: 24px 0 10px; }
.info-body p { color: var(--muted); margin: 0 0 10px; }
.info-body ul { margin: 0; padding-left: 18px; color: var(--muted); }
.info-body li { margin: 4px 0; }
.info-body strong { color: var(--ink); font-weight: 500; }
.info-body pre { background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font: 12.5px/1.6 var(--mono); color: var(--ink); }
.info-body code { font-family: var(--mono); font-size: .92em; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 13.5px; }
.kv dt { color: var(--faint); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding-top: 2px; }
.kv dd { margin: 0; color: var(--ink); font-family: var(--mono); overflow-wrap: anywhere; }
.kv a { color: var(--accent); }
.info-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.info-actions button, .info-actions a {
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--ink);
  border-radius: 10px; padding: 9px 14px; font: 500 13px/1 var(--sans); text-decoration: none;
}
.info-actions .go { background: #fbf3e6; color: #120c09; border-color: transparent; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat b { display: block; font: 600 20px/1.1 var(--serif); letter-spacing: -0.02em; color: var(--ink); }
.stat span { font: 11px/1.3 var(--mono); color: var(--faint); letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 760px) {
  .nav { display: none; }
}
@media (max-width: 560px) {
  .signin { padding: 0 12px; font-size: 12px; letter-spacing: .1em; }
  .signin.on { max-width: 150px; overflow: hidden; white-space: nowrap; }
  .stat-row { grid-template-columns: 1fr; }
  .info-body { padding: 18px; }
}
.drawer-nav { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding: 10px 0; margin-bottom: 4px; }
.drawer-nav button { text-align: left; background: none; border: 0; padding: 10px; border-radius: 8px; font: 500 12.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.drawer-nav button:hover { color: var(--ink); background: rgba(255,255,255,.05); }

/* ---------- display caps (Marcellus, flared serif) ---------- */
:root { --display: "Marcellus", "Cinzel", ui-serif, Georgia, serif; }
.brand { font: 400 24px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.hero h1 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  letter-spacing: -0.005em; line-height: 1; font-size: clamp(42px, 7.2vw, 96px);
  font-variation-settings: normal; font-stretch: normal; text-wrap: balance;
}
.hero h1 em { font-weight: 400; font-stretch: normal; letter-spacing: -0.005em; }
.hero .sub { font-size: 17px; }
@media (max-width: 560px) { .hero h1 { font-size: 10.4vw; } }

/* ---------- headline: always two lines ---------- */
.hero h1 { font-size: clamp(30px, 5vw, 66px); line-height: 1.04; }
.hero h1 > span, .hero h1 > em { display: block; white-space: nowrap; }
@media (max-width: 560px) { .hero h1 { font-size: 8.4vw; } }

/* =========================================================
   Composer — tabbed card with a hardware-style Send key
   ========================================================= */
.composer { background: none; border: 0; padding: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.composer:focus-within { box-shadow: none; border: 0; }

.c-tab {
  display: inline-flex; align-items: center; gap: 9px; margin-left: 26px;
  padding: 9px 16px 8px 13px; border-radius: 12px 12px 0 0;
  background: #1b1718; border: 1px solid rgba(255,214,170,.12); border-bottom: 0;
  font: 500 11.5px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  cursor: pointer; user-select: none; position: relative; top: 1px; transition: color .15s;
}
.c-tab:hover { color: var(--ink); }
.c-tab input { position: absolute; opacity: 0; pointer-events: none; }
.c-tab .box { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid currentColor; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.c-tab input:checked + .box { background: var(--accent); border-color: var(--accent); }
.c-tab input:checked + .box::after { content: ""; width: 7px; height: 4px; border: 1.8px solid #1a0904; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.c-tab input:checked ~ span:last-child { color: var(--accent-2); }
.c-tab input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }

.c-card {
  display: grid; grid-template-columns: 1fr 200px; gap: 16px;
  background: rgba(20, 17, 18, .94); border: 1px solid rgba(255,214,170,.12);
  border-radius: 22px; padding: 18px 16px 16px 22px;
  box-shadow: 0 30px 80px -24px rgba(0,0,0,.85);
  transition: border-color .2s;
}
.composer:focus-within .c-card { border-color: rgba(255,214,170,.24); }
.c-main { display: flex; flex-direction: column; min-width: 0; }
.c-main textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: none; color: var(--ink);
  font: 400 19px/1.45 var(--sans); min-height: 60px; max-height: 40vh; padding: 2px 0 0;
}
.c-main textarea::placeholder { color: rgba(243,236,226,.58); }
.c-row { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 14px; }

.c-plus {
  flex: none; width: 46px; height: 46px; border-radius: 13px; border: 0;
  background: rgba(255,255,255,.05); color: var(--muted); display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.c-plus:hover { background: rgba(255,255,255,.09); color: var(--ink); }

.c-model {
  min-width: 0; height: 46px; display: inline-flex; align-items: center; gap: 11px;
  padding: 0 6px 0 14px; border-radius: 13px;
  border: 1px solid rgba(255,214,170,.2); background: rgba(255,236,214,.035);
  transition: border-color .15s, background .15s;
}
.c-model:hover { border-color: rgba(255,214,170,.38); background: rgba(255,236,214,.06); }
.c-glyph { flex: none; width: 17px; height: 17px; border-radius: 50%; border: 1.6px solid var(--ink); position: relative; }
.c-glyph::after { content: ""; position: absolute; width: 22px; height: 1.6px; background: var(--ink); left: -4px; top: 6px; transform: rotate(-35deg); }
.c-name { font: 500 15.5px/1 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.c-badge {
  flex: none; padding: 9px 11px; border-radius: 9px;
  background: linear-gradient(180deg, #f6e1b2, #dcb66f); color: #2a1a06;
  font: 600 13px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
.c-badge:empty { display: none; }

.c-switch { flex: none; display: inline-flex; align-items: center; gap: 12px; margin-left: 4px; cursor: pointer; user-select: none; }
.c-switch > span:first-child { font: 500 12.5px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.c-switch input { position: absolute; opacity: 0; pointer-events: none; }
.c-switch .track {
  width: 56px; height: 34px; border-radius: 99px; padding: 4px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  display: block; transition: background .2s, border-color .2s;
}
.c-switch .knob {
  display: block; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffffff 0%, #e4dccf 35%, #a49a8b 75%, #6f675c 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  transition: transform .25s cubic-bezier(.3,1.4,.5,1), background .25s;
}
.c-switch input:checked ~ .track { background: rgba(255,106,61,.16); border-color: rgba(255,140,90,.45); }
.c-switch input:checked ~ .track .knob {
  transform: translateX(20px);
  background: radial-gradient(circle at 34% 30%, #ffe2c4 0%, #ff9a5c 40%, #d9481c 80%, #8c2a0e 100%);
}
.c-switch input:checked ~ span:first-child, .c-switch:has(input:checked) > span:first-child { color: var(--accent-2); }
.c-switch input:focus-visible ~ .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.c-send {
  align-self: stretch; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 118px; padding: 16px 16px 14px; border: 0; border-radius: 18px;
  background: linear-gradient(180deg, #f8bf92 0%, #f1945a 55%, #ea7a3f 100%);
  color: #1a0904;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(0,0,0,.08), 0 6px 0 #a9461b, 0 14px 24px -8px rgba(0,0,0,.6);
  transition: transform .08s, box-shadow .08s, filter .2s;
  margin-bottom: 6px;
}
.c-send:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 2px 0 #a9461b, 0 6px 12px -6px rgba(0,0,0,.6); }
.c-send:disabled { cursor: default; }
.c-send-label { flex: 1; display: grid; place-items: center; font: 500 17px/1 var(--mono); letter-spacing: .26em; text-transform: uppercase; padding-left: .26em; }
.c-send-meta { display: flex; justify-content: space-between; font: 600 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.c-meter { display: block; height: 4px; border-radius: 4px; background: rgba(26,9,4,.18); margin-top: 8px; overflow: hidden; }
.c-meter > span { display: block; height: 100%; width: 0; background: #1a0904; border-radius: 4px; transition: width .3s; }
.busy .c-send { background: linear-gradient(180deg, #3a2a24, #251a17); color: #ffd9c2; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 6px 0 #120c0a, 0 14px 24px -8px rgba(0,0,0,.6); }
.busy .c-meter { background: rgba(255,217,194,.15); }
.busy .c-meter > span { background: #ffd9c2; }

/* chat mode: tighter */
main:not(.is-empty) .c-main textarea { min-height: 30px; font-size: 17px; }
main:not(.is-empty) .c-send { min-height: 96px; }

@media (max-width: 640px) {
  .c-tab { margin-left: 18px; }
  .c-card { grid-template-columns: 1fr; padding: 16px 14px 14px; gap: 12px; }
  .c-row { gap: 8px; }
  .c-plus { width: 42px; height: 42px; }
  .c-model { height: 42px; flex: 1; }
  .c-name { font-size: 14.5px; }
  .c-switch { gap: 8px; margin-left: 0; }
  .c-switch > span:first-child { display: none; }
  .c-send, main:not(.is-empty) .c-send { min-height: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 16px; padding: 14px 16px 12px; }
  .c-send-label { place-items: start; font-size: 15px; }
  .c-send-meta { justify-content: flex-end; gap: 12px; }
  .c-meter { grid-column: 1 / -1; }
}

/* ---------- size tune: bigger headline, compact composer ---------- */
.hero h1 { font-size: clamp(34px, 5.9vw, 80px); }
main.is-empty .composer { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
.c-tab { margin-left: 22px; padding: 7px 13px 6px 11px; font-size: 11px; gap: 8px; }
.c-tab .box { width: 12px; height: 12px; }
.c-card { grid-template-columns: 1fr 150px; gap: 12px; padding: 14px 12px 12px 18px; border-radius: 18px; }
.c-main textarea { font-size: 16px; min-height: 40px; }
.c-row { gap: 8px; padding-top: 10px; }
.c-plus { width: 38px; height: 38px; border-radius: 11px; }
.c-model { height: 38px; gap: 9px; padding: 0 4px 0 11px; border-radius: 11px; }
.c-glyph { width: 15px; height: 15px; }
.c-glyph::after { width: 19px; left: -3.5px; top: 5.5px; }
.c-name { font-size: 14px; max-width: 170px; }
.c-badge { padding: 7px 8px; font-size: 11.5px; border-radius: 8px; }
.c-switch { gap: 9px; }
.c-switch > span:first-child { font-size: 11px; }
.c-switch .track { width: 46px; height: 28px; padding: 3px; }
.c-switch .knob { width: 20px; height: 20px; }
.c-switch input:checked ~ .track .knob { transform: translateX(18px); }
.c-send { min-height: 88px; padding: 12px 12px 10px; border-radius: 14px; margin-bottom: 5px; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(0,0,0,.08), 0 5px 0 #a9461b, 0 12px 20px -8px rgba(0,0,0,.6); }
.c-send-label { font-size: 14.5px; }
.c-send-meta { font-size: 11px; }
.c-meter { height: 3px; margin-top: 6px; }
main:not(.is-empty) .c-main textarea { min-height: 26px; font-size: 16px; }
main:not(.is-empty) .c-send { min-height: 80px; }
@media (max-width: 640px) {
  .c-card { grid-template-columns: 1fr; }
  .c-send, main:not(.is-empty) .c-send { min-height: 0; }
}

/* sign-in nudge when the free quota runs out */
.signin.nudge { animation: nudge .6s cubic-bezier(.3,1.6,.5,1) 2; box-shadow: 0 0 0 3px rgba(255,106,61,.55); }
@keyframes nudge { 30% { transform: translateY(-3px) scale(1.04); } 60% { transform: translateY(0) scale(.98); } }

/* ---------- reasoning ("Thinking…") ---------- */
.think { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.think summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.think summary::-webkit-details-marker { display: none; }
.think summary::before { content: "▸"; font-size: 11px; transition: transform .15s; }
.think[open] summary::before { transform: rotate(90deg); }
.think .t-time { color: var(--faint); letter-spacing: .04em; text-transform: none; }
.think.live .t-label { color: var(--ink); animation: thinkfade 1.4s ease-in-out infinite; }
@keyframes thinkfade { 50% { opacity: .45; } }
.think .t-body { max-height: 180px; overflow-y: auto; padding: 0 12px 10px; font-size: 13px; line-height: 1.55; color: var(--faint); white-space: pre-wrap; }

/* ---------- web sources ---------- */
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.sources a {
  display: inline-flex; align-items: center; gap: 7px; max-width: 260px;
  padding: 6px 10px 6px 6px; border-radius: 9px; text-decoration: none;
  border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--ink); font-size: 12.5px;
  transition: border-color .15s, background .15s;
}
.sources a:hover { border-color: rgba(255,170,110,.45); background: rgba(255,255,255,.06); }
.sources b { flex: none; width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; background: rgba(255,106,61,.18); color: var(--accent-2); font: 600 11px/1 var(--mono); }
.sources span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sources small { color: var(--faint); font: 11px var(--mono); white-space: nowrap; }
.web-tag { color: var(--accent-2); }

/* ---------- brand mark + X ---------- */
.brand .logo { width: 26px; height: 26px; display: block; }
.x-link { color: rgba(243,236,226,.7); text-decoration: none; }
.x-link:hover { color: #fff; }
.drawer-nav a { display: block; padding: 10px; border-radius: 8px; font: 500 12.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.drawer-nav a:hover { color: var(--ink); background: rgba(255,255,255,.05); }
