/* DAWN — usedawn.ai */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800&family=Geist+Mono:wght@400;500;600&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --fg: #f5f5f5;
  --fg-dim: rgba(245, 245, 245, 0.62);
  --fg-faint: rgba(245, 245, 245, 0.38);
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #fff;
  --radius: 14px;
  --radius-lg: 22px;

  --f-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-font="inter"] { --f-sans: 'Inter', ui-sans-serif, system-ui, sans-serif; --f-mono: 'JetBrains Mono', ui-monospace, monospace; }
[data-font="geist"] { --f-sans: 'Geist', ui-sans-serif, system-ui, sans-serif; --f-mono: 'Geist Mono', ui-monospace, monospace; }
[data-font="gt"]    { --f-sans: 'Inter', ui-sans-serif, system-ui, sans-serif; --f-mono: 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: -0.005em; }
[data-font="mono"]  { --f-sans: 'Geist Mono', ui-monospace, monospace; --f-mono: 'Geist Mono', ui-monospace, monospace; letter-spacing: -0.01em; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: var(--f-sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* ─── global custom scrollbar ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
a { color: inherit; }
button { font-family: inherit; }

::selection { background: rgba(255,255,255,0.15); color: #fff; }

/* ─────────────── BACKGROUND ─────────────── */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg--flat { background: #0a0a0a; }
.bg--grain {
  background: #0a0a0a;
}
.bg--grain::after {
  content: ""; position: absolute; inset: -20%;
  background-image:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.03), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.02), transparent 50%);
  pointer-events: none;
}
.bg--grain::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.6; mix-blend-mode: overlay;
}
.bg--gradient {
  background: #050505;
}
.bg--gradient::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(255,255,255,0.06), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(200,200,200,0.04), transparent 45%),
    radial-gradient(ellipse at 50% 90%, rgba(120,120,180,0.05), transparent 60%);
  animation: dawnPulse 12s ease-in-out infinite;
}
@keyframes dawnPulse { 0%,100% { opacity: 1; transform: translateY(0); } 50% { opacity: 0.85; transform: translateY(-1%); } }

.bg--starfield { background: #050505; }
.stars { position: absolute; inset: 0; }
.star { position: absolute; background: #fff; border-radius: 50%; animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: 0.2; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }

.root { position: relative; z-index: 1; min-height: 100vh; }
/* When in chat layout, root must not scroll — the chat-scroll div handles it */
.root:has(.app-layout) { overflow: hidden; height: 100vh; }

/* ─────────────── HEADER ─────────────── */
.hd {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  transition: background 220ms ease, border-color 220ms ease, backdrop-filter 220ms ease;
  border-bottom: 1px solid transparent;
}
.hd.is-scrolled {
  background: rgba(10, 10, 10, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom-color: var(--line);
}
.hd-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.hd-nav { display: flex; gap: 28px; }
.hd-nav a {
  color: var(--fg-dim); text-decoration: none; font-size: 13px; font-weight: 500;
  letter-spacing: -0.005em; transition: color 160ms ease;
}
.hd-nav a:hover { color: var(--fg); }
.hd-actions { display: flex; align-items: center; gap: 8px; }
.hd-user-email {
  font-size: 13px; color: var(--fg-dim);
  filter: blur(3.5px);
  transition: filter 200ms ease;
  cursor: default;
}
.hd-actions:hover .hd-user-email { filter: blur(0); }

@media (max-width: 800px) {
  .hd-nav { display: none; }
}

/* ─────────────── BUTTONS ─────────────── */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px;
  font-weight: 500; letter-spacing: -0.005em;
  transition: transform 120ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn--sm { padding: 7px 14px; font-size: 13px; }
.btn--lg { padding: 14px 24px; font-size: 15px; }
.btn--primary {
  background: #fff; color: #0a0a0a;
}
.btn--primary:hover { background: #e9e9e9; }
.btn--white {
  background: transparent; color: var(--fg-dim);
  border: 1px solid var(--line-strong);
}
.btn--white:hover { background: rgba(255,255,255,0.05); color: var(--fg); border-color: rgba(255,255,255,0.28); }
.btn--ghost {
  background: transparent; color: var(--fg);
  border: 1px solid var(--line-strong);
}
.btn--ghost:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.28); }

/* ─────────────── HERO ─────────────── */
.hero {
  height: 100vh;
  height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 24px 40px;
  position: relative;
  overflow: hidden;
}
.hero-inner {
  width: 100%; max-width: 760px;
  display: flex; flex-direction: column; align-items: center;
  gap: 24px;
}

.hero-h1 {
  margin: 0;
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-align: center;
  text-wrap: balance;
}
.hero-h1-track {
  position: relative;
  display: block;
  perspective: 800px;
  transform-style: preserve-3d;
}
.hero-h1-line {
  display: block;
  text-align: center;
  white-space: nowrap;
  backface-visibility: hidden;
}
.hero-h1-line.is-active {
  position: relative;
  pointer-events: auto;
  animation: rotateIn 550ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
.hero-h1-line.is-prev {
  position: absolute;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  animation: rotateOut 320ms cubic-bezier(0.4, 0, 1, 1) both;
}
@keyframes rotateIn  { from { transform: rotateX(-90deg) translateY(40px); opacity: 0; filter: blur(8px); } to { transform: rotateX(0) translateY(0); opacity: 1; filter: blur(0); } }
@keyframes rotateOut { from { transform: rotateX(0) translateY(0); opacity: 1; filter: blur(0); } to { transform: rotateX(90deg) translateY(-40px); opacity: 0; filter: blur(8px); } }

.hero-sub {
  margin: 0;
  color: var(--fg-dim);
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
  max-width: 520px;
  letter-spacing: -0.005em;
  animation: fadeUp 800ms 200ms backwards ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.hero-suggest {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  max-width: 640px;
  margin-top: 4px;
}
.suggest-chip {
  appearance: none; cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--fg-dim);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  letter-spacing: -0.005em;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
  animation: fadeUp 600ms backwards ease;
  animation-delay: calc(var(--d, 0ms) + 400ms);
}
.suggest-chip:hover { background: rgba(255,255,255,0.08); color: var(--fg); border-color: var(--line-strong); }

/* ─────────────── COMPOSER ─────────────── */
.composer {
  width: 100%;
  max-width: 680px;
  animation: fadeUp 1000ms 600ms backwards ease;
}
.composer-inner {
  display: flex; flex-direction: column;
  border-radius: 18px;
  padding: 16px 16px 12px;
  transition: box-shadow 260ms ease, background 260ms ease;
  position: relative;
}
/* minimal — flat frosted card, border appears on focus */
.composer--minimal .composer-inner {
  background: rgba(255,255,255,0.055);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 40px rgba(0,0,0,0.35);
}
.composer--minimal .composer-inner:focus-within {
  background: rgba(255,255,255,0.075);
  border-color: rgba(255,255,255,0.18);
  box-shadow:
    0 2px 40px rgba(0,0,0,0.4),
    0 0 0 3px rgba(255,255,255,0.04);
}
.composer--heavy .composer-inner {
  background: linear-gradient(180deg, rgba(32,32,32,0.96), rgba(20,20,20,0.96));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 30px 80px -10px rgba(0,0,0,0.7),
    0 0 0 1px rgba(0,0,0,0.5);
  padding: 20px 20px 14px;
}
.composer--heavy .composer-inner:focus-within {
  border-color: rgba(255,255,255,0.26);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.1) inset,
    0 36px 90px -10px rgba(0,0,0,0.8),
    0 0 0 4px rgba(255,255,255,0.04);
}
.composer--glass .composer-inner {
  background: rgba(255,255,255,0.05);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.1) inset,
    0 24px 60px rgba(0,0,0,0.5);
}
.composer--glass .composer-inner:focus-within {
  border-color: rgba(255,255,255,0.26);
  background: rgba(255,255,255,0.08);
}

/* ─── open variant — borderless search-engine style ─── */
.composer--open {
  max-width: 680px;
}
.composer--open .composer-inner {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}
.composer--open .composer-inner::before { display: none; }
.composer--open .composer-input-wrap {
  padding: 0 0 14px;
  border-bottom: 1.5px solid rgba(255,255,255,0.14);
  transition: border-color 240ms ease, box-shadow 240ms ease;
}
.composer--open .composer-inner:focus-within .composer-input-wrap {
  border-bottom-color: rgba(255,255,255,0.55);
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.06);
}
.composer--open .composer-input {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.composer--open .composer-ph {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
  top: 0;
  left: 0;
  color: rgba(245,245,245,0.28);
}
.composer--open .composer-row {
  border-top: none;
  padding-top: 12px;
  margin-top: 0;
}
.composer--open .csend {
  background: rgba(255,255,255,0.06);
}
.composer--open .csend.is-active {
  background: linear-gradient(180deg, #fff, #e8e8e8);
  color: #0a0a0a;
}

/* subtle glow on focus — all boxed variants */
.composer-inner::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 80%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.04), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms ease;
  z-index: -1;
}
.composer-inner:focus-within::before { opacity: 1; }
.composer--open .composer-inner::before { display: none; }

.composer-input-wrap {
  position: relative;
  padding: 8px 6px 10px;
}
.composer-input {
  appearance: none; border: 0; outline: 0; background: transparent;
  width: 100%; resize: none;
  color: var(--fg);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  position: relative;
  z-index: 1;
  caret-color: #fff;
}
.composer-input::placeholder { color: transparent; }

.composer-ph {
  position: absolute;
  top: 8px; left: 6px; right: 6px;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: rgba(245,245,245,0.38);
  white-space: nowrap;
  overflow: hidden;
}
.composer-ph-fixed { flex-shrink: 0; }
.composer-ph-typewriter {
  display: inline-flex;
  align-items: center;
}
.composer-ph-text {
  display: inline;
}
/* blinking cursor — sits immediately after the last character */
.composer-ph-cursor {
  display: inline-block;
  width: 1.5px;
  height: 1em;
  background: rgba(245,245,245,0.4);
  margin-left: 1px;
  vertical-align: -0.1em;
  border-radius: 1px;
  animation: phBlink 900ms steps(2) infinite;
}
@keyframes phBlink { 50% { opacity: 0; } }

.composer-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
  padding-top: 8px;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.composer-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctool {
  appearance: none; cursor: pointer;
  background: transparent;
  border: 0;
  color: var(--fg-dim);
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 160ms ease, color 160ms ease;
}
.ctool:hover { background: rgba(255,255,255,0.07); color: var(--fg); }
.ctool--chip {
  width: auto; padding: 0 10px; gap: 5px; font-size: 12.5px; height: 30px;
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.ctool--chip:hover { background: rgba(255,255,255,0.06); }
.ctool--on { background: rgba(255,255,255,0.1) !important; color: #fff !important; }
.ctool--on:hover { background: rgba(255,255,255,0.14) !important; }
.ctool--model {
  display: inline-flex; align-items: center; gap: 6px;
  width: auto; height: 30px; padding: 0 12px;
  font-size: 12.5px; font-weight: 500;
  color: var(--fg);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms ease;
}
.ctool--model:hover { background: rgba(255,255,255,0.09); }
.ctool-model-name { letter-spacing: -0.005em; }

.csend {
  appearance: none; border: 0; cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.3);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.csend.is-active {
  background: linear-gradient(180deg, #fff, #e8e8e8);
  color: #0a0a0a;
  box-shadow: 0 4px 20px rgba(255,255,255,0.15), 0 0 0 4px rgba(255,255,255,0.04);
}
.csend.is-active:hover { transform: scale(1.06); box-shadow: 0 6px 24px rgba(255,255,255,0.2), 0 0 0 5px rgba(255,255,255,0.06); }

/* ─────────────── SECTIONS (general) ─────────────── */
.section {
  padding: 120px 24px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}
.section--alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.012)); max-width: none; padding-left: 0; padding-right: 0; }
.section--alt > * { max-width: 1200px; margin-left: auto; margin-right: auto; padding: 0 24px; }
.section--alt > .section-head { padding-left: 24px; padding-right: 24px; }

.eyebrow {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 16px;
}
.section-head { max-width: 720px; margin-bottom: 64px; }
.section-head--row { display: flex; align-items: flex-end; justify-content: space-between; max-width: 1200px; }
.section-h2 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
}
.section-sub {
  margin: 0;
  color: var(--fg-dim);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  max-width: 580px;
  text-wrap: pretty;
}
.section-link {
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: -0.005em;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color 160ms ease, border-color 160ms ease;
}
.section-link:hover { color: var(--fg); border-color: var(--fg); }

/* ─────────────── FEATURES GRID ─────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.feature {
  padding: 32px 28px 36px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px;
  transition: background 220ms ease;
  position: relative;
}
.feature:hover { background: rgba(255,255,255,0.02); }
.feature-top { display: flex; align-items: center; justify-content: space-between; color: var(--fg-dim); }
.feature-kick { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--fg-faint); }
.feature-title {
  margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.018em; line-height: 1.25;
}
.feature-body {
  margin: 0; color: var(--fg-dim); font-size: 14px; line-height: 1.55; letter-spacing: -0.003em;
}
@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* ─────────────── CAPABILITIES ─────────────── */
.cap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.cap-list { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.cap-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.cap-list li:last-child { border-bottom: 1px solid var(--line); }
.cap-key { font-family: var(--f-mono); font-size: 12px; color: var(--fg-faint); letter-spacing: 0.05em; text-transform: uppercase; }
.cap-val { font-size: 15px; color: var(--fg); letter-spacing: -0.005em; }

.codeblock {
  background: #0e0e0e;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--f-mono);
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.codeblock-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.codeblock-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.12); }
.codeblock-title { font-size: 11.5px; color: var(--fg-faint); margin-left: 12px; }
.codeblock-body {
  padding: 18px 20px;
  font-size: 13px;
  line-height: 1.7;
  min-height: 240px;
  color: var(--fg);
}
.code-line { display: flex; gap: 8px; align-items: baseline; animation: fadeUp 240ms ease; }
.code-kw { color: rgba(255,255,255,0.9); }
.code-comment { color: var(--fg-faint); font-style: italic; }
.code-dim { color: var(--fg-faint); }
.code-num { color: #fff; font-weight: 500; }
.code-cursor {
  display: inline-block; width: 8px; height: 14px; background: #fff;
  vertical-align: middle; animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 900px) {
  .cap-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* ─────────────── BENCHMARKS ─────────────── */
.bench {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.bench-head {
  display: grid;
  grid-template-columns: 200px repeat(4, 1fr);
  background: rgba(255,255,255,0.02);
  padding: 14px 20px;
  font-size: 12px;
  font-family: var(--f-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-dim);
  border-bottom: 1px solid var(--line);
}
.bench-col--dawn { color: #fff; }
.bench-row {
  display: grid;
  grid-template-columns: 200px repeat(4, 1fr);
  padding: 18px 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.bench-row:last-child { border-bottom: 0; }
.bench-row:hover { background: rgba(255,255,255,0.012); }
.bench-name { font-size: 14px; letter-spacing: -0.005em; }
.bench-cell { display: flex; align-items: center; gap: 10px; }
.bench-bar-track { flex: 1; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.bench-bar-fill {
  height: 100%;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  transition: width 800ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bench-cell.is-hi .bench-bar-fill { background: linear-gradient(90deg, rgba(255,255,255,0.7), #fff); }
.bench-num { font-family: var(--f-mono); font-size: 12px; color: var(--fg-dim); min-width: 38px; text-align: right; }
.bench-cell.is-hi .bench-num { color: #fff; font-weight: 600; }

@media (max-width: 800px) {
  .bench-head, .bench-row { grid-template-columns: 110px repeat(4, 1fr); padding: 12px; gap: 8px; font-size: 11px; }
  .bench-name { font-size: 12px; }
  .bench-num { font-size: 11px; min-width: 28px; }
}

/* ─────────────── PRICING ─────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.tier {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  display: flex; flex-direction: column; gap: 18px;
  transition: border-color 220ms ease, background 220ms ease, transform 220ms ease;
}
.tier:hover { border-color: var(--line-strong); }
.tier--hi {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.16);
}
.tier--hi:hover { border-color: rgba(255,255,255,0.28); }
.tier-head { display: flex; align-items: center; justify-content: space-between; }
.tier-name { font-size: 14px; letter-spacing: -0.005em; color: var(--fg); font-weight: 500; }
.tier-badge {
  font-size: 10.5px;
  font-family: var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: rgba(255,255,255,0.1);
  color: var(--fg-dim);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
}
.tier-price { display: flex; align-items: baseline; gap: 4px; }
.tier-amount { font-size: 44px; font-weight: 600; letter-spacing: -0.035em; }
.tier-per { font-size: 14px; color: var(--fg-dim); }
.tier-sub { font-size: 13px; color: var(--fg-dim); margin-top: -8px; }
.tier-feat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tier-feat li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--fg); letter-spacing: -0.003em; }
.tier-feat li svg { color: var(--fg-faint); flex-shrink: 0; }
.tier--hi .tier-feat li svg { color: var(--fg-dim); }
.tier-cta {
  appearance: none; cursor: pointer;
  margin-top: auto;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background 160ms ease;
}
.tier-cta:hover { background: rgba(255,255,255,0.09); }
.tier-cta--hi {
  background: #fff; color: #0a0a0a; border-color: #fff;
}
.tier-cta--hi:hover { background: #ececec; }

@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

/* ─────────────── BLOG ─────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.post {
  display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: inherit;
  transition: transform 220ms ease;
}
.post:hover { transform: translateY(-4px); }
.post:hover .post-title { color: #fff; }
.post:hover .post-cta { color: #fff; }
.post-img {
  aspect-ratio: 16/10;
  border-radius: 12px;
  overflow: hidden;
  background: #0e0e0e;
  border: 1px solid var(--line);
}
.post-img svg { width: 100%; height: 100%; display: block; }
.post-meta { display: flex; align-items: center; gap: 12px; }
.post-tag {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-dim);
}
.post-date { font-size: 12px; color: var(--fg-faint); }
.post-title {
  margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3;
  color: var(--fg);
  text-wrap: balance;
  transition: color 160ms ease;
}
.post-cta { font-size: 13px; color: var(--fg-dim); transition: color 160ms ease; }

@media (max-width: 900px) {
  .blog-grid { grid-template-columns: 1fr; }
}

/* ─────────────── FOOTER CTA ─────────────── */
.footer-cta {
  position: relative;
  padding: 140px 24px 100px;
  text-align: center;
  overflow: hidden;
}
.cta-h {
  margin: 0; font-size: clamp(40px, 6vw, 80px); font-weight: 600;
  letter-spacing: -0.04em; line-height: 1.0;
}
.cta-sub { margin: 16px 0 32px; color: var(--fg-dim); font-size: 17px; }
.cta-row { display: flex; gap: 12px; justify-content: center; }
.cta-mark { margin-top: 60px; opacity: 0.1; display: flex; justify-content: center; }

/* ─────────────── FOOTER ─────────────── */
.footer { border-top: 1px solid var(--line); padding: 60px 24px 40px; max-width: 1200px; margin: 0 auto; }
.footer-top { display: grid; grid-template-columns: 1fr 2fr; gap: 60px; padding-bottom: 60px; border-bottom: 1px solid var(--line); }
.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-tag { font-size: 13px; color: var(--fg-dim); letter-spacing: -0.005em; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-h { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 6px; }
.footer-link { font-size: 13.5px; color: var(--fg-dim); text-decoration: none; transition: color 160ms ease; }
.footer-link:hover { color: var(--fg); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; font-size: 12px; color: var(--fg-faint); }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { text-decoration: none; transition: color 160ms ease; }
.footer-legal a:hover { color: var(--fg); }

@media (max-width: 800px) {
  .footer-top { grid-template-columns: 1fr; gap: 40px; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}

/* ─────────────── SIDEBAR + APP LAYOUT ─────────────── */
.app-layout { display: flex; height: 100vh; overflow: hidden; }
.chatview-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.sidebar {
  width: 260px; flex-shrink: 0;
  background: #1c1c1c; border-right: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; overflow: hidden; min-height: 0;
  transition: width 220ms cubic-bezier(0.4,0,0.2,1);
}
.sidebar--collapsed {
  width: 52px; min-width: 52px;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 12px 0;
}
.sidebar-toggle {
  appearance: none; border: 0; background: transparent; color: var(--fg-faint);
  cursor: pointer; width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background 140ms ease, color 140ms ease; flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.07); color: var(--fg); }
.sidebar-head { padding: 14px 10px 10px; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.sidebar-logo { display: flex; align-items: center; text-decoration: none; flex: 1; justify-content: center; }
.sidebar-new { appearance: none; border: 0; background: transparent; color: var(--fg-dim); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: background 140ms ease, color 140ms ease; }
.sidebar-new:hover { background: rgba(255,255,255,0.07); color: var(--fg); }
.sidebar-new--col { color: var(--fg-faint); }
.sidebar-search { padding: 0 10px 10px; }
.sidebar-search-inp { width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); border-radius: 8px; padding: 7px 12px; font-size: 12.5px; color: var(--fg); font-family: inherit; outline: none; transition: border-color 160ms ease, background 160ms ease; }
.sidebar-search-inp::placeholder { color: var(--fg-faint); }
.sidebar-search-inp:focus { border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.06); }
.sidebar-list { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
.sidebar-list::-webkit-scrollbar { width: 4px; }
.sidebar-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.sidebar-group-label { font-size: 10.5px; font-family: var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); padding: 10px 8px 4px; }
.conv-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 140ms ease; text-align: left; width: 100%; appearance: none; border: 0; background: transparent; color: var(--fg-dim); font-size: 13px; font-family: inherit; letter-spacing: -0.003em; }
.conv-item:hover { background: rgba(255,255,255,0.05); color: var(--fg); }
.conv-item.is-active { background: rgba(255,255,255,0.08); color: var(--fg); }
.conv-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-del { display: none; font-size: 11px; color: var(--fg-faint); padding: 2px 4px; border-radius: 4px; line-height: 1; }
.conv-del:hover { color: var(--fg); background: rgba(255,255,255,0.08); }
.conv-item:hover .conv-del { display: block; }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,0.07); flex-shrink: 0; position: relative; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 140ms ease; width: 100%; appearance: none; border: 0; background: transparent; font-family: inherit; text-align: left; }
.sidebar-user:hover { background: rgba(255,255,255,0.05); }
.sidebar-avatar { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--fg); flex-shrink: 0; }
.sidebar-user-email { font-size: 12.5px; color: var(--fg-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; filter: blur(3.5px); transition: filter 200ms ease; }
.sidebar-user:hover .sidebar-user-email { filter: blur(0); }
.sidebar-signin-btn { appearance: none; border: 1px solid rgba(255,255,255,0.1); background: transparent; color: var(--fg-dim); font-size: 12.5px; font-family: inherit; padding: 8px 12px; border-radius: 8px; cursor: pointer; width: 100%; text-align: left; transition: background 140ms ease, color 140ms ease; }
.sidebar-signin-btn:hover { background: rgba(255,255,255,0.05); color: var(--fg); }
.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; min-width: 0; }

/* Settings popover */
.settings-popover {
  position: absolute; bottom: calc(100% + 6px); left: 10px; right: 10px;
  background: #1e1e1e; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 4px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  animation: settingsIn 160ms cubic-bezier(0.2,0.8,0.2,1);
  z-index: 20;
}
@keyframes settingsIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.settings-user-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.settings-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--fg); flex-shrink: 0; }
.settings-user-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-display-name { font-size: 13px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-email { font-size: 11.5px; color: var(--fg-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; filter: blur(3.5px); transition: filter 200ms ease; }
.settings-user-row:hover .settings-email { filter: blur(0); }
.settings-divider { height: 1px; background: rgba(255,255,255,0.07); margin: 2px 0; }
.settings-fields { padding: 10px 12px; display: flex; flex-direction: column; }
.settings-label { font-size: 10.5px; font-family: var(--f-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 5px; }
.settings-input {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px; padding: 7px 10px;
  font-size: 12.5px; color: var(--fg); font-family: var(--f-sans);
  outline: none;
}
.settings-input:focus { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.07); }
.settings-textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px; padding: 7px 10px;
  font-size: 12.5px; color: var(--fg); font-family: var(--f-sans); line-height: 1.5;
  outline: none;
}
.settings-textarea:focus { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.07); }
.settings-input::placeholder, .settings-textarea::placeholder { color: var(--fg-faint); }
.settings-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  appearance: none; border: 0; background: transparent;
  font-family: inherit; font-size: 13px; color: var(--fg-dim);
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
  text-align: left;
}
.settings-btn:hover { background: rgba(255,255,255,0.05); color: var(--fg); }
.settings-btn--danger:hover { background: rgba(255,60,60,0.1); color: rgba(255,120,120,0.9); }

/* Mobile overlay sidebar */
@media (max-width: 700px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(0.4,0,0.2,1);
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar--collapsed { display: none; }
  .mobile-hamburger {
    display: flex; position: absolute; top: 12px; left: 12px; z-index: 10;
    appearance: none; border: 0; background: rgba(20,20,20,0.8);
    color: var(--fg-dim); cursor: pointer; width: 36px; height: 36px;
    border-radius: 9px; align-items: center; justify-content: center;
    backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.08);
    transition: background 140ms ease, color 140ms ease;
  }
  .mobile-hamburger:hover { background: rgba(30,30,30,0.95); color: var(--fg); }
  .sidebar-overlay {
    position: fixed; inset: 0; z-index: 59; background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px); animation: fadeIn 160ms ease;
  }
}
@media (min-width: 701px) {
  .mobile-hamburger { display: none; }
  .sidebar-overlay { display: none; }
}

/* ─────────────── CHAT VIEW ─────────────── */
.chatview { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
@keyframes chatIn { from { opacity: 0; transform: scale(0.99); } to { opacity: 1; transform: scale(1); } }

.chat-topbar {
  height: 52px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  background: rgba(10,10,10,0.7);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.chat-topbar-side { flex: 1; display: flex; align-items: center; min-width: 0; }
.chat-topbar-right { justify-content: flex-end; }
.chat-topbar-center { display: flex; align-items: center; justify-content: center; position: relative; }
.chat-model-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--fg); font-size: 14px; font-weight: 500;
  font-family: var(--f-sans); letter-spacing: -0.012em;
  padding: 6px 10px; border-radius: 9px;
  transition: background 150ms ease;
}
.chat-model-btn:hover { background: rgba(255,255,255,0.06); }
.chat-back-btn { appearance: none; border: 0; background: transparent; color: var(--fg-dim); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 140ms ease, color 140ms ease; }
.chat-back-btn:hover { background: rgba(255,255,255,0.07); color: var(--fg); }
.chat-meta {
  font-family: var(--f-mono); font-size: 11px; color: var(--fg-faint);
  letter-spacing: 0.06em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}

.chat-scroll { flex: 1; overflow-y: auto; padding: 40px 24px 220px; }
.chat-scroll::-webkit-scrollbar { width: 6px; }
.chat-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 3px; }
.chat-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }
.chat-inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }

.msg--user { justify-content: flex-end; }
.msg--assistant .msg-body { flex: 1; max-width: 100%; }
.msg-para {
  margin: 0 0 12px; font-size: 15px; line-height: 1.72; color: rgba(245,245,245,0.9);
  letter-spacing: -0.003em;
  text-wrap: pretty;
}
.msg-para:last-child { margin-bottom: 0; }
.msg-para strong { font-weight: 600; color: #fff; }
.msg-para em { color: rgba(245,245,245,0.8); }

.msg-sources { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; padding: 10px 12px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; }
.msg-sources-label { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-faint); margin-right: 4px; }
.msg-source-chip {
  font-size: 11.5px; padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 999px;
  color: var(--fg-dim);
  font-family: var(--f-mono);
  transition: background 140ms ease, color 140ms ease;
  cursor: pointer;
}
.msg-source-chip:hover { background: rgba(255,255,255,0.09); color: #fff; }
.msg-cursor {
  display: inline-block; width: 7px; height: 16px;
  background: #fff; vertical-align: -3px; margin-left: 3px;
  border-radius: 1px;
  animation: blink 1s steps(2) infinite;
}

.msg-img { max-width: 320px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08); margin: 8px 0; }
.msg-attach-label { font-size: 11.5px; color: var(--fg-faint); font-family: var(--f-mono); margin-bottom: 6px; }
.msg-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; }
.msg-divider-line { flex: 1; height: 1px; background: rgba(255,255,255,0.07); }
.msg-divider-label { font-size: 11px; font-family: var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); white-space: nowrap; }

.chat-composer-wrap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 30px 24px;
  background: linear-gradient(180deg, transparent, rgba(10,10,10,0.88) 28%, var(--bg));
  pointer-events: none;
  z-index: 4;
}
.chat-composer {
  pointer-events: auto;
  max-width: 820px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  background: rgba(20,20,20,0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  padding: 6px 8px 6px 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  transition: border-color 200ms ease;
}
.chat-composer:focus-within { border-color: rgba(255,255,255,0.18); }
.chat-input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--fg); font-size: 15px; font-family: inherit;
  padding: 12px 0;
  caret-color: #fff;
  letter-spacing: -0.005em;
}
.chat-input::placeholder { color: var(--fg-faint); }
.chat-input:disabled { opacity: 0.6; }

.chat-attach-btn { appearance: none; border: 0; background: transparent; color: var(--fg-faint); cursor: pointer; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; flex-shrink: 0; }
.chat-attach-btn:hover { background: rgba(255,255,255,0.06); color: var(--fg-dim); }

/* Attachment float — appears above the composer box */
.chat-attach-float {
  max-width: 820px; margin: 0 auto 10px;
  padding: 0 8px;
}
.chat-attach-card {
  position: relative;
  display: inline-flex;
}
.chat-attach-img {
  height: 88px; width: auto; max-width: 220px;
  border-radius: 12px; object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  display: block;
}
.chat-attach-dismiss {
  position: absolute; top: -7px; right: -7px;
  appearance: none; border: 0;
  background: #3a3a3a;
  color: rgba(255,255,255,0.8);
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(0,0,0,0.5);
  transition: background 140ms ease;
}
.chat-attach-dismiss:hover { background: #555; }

/* ─────────────── FILE ATTACHMENTS + MODEL DROPDOWN ─────────────── */
.attach-preview { display: flex; align-items: center; gap: 8px; padding: 8px 6px 4px; }
.attach-thumb { height: 60px; width: auto; max-width: 120px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(255,255,255,0.1); }
.attach-chip { font-size: 12px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 4px 10px; color: var(--fg-dim); }
.attach-remove { appearance: none; border: 0; background: rgba(255,255,255,0.07); color: var(--fg-dim); width: 22px; height: 22px; border-radius: 50%; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.model-dropdown { position: absolute; top: calc(100% + 6px); left: 0; background: #1c1c1c; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 4px; min-width: 160px; z-index: 50; box-shadow: 0 8px 32px rgba(0,0,0,0.5); animation: fadeIn 120ms ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.model-option { display: flex; align-items: center; justify-content: space-between; width: 100%; appearance: none; border: 0; background: transparent; color: var(--fg-dim); font-size: 13px; font-family: inherit; padding: 8px 12px; border-radius: 7px; cursor: pointer; transition: background 120ms ease, color 120ms ease; }
.model-option:hover { background: rgba(255,255,255,0.06); color: var(--fg); }
.model-option.is-active { background: rgba(255,255,255,0.08); color: var(--fg); }
.model-option.is-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.model-opt-name { font-weight: 500; }
.model-opt-tag { font-size: 10px; font-family: var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; background: rgba(255,255,255,0.1); color: var(--fg-faint); padding: 2px 6px; border-radius: 4px; }

/* ─── chat notification pill ─── */
.chat-notif {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,28,0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--fg);
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  animation: notifPop 200ms cubic-bezier(0.16,1,0.3,1) both;
}
.chat-notif--warn { border-color: rgba(255,160,80,0.3); color: rgba(255,200,120,0.95); }
@keyframes notifPop {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─────────────── AUTH / CONSENT MODALS ─────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fadeIn 160ms ease; }
.modal-box { background: #161616; border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; padding: 32px; width: 100%; max-width: 380px; position: relative; animation: modalIn 200ms cubic-bezier(0.2,0.8,0.2,1); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-box--consent { max-width: 360px; text-align: center; }
.modal-close { position: absolute; top: 16px; right: 16px; appearance: none; border: 0; background: transparent; color: var(--fg-faint); cursor: pointer; font-size: 16px; width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: rgba(255,255,255,0.07); color: var(--fg); }
.modal-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.modal-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.mtab { appearance: none; border: 0; background: transparent; color: var(--fg-faint); font-size: 14px; font-family: inherit; font-weight: 500; padding: 8px 16px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 140ms ease, border-color 140ms ease; }
.mtab.is-active { color: var(--fg); border-bottom-color: #fff; }
.modal-google-btn { min-height: 44px; display: flex; justify-content: center; }
.modal-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--fg-faint); font-size: 12px; }
.modal-divider::before, .modal-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08); }
.modal-form { display: flex; flex-direction: column; gap: 10px; }
.modal-input { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 11px 14px; font-size: 14px; font-family: inherit; color: var(--fg); outline: none; }
.modal-input:focus { border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.07); }
.modal-err { font-size: 12.5px; color: rgba(255,100,100,0.9); padding: 4px 2px; }
.modal-submit { appearance: none; border: 0; background: #fff; color: #0a0a0a; font-size: 14px; font-weight: 600; font-family: inherit; padding: 12px; border-radius: 10px; cursor: pointer; transition: background 140ms ease; margin-top: 4px; }
.modal-submit:hover { background: #e8e8e8; }
.modal-submit:disabled { opacity: 0.5; cursor: default; }
.consent-text { font-size: 14px; color: var(--fg-dim); line-height: 1.6; margin: 0 0 24px; }
.consent-text a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ─────────────── HISTORY FAB + MODAL ─────────────── */
.hist-fab {
  position: fixed; bottom: 24px; left: 24px; z-index: 30;
  display: flex; align-items: center; gap: 7px;
  appearance: none; cursor: pointer;
  background: rgba(22,22,22,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--fg-dim);
  font-size: 13px; font-weight: 500; font-family: inherit;
  letter-spacing: -0.005em;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
  animation: fadeUp 300ms ease;
}
.hist-fab:hover { background: rgba(30,30,30,0.98); color: var(--fg); border-color: rgba(255,255,255,0.18); transform: translateY(-1px); }

.hist-modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: flex-start; padding: 24px; }
.hist-modal {
  background: #161616;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 4px;
  width: 280px;
  max-height: 380px;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  animation: modalIn 180ms cubic-bezier(0.2,0.8,0.2,1);
  overflow: hidden;
}
.hist-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; flex-shrink: 0; }
.hist-modal-title { font-size: 11px; font-family: var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-faint); }
.hist-modal-close { appearance: none; border: 0; background: transparent; color: var(--fg-faint); cursor: pointer; font-size: 14px; width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.hist-modal-close:hover { background: rgba(255,255,255,0.07); color: var(--fg); }
.hist-modal-list { overflow-y: auto; padding: 0 4px 4px; }
.hist-modal-list::-webkit-scrollbar { width: 4px; }
.hist-modal-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.hist-item { display: flex; align-items: center; gap: 8px; width: 100%; appearance: none; border: 0; background: transparent; color: var(--fg-dim); font-size: 13px; font-family: inherit; letter-spacing: -0.003em; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; transition: background 120ms ease, color 120ms ease; }
.hist-item:hover { background: rgba(255,255,255,0.06); color: var(--fg); }
.hist-item-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-item-del { font-size: 11px; color: var(--fg-faint); padding: 2px 5px; border-radius: 4px; display: none; line-height: 1; }
.hist-item:hover .hist-item-del { display: block; }
.hist-item-del:hover { background: rgba(255,255,255,0.08); color: var(--fg); }

/* ─────────────── MARKDOWN RENDERER ─────────────── */
.md-h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; margin: 20px 0 10px; color: #fff; line-height: 1.2; }
.md-h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin: 18px 0 8px; color: #fff; line-height: 1.25; }
.md-h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; margin: 14px 0 6px; color: var(--fg); line-height: 1.3; }
.md-h1:first-child, .md-h2:first-child, .md-h3:first-child { margin-top: 0; }

.md-ul, .md-ol { margin: 6px 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.md-ul li, .md-ol li { font-size: 15px; line-height: 1.65; color: rgba(245,245,245,0.9); letter-spacing: -0.003em; }
.md-ul li::marker { color: var(--fg-faint); }
.md-ol li::marker { color: var(--fg-faint); font-family: var(--f-mono); font-size: 13px; }

.md-blockquote {
  border-left: 3px solid rgba(255,255,255,0.2);
  padding: 6px 16px;
  margin: 10px 0;
  color: var(--fg-dim);
  font-size: 15px; line-height: 1.65;
  font-style: italic;
  background: rgba(255,255,255,0.02);
  border-radius: 0 6px 6px 0;
}

.md-hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 20px 0; }

.md-code-block {
  background: #0e0e0e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
  font-family: var(--f-mono);
}
.md-code-lang {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}
.md-pre {
  margin: 0; padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(245,245,245,0.88);
}
.md-pre::-webkit-scrollbar { height: 4px; }
.md-pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.md-pre code { font-family: var(--f-mono); background: none; padding: 0; font-size: inherit; }

.md-code-inline {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--f-mono);
  font-size: 0.88em;
  color: rgba(245,245,245,0.92);
}

.md-link { color: rgba(255,255,255,0.7); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,0.25); transition: color 140ms ease; }
.md-link:hover { color: #fff; text-decoration-color: rgba(255,255,255,0.6); }

/* ─────────────── POLISH & TRANSITIONS ─────────────── */
.msg { display: flex; gap: 14px; animation: msgIn 280ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Improved user bubble */
.msg--user .msg-body {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 12px 18px;
  border-radius: 18px 18px 4px 18px;
  max-width: 75%;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  transition: background 160ms ease;
}
.msg--user .msg-body:hover { background: rgba(255,255,255,0.09); }
.msg--user .msg-body p { margin: 0; }

/* Thinking pulse with dots */
.msg-thinking {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--fg-faint);
}
.msg-thinking::after {
  content: '';
  display: inline-block; width: 14px; height: 5px;
  background: radial-gradient(circle, var(--fg-faint) 2px, transparent 2px),
              radial-gradient(circle, var(--fg-faint) 2px, transparent 2px),
              radial-gradient(circle, var(--fg-faint) 2px, transparent 2px);
  background-size: 5px 5px;
  background-position: 0 0, 8px 0, 16px 0;
  background-repeat: no-repeat;
  animation: dotPulse 1.2s ease-in-out infinite;
}
@keyframes dotPulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

/* info message improvement */
.msg-info {
  text-align: center; font-size: 12px; color: var(--fg-faint);
  padding: 6px 16px 10px; font-family: var(--f-mono); letter-spacing: 0.02em;
  background: rgba(255,200,0,0.04); border: 1px solid rgba(255,200,0,0.08);
  border-radius: 8px; margin: 0 auto; max-width: 480px;
}
