/* =========================================================================
   Astryx-style design tokens — "AI Chat Landing" + "AI Chat Conversation"
   Dark, glassy, gradient-accented. Pure CSS, no build step.
   ========================================================================= */
:root {
  --bg: #07080c;
  --bg-elev: #0d0f16;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-strong: rgba(255, 255, 255, 0.16);

  --text: #f2f4f8;
  --text-dim: #a2a9bb;
  --text-faint: #6b7286;

  --brand: #6c8cff;
  --brand-2: #b06cff;
  --brand-3: #34e5d0;
  --grad: linear-gradient(110deg, var(--brand) 0%, var(--brand-2) 52%, var(--brand-3) 100%);
  --grad-soft: linear-gradient(140deg, rgba(108,140,255,.22), rgba(176,108,255,.14) 55%, rgba(52,229,208,.12));

  --danger: #ff6b81;
  --ok: #3ddc97;
  --warn: #ffc857;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, .9);
  --shadow-glow: 0 0 0 1px var(--stroke), 0 20px 60px -25px rgba(108, 140, 255, .55);

  --font: "Inter", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans KR", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --maxw: 1180px;
  --rail: 288px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

@media (prefers-color-scheme: light) {
  :root.auto-theme {
    --bg: #f7f8fc; --bg-elev: #ffffff;
    --surface: rgba(10, 12, 20, .035); --surface-2: rgba(10,12,20,.06);
    --stroke: rgba(10, 12, 20, .1); --stroke-strong: rgba(10,12,20,.18);
    --text: #0d1020; --text-dim: #4d566e; --text-faint: #858da3;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: rgba(108,140,255,.35); }

/* ---------- ambient background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
}
.aurora::before {
  width: 720px; height: 720px; top: -280px; left: -160px;
  background: radial-gradient(circle at 30% 30%, rgba(108,140,255,.75), transparent 62%);
  animation: drift 26s var(--ease) infinite alternate;
}
.aurora::after {
  width: 640px; height: 640px; top: -180px; right: -180px;
  background: radial-gradient(circle at 70% 40%, rgba(176,108,255,.6), transparent 62%);
  animation: drift 32s var(--ease) infinite alternate-reverse;
}
.grid-fade {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 10%, transparent 72%);
}
@keyframes drift { to { transform: translate3d(90px, 70px, 0) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---------- shell ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--stroke);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 650; letter-spacing: -.02em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; box-shadow: 0 6px 22px -6px rgba(108,140,255,.85);
}
.brand .mark svg { width: 17px; height: 17px; }
.nav-links { display: flex; gap: 26px; margin-left: 12px; }
.nav-links a { color: var(--text-dim); font-size: 14.5px; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ---------- buttons ---------- */
.btn {
  --pad: 12px 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: var(--pad); border-radius: var(--r-pill); border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; cursor: pointer;
  background: var(--surface); border-color: var(--stroke); color: var(--text);
  transition: transform .18s var(--ease), background .2s, border-color .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--stroke-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.btn-primary { background: var(--grad); color: #08090f; border-color: transparent; box-shadow: 0 10px 34px -12px rgba(108,140,255,.9); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.07); }
.btn-lg { --pad: 15px 28px; font-size: 16px; }
.btn-ghost { background: transparent; }
.btn-icon { --pad: 0; width: 40px; height: 40px; border-radius: 12px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- pills / chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 15px 7px 9px;
  border-radius: var(--r-pill); border: 1px solid var(--stroke);
  background: var(--surface); font-size: 13px; color: var(--text-dim);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(61,220,151,.16); }
.pill .dot.busy { background: var(--warn); box-shadow: 0 0 0 4px rgba(255,200,87,.16); animation: pulse 1.3s infinite; }
.pill .dot.off { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,107,129,.16); }
@keyframes pulse { 50% { opacity: .35; } }
.pill .tag { padding: 2px 9px; border-radius: var(--r-pill); background: var(--grad); color: #0a0b11; font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- hero (Landing) ---------- */
.hero { padding: 96px 0 72px; text-align: center; }
.hero h1 {
  margin: 26px 0 0; font-size: clamp(40px, 6.4vw, 76px); line-height: 1.03;
  letter-spacing: -.045em; font-weight: 700;
}
.hero h1 .grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lede {
  margin: 22px auto 0; max-width: 640px; font-size: clamp(16px, 1.8vw, 19px); color: var(--text-dim);
}
.hero-actions { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- landing composer ---------- */
.launcher {
  margin: 52px auto 0; max-width: 760px; text-align: left;
  border-radius: var(--r-xl); padding: 1px; background: var(--grad); box-shadow: var(--shadow-lg);
}
.launcher-inner {
  border-radius: calc(var(--r-xl) - 1px); background: var(--bg-elev);
  padding: 18px 18px 14px;
}
.launcher textarea {
  width: 100%; min-height: 64px; max-height: 200px; resize: none; border: 0; outline: 0;
  background: transparent; font-size: 16.5px; line-height: 1.55; padding: 6px 4px;
}
.launcher textarea::placeholder { color: var(--text-faint); }
.launcher-bar { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--stroke); }
.launcher-bar .hint { font-size: 12.5px; color: var(--text-faint); margin-right: auto; }

.suggest { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }
.chip {
  padding: 10px 16px; border-radius: var(--r-pill); border: 1px solid var(--stroke);
  background: var(--surface); color: var(--text-dim); font-size: 14px; cursor: pointer;
  transition: all .2s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--stroke-strong); background: var(--surface-2); transform: translateY(-2px); }

/* ---------- sections ---------- */
.section { padding: 84px 0; }
.section-head { max-width: 620px; margin: 0 auto 48px; text-align: center; }
.eyebrow {
  font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-head h2 { margin: 12px 0 0; font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -.035em; line-height: 1.12; }
.section-head p { margin: 14px 0 0; color: var(--text-dim); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); gap: 18px; }
.card {
  position: relative; border: 1px solid var(--stroke); border-radius: var(--r-lg);
  background: var(--surface); padding: 26px; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.card::after {
  content: ""; position: absolute; inset: 0; opacity: 0; background: var(--grad-soft); transition: opacity .3s;
}
.card:hover { transform: translateY(-4px); border-color: var(--stroke-strong); }
.card:hover::after { opacity: 1; }
.card > * { position: relative; z-index: 1; }
.card .ico {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--stroke); margin-bottom: 16px;
}
.card h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.02em; }
.card p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.step { border: 1px solid var(--stroke); border-radius: var(--r-lg); padding: 24px; background: var(--surface); }
.step .n {
  counter-increment: s; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #0a0b11; font-weight: 800; font-size: 13px; margin-bottom: 14px;
}
.step .n::before { content: counter(s); }
.step h3 { margin: 0 0 6px; font-size: 16.5px; }
.step p { margin: 0; color: var(--text-dim); font-size: 14px; }

/* ---------- preview mock ---------- */
.preview {
  border: 1px solid var(--stroke); border-radius: var(--r-xl); overflow: hidden;
  background: linear-gradient(180deg, var(--bg-elev), rgba(13,15,22,.4)); box-shadow: var(--shadow-lg);
}
.preview-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--stroke); }
.preview-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--stroke-strong); }
.preview-body { padding: 26px; display: grid; gap: 16px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--stroke); padding: 44px 0; color: var(--text-faint); font-size: 13.5px; }
.footer-inner { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer a:hover { color: var(--text); }

/* =========================================================================
   AI Chat Conversation
   ========================================================================= */
.app { display: grid; grid-template-columns: var(--rail) 1fr; height: 100dvh; position: relative; z-index: 1; }

.rail {
  border-right: 1px solid var(--stroke); background: color-mix(in srgb, var(--bg-elev) 80%, transparent);
  backdrop-filter: blur(12px); display: flex; flex-direction: column; min-height: 0;
}
.rail-head { padding: 18px 16px; display: flex; align-items: center; gap: 10px; }
.rail-new { margin: 0 16px 14px; }
.rail-new .btn { width: 100%; }
.rail-scroll { flex: 1; overflow-y: auto; padding: 6px 10px 16px; }
.rail-label { padding: 12px 8px 6px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.thread {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; background: transparent;
  color: var(--text-dim); font-size: 14px; cursor: pointer; transition: all .18s;
}
.thread:hover { background: var(--surface); color: var(--text); }
.thread.active { background: var(--surface-2); border-color: var(--stroke); color: var(--text); }
.thread span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot { border-top: 1px solid var(--stroke); padding: 14px 16px; display: grid; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-faint); }
.kv b { font-weight: 600; color: var(--text-dim); font-family: var(--mono); font-size: 11.5px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 26px;
  border-bottom: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(12px);
}
.topbar h1 { margin: 0; font-size: 16px; letter-spacing: -.02em; font-weight: 650; }
.topbar .sub { font-size: 12.5px; color: var(--text-faint); }
.topbar .spacer { margin-left: auto; }

.stream { flex: 1; overflow-y: auto; scroll-behavior: smooth; padding: 30px 0 8px; }
.stream-inner { max-width: 820px; margin: 0 auto; padding: 0 26px; display: flex; flex-direction: column; gap: 26px; }

.msg { display: flex; gap: 14px; animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.msg .av {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  border: 1px solid var(--stroke); background: var(--surface); font-size: 13px; font-weight: 700;
}
.msg.bot .av { background: var(--grad); color: #0a0b11; border-color: transparent; }
.msg .body { min-width: 0; flex: 1; }
.msg .who { font-size: 12.5px; color: var(--text-faint); margin-bottom: 5px; font-weight: 600; letter-spacing: .02em; }
.bubble {
  border: 1px solid var(--stroke); background: var(--surface); border-radius: 18px;
  padding: 14px 18px; font-size: 15.4px; line-height: 1.72; overflow-wrap: anywhere;
}
.msg.user .bubble { background: var(--grad-soft); border-color: rgba(108,140,255,.3); }
.msg.err .bubble { border-color: rgba(255,107,129,.4); background: rgba(255,107,129,.08); color: #ffc2cb; }
.bubble > *:first-child { margin-top: 0; }
.bubble > *:last-child { margin-bottom: 0; }
.bubble p { margin: 0 0 .85em; }
.bubble ul, .bubble ol { margin: 0 0 .85em; padding-left: 1.3em; }
.bubble li { margin: .25em 0; }
.bubble h1, .bubble h2, .bubble h3 { margin: 1em 0 .5em; line-height: 1.25; letter-spacing: -.02em; }
.bubble h1 { font-size: 21px; } .bubble h2 { font-size: 19px; } .bubble h3 { font-size: 17px; }
.bubble a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.bubble code {
  font-family: var(--mono); font-size: .88em; background: var(--surface-2);
  border: 1px solid var(--stroke); border-radius: 6px; padding: 1px 6px;
}
.bubble pre {
  background: #0a0c13; border: 1px solid var(--stroke); border-radius: 14px;
  padding: 14px 16px; overflow-x: auto; margin: 0 0 .85em;
}
.bubble pre code { background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.6; }
.bubble table { width: 100%; border-collapse: collapse; margin: 0 0 .85em; font-size: 14px; }
.bubble th, .bubble td { border: 1px solid var(--stroke); padding: 8px 11px; text-align: left; }
.bubble th { background: var(--surface-2); font-weight: 650; }
.bubble blockquote { margin: 0 0 .85em; padding-left: 14px; border-left: 3px solid var(--stroke-strong); color: var(--text-dim); }
.bubble img { max-width: 100%; border-radius: 12px; }

/* streaming affordances */
.bubble.live::after {
  content: ""; display: inline-block; width: 9px; height: 17px; margin-left: 3px;
  vertical-align: -3px; border-radius: 2px; background: var(--brand);
  animation: caret .9s steps(2, start) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.interim {
  display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-dim);
  border: 1px dashed var(--stroke-strong); border-radius: var(--r-pill); padding: 6px 14px;
  background: var(--surface);
}
.interim .spin {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--stroke-strong);
  border-top-color: var(--brand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); animation: bounce 1.25s infinite; }
.typing i:nth-child(2) { animation-delay: .16s; } .typing i:nth-child(3) { animation-delay: .32s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

/* citations + actions */
.sources { margin-top: 12px; border-top: 1px dashed var(--stroke); padding-top: 10px; }
.sources .lbl { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; margin-bottom: 8px; }
.sources ol { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-dim); }
.sources a { color: var(--brand); }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.actions .chip { font-size: 13.5px; padding: 8px 14px; }
.msg-tools { display: flex; gap: 6px; margin-top: 9px; opacity: 0; transition: opacity .2s; }
.msg:hover .msg-tools { opacity: 1; }
.msg-tools button {
  border: 1px solid var(--stroke); background: var(--surface); color: var(--text-faint);
  border-radius: 9px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.msg-tools button:hover { color: var(--text); border-color: var(--stroke-strong); }

/* 위치정보 — 컴포저 칩 + 전송 배지 */
.loc-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 250px;
  padding: 4px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--stroke); background: var(--surface);
  color: var(--text-faint); font-family: inherit; font-size: 12px; line-height: 1.4;
  cursor: pointer; transition: color .2s, background .2s, border-color .2s, opacity .2s;
}
.loc-chip:hover { color: var(--text-dim); border-color: var(--stroke-strong); background: var(--surface-2); }
.loc-chip svg { flex: none; }
.loc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-chip.on { color: var(--brand); border-color: rgba(108, 140, 255, .42); background: rgba(108, 140, 255, .1); }
.loc-chip.off { opacity: .5; }
.loc-chip.off svg { opacity: .65; }

.loc-note {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  padding: 4px 11px; border-radius: var(--r-pill);
  border: 1px dashed var(--stroke); color: var(--text-faint); font-size: 11.5px;
}
.loc-note svg { flex: none; color: var(--brand); }

.typing-note { margin-left: 9px; font-size: 12.5px; color: var(--text-faint); vertical-align: 2px; }

/* composer */
.composer-dock { padding: 14px 26px 22px; background: linear-gradient(180deg, transparent, var(--bg) 40%); }
.composer { max-width: 820px; margin: 0 auto; }
.composer-shell {
  border-radius: var(--r-lg); padding: 1px; background: var(--stroke-strong);
  transition: background .25s;
}
.composer-shell:focus-within { background: var(--grad); box-shadow: var(--shadow-glow); }
.composer-inner { border-radius: calc(var(--r-lg) - 1px); background: var(--bg-elev); padding: 12px 12px 10px; }
.composer textarea {
  width: 100%; min-height: 26px; max-height: 190px; resize: none; border: 0; outline: 0;
  background: transparent; font-size: 15.5px; line-height: 1.6; padding: 6px 6px 2px;
}
.composer textarea::placeholder { color: var(--text-faint); }
.composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.composer-bar .meta { font-size: 12px; color: var(--text-faint); margin-right: auto; display: flex; gap: 10px; align-items: center; }
.send {
  width: 38px; height: 38px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--grad); color: #0a0b11; display: grid; place-items: center;
  transition: transform .18s var(--ease), filter .2s;
}
.send:hover { transform: translateY(-1px) scale(1.03); }
.send[disabled] { opacity: .4; pointer-events: none; }
.stop { border: 1px solid var(--stroke-strong); background: var(--surface); border-radius: 12px; height: 38px; padding: 0 14px; cursor: pointer; font-size: 13.5px; }
.disclaimer { text-align: center; font-size: 11.5px; color: var(--text-faint); margin: 10px auto 0; max-width: 820px; }

/* empty state */
.empty { text-align: center; padding: 46px 0 10px; }
.empty .orb {
  width: 74px; height: 74px; border-radius: 24px; margin: 0 auto 22px; background: var(--grad);
  box-shadow: 0 24px 60px -20px rgba(108,140,255,.9); display: grid; place-items: center;
  animation: float 5s var(--ease) infinite alternate;
}
@keyframes float { to { transform: translateY(-9px); } }
.empty h2 { margin: 0 0 8px; font-size: 27px; letter-spacing: -.03em; }
.empty p { margin: 0 auto; max-width: 430px; color: var(--text-dim); font-size: 15px; }

/* config drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(3,4,8,.62); backdrop-filter: blur(5px); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(460px, 100vw); z-index: 91;
  background: var(--bg-elev); border-left: 1px solid var(--stroke); transform: translateX(102%);
  transition: transform .34s var(--ease); display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--stroke); }
.drawer-head h2 { margin: 0; font-size: 16.5px; }
.drawer-body { padding: 22px; overflow-y: auto; display: grid; gap: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.field .help { font-size: 12px; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }
.field input[type="text"], .field input[type="url"], .field textarea, .field select {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--stroke);
  background: var(--surface); outline: 0; font-size: 13.5px; font-family: var(--mono);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); }
.switch { display: flex; align-items: center; gap: 11px; font-size: 14px; cursor: pointer; }
.switch input { width: 40px; height: 23px; appearance: none; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--stroke); position: relative; cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--text-dim); transition: transform .2s var(--ease), background .2s; }
.switch input:checked { background: var(--brand); border-color: transparent; }
.switch input:checked::after { transform: translateX(17px); background: #fff; }
.drawer-foot { margin-top: auto; padding: 18px 22px; border-top: 1px solid var(--stroke); display: flex; gap: 10px; }

.log { font-family: var(--mono); font-size: 11.5px; line-height: 1.65; max-height: 230px; overflow: auto; background: #0a0c13; border: 1px solid var(--stroke); border-radius: 12px; padding: 12px; color: var(--text-dim); }
.log .t-informative { color: var(--warn); } .log .t-streaming { color: var(--brand); }
.log .t-final { color: var(--ok); } .log .t-err { color: var(--danger); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* responsive */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .app { grid-template-columns: 1fr; }
  .rail {
    position: fixed; inset: 0 auto 0 0; width: 284px; z-index: 80;
    transform: translateX(-102%); transition: transform .3s var(--ease); background: var(--bg-elev);
  }
  .rail.open { transform: none; box-shadow: var(--shadow-lg); }
  .stream-inner, .composer-dock { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 64px 0 48px; }
}
@media (min-width: 961px) { .rail-toggle { display: none; } }
