:root {
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --bg-3: #ebebef;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #1d1d1f;
  --accent-ink: #ffffff;
  --card: rgba(255, 255, 255, 0.82);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-2: #141416;
    --bg-3: #1d1d1f;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #6e6e73;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #f5f5f7;
    --accent-ink: #000000;
    --card: rgba(29, 29, 31, 0.82);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--bg-3); padding: 0.1em 0.4em; border-radius: 6px; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(680px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--text-2); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.wordmark .mark {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 700;
}
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--text-2); }
.nav-links a:hover { color: var(--text); }
@media (max-width: 640px) { .nav-links { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 980px; border: 1px solid transparent;
  font-weight: 500; font-size: 15px; transition: transform 0.2s var(--ease), filter 0.2s var(--ease), background 0.2s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: scale(1.02); filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); background: transparent; }
.btn-ghost:hover { background: var(--bg-2); }
.btn-sm { min-height: 36px; padding: 6px 16px; font-size: 14px; }

/* Hero */
.hero { padding: 96px 0 48px; text-align: center; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0.02em; text-transform: uppercase; }
h1 { font-size: clamp(40px, 7vw, 68px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 600; margin: 14px 0 18px; }
.lede { font-size: clamp(18px, 2.4vw, 22px); color: var(--text-2); max-width: 560px; margin: 0 auto 36px; }

.ask {
  display: flex; align-items: center; gap: 8px;
  max-width: 640px; margin: 0 auto; padding: 6px 6px 6px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: 980px; box-shadow: var(--shadow);
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.ask:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); }
.ask input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 17px; height: 44px; outline: none; }
.ask input::placeholder { color: var(--text-3); }
.ask button { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; transition: transform 0.2s var(--ease); }
.ask button:hover { transform: scale(1.06); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.chip {
  font-size: 14px; color: var(--text-2); background: var(--bg-2); border: 1px solid transparent;
  padding: 8px 14px; border-radius: 980px; min-height: 36px; transition: all 0.2s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line); background: var(--bg); }

/* Preview window */
.preview { margin: 64px auto 0; max-width: 760px; text-align: left; }
.window {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; backdrop-filter: blur(20px);
}
.window-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--bg-3); display: block; }
.window-bar span { margin-left: auto; font-size: 12px; color: var(--text-3); }
.window-body { padding: 20px; display: grid; gap: 14px; }

/* Messages (shared with chat page) */
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.bubble {
  max-width: min(78%, 620px); padding: 11px 16px; border-radius: 18px; line-height: 1.5; font-size: 16px;
  white-space: normal; overflow-wrap: anywhere;
}
.user .bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.bot .bubble { background: var(--bg-2); border-bottom-left-radius: 6px; }
.bubble p { margin: 0 0 10px; }
.bubble p:last-child, .bubble ul:last-child, .bubble ol:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 0 0 10px; padding-left: 20px; }
.bubble li { margin: 3px 0; }
.bubble pre { background: var(--bg-3); padding: 12px; border-radius: 10px; overflow: auto; font-family: var(--mono); font-size: 13px; margin: 0 0 10px; }
.bubble pre code { background: none; padding: 0; }
.bubble a { color: #0a84ff; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.bubble a:hover { color: #3b9cff; }
.user .bubble a { color: inherit; }
.user .bubble code { background: color-mix(in srgb, var(--accent-ink) 18%, transparent); }

/* Sections */
section { padding: 96px 0; }
section + section { border-top: 1px solid var(--line); }
h2 { font-size: clamp(30px, 4.5vw, 44px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 600; margin: 0 0 12px; }
.section-head { max-width: 620px; margin-bottom: 48px; }
.section-head p { color: var(--text-2); font-size: 19px; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow); transition: transform 0.3s var(--ease);
}
.card:hover { transform: translateY(-2px); }
.card .icon { width: 40px; height: 40px; border-radius: 12px; background: var(--bg-2); display: grid; place-items: center; margin-bottom: 18px; color: var(--accent); }
.card h3 { margin: 0 0 6px; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.card p { margin: 0; color: var(--text-2); font-size: 15px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; counter-reset: step; }
.step { position: relative; padding-top: 48px; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; top: 0; left: 0; font-family: var(--mono); font-size: 13px; color: var(--accent);
}
.step h3 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.step p { margin: 0; color: var(--text-2); }

.faq { max-width: 680px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 0; font-size: 18px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 300; font-size: 24px; transition: transform 0.25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 20px; color: var(--text-2); }

.cta { text-align: center; }
.cta .btn { margin-top: 24px; }

footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 13px; color: var(--text-3); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* Entrance */
@media (prefers-reduced-motion: no-preference) {
  .fade { animation: fadeUp 0.7s var(--ease) both; }
  .fade:nth-child(2) { animation-delay: 0.08s; }
  .fade:nth-child(3) { animation-delay: 0.16s; }
  .fade:nth-child(4) { animation-delay: 0.24s; }
  .fade:nth-child(5) { animation-delay: 0.32s; }
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Chat page */
.chat-page { height: 100dvh; display: flex; overflow: hidden; }
.sidebar {
  width: 272px; flex: none; display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-2); border-right: 1px solid var(--line); padding: 12px;
  transition: margin 0.3s var(--ease);
}
.sidebar-collapsed .sidebar { margin-left: -273px; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 2px 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); display: grid; place-items: center; }
.icon-btn:hover { background: var(--bg-3); color: var(--text); }
.new-chat {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); font-weight: 500; font-size: 14px; text-align: left;
}
.new-chat:hover { background: var(--bg-3); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 36px; border-radius: 10px; color: var(--text-3); }
.search:focus-within { background: var(--bg); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 14px; }
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.chat-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.list-group { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; padding: 14px 10px 6px; }
.list-empty { font-size: 13px; color: var(--text-3); padding: 14px 10px; margin: 0; }
.chat-item { display: flex; align-items: center; border-radius: 9px; }
.chat-item:hover, .chat-item.active { background: var(--bg-3); }
.chat-item.active .chat-open { color: var(--text); font-weight: 500; }
.chat-open { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: 8px 10px; font-size: 14px; color: var(--text-2); border-radius: 9px; }
.chat-open span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-del { flex: none; width: 30px; height: 30px; margin-right: 4px; border: 0; background: transparent; color: var(--text-3); border-radius: 7px; display: grid; place-items: center; opacity: 0; }
.chat-item:hover .chat-del, .chat-item.active .chat-del { opacity: 1; }
.chat-del:hover { color: var(--text); background: var(--bg-2); }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.sidebar-foot .btn { width: 100%; }

.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.chat-top { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.sidebar-collapsed #expand, .sidebar-collapsed .wordmark.small { display: grid; }
#expand, .wordmark.small { display: none; }
.wordmark.small { margin-left: auto; font-size: 15px; }
.chat-title { font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { flex: 1; overflow-y: auto; padding: 24px max(16px, calc(50% - 400px)) 150px; display: flex; flex-direction: column; gap: 14px; }
.empty { text-align: center; padding: 64px 0 24px; }
.empty[hidden] { display: none; }
.empty h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 8px; }
.empty p { color: var(--text-2); margin: 0 0 24px; }
.composer-wrap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.composer {
  width: min(800px, 100%); margin: 0 auto; display: flex; align-items: flex-end; gap: 8px;
  padding: 6px 6px 6px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.composer textarea { flex: 1; min-width: 0; resize: none; overflow-y: hidden; border: 0; background: transparent; outline: none; font-size: 16px; line-height: 1.45; padding: 10px 0; max-height: 180px; }
.composer textarea::placeholder { color: var(--text-3); }
.composer button { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; transition: opacity 0.2s, transform 0.2s var(--ease); }
.composer button:disabled { opacity: 0.35; cursor: default; }
.composer button:not(:disabled):hover { transform: scale(1.06); }
.disclaimer { text-align: center; font-size: 12px; color: var(--text-3); margin: 10px 0 0; }
.scrim { display: none; }
@media (max-width: 820px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; margin-left: -273px; box-shadow: var(--shadow); }
  .sidebar-open .sidebar { margin-left: 0; }
  .sidebar-collapsed .sidebar { margin-left: -273px; }
  .sidebar-open.sidebar-collapsed .sidebar { margin-left: 0; }
  #expand, .wordmark.small { display: grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,0.4); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  .sidebar-open .scrim { opacity: 1; pointer-events: auto; }
}
.notice { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 14px; color: var(--text-2); }
.notice code { font-size: 13px; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; } .typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.error .bubble { background: transparent; border: 1px solid var(--line); color: var(--text-2); }

/* Hero actions */
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
#assistant .preview { margin: 0 auto 32px; }
#assistant .ask { margin-top: 0; }

/* Hero video slot */
.video-wrap { max-width: 920px; margin: 56px auto 0; }
.video-window { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); }
.video-window video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mute { position: absolute; right: 14px; bottom: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(10px); color: var(--text); display: grid; place-items: center; }
.mute.on { background: var(--accent); color: var(--accent-ink); }

/* Section head variants */
.section-head.center { text-align: center; margin-inline: auto; }
.section-head .eyebrow { margin: 0 0 10px; }
.link { text-decoration: underline; text-underline-offset: 3px; color: var(--text); }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.bento .card { display: flex; flex-direction: column; padding: 28px; }
.bento .card h3 { font-size: 21px; }
.bento .card > p { margin-bottom: 20px; }
.bento .mock { margin-top: auto; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
@media (max-width: 900px) { .span-2, .span-3, .span-4 { grid-column: span 6; } }

/* Mockups: all monochrome, all static */
.mock { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 13.5px; line-height: 1.4; overflow: hidden; }
.dim { color: var(--text-3); }

.post { padding: 14px 16px; }
.post-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.post-head .dim { font-size: 12px; }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 9px; font-weight: 700; display: grid; place-items: center; }
.post p { margin: 0 0 10px; color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--bg-2); color: var(--text-2); }

.channels { padding: 8px; }
.channels > div { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); }
.channels > div:nth-child(2) { background: var(--bg-2); color: var(--text); }
.channels i { font-style: normal; color: var(--text-3); width: 12px; display: inline-grid; place-items: center; }
.channels b { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 7px; }
.channels em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--text); display: inline-flex; align-items: center; gap: 5px; }
.channels em::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text); animation: blink 1.6s infinite; }

.feed > div { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.feed > div:first-child { border-top: 0; }
.feed code { background: none; padding: 0; font-size: 12px; color: var(--text-2); }
.feed span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed b { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); }
.feed b.out { background: transparent; color: var(--text-2); border: 1px solid var(--line); }

.mock.chat { padding: 12px; display: grid; gap: 8px; }
.mock.chat .bubble { font-size: 13.5px; padding: 8px 12px; max-width: 88%; }

.list > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); }
.list > div:first-child { border-top: 0; }
.list em { font-style: normal; color: var(--text-3); white-space: nowrap; font-size: 12px; }

.checks { padding: 8px 10px; }
.checks > div { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.checks i { width: 16px; height: 16px; border-radius: 5px; background: var(--accent); flex: none; position: relative; }
.checks i::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Sidebar extras */
.new-chat kbd { margin-left: auto; font: 500 11px var(--font); color: var(--text-3); background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.chat-open { display: flex; align-items: center; gap: 9px; }
.chat-open svg { flex: none; color: var(--text-3); }
.chat-item.active .chat-open svg { color: var(--text); }
.show-more { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text-3); font-size: 13px; padding: 10px 10px; border-radius: 9px; }
.show-more:hover { color: var(--text); background: var(--bg-3); }

/* Recent chats on the empty state */
.recent { max-width: 800px; margin: 56px auto 0; text-align: left; }
.recent[hidden] { display: none; }
.recent-head { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 12px; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.recent-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); transition: background 0.2s var(--ease); }
.recent-card:hover { background: var(--bg-2); }
.recent-card svg { color: var(--text-3); }
.recent-card span { font-size: 15px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent-card em { font-style: normal; font-size: 12px; color: var(--text-3); }

/* Admin: knowledge editor */
.actions.end { justify-content: flex-end; }
.row.tight { margin-top: 0; }
.kb { max-width: 54rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
  .kb h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 .35rem; }
  .kb p.lede { color: var(--text-2); margin: 0 0 1.75rem; line-height: 1.6; }
  .kb label { display: block; font-size: .82rem; color: var(--text-2); margin: 0 0 .4rem; }
  .kb input[type="password"], .kb textarea {
    width: 100%; font: inherit; color: var(--text); background: var(--bg-2);
    border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem;
  }
  .kb textarea { font-family: var(--mono); font-size: .85rem; line-height: 1.6; min-height: 26rem; resize: vertical; }
  .kb input:focus, .kb textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  .row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
  .row .spacer { flex: 1; }
  .note { font-size: .82rem; color: var(--text-2); }
  .note.bad { color: var(--text); font-weight: 600; }
  .hidden { display: none; }
  .versions { margin-top: 1.5rem; font-size: .85rem; }
  .versions select { font: inherit; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: .45rem .6rem; }
  .tips { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--text-2); line-height: 1.7; }
  .tips code { font-family: var(--mono); font-size: .9em; background: var(--bg-2); padding: .1rem .35rem; border-radius: 5px; }

/* Example-question carousel */
.carousel { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.carousel-chip { font-size: 15px; padding: 10px 18px; min-height: 42px; transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease); }
.carousel-chip.swap { opacity: 0; transform: translateY(6px); }
.carousel-dots { display: flex; gap: 6px; }
.dot { width: 6px; height: 6px; padding: 0; border-radius: 50%; border: 0; background: var(--line); transition: background 0.2s, transform 0.2s; }
.dot.on { background: var(--text-2); transform: scale(1.3); }

/* Sign-in gate + account */
.gate { text-align: center; padding: 72px 0 24px; }
.gate[hidden] { display: none; }
.gate h1 { font-size: clamp(26px, 4.5vw, 36px); margin: 0 0 10px; }
.gate p { color: var(--text-2); max-width: 460px; margin: 0 auto 24px; }
.gate .actions { justify-content: center; }
.account { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.account img, .account .avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 12px; }
.account-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
textarea:disabled { opacity: 0.6; }

/* Fresh state: composer centred under the heading, carousel below it */
.fresh .thread { justify-content: center; padding-bottom: 24px; }
.fresh .empty { padding: 0 0 24px; }
.fresh .empty h1 { margin-bottom: 6px; }
.fresh .empty p { margin-bottom: 28px; }
.composer-slot:empty { display: none; }
.composer-slot .composer-wrap { position: static; padding: 0; background: none; margin: 0 auto 28px; }
.composer-slot .composer { width: min(720px, 100%); }
.composer-slot .disclaimer { display: none; }
.fresh .recent { margin-top: 40px; }

/* Admin gate */
.pw { margin-top: 18px; }
.pw summary { cursor: pointer; color: var(--text-2); font-size: 14px; margin-bottom: 10px; }

/* Tool status inside a reply */
.tool-note { display: block; margin-top: 8px; font-size: 13px; color: var(--text-3); }
.tool-note::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); margin-right: 8px; animation: blink 1.2s infinite; }

/* X profile card */
.xcard { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--text) !important; text-decoration: none !important; max-width: 420px; }
.xcard:hover { background: var(--bg-3); }
.xcard img, .xcard-avatar { width: 48px; height: 48px; border-radius: 50%; flex: none; background: var(--bg-3); object-fit: cover; }
.xcard-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.xcard-name { font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.xcard-handle { font-size: 13px; color: var(--text-2); }
.xcard-bio { font-size: 13px; color: var(--text-2); line-height: 1.4; margin-top: 4px; }
.xcard-x { font-size: 16px; color: var(--text-3); flex: none; }

/* Owner dashboard */
.dash { --s1: #2a78d6; --s2: #eb6834; --good: #0ca30c; --bad: #e34948; }
@media (prefers-color-scheme: dark) { .dash { --s1: #3987e5; --s2: #d95926; --good: #2bbf2b; --bad: #e66767; } }
.dash-main { padding: 32px 0 80px; }
.dash-gate { max-width: 560px; padding-top: 48px; }
.dash-gate h1, .dash-head h1 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 6px; }
.dash-gate .row, .dash .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.dash .hidden { display: none; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head p { margin: 0; font-size: 13px; }
.dash-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 980px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-2); font-size: 13px; padding: 5px 12px; border-radius: 980px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.hero-tile { padding: 22px 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.hero-num { font-size: clamp(40px, 6vw, 56px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.tile-label { font-size: 13px; color: var(--text-2); }
.tile-sub { font-size: 13px; color: var(--text-3); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.tile { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); display: flex; flex-direction: column; gap: 3px; }
.tile-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.tile-rows { margin-top: 12px; display: grid; gap: 6px; font-size: 13px; }
.tile-rows > div { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; color: var(--text-2); }
.tile-rows b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; font-weight: 500; }
.delta.good { color: var(--good); } .delta.bad { color: var(--bad); } .delta.flat { color: var(--text-3); }
.delta .vs { color: var(--text-3); font-weight: 400; }
.chart-card, .log-card { margin-bottom: 14px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-head h3 { margin: 0; font-size: 16px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.s1, .bar.s1 { background: var(--s1); fill: var(--s1); } .sw.s2, .bar.s2 { background: var(--s2); fill: var(--s2); }
.chart-wrap { position: relative; }
#chart { width: 100%; height: 260px; display: block; }
#chart .grid { stroke: var(--line); stroke-width: 1; } #chart .base { stroke: var(--text-3); stroke-width: 1; }
#chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--mono); }
#chart .hit { fill: transparent; } #chart .hit:hover { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.tip { position: absolute; z-index: 5; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; line-height: 1.5; box-shadow: var(--shadow); white-space: nowrap; position: fixed; transform: translateY(-100%); }
.table-view summary { font-size: 13px; color: var(--text-2); cursor: pointer; margin-top: 8px; }
table.log { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
table.log th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.log td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.log .num { text-align: right; font-variant-numeric: tabular-nums; }
table.log .ref { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; background: var(--text-3); }
.dot.revenue { background: var(--s1); } .dot.paid { background: var(--s2); }
