/* FLAM — FYRE charte: Raleway everywhere (same treatment as fyre.one), dark teal-charcoal grounds,
   mint ink, emerald accent. Real on-trade photography behind glass panels. */
:root {
  --ground: #121A1D; --ground-2: #10322A; --panel: rgba(18,28,33,.72); --panel-solid: #16222A; --line: rgba(143,160,164,.18); --line-strong: rgba(20,210,166,.35);
  --ink: #EDFBF6; --muted: #8FA0A4; --emerald: #14D2A6; --mint: #26DC9E; --steel: #1F6786; --amber: #F7B440; --red: #E36B6B;
  --radius: 16px; --amp: 0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: 'Raleway', system-ui, sans-serif; background: var(--ground); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--mint); }
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; text-wrap: balance; margin: 0; }
.eyebrow { font: 700 12px/1 'Raleway', system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); }
.logo { height: 34px; width: auto; display: block; }
.logo.small { height: 26px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 999px; padding: 13px 24px; font: 700 14px/1 'Raleway', system-ui, sans-serif; letter-spacing: .04em; border: 1px solid transparent; background: var(--emerald); color: #072A22; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(20,210,166,.25); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { box-shadow: none; border-color: var(--emerald); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12.5px; padding: 6px 4px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }

/* ---------- Gate ---------- */
.gate { position: relative; min-height: 100%; display: grid; place-items: center; padding: 32px; overflow: hidden; }
.gate-bg { position: absolute; inset: 0; background: url("/bg-hero.jpg") center/cover no-repeat, var(--ground); }
.gate-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,26,29,.96) 0%, rgba(18,26,29,.82) 40%, rgba(18,26,29,.45) 100%), linear-gradient(0deg, rgba(18,26,29,.9), transparent 50%); }
.gate-inner { position: relative; width: min(1100px, 100%); display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.gate-copy .logo { margin-bottom: 36px; height: 40px; }
.gate-copy h1 { font-size: clamp(42px, 6vw, 72px); line-height: 1.02; margin: 12px 0 18px; }
.lead { font-size: 17px; line-height: 1.55; color: var(--ink); max-width: 520px; margin: 0 0 22px; font-weight: 500; }
.gate-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; font-weight: 600; }
.gate-facts span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); margin-right: 8px; vertical-align: 2px; }
.gate-card { background: var(--panel); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 22px; padding: 30px 28px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.gate-avatar { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--line-strong), 0 0 30px rgba(20,210,166,.25); margin-bottom: 18px; }
.gate-form { display: grid; gap: 10px; }
.gate input { background: rgba(10,16,19,.7); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none; }
.gate input:focus { border-color: var(--emerald); }
.gate-error { color: var(--red); font-size: 13px; margin: 12px 0 0; }
.gate-foot { color: var(--muted); font-size: 12px; margin: 16px 0 0; }

/* ---------- Layout: stage | flow ---------- */
.app { display: grid; grid-template-columns: minmax(380px, 42%) 1fr; height: 100vh; overflow: hidden; }
/* Both columns are grid items: without min-height: 0 they grow with their content and the whole page scrolls. */
.stage { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px 22px 14px; overflow-y: auto; min-height: 0; border-right: 1px solid var(--line); }
.stage-bg { position: absolute; inset: 0; z-index: -1; background: url("/bg-stage.jpg") center/cover no-repeat, var(--ground); }
.stage-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,26,29,.78), rgba(18,26,29,.9) 55%, rgba(18,26,29,.97)); }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.who-line { color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: right; }
.who-line .dot { margin: 0 6px; }

/* Presence */
.presence { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 0; flex: none; }
.halo { position: absolute; top: 6px; width: min(46%, 210px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(38,220,158,.5), rgba(20,210,166,.12) 55%, transparent 72%); filter: blur(20px); transform: scale(calc(1 + var(--amp) * .35)); opacity: calc(.4 + var(--amp) * .6); transition: transform .08s linear, opacity .08s linear; pointer-events: none; }
.frame { position: relative; width: min(46%, 210px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--line-strong), 0 0 calc(24px + var(--amp) * 50px) rgba(20,210,166,calc(.25 + var(--amp) * .4)), 0 30px 60px rgba(0,0,0,.5); background: #0b1215; }
.frame .still, .frame .vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame .vid { opacity: 0; transition: opacity .35s ease; }
.frame.has-video .still { opacity: 0; }
.frame.has-video .vid.idle { opacity: 1; }
.frame.has-video.talking .vid.idle { opacity: 0; }
.frame.has-video.talking .vid.talk { opacity: 1; }
.frame.thinking { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 2px rgba(247,180,64,.5), 0 0 34px rgba(247,180,64,.35), 0 30px 60px rgba(0,0,0,.5); } }
.name-line { display: flex; align-items: baseline; gap: 12px; margin-top: 2px; }
.name-line .name { font-weight: 800; font-size: 20px; letter-spacing: .12em; }
.state { color: var(--muted); font-size: 13px; font-weight: 600; }
.state.live { color: var(--mint); }
.state.listening { color: var(--amber); }
.caption { min-height: 40px; max-width: 440px; text-align: center; font-size: 15px; line-height: 1.4; font-weight: 500; color: var(--ink); padding: 0 8px; }

.controls { display: flex; align-items: center; justify-content: center; gap: 18px; flex: none; }
.mic { width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--emerald); color: #072A22; cursor: pointer; display: grid; place-items: center; flex: none; box-shadow: 0 14px 36px rgba(20,210,166,.3); transition: transform .15s ease; }
.mic:hover { transform: translateY(-1px); }
.mic.listening { background: var(--amber); animation: glow 1.2s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 14px rgba(247,180,64,.18); } }
.mic:disabled { opacity: .35; cursor: not-allowed; }
.controls-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.toggle { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.toggle input { accent-color: var(--emerald); }
#lang { background: rgba(10,16,19,.7); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; }

.panel { background: var(--panel); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 8px; }
.profile { font-size: 13px; line-height: 1.5; }
.profile b { color: var(--mint); font-weight: 700; }
.profile .muted { color: var(--muted); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn.tiny { padding: 5px 10px; font-size: 12px; border-radius: 9px; }
.history { display: grid; align-content: start; gap: 4px; max-height: 240px; overflow-y: auto; font-size: 13px; }
.history .muted { color: var(--muted); }
.history .day { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 6px 0 2px; }
.history .day:first-child { margin-top: 0; }
.hist { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; text-align: left; width: 100%; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 7px 10px; color: var(--ink); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.hist:hover { background: rgba(10,16,19,.55); border-color: var(--line); }
.hist.current { background: rgba(20,210,166,.12); border-color: var(--emerald); }
.hist .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hist .m { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.history-panel { flex: 1 1 auto; min-height: 150px; display: flex; flex-direction: column; }
.history-panel .history { flex: 1; max-height: none; min-height: 0; }
.profile-panel { flex: none; }
.profile-form { display: grid; gap: 6px; font-size: 12.5px; }
.profile-form label { display: grid; gap: 3px; color: var(--muted); font-weight: 700; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.profile-form input, .profile-form textarea { background: rgba(10,16,19,.7); border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; font-size: 13px; font-weight: 500; color: var(--ink); outline: none; text-transform: none; letter-spacing: 0; resize: vertical; }
.profile-form input:focus, .profile-form textarea:focus { border-color: var(--emerald); }
.profile-actions { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.side-foot { margin-top: 0; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding-top: 2px; }

/* Question chips in the flow */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips .muted { color: var(--muted); font-size: 12.5px; font-weight: 600; width: 100%; }
.chip { text-align: left; background: rgba(10,16,19,.55); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.chip:hover { border-color: var(--emerald); background: rgba(20,210,166,.08); }
.chips.starters { justify-content: center; margin-top: 10px; }
.chips.starters .chip { background: var(--panel); }
.chips.followups { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- Flow ---------- */
.flow { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.flow-bg { position: absolute; inset: 0; z-index: -1; background: url("/bg-texture.jpg") center/cover no-repeat, var(--ground); }
.flow-bg::after { content: ""; position: absolute; inset: 0; background: rgba(18,26,29,.9); }
.flow-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.status { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.thread { flex: 1; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.welcome { max-width: 640px; margin: 48px auto; text-align: center; color: var(--muted); font-size: 15.5px; }
.welcome h2 { color: var(--ink); font-size: 30px; margin: 0 0 10px; }

.msg { display: flex; gap: 12px; max-width: 980px; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; max-width: 760px; }
.msg .who { width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; }
.msg.user .who { background: var(--steel); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.bubble { background: var(--panel); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; min-width: 0; max-width: 100%; }
.msg.user .bubble { background: rgba(16,50,42,.75); border-color: rgba(20,210,166,.25); font-weight: 500; }
.bubble p { margin: 0 0 10px; } .bubble p:last-child { margin-bottom: 0; }
.bubble h1, .bubble h2, .bubble h3 { margin: 14px 0 6px; font-size: 15px; color: var(--mint); letter-spacing: 0; font-weight: 800; }
.bubble ul, .bubble ol { margin: 4px 0 10px; padding-left: 20px; }
.bubble li { margin: 3px 0; }
.bubble code { background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.bubble pre { background: rgba(10,16,19,.7); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; font-size: 12.5px; }
.bubble table { border-collapse: collapse; margin: 8px 0 12px; font-size: 13px; max-width: 100%; display: block; overflow-x: auto; }
.bubble th, .bubble td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; white-space: nowrap; }
.bubble th { color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.bubble td.num, .bubble th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bubble strong { color: var(--ink); }
.cursor::after { content: "▍"; color: var(--emerald); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.activity { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 8px; }
.act { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.act .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; }
.act.ok .dot { background: var(--emerald); } .act.err .dot { background: var(--red); }
.act.run .dot { animation: pulse 1s infinite; }
.act.think { color: var(--muted); font-style: italic; font-weight: 500; animation: shimmer 2.4s ease-in-out infinite; }
.act.think .dot { background: var(--emerald); animation: pulse 1.4s infinite; }
@keyframes shimmer { 50% { opacity: .55; } }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .5; } }

.table-card, .chart-card, .file-card { background: rgba(10,16,19,.6); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.table-card summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.table-card table { font-size: 12.5px; margin-top: 8px; border-collapse: collapse; display: block; overflow-x: auto; }
.table-card th, .table-card td { padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-card .num { text-align: right; font-variant-numeric: tabular-nums; }
.chart-card .title { font-weight: 700; margin-bottom: 4px; }
.chart-card .note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.chart-card svg { width: 100%; height: auto; display: block; }
.file-card { display: flex; align-items: center; gap: 12px; }
.file-card .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 11px; background: var(--ground-2); color: var(--mint); }
.file-card .ico.pptx { background: #3a2a14; color: var(--amber); }
.file-card a { font-weight: 700; text-decoration: none; }
.file-card small { color: var(--muted); display: block; }
.error { color: var(--red); font-size: 13px; }
.feedback { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; }
.feedback .muted { color: var(--muted); }
.feedback button { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; cursor: pointer; font-size: 14px; }
.feedback button:hover { border-color: var(--emerald); }

.composer { display: flex; gap: 10px; padding: 14px 24px 18px; border-top: 1px solid var(--line); align-items: flex-end; background: rgba(18,26,29,.6); backdrop-filter: blur(10px); }
.composer textarea { flex: 1; resize: none; background: rgba(10,16,19,.7); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none; max-height: 180px; }
.composer textarea:focus { border-color: var(--emerald); }
.send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--emerald); color: #072A22; cursor: pointer; display: grid; place-items: center; flex: none; }

@media (max-width: 900px) {
  .gate-inner { grid-template-columns: 1fr; gap: 24px; }
  .gate-copy h1 { font-size: 40px; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .stage .panel, .stage .side-foot { display: none; }
  .frame, .halo { width: min(52%, 220px); }
  .thread { padding: 14px; }
  .composer { padding: 10px 12px 14px; }
}
