:root {
  /* ChatGPT-style dark greys */
  --bg: #000000;
  --side: #000000;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.13);
  --hover: #1A1A1A;
  --card: #2A2A2A;
  --field: #2F2F2F;
  --bubble: #303030;
  --pop: #353535;
  --text: #ECECEC;
  --text-2: #ECECEC;
  --muted: #A1A1A1;
  --danger: #FF7A7A;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--text); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #8FA2FF; outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* Icons */
.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; stroke-width: 2; }
.ic-lg { width: 24px; height: 24px; }
.ic-bold { stroke-width: 2.2; }
.ic-fill { fill: currentColor; stroke: none; }
.muted-ic { color: var(--muted); }

/* Logo */
.logo { display: block; width: 56px; height: auto; }
.loop { fill: none; stroke: #FFFFFF; stroke-width: 9; }
.loop-thick { stroke-width: 11; }
.glow { filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.45)); }
.brand { display: flex; align-items: center; gap: 12px; }
.wordmark { font-family: 'Inter', system-ui, sans-serif; font-size: 23px; font-weight: 600; letter-spacing: -0.3px; }
.brand-btn { border: 0; background: none; padding: 4px; border-radius: 10px; }

/* Boot */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .logo { width: 112px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; } }

/* Buttons */
.btn { height: 52px; padding: 0 22px; border-radius: 26px; border: 0; font-weight: 600; font-size: 15px; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: #FFFFFF; }
.btn-primary:disabled { opacity: 0.6; }
.btn-outline { background: var(--field); border: 1px solid var(--line-2); }
.btn-outline:hover { background: var(--hover); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { background: var(--danger); color: #1A0B0B; }
.link-btn { border: 0; background: none; padding: 4px 2px; color: var(--muted); font-size: 14px; }
.link-btn:hover { color: var(--text); }
.link-btn.strong { color: var(--text); font-weight: 600; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: #C9CBD1; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .ic { width: 22px; height: 22px; }

/* Sign in */
/* Sign in / sign up — ChatGPT-inspired: one calm column, email first, then password. */
.auth { min-height: 100vh; min-height: 100dvh; background: #000; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; min-height: 100dvh; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px 24px; }
.auth-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 22px; margin: auto 0; animation: auth-in 0.45s cubic-bezier(.2,.7,.2,1); }
@keyframes auth-in { from { opacity: 0; transform: translateY(10px); } }
.auth-head { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.auth-head h1 { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: -0.6px; line-height: 1.15; }
.auth-sub { margin: 0; color: #A8A8A8; font-size: 15px; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }

/* Inputs with a label that floats onto the border, like ChatGPT */
.float-field { position: relative; }
.float-field input { width: 100%; height: 54px; padding: 18px 16px 0; border: 1px solid #3A3A3A; border-radius: 14px; background: #0D0D0D; color: var(--text); font-size: 16px; transition: border-color 0.15s, box-shadow 0.15s; }
.float-field input:hover { border-color: #4A4A4A; }
.float-field input:focus { outline: none; border-color: #4A8BFF; box-shadow: 0 0 0 4px rgba(74, 139, 255, 0.16); }
.float-field input[readonly] { color: #CFCFCF; border-color: #2A2A2A; background: #0A0A0A; padding-right: 64px; }
.float-field label { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #8C8C8C; font-size: 16px; pointer-events: none; transition: all 0.15s ease; transform-origin: left center; }
.float-field input:focus + label, .float-field input:not(:placeholder-shown) + label { top: 15px; font-size: 12px; color: #9A9A9A; }
.float-field input:focus + label { color: #6FA3FF; }
.has-error .float-field input:not([readonly]) { border-color: #E5484D; box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.14); }
.field-action { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: #6FA3FF; font-size: 14px; font-weight: 500; }
.field-action:hover { background: rgba(255, 255, 255, 0.06); }
.field-eye { width: 40px; padding: 0; color: #9A9A9A; display: flex; align-items: center; justify-content: center; }
.field-eye .ic { width: 20px; height: 20px; }
.float-field #auth-password { padding-right: 52px; }
.pw-rules { margin: -2px 0 0; padding: 12px 14px; list-style: none; border: 1px solid #262626; border-radius: 12px; font-size: 13px; color: #9A9A9A; }
.pw-rules li { display: flex; align-items: center; gap: 8px; }
.pw-rules li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #555; flex: 0 0 auto; transition: all 0.2s; }
.pw-rules li.ok { color: #CFCFCF; }
.pw-rules li.ok::before { border-color: #3FB950; background: #3FB950 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 10px no-repeat; }
.forgot { align-self: flex-start; margin: -4px 0 0; padding: 2px 0; color: #6FA3FF; font-size: 14px; font-weight: 500; }
.forgot:hover { color: #9CC0FF; text-decoration: underline; }
.form-error { margin: -4px 0 0; color: #FF8A8E; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.auth-continue { height: 54px; border: 0; border-radius: 27px; background: #FFFFFF; color: #0A0A0A; font-size: 16px; font-weight: 600; transition: transform 0.1s, background 0.15s; position: relative; }
.auth-continue:hover { background: #E8E8E8; }
.auth-continue:active { transform: scale(0.99); }
.auth-continue.busy { color: transparent; }
.auth-continue.busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 2.5px solid #0A0A0A; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.switch { margin: -4px 0 0; text-align: center; font-size: 14px; color: #A8A8A8; }
.switch-btn { border: 0; background: none; padding: 2px; color: #6FA3FF; font-weight: 500; font-size: 14px; }
.switch-btn:hover { text-decoration: underline; }
.auth-alt { display: flex; flex-direction: column; gap: 14px; }
.divider { display: flex; align-items: center; gap: 14px; color: #7A7A7A; font-size: 12px; font-weight: 500; letter-spacing: 0.5px; }
.divider span { flex: 1 1 auto; height: 1px; background: #2A2A2A; }
.social-btn { height: 54px; display: flex; align-items: center; gap: 14px; padding: 0 20px; border: 1px solid #333; border-radius: 27px; background: transparent; color: var(--text); font-size: 16px; font-weight: 500; transition: background 0.15s, border-color 0.15s; }
.social-btn:hover { background: #111; border-color: #444; }
.g-logo { width: 20px; height: 20px; flex: 0 0 auto; }
.auth-foot { display: flex; justify-content: center; gap: 10px; padding: 24px 0 0; font-size: 13px; color: #6E6E6E; }
.auth-foot a { color: #8C8C8C; text-decoration: none; }
.auth-foot a:hover { color: var(--text); text-decoration: underline; }
.auth-foot a + a::before { content: "|"; margin-right: 10px; color: #444; }

/* Showcase (desktop): the Veta loop in liquid glass, as large as X shows its logo. */
.auth-split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-show { order: -1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #000; }
.show-logo { width: min(70%, 600px); }
@keyframes logo-float { 50% { transform: translateY(-10px) rotate(-0.6deg); } }
/* Slow coloured light behind the glass, so it has something to bend. */
.show-aura { position: absolute; inset: 0; filter: blur(70px); opacity: 0.55; }
.show-aura span { position: absolute; width: 34%; aspect-ratio: 1; border-radius: 50%; }
.show-aura span:nth-child(1) { left: 18%; top: 34%; background: #1f5fff; animation: aura-a 14s ease-in-out infinite; }
.show-aura span:nth-child(2) { left: 46%; top: 30%; background: #8a3cff; animation: aura-b 17s ease-in-out infinite; }
.show-aura span:nth-child(3) { left: 34%; top: 46%; background: #00b4ff; opacity: 0.6; animation: aura-c 12s ease-in-out infinite; }
@keyframes aura-a { 50% { transform: translate(18%, -10%) scale(1.15); } }
@keyframes aura-b { 50% { transform: translate(-20%, 12%) scale(0.9); } }
@keyframes aura-c { 50% { transform: translate(10%, -18%) scale(1.2); } }
.auth-glass-logo { display: none; width: 120px; align-self: center; margin-bottom: -6px; }

@media (max-width: 960px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-show { display: none; }
  .auth-glass-logo { display: block; }
  .auth-main { padding: 32px 20px 20px; }
  .auth-head h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .auth-card, .show-logo, .show-aura span { animation: none; } }

/* App layout */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: 280px; flex: 0 0 280px; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px 14px; min-height: 0; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0; }

.side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 18px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; font-size: 15px; text-align: left; }
.nav-item:hover, .nav-item.active { background: var(--hover); }
.search-box { display: block; margin: 10px 0 0; }
.search-box input { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--field); font-size: 14px; }
.search-box input:focus { outline: none; border-color: #5B5E66; }
.side-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 18px -6px 0; padding: 0 6px; }
.side-label { padding: 8px 10px; font-size: 14px; color: var(--muted); }
.side-empty { padding: 4px 10px; font-size: 14px; margin: 0; }
.chat-list { list-style: none; margin: 0; padding: 0; }
.chat-item { position: relative; display: flex; align-items: center; border-radius: 10px; }
.chat-item:hover, .chat-item.active { background: var(--hover); }
.chat-link { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 10px; border: 0; background: none; color: var(--text-2); font-size: 14px; text-align: left; }
.chat-link .ic { width: 18px; height: 18px; color: var(--muted); }
.chat-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.active .chat-link { color: var(--text); }
.chat-more { width: 32px; height: 32px; margin-right: 4px; border: 0; border-radius: 8px; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; opacity: 0; }
.chat-item:hover .chat-more, .chat-item.active .chat-more, .chat-more:focus-visible, .chat-more[aria-expanded="true"] { opacity: 1; }
.chat-more:hover { color: var(--text); }
@media (hover: none) { .chat-more { opacity: 1; } }

.upgrade { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-align: left; }
.upgrade:hover { border-color: var(--line-2); }
.upgrade-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; }
.upgrade-text strong { font-size: 14px; font-weight: 600; }
.upgrade-text span { font-size: 12px; color: var(--muted); }
.account { margin-top: 12px; }
.account-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; border-radius: 12px; background: transparent; text-align: left; font-weight: 500; }
.account-btn:hover { background: var(--hover); }
.account-badge { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; background: var(--hover); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; }
.account-badge svg { width: 28px; height: auto; }
.account-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.top-left, .top-right { display: flex; align-items: center; gap: 10px; }
.top-right { gap: 14px; }
.menu-btn { display: none; }
.model-btn { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; font-size: 18px; font-weight: 600; letter-spacing: -0.2px; }
.model-btn:hover { background: var(--hover); }
.pill-btn { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 21px; background: transparent; font-weight: 600; }
.pill-btn:hover { background: var(--hover); }
.avatar { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--line-2); font-weight: 600; font-size: 16px; }
.avatar:hover { background: #363943; }

/* Home */
.home { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 72px 24px 48px; }
.home-logo { width: 128px; flex: 0 0 auto; }
.home-title { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.4px; text-align: center; }
.home-sub { margin: 14px 0 0; font-size: 16px; text-align: center; }
.home .composer-slot { width: 100%; max-width: 816px; margin-top: 32px; }
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 30px; max-width: 816px; }
.chip { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 20px; border: 1px solid var(--line-2); border-radius: 22px; background: transparent; font-size: 14px; font-weight: 500; }
.chip:hover { background: var(--hover); }

/* Composer */
.composer { display: flex; flex-direction: column; gap: 10px; padding: 16px 14px 12px; background: var(--field); border: 1px solid var(--line-2); border-radius: 24px; }
.composer:focus-within { border-color: #44474F; }
.composer-input { display: flex; padding: 0 8px; }
.composer textarea { flex: 1 1 auto; resize: none; border: 0; outline: none; background: transparent; font-size: 16px; line-height: 1.5; max-height: 220px; color: var(--text); }
.composer textarea::placeholder { color: var(--muted); }
.composer-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.round-btn { width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 50%; background: transparent; display: inline-flex; align-items: center; justify-content: center; }
.round-btn:hover { background: var(--hover); }
.toggle { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 20px; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; }
.toggle .ic { width: 18px; height: 18px; }
.toggle:hover { background: var(--hover); }
.toggle[aria-pressed="true"] { background: var(--bubble); border-color: #4A4D57; color: #FFFFFF; }

/* Voice chat */
.voice { position: fixed; z-index: 45; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 40px 24px max(40px, env(safe-area-inset-bottom)); background: #000; }
.voice-center { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; width: 100%; }
.voice-orb { --level: 0.3; position: relative; width: min(520px, 100vw, 70vh); aspect-ratio: 1; padding: 0; border: 0; background: transparent; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; perspective: 900px; }
.voice-orb:focus-visible { outline: 2px solid rgba(80, 140, 255, 0.6); outline-offset: 6px; border-radius: 24px; }
/* Veta Origin's head. A blue halo behind it breathes with the voice. */
.voice-orb::before { content: ""; position: absolute; left: 50%; top: 44%; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(calc(0.9 + var(--level) * 0.3)); border-radius: 50%; background: radial-gradient(circle, rgba(40, 110, 255, calc(0.1 + var(--level) * 0.22)) 0%, transparent 68%); pointer-events: none; }
.voice-figure { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; will-change: transform;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 46%, #000 70%, transparent 100%); mask-image: radial-gradient(ellipse 62% 58% at 50% 46%, #000 70%, transparent 100%); }
.voice-figure img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; filter: brightness(calc(0.92 + var(--level) * 0.18)); }
.voice-lights { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.voice[data-state="error"] .voice-lights { opacity: 0.35; }
/* Two-line menu icon: a long line over a short one. */
.ic-ham { stroke-width: 2; }
.voice-menu { display: none; position: absolute; top: max(16px, env(safe-area-inset-top)); left: 16px; width: 48px; height: 48px; align-items: center; justify-content: center; border: 1px solid #2A2C33; border-radius: 50%; background: rgba(21, 23, 27, 0.8); color: var(--text); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.voice-menu .ic { width: 22px; height: 22px; }
.voice-menu:hover { background: #1F2127; }
.voice-bar { display: flex; align-items: center; justify-content: center; gap: 14px; }
.voice-lang { height: 60px; display: flex; align-items: center; gap: 8px; padding: 0 20px; border: 1px solid #2A2C33; border-radius: 30px; background: #15171B; color: var(--text); font-size: 15px; font-weight: 500; }
.voice-lang:hover { background: #1F2127; }
.voice-end { width: 60px; height: 60px; flex: none; display: flex; align-items: center; justify-content: center; border: 1px solid #2A2C33; border-radius: 50%; background: #15171B; color: var(--text); }
.voice-end .ic { width: 24px; height: 24px; }
.voice-end:hover { background: #1F2127; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.send-btn { margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; }
.send-btn:hover { background: #FFFFFF; }
.stop-ic { width: 14px; height: 14px; fill: currentColor; }

/* Thread */
.thread { flex: 1 1 auto; overflow-y: auto; padding: 24px 24px 16px; }
.messages { max-width: 768px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.msg-user { align-self: flex-end; max-width: 78%; background: var(--bubble); padding: 12px 18px; border-radius: 22px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-bot { display: flex; gap: 16px; }
.bot-badge { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.bot-badge svg { width: 20px; height: auto; }
.msg-bot.thinking .bot-badge { box-shadow: 0 0 14px rgba(255, 255, 255, 0.18); }
.bot-body { flex: 1 1 auto; min-width: 0; color: var(--text-2); line-height: 1.65; }
.bot-error { color: var(--danger); margin: 0; }
.bot-note { color: var(--muted); margin: 0; }
.dots { display: flex; gap: 6px; height: 32px; align-items: center; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--text); animation: dot 1.1s ease-in-out infinite; }
.dots span:nth-child(2) { animation-delay: 0.18s; }
.dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes dot { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.bot-actions { display: flex; gap: 2px; margin: 6px 0 0 -10px; }
.bot-actions button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.bot-actions button:hover { background: var(--hover); color: var(--text); }
.bot-actions .ic { width: 18px; height: 18px; }
.retry-btn { margin-top: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 19px; background: transparent; font-size: 14px; }

/* Markdown */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h1, .md h2, .md h3, .md h4 { color: var(--text); margin: 20px 0 8px; line-height: 1.3; }
.md h1 { font-size: 22px; } .md h2 { font-size: 18px; } .md h3, .md h4 { font-size: 16px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 24px; }
.md li { margin: 4px 0; }
.md strong { color: var(--text); }
.md a { color: #A9B6FF; }
.md code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.88em; background: var(--hover); padding: 2px 6px; border-radius: 6px; }
.md pre { background: #08090B; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; margin: 0 0 12px; }
.md pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.55; }
.md blockquote { margin: 0 0 12px; padding-left: 14px; border-left: 3px solid var(--line-2); color: var(--muted); }
.md table { border-collapse: collapse; margin: 0 0 12px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line-2); padding: 6px 10px; text-align: left; }
.md hr { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }

/* Artifact cards (in a reply) */
.artifact-card { width: 100%; max-width: 520px; display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; padding: 12px 14px 12px 12px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--card); color: var(--text); text-align: left; }
.artifact-card:hover { border-color: #3A3D46; background: #181A1F; }
.artifact-card.open { border-color: #5B5E66; }
.artifact-icon { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; background: var(--hover); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; }
.artifact-icon .ic { width: 22px; height: 22px; }
.artifact-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.artifact-text strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artifact-text span { font-size: 13px; color: var(--muted); }
.artifact-open { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 14px; flex: 0 0 auto; }

/* Artifact panel */
.panel { flex: 0 0 auto; width: min(46vw, 760px); min-width: 420px; display: flex; flex-direction: column; min-height: 0; background: var(--side); border-left: 1px solid var(--line); }
.panel-top { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-heading { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; }
.panel-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-sub { font-size: 12px; }
.panel-tabs { display: flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 12px; }
.tab { height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.tab[aria-selected="true"] { background: var(--hover); color: var(--text); }
.panel-actions { display: flex; }
.panel-body { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; }
.panel-frame { display: block; width: 100%; height: 100%; border: 0; background: #FFFFFF; }
.panel-code { margin: 0; padding: 18px 20px; min-height: 100%; font: 13.5px/1.6 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--text-2); white-space: pre; tab-size: 2; }
.panel-doc { padding: 28px 32px; max-width: 720px; color: var(--text-2); line-height: 1.7; }
.panel-writing { position: absolute; top: 12px; right: 16px; font-size: 12px; color: var(--muted); background: var(--card); border: 1px solid var(--line-2); padding: 4px 10px; border-radius: 10px; }

/* Dock */
.dock { padding: 0 24px 18px; }
.dock .composer-slot { max-width: 768px; margin: 0 auto; }
.dock .composer { padding: 14px 14px 12px; }
.disclaimer { max-width: 768px; margin: 10px auto 0; text-align: center; font-size: 12px; }

/* Menu */
.menu { position: fixed; z-index: 48; min-width: 220px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow-y: auto; padding: 6px; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); }
.menu-label { padding: 8px 12px 6px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 14px; }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); }
.menu-item.danger { color: var(--danger); }
.menu-item .menu-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.menu-item .menu-sub { font-size: 12px; color: var(--muted); }
.menu-check { width: 18px; height: 18px; flex: 0 0 auto; }
.menu-sep { height: 1px; background: var(--line-2); margin: 6px 4px; }

/* Dialog */
.dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 20px; background: var(--card); color: var(--text); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialog form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dialog h2 { margin: 0; font-size: 18px; font-weight: 700; }
.dialog p { margin: 0; color: var(--text-2); }
.dialog input[type="text"] { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--field); }
.dialog input[type="text"]:focus { outline: none; border-color: #5B5E66; }
.dialog .btn { height: 44px; padding: 0 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.reasons { display: flex; flex-direction: column; gap: 4px; }
.reasons label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 10px; }
.reasons label:hover { background: var(--hover); }

/* Toast */
.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }

/* Phones and small tablets */
@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform 0.22s ease; }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.55); }
  .menu-btn { display: inline-flex; }
  .voice-menu { display: flex; }
  /* Opened from the voice screen, the sidebar slides in over it. */
  .app.over-voice .sidebar { z-index: 47; }
  .app.over-voice .scrim { z-index: 46; }
  .top { padding: 10px 8px; }
  .share-btn span { display: none; }
  .share-btn { width: 42px; padding: 0; justify-content: center; }
  .home { padding: 32px 16px 24px; }
  /* Center vertically without clipping the top when content overflows (justify-content:center would). */
  .home > :first-child { margin-top: auto; }
  .home > :last-child { margin-bottom: auto; }
  .home-logo { width: 96px; }
  .home-title { font-size: 24px; margin-top: 0; }
  .home-sub { font-size: 15px; }
  .quick { gap: 10px; }
  .chip { padding: 0 14px; }
  .thread { padding: 16px 16px 12px; }
  .dock { padding: 0 12px 12px; }
  .msg-user { max-width: 88%; }
  .msg-bot { gap: 12px; }
  .panel { position: fixed; z-index: 35; inset: 0; width: auto; min-width: 0; border-left: 0; }
  .panel-top { padding-left: 14px; }
  .panel-doc { padding: 20px 18px; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .app.panel-open .sidebar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Attachments */
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 6px 4px; }
.attach-chip { position: relative; display: flex; align-items: center; gap: 10px; max-width: 240px; height: 56px; padding: 0 34px 0 8px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--card); font-size: 13px; }
.attach-chip.is-image { width: 56px; padding: 0; overflow: hidden; }
.attach-chip.is-image img { width: 100%; height: 100%; object-fit: cover; }
.attach-chip .file-icon { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; background: var(--hover); display: flex; align-items: center; justify-content: center; }
.attach-chip .file-text { min-width: 0; display: flex; flex-direction: column; }
.attach-chip .file-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-chip .file-text span { color: var(--muted); font-size: 12px; }
.attach-chip.uploading::after { content: ""; position: absolute; inset: 0; background: rgba(11, 12, 15, 0.55); border-radius: inherit; }
.attach-chip.failed { border-color: var(--danger); }
.attach-remove { position: absolute; z-index: 1; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(11, 12, 15, 0.85); color: var(--text); display: flex; align-items: center; justify-content: center; }
.attach-remove .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.composer.dragging { border-color: #8FA2FF; }

.msg-user-wrap { align-self: flex-end; max-width: 78%; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.msg-user-wrap .msg-user { align-self: auto; max-width: 100%; }
.msg-files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.msg-files .attach-chip { padding-right: 12px; }
.msg-files img { display: block; max-width: 220px; max-height: 220px; border-radius: 14px; border: 1px solid var(--line-2); object-fit: cover; background: var(--card); }

/* Created media */
.md img { display: block; max-width: min(100%, 520px); height: auto; border-radius: 16px; margin: 6px 0 12px; background: var(--card); }
.md a.media-link { display: inline-block; }
.video-card { max-width: 560px; margin: 6px 0 12px; border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; background: var(--card); }
.video-card video { display: block; width: 100%; max-height: 420px; background: #000; }
.video-wait { display: flex; align-items: center; gap: 14px; padding: 18px; }
.video-wait p { margin: 0; color: var(--text-2); }
.video-wait span { display: block; font-size: 13px; color: var(--muted); }
.video-error { padding: 16px 18px; color: var(--danger); margin: 0; }
.spinner { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--text); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bot-status { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 14px; }
.bot-status .dots { height: 24px; }

/* Library */
.library { flex: 1 1 auto; overflow-y: auto; padding: 24px 24px 40px; }
.library-inner { max-width: 1100px; margin: 0 auto; }
.library-title { margin: 0; font-size: 26px; font-weight: 700; }
.library-sub { margin: 6px 0 22px; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.lib-item { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); background: var(--card); }
.lib-item img, .lib-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-item a { display: block; height: 100%; }
.lib-caption { position: absolute; inset: auto 0 0 0; padding: 22px 12px 10px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.lib-pending { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.library-empty { margin: 8px 0 0; }
@media (max-width: 900px) {
  .library { padding: 16px; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .msg-user-wrap { max-width: 88%; }
  .msg-files img { max-width: 160px; max-height: 160px; }
}

/* Replies with media, files and sources (same look as the rest of the chat) */
.reply-media { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.reply-media > a.media-link img { display: block; max-width: min(100%, 520px); height: auto; border-radius: 16px; background: var(--card); }
.reply-media .artifact-card { margin: 0; }
.media-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 560px; }
.media-gallery img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--card); }
.sources { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.sources-title { margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.sources ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.sources a { color: var(--text-2); text-decoration: none; }
.sources a:hover { color: var(--text); text-decoration: underline; }
.source-host { color: var(--muted); }
.md a.cite { color: var(--muted); text-decoration: none; font-size: 0.85em; vertical-align: super; line-height: 0; }
.md a.cite:hover { color: var(--text); }
.md input[type="checkbox"] { margin-right: 6px; accent-color: var(--text); }
.md .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.md pre code.hljs { background: none; padding: 0; }

/* Narrow phones: keep +, Search, Reason and Send on one line beside the icon bar. */
@media (max-width: 440px) {
  .composer-row { gap: 6px; flex-wrap: nowrap; }
  .composer-row > .round-btn, .composer-row > .send-btn { flex-shrink: 0; }
  .toggle { padding: 0 9px; gap: 4px; font-size: 13px; }
  .toggle .ic { width: 16px; height: 16px; }
}


/* ================= ChatGPT-style interface ================= */

/* The message box keeps its own look. */
.composer { --bg: #0B0C0F; --line: #1F2127; --line-2: #2A2C33; --hover: #1B1D22; --card: #15171B; --field: #121318; --bubble: #1F2127; --text: #ECEDEF; --text-2: #D9DBE0; --muted: #9A9DA6; color: var(--text); }

body { font-size: 15px; }
:focus-visible { outline-color: #9BB8FF; }

/* Sidebar */
.sidebar { width: 260px; flex: 0 0 260px; padding: 8px 8px 10px; border-right: 0; transition: width 0.2s ease, flex-basis 0.2s ease; }
.side-top { padding: 4px 4px 10px; }
.brand-btn .logo { width: 40px; }
.brand-btn { padding: 6px; border-radius: 8px; }
.brand-btn:hover, .side-toggle:hover { background: var(--hover); }
.side-toggle { width: 36px; height: 36px; border-radius: 8px; color: #B4B4B4; }
.side-toggle .ic { width: 20px; height: 20px; }
.side-nav { gap: 0; }
.nav-item { height: 36px; gap: 10px; padding: 0 10px; border-radius: 8px; font-size: 14px; color: var(--text); white-space: nowrap; }
.nav-item .ic { width: 18px; height: 18px; }
.nav-item:hover, .nav-item.active { background: var(--hover); }
.search-box { margin: 6px 2px 0; }
.search-box input { height: 36px; border-radius: 8px; background: var(--field); border-color: transparent; }
.side-list { margin: 14px -4px 0; padding: 0 4px; }
.chat-group { margin-bottom: 14px; }
.chat-group-label { padding: 6px 10px 4px; font-size: 12px; font-weight: 600; color: #8F8F8F; position: sticky; top: 0; background: var(--side); z-index: 1; }
.chat-item { border-radius: 8px; }
.chat-item:hover { background: #212121; }
.chat-item.active { background: var(--hover); }
.chat-link { min-height: 36px; padding: 0 10px; gap: 0; font-size: 14px; color: var(--text); }
.chat-link .ic { display: none; }
.chat-more { width: 28px; height: 28px; margin-right: 6px; }
.side-empty { padding: 6px 10px; font-size: 13px; }

.upgrade { margin-top: 8px; padding: 8px 10px; gap: 10px; border: 0; border-radius: 10px; background: transparent; }
.upgrade:hover { background: var(--hover); }
.upgrade-icon { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; }
.upgrade-icon .ic { width: 16px; height: 16px; }
.upgrade-text strong { font-size: 14px; font-weight: 500; }
.upgrade-text span { font-size: 12px; }
.account { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.account-btn { padding: 8px 10px; gap: 10px; border-radius: 10px; }
.account-badge { width: 30px; height: 30px; border: 0; background: #7C5CFF; color: #fff; font-size: 13px; font-weight: 600; letter-spacing: 0.2px; }
.account-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.account-name { font-size: 14px; font-weight: 500; }
.account-plan { font-size: 12px; color: var(--muted); }

/* Desktop: the sidebar folds into a slim icon rail */
@media (min-width: 901px) {
  .app.side-collapsed .sidebar { width: 56px; flex-basis: 56px; padding: 8px 6px 10px; border-right: 1px solid var(--line); }
  .app.side-collapsed .side-top { flex-direction: column; gap: 4px; padding: 4px 0 8px; }
  .app.side-collapsed .brand-btn { display: none; }
  .app.side-collapsed .nav-item { width: 40px; justify-content: center; padding: 0; gap: 0; margin: 0 auto; }
  .app.side-collapsed .nav-text,
  .app.side-collapsed .search-box,
  .app.side-collapsed .side-list,
  .app.side-collapsed .upgrade-text,
  .app.side-collapsed .account-text,
  .app.side-collapsed .account-btn > .muted-ic { display: none; }
  .app.side-collapsed .upgrade { margin-top: auto; justify-content: center; padding: 6px 0; }
  .app.side-collapsed .account { border-top: 0; }
  .app.side-collapsed .account-btn { justify-content: center; padding: 6px 0; }
}

/* Top bar */
.top { padding: 8px 12px; min-height: 56px; }
.model-btn { height: 40px; padding: 0 12px; border-radius: 10px; font-size: 18px; font-weight: 500; }
.top-new { display: none; }
.top .icon-btn { width: 40px; height: 40px; border-radius: 10px; }

/* Home */
.home { padding: 48px 24px 40px; justify-content: center; }
.home > :first-child { margin-top: auto; }
.home > :last-child { margin-bottom: auto; }
.home-title { font-size: 28px; font-weight: 500; letter-spacing: -0.2px; }
.home .composer-slot { max-width: 768px; margin-top: 28px; }
.quick { gap: 8px; margin-top: 20px; max-width: 768px; }
.chip { height: 38px; padding: 0 14px; gap: 8px; border-color: var(--line-2); border-radius: 19px; font-size: 13.5px; color: #CFCFCF; }
.chip .ic { width: 17px; height: 17px; }

/* Conversation */
.main { position: relative; }
.thread { padding: 20px 24px 28px; }
.messages { max-width: 768px; gap: 22px; }
.msg-user-wrap, .msg-user-row { align-self: flex-end; max-width: 72%; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.msg-user-row .msg-user, .msg-user-row .msg-user-wrap { max-width: 100%; }
.msg-user { background: var(--bubble); padding: 10px 16px; border-radius: 22px; font-size: 16px; line-height: 1.6; color: var(--text); }
.user-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.msg-user-row:hover .user-actions, .user-actions:focus-within { opacity: 1; }
@media (hover: none) { .user-actions { opacity: 1; } }
.user-actions button, .bot-actions button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #B4B4B4; display: inline-flex; align-items: center; justify-content: center; }
.user-actions button:hover, .bot-actions button:hover { background: var(--hover); color: var(--text); }
.user-actions .ic, .bot-actions .ic { width: 17px; height: 17px; }
.bot-actions button[aria-pressed="true"] { color: var(--text); }
.bot-actions { gap: 0; margin: 8px 0 0 -6px; }
.msg-bot { display: block; }
.msg-bot .bot-badge { display: none; }
.bot-body { color: var(--text); font-size: 16px; line-height: 1.75; }

/* Editing a sent message */
.edit-box { align-self: stretch; margin-left: auto; width: min(100%, 640px); background: var(--bubble); border-radius: 22px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.edit-box textarea { width: 100%; min-height: 60px; max-height: 300px; resize: none; border: 0; outline: none; background: transparent; color: var(--text); font-size: 16px; line-height: 1.6; }
.edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.edit-actions button { height: 36px; padding: 0 16px; border-radius: 18px; border: 0; font-size: 14px; font-weight: 500; }
.edit-cancel { background: #424242; color: var(--text); }
.edit-send { background: var(--text); color: #1A1A1A; }

/* Thinking: one pulsing dot; status text shimmers */
.bot-status { display: flex; align-items: center; gap: 10px; min-height: 28px; color: var(--muted); font-size: 15px; }
.bot-status .dots { display: none; }
.pulse-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--text); animation: pulse-dot 1.2s ease-in-out infinite; flex: 0 0 auto; }
@keyframes pulse-dot { 0%, 100% { transform: scale(0.75); opacity: 0.6; } 50% { transform: scale(1); opacity: 1; } }
.shimmer { background: linear-gradient(90deg, #8a8a8a 0%, #ececec 40%, #8a8a8a 80%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Markdown, ChatGPT-like */
.md p { margin: 0 0 14px; }
.md h1 { font-size: 24px; font-weight: 600; } .md h2 { font-size: 20px; font-weight: 600; } .md h3 { font-size: 17px; font-weight: 600; }
.md h1, .md h2, .md h3, .md h4 { margin: 24px 0 10px; }
.md li { margin: 6px 0; }
.md hr { border-top-color: var(--line); margin: 24px 0; }
.md a { color: #8AB4FF; }
.md code { background: #424242; color: #ECECEC; padding: 2px 5px; border-radius: 5px; font-size: 0.86em; }
.md table { border-radius: 10px; }
.md th { background: #2A2A2A; font-weight: 600; }
.md th, .md td { border-color: var(--line-2); padding: 8px 12px; }
.code-block { margin: 0 0 16px; border-radius: 14px; overflow: hidden; background: #171717; border: 1px solid var(--line); }
.code-head { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 8px 0 16px; background: #2A2A2A; font-size: 12.5px; color: #B4B4B4; }
.code-copy { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: #B4B4B4; font-size: 12.5px; }
.code-copy:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.code-copy .ic { width: 15px; height: 15px; }
.code-block pre { margin: 0; border: 0; border-radius: 0; background: transparent; padding: 16px; }
.code-block pre code.hljs { background: transparent; padding: 0; }

/* Scroll to the latest message */
.to-bottom { position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); bottom: 150px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: #2F2F2F; color: var(--text); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.to-bottom .ic { width: 17px; height: 17px; }
.to-bottom:hover { background: #3A3A3A; }

/* Dock */
.dock { padding: 0 24px 10px; }
.disclaimer { margin-top: 8px; font-size: 12px; color: #9B9B9B; }

/* Pop-up menus and dialogs */
.menu { background: var(--pop); border-color: var(--line-2); border-radius: 16px; padding: 6px; }
.menu-item { min-height: 38px; border-radius: 10px; }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, 0.07); }
.menu-sep { background: var(--line-2); }
.dialog { background: #2F2F2F; border-color: var(--line-2); }
.artifact-card { background: #2A2A2A; border-color: var(--line-2); }
.artifact-card:hover { background: #303030; border-color: rgba(255, 255, 255, 0.2); }
.panel { background: #1C1C1C; border-left-color: var(--line); }

@media (max-width: 900px) {
  .top { padding: 6px 6px; min-height: 52px; }
  .top-new { display: inline-flex; }
  .side-toggle { display: none; }
  .thread { padding: 14px 14px 20px; }
  .msg-user-wrap, .msg-user-row { max-width: 86%; }
  .bot-body { font-size: 16px; }
  .home-title { font-size: 24px; }
  .to-bottom { bottom: 140px; }
}
.messages { gap: 18px; }
.msg-user-row { gap: 2px; }
.user-actions button { width: 28px; height: 28px; }

/* Pure black everywhere; a hairline keeps the sidebar separate. */
html, body, .app, .main, .auth, .boot { background: #000; }
.sidebar { border-right: 1px solid rgba(255, 255, 255, 0.08); }
.chat-item:hover { background: #141414; }
.chat-item.active { background: #1A1A1A; }
.panel { background: #0A0A0A; }

/* Liquid-glass edge on the message box: a bright rim that catches light at the
   top-left and fades around, a soft inner sheen, and a faint frosted body. */
.composer { position: relative; isolation: isolate; border-color: transparent;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 45%, rgba(255, 255, 255, 0.035) 100%), rgba(18, 19, 24, 0.7);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(255, 255, 255, 0.06), inset 0 0 22px rgba(255, 255, 255, 0.05), 0 0 22px rgba(140, 170, 255, 0.10), 0 10px 40px rgba(0, 0, 0, 0.6); }
.composer::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--glass-angle, 210deg), rgba(255, 255, 255, 0.95), rgba(150, 190, 255, 0.45) 14%, rgba(255, 255, 255, 0.10) 32%, rgba(190, 150, 255, 0.45) 52%, rgba(255, 255, 255, 0.08) 70%, rgba(170, 220, 255, 0.5) 86%, rgba(255, 255, 255, 0.95));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity 0.3s ease; opacity: 0.85; }
.composer:focus-within { border-color: transparent; }
.composer:focus-within::before { opacity: 1; animation: glass-flow 6s linear infinite; }
@property --glass-angle { syntax: "<angle>"; inherits: false; initial-value: 210deg; }
@keyframes glass-flow { to { --glass-angle: 570deg; } }
@media (prefers-reduced-motion: reduce) { .composer:focus-within::before { animation: none; } }


/* The Veta logo on the sign-in page: the glowing loop and the word "Veta"
   take turns in the same spot, melting from one into the other. */
.vmark { position: relative; display: grid; place-items: center; aspect-ratio: 809 / 409; container-type: inline-size; }
.vmark > * { grid-area: 1 / 1; }
.vmark-icon { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; animation: vmark-icon 8s cubic-bezier(.65, 0, .35, 1) infinite; }
.vmark-word { font-family: 'Inter', system-ui, sans-serif; font-weight: 700; font-size: 34cqw; letter-spacing: -0.04em; line-height: 1; color: #fff;
  text-shadow: 0 0 0.08em rgba(255, 255, 255, 0.55), 0 0 0.3em rgba(255, 255, 255, 0.18); opacity: 0; animation: vmark-word 8s cubic-bezier(.65, 0, .35, 1) infinite; }
@keyframes vmark-icon {
  0%, 42% { opacity: 1; transform: scale(1); filter: blur(0); }
  50%, 92% { opacity: 0; transform: scale(0.82); filter: blur(14px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes vmark-word {
  0%, 42% { opacity: 0; transform: scale(1.18); filter: blur(14px); }
  50%, 92% { opacity: 1; transform: scale(1); filter: blur(0); }
  100% { opacity: 0; transform: scale(1.18); filter: blur(14px); }
}
@media (prefers-reduced-motion: reduce) { .vmark-icon, .vmark-word { animation: none; } }
.vmark.auth-glass-logo { display: none; }
@media (max-width: 960px) { .vmark.auth-glass-logo { display: grid; } }

/* Google button: compact and centred, not full width */
.auth-alt .social-btn { align-self: center; width: auto; height: 46px; padding: 0 22px 0 18px; gap: 10px; font-size: 15px; border-radius: 23px; justify-content: center; }

/* ===== Split screen while building (chat | website) ===== */
.panel { width: var(--panel-w, min(52vw, 900px)); min-width: 360px; background: #0A0A0A; border-left: 0; }
.panel-resizer { flex: 0 0 auto; width: 9px; margin: 0 -4px; z-index: 6; cursor: col-resize; position: relative; touch-action: none; }
.panel-resizer::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.08); transition: background 0.15s, width 0.15s; }
.panel-resizer:hover::after, .panel-resizer:focus-visible::after, .app.resizing .panel-resizer::after { background: #4A8BFF; width: 2px; left: 3.5px; }
.app.resizing, .app.resizing * { cursor: col-resize; user-select: none; }
.app.resizing .panel-frame { pointer-events: none; }
.panel-back { display: none; }
.panel-top { gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.panel-title { font-size: 14.5px; }
.panel.building .panel-sub { color: #8FB4FF; }
.panel-tabs { border-color: rgba(255, 255, 255, 0.12); border-radius: 10px; }
.tab { height: 30px; border-radius: 7px; }
.panel-devices { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px; }
.device-btn { width: 32px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: #9A9A9A; display: inline-flex; align-items: center; justify-content: center; }
.device-btn .ic { width: 17px; height: 17px; }
.device-btn:hover { color: var(--text); }
.device-btn[aria-pressed="true"] { background: #1F1F1F; color: var(--text); }
.panel-actions .icon-btn { width: 38px; height: 38px; }
.panel-body { background: #0A0A0A; }
.preview-stage { height: 100%; display: flex; justify-content: center; }
.preview-stage .panel-frame { width: 100%; height: 100%; }
.preview-stage.device-phone { padding: 18px 0; background: radial-gradient(60% 50% at 50% 50%, #151515, #0A0A0A); }
.preview-stage.device-phone .panel-frame { width: 390px; max-width: calc(100% - 24px); border-radius: 28px; border: 8px solid #1E1E1E; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); }
.panel-code { color: #D4D4D4; font-size: 13px; }
.panel.building .panel-code { padding-bottom: 60px; }
.panel-writing { display: inline-flex; align-items: center; gap: 8px; top: auto; bottom: 16px; right: 16px; padding: 8px 14px; border-radius: 18px; font-size: 13px; color: var(--text); background: rgba(30, 30, 30, 0.92); border-color: rgba(255, 255, 255, 0.12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.panel-writing .pulse-dot { width: 9px; height: 9px; background: #4A8BFF; }
.artifact-card.open { border-color: #4A8BFF; box-shadow: 0 0 0 3px rgba(74, 139, 255, 0.15); }
@media (max-width: 900px) {
  .panel-back { display: inline-flex; }
  .panel-top { padding-left: 6px; }
  .panel-devices { display: none; }
}

/* ===== Artifacts, styled like Claude's ===== */
/* Card in the chat: compact, clickable, icon tile on the left. */
.artifact-card { max-width: 440px; gap: 12px; margin: 6px 0 14px; padding: 10px 14px 10px 10px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.10); background: #141414; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.artifact-card:hover { background: #1A1A1A; border-color: rgba(255, 255, 255, 0.18); }
.artifact-card:active { transform: scale(0.995); }
.artifact-card.open { border-color: rgba(255, 255, 255, 0.28); box-shadow: none; background: #1A1A1A; }
.artifact-icon { width: 48px; height: 48px; border-radius: 10px; background: #0A0A0A; border: 1px solid rgba(255, 255, 255, 0.08); color: #BDBDBD; }
.artifact-icon .ic { width: 22px; height: 22px; }
.artifact-text strong { font-size: 14.5px; font-weight: 600; }
.artifact-text span { font-size: 12.5px; color: #8E8E8E; }
.artifact-open { display: none; }
.artifact-card.writing .artifact-icon { position: relative; overflow: hidden; }
.artifact-card.writing .artifact-icon::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.14) 50%, transparent 70%); background-size: 220% 100%; animation: card-sheen 1.4s linear infinite; }
.artifact-card.writing .artifact-text span { background: linear-gradient(90deg, #8a8a8a 0%, #ececec 40%, #8a8a8a 80%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.8s linear infinite; }
@keyframes card-sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* Panel: an inset rounded window beside the chat. */
@media (min-width: 901px) {
  .panel { margin: 8px 8px 8px 0; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.09); overflow: hidden; background: #111; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
  .panel-resizer { margin: 0 -2px 0 -4px; }
}
.panel-top { min-height: 52px; padding: 6px 8px 6px 16px; background: #111; border-bottom: 1px solid rgba(255, 255, 255, 0.07); flex-wrap: nowrap; }
.panel-heading { flex: 1 1 auto; min-width: 0; gap: 1px; }
.panel-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.panel-title { font-size: 14px; font-weight: 600; }
.panel-sub { font-size: 11.5px; color: #8A8A8A; }
.panel-version { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 6px 0 8px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 6px; background: transparent; color: #B5B5B5; font-size: 11.5px; font-weight: 500; }
.panel-version:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.panel-version .ic { width: 13px; height: 13px; }
.panel-tabs { padding: 2px; gap: 2px; border: 0; border-radius: 9px; background: #1D1D1D; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: #9A9A9A; }
.tab .ic { width: 15px; height: 15px; }
.tab[aria-selected="true"] { background: #333; color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.panel-devices { border: 0; background: #1D1D1D; border-radius: 9px; padding: 2px; }
.device-btn { width: 30px; height: 28px; }
.device-btn[aria-pressed="true"] { background: #333; }
.panel-actions { gap: 2px; align-items: center; }
.panel-actions .icon-btn { width: 32px; height: 32px; border-radius: 8px; color: #A8A8A8; }
.panel-actions .icon-btn .ic { width: 17px; height: 17px; }
.panel-copy { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; margin-right: 4px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px; background: transparent; color: var(--text); font-size: 12.5px; font-weight: 500; }
.panel-copy .ic { width: 15px; height: 15px; }
.panel-copy:hover { background: rgba(255, 255, 255, 0.06); }
.panel-body { background: #0D0D0D; }
.panel-frame { background: #fff; }

/* Code with line numbers */
.code-view { display: flex; min-height: 100%; font: 12.5px/1.65 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.code-gutter { margin: 0; padding: 16px 12px 60px 16px; text-align: right; color: #4E4E4E; user-select: none; border-right: 1px solid rgba(255, 255, 255, 0.05); background: #0D0D0D; position: sticky; left: 0; font: inherit; }
.code-view .panel-code { flex: 1 1 auto; margin: 0; padding: 16px 18px 60px; font: inherit; color: #D4D4D4; background: transparent; min-height: 0; }
.code-view .panel-code code.hljs { background: transparent; padding: 0; }

@media (max-width: 900px) {
  .panel-copy span, .tab span { display: none; }
  .panel-copy { padding: 0 8px; }
}

/* Shown only if Veta can't start */
.boot { position: relative; }
.boot-error { position: absolute; left: 50%; top: calc(50% + 70px); transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.boot-error p { margin: 0; color: var(--text); font-size: 15px; }
.boot-error .boot-detail { color: #8C8C8C; font-size: 12.5px; word-break: break-word; }
.boot-error button { margin-top: 6px; height: 40px; padding: 0 22px; border: 0; border-radius: 20px; background: #fff; color: #000; font-weight: 600; }

/* ---------- Building screen (instead of showing code while a site is made) ---------- */
.build-stage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px; background: radial-gradient(70% 55% at 50% 42%, #141414, #0A0A0A 70%); animation: bs-in .4s ease both; }
.bs-canvas { position: relative; width: min(340px, 78%); aspect-ratio: 4 / 3; padding: 14px; border-radius: 14px; background: #111; border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04); display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 10px 1fr 8px 8px 1fr 8px; gap: 9px; overflow: hidden; }
.bs-block { border-radius: 6px; background: linear-gradient(90deg, #1C1C1C, #262626, #1C1C1C); background-size: 200% 100%; opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); animation: bs-shimmer 2.2s linear infinite; }
.bs-block.on { opacity: 1; transform: none; }
.bs-nav { grid-column: 1 / -1; border-radius: 4px; }
.bs-hero { grid-column: 1 / -1; background: linear-gradient(90deg, #22202B, #2D2A3A, #22202B); background-size: 200% 100%; }
.bs-row:nth-of-type(3) { grid-column: 1 / 3; border-radius: 4px; }
.bs-row:nth-of-type(4) { grid-column: 1 / 2; border-radius: 4px; }
.bs-cards { grid-column: 1 / -1; background: repeating-linear-gradient(90deg, #1E1E1E 0 31%, transparent 31% 34.5%); animation: none; }
.bs-foot { grid-column: 1 / -1; border-radius: 4px; }
.bs-sheen { position: absolute; top: 0; bottom: 0; left: -60%; width: 50%; background: linear-gradient(100deg, transparent, rgba(190, 170, 255, 0.10), transparent); animation: bs-sweep 2.8s ease-in-out infinite; pointer-events: none; z-index: 1; }
.bs-text { text-align: center; }
.bs-word { position: relative; height: 30px; margin: 0; min-width: 260px; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.bs-word span { position: absolute; left: 0; right: 0; top: 0; background: linear-gradient(90deg, #8A8A8A 0%, #FFFFFF 45%, #8A8A8A 90%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: bs-text-shine 2.4s linear infinite; }
.bs-word-in { animation: bs-text-shine 2.4s linear infinite, bs-word-in .45s cubic-bezier(.2, .8, .2, 1) both !important; }
.bs-word-out { animation: bs-word-out .45s ease both !important; }
.bs-note { margin: 6px 0 0; font-size: 14px; color: var(--muted); min-height: 20px; }
.bs-steps { display: flex; gap: 6px; }
.bs-steps span { width: 22px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); transition: background .4s ease; }
.bs-steps span.done { background: rgba(255, 255, 255, 0.55); }
.bs-steps span.now { background: linear-gradient(90deg, rgba(255,255,255,.15), #fff, rgba(255,255,255,.15)); background-size: 200% 100%; animation: bs-shimmer 1.4s linear infinite; }
.preview-stage.reveal { animation: bs-reveal .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes bs-in { from { opacity: 0; } }
@keyframes bs-shimmer { to { background-position: -200% 0; } }
@keyframes bs-sweep { to { transform: translateX(320%); } }
@keyframes bs-text-shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes bs-word-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes bs-word-out { to { opacity: 0; transform: translateY(-10px); filter: blur(4px); } }
@keyframes bs-reveal { from { opacity: 0; transform: scale(.985); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) {
  .build-stage *, .preview-stage.reveal { animation: none !important; transition: none !important; }
}

/* ---------- Website flow in the chat: steps → site card → download ---------- */
.artifact-flow { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; max-width: 440px; }
.artifact-flow .artifact-card { margin: 0; }
.build-steps { border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; background: rgba(255, 255, 255, 0.02); font-size: 14px; }
.build-steps-title { margin: 0 0 8px; font-weight: 600; }
.build-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.build-steps .step { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.build-steps .step.done { color: var(--text-2); }
.build-steps .step.now { color: var(--text); font-weight: 500; }
.step-mark, .step-spin, .step-dot { flex: 0 0 18px; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }
.step-mark { border-radius: 50%; background: rgba(140, 200, 140, 0.16); color: #9FDB9F; }
.step-mark .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.step-spin { border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: #fff; animation: step-spin .9s linear infinite; width: 14px; height: 14px; flex-basis: 14px; margin: 2px; }
.step-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.build-steps.done { padding: 0; }
.build-steps.done summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; color: var(--text-2); border-radius: 14px; }
.build-steps.done summary::-webkit-details-marker { display: none; }
.build-steps.done summary:hover { background: rgba(255, 255, 255, 0.04); }
.build-steps-chev { margin-left: auto; color: var(--muted); display: inline-flex; transition: transform .2s ease; }
.build-steps-chev .ic { width: 16px; height: 16px; }
.build-steps.done[open] .build-steps-chev { transform: rotate(180deg); }
.build-steps.done ol { padding: 2px 14px 12px; }
.file-card.appear { animation: file-in .45s cubic-bezier(.2, .8, .2, 1) both; }
.file-card .artifact-open { display: inline-flex; align-items: center; gap: 6px; }
.file-card .artifact-open .ic { width: 15px; height: 15px; }
@keyframes step-spin { to { transform: rotate(360deg); } }
@keyframes file-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .step-spin, .file-card.appear { animation: none; } }
