:root {
  color-scheme: light;
  --paper: #f4edd8; --paper-deep: #e9dfc3; --cream: #fcfaf3;
  --ink: #273623; --muted: #65715d; --gold: #aa8a32;
  --hair: rgba(39,54,35,.20); --soft-hair: rgba(39,54,35,.10);
  --reply: #edf0e5; --sage: #dce8d1; --rose: #f1ddd4;
  --display: Georgia, "Times New Roman", serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121a10; --paper-deep: #253020; --cream: #182015;
  --ink: #f3efdf; --muted: #b1bba5; --gold: #ceb365;
  --hair: rgba(243,239,223,.21); --soft-hair: rgba(243,239,223,.10);
  --reply: #273323; --sage: #35452c; --rose: #49332a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; height: 100%; }
body { margin: 0; height: 100dvh; padding: 16px; background: var(--paper); color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button, a, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--gold); }
p, h1, h2, h3, figure { margin: 0; }
.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; }
.skip-link { position: fixed; top: -60px; left: 24px; z-index: 40; padding: 10px; background: var(--cream); }
.skip-link:focus { top: 8px; }
.shell { width: min(1540px,100%); height: 100%; margin: auto; display: flex; flex-direction: column; overflow: hidden; background: var(--cream); border: 1px solid var(--hair); border-radius: 18px; box-shadow: 0 12px 50px rgba(35,48,25,.06); }
.topbar { flex-shrink: 0; min-height: 82px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 26px; border-bottom: 1px solid var(--soft-hair); }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: block; flex-shrink: 0; width: 46px; height: 46px; object-fit: cover; border: 1px solid var(--hair); border-radius: 14px; background: var(--paper); }
.eyebrow, .section-kicker { font: 10px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .13em; color: var(--muted); }
h1 { margin-top: 2px; font: 29px/1 var(--display); display: flex; gap: 12px; align-items: center; }
.model-badge { padding: 5px 7px; border-radius: 5px; background: var(--paper); font: 10px/1 var(--mono); color: var(--muted); letter-spacing: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.quiet-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 36px; padding: 7px 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
.quiet-button:hover:not(:disabled) { background: var(--paper); color: var(--ink); border-color: var(--soft-hair); }
.details-toggle, .close-details { display: none; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 365px; }
.chat-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chat-toolbar { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 24px; }
.live-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #b79745; }
.status-pill.ready .status-dot { background: #70965b; box-shadow: 0 0 0 3px rgba(112,150,91,.10); }
.status-pill.busy .status-dot { background: #be9840; animation: breathe 1.8s ease-in-out infinite; }
.online-count { color: var(--muted); font: 10px/1.4 var(--mono); }
.conversation-area { position: relative; flex: 1; min-height: 0; }
.chat-log { height: 100%; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 12px max(26px,calc((100% - 760px)/2)) 28px; scrollbar-width: thin; scrollbar-color: var(--hair) transparent; }
.empty-state { min-height: 100%; max-width: 680px; margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px 0 40px; text-align: center; }
.welcome-mark { display: block; flex-shrink: 0; width: 96px; height: 96px; object-fit: cover; margin-bottom: 26px; background: var(--sage); border: 1px solid var(--soft-hair); border-radius: 24px; }
.empty-state h2 { margin: 12px 0 13px; font: clamp(30px,3.5vw,43px)/1.15 var(--display); letter-spacing: -.035em; }
.empty-state > p { max-width: 380px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.examples { width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 34px; }
.example { position: relative; display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 17px 13px; border: 1px solid var(--soft-hair); border-radius: 12px; text-align: left; background: transparent; transition: background .15s, border-color .15s; }
.example:hover:not(:disabled) { background: var(--paper); border-color: var(--hair); }
.example strong { font-size: 12px; font-weight: 550; }
.example > span:not(.example-icon):not(.example-arrow) { color: var(--muted); font-size: 11px; line-height: 1.5; }
.example-icon { font-size: 21px; color: var(--gold); margin-bottom: 7px; }
.example-arrow { position: absolute; top: 17px; right: 13px; color: var(--muted); font-size: 13px; }
.turn { max-width: 760px; margin: 14px auto 28px; }
.turn-user { display: flex; flex-direction: column; align-items: flex-end; }
.label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.turn-assistant > .label { display: flex; align-items: center; gap: 8px; }
.reply-avatar { display: block; width: 24px; height: 24px; object-fit: cover; border: 1px solid var(--soft-hair); border-radius: 7px; }
.turn-user .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.user-copy { display: block; max-width: 85%; padding: 12px 17px; border-radius: 18px 18px 4px 18px; background: var(--reply); line-height: 1.6; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-copy { min-width: 0; color: var(--ink); font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.assistant-copy > :first-child, .thinking-copy > :first-child { margin-top: 0; }
.assistant-copy > :last-child, .thinking-copy > :last-child { margin-bottom: 0; }
.assistant-copy p, .thinking-copy p { margin: 0 0 13px; }
.assistant-copy h1, .assistant-copy h2, .assistant-copy h3, .assistant-copy h4 { display: block; margin: 22px 0 10px; font: 600 1.1em/1.4 var(--body); letter-spacing: 0; }
.assistant-copy ul, .assistant-copy ol, .thinking-copy ul, .thinking-copy ol { margin: 10px 0 17px; padding-left: 25px; }
.assistant-copy li, .thinking-copy li { padding-left: 3px; margin-bottom: 6px; }
.assistant-copy pre, .thinking-copy pre { padding: 16px; margin: 15px 0; overflow-x: auto; border: 1px solid var(--soft-hair); border-radius: 10px; background: var(--paper); white-space: pre; }
.assistant-copy code, .thinking-copy code { font: .88em/1.6 var(--mono); background: var(--paper); border-radius: 4px; padding: 2px 4px; }
.assistant-copy pre code, .thinking-copy pre code { padding: 0; background: transparent; }
.assistant-copy blockquote { margin: 15px 0; padding: 3px 0 3px 17px; border-left: 3px solid var(--gold); color: var(--muted); }
.assistant-copy table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.assistant-copy th, .assistant-copy td { padding: 8px 12px; border: 1px solid var(--hair); text-align: left; }
.assistant-copy hr { border: 0; border-top: 1px solid var(--hair); margin: 20px 0; }
.streaming::after { content: "●"; display: inline-block; font-size: 9px; vertical-align: middle; margin-left: 5px; color: var(--gold); animation: breathe 1s ease-in-out infinite; }
.thinking-block { margin-bottom: 13px; color: var(--muted); font-size: 13px; }
.thinking-block summary { cursor: pointer; padding: 7px 0; width: fit-content; }
.thinking-copy { margin: 7px 0 14px; padding: 12px 16px; border-left: 2px solid var(--hair); line-height: 1.65; overflow-wrap: anywhere; }
.response-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 13px; font: 10px/1.5 var(--mono); color: var(--muted); }
.speed-chip { padding: 5px 8px; border: 1px solid var(--soft-hair); border-radius: 6px; background: var(--reply); color: var(--ink); }
.math-display { display: block; max-width: 100%; overflow-x: auto; margin: 16px 0; }
.math-display .katex-display { margin: 4px 0; }
.math-inline { font-size: 1em; }
.katex-error { color: inherit !important; white-space: pre-wrap; }
.copy-button { padding: 4px 6px; margin-left: -6px; border: 0; border-radius: 5px; background: transparent; font: 11px var(--body); color: var(--muted); }
.copy-button:hover { background: var(--paper); color: var(--ink); }
.turn-error .assistant-copy { color: var(--muted); }
.latest-button { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); padding: 8px 12px; border: 1px solid var(--hair); border-radius: 20px; background: var(--cream); box-shadow: 0 3px 12px rgba(0,0,0,.08); font-size: 11px; }
.composer-area { flex-shrink: 0; padding: 8px max(26px,calc((100% - 760px)/2)) 18px; }
.composer { padding: 14px 15px 11px; background: var(--cream); border: 1px solid var(--hair); border-radius: 18px; box-shadow: 0 3px 16px rgba(40,50,28,.035); }
.composer:focus-within { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(170,138,50,.07); }
.composer textarea { display: block; width: 100%; min-height: 30px; max-height: 160px; padding: 2px 1px 7px; margin: 0; resize: none; overflow-y: auto; border: 0; outline: 0; background: transparent; font-size: 15px; line-height: 1.55; }
.composer textarea::placeholder { color: var(--muted); opacity: .8; }
.composer-tools { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.thinking-button { display: flex; align-items: center; gap: 6px; border: 1px solid var(--soft-hair); border-radius: 18px; padding: 7px 11px; background: transparent; color: var(--muted); font-size: 11px; }
.thinking-button[aria-pressed="true"] { background: var(--sage); border-color: var(--hair); color: var(--ink); }
.character-count { flex: 1; color: var(--muted); font: 10px var(--mono); text-align: right; }
.send-button, .stop-button { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: var(--cream); }
.send-button svg, .stop-button svg { width: 22px; height: 22px; }
.send-button svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stop-button svg { fill: currentColor; }
.send-button:disabled { opacity: .25; }
.composer-status { margin: 0 0 9px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.composer-footnote { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 11px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: center; }
.details-panel { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--paper); border-left: 1px solid var(--soft-hair); }
.details-heading { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; padding: 24px 25px 10px; }
.details-scroll { padding: 15px 25px 24px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--hair) transparent; }
.gpu-card { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 10px 11px; border: 1px solid var(--hair); border-radius: 8px; font-size: 10px; color: var(--muted); }
.gpu-card .status-dot { background: #70965b; }
.gpu-card strong { color: var(--ink); font-weight: 550; }
.gpu-label { margin-left: auto; font: 9px var(--mono); }
.model-intro h2 { font: 27px/1.18 var(--display); letter-spacing: -.025em; }
.model-intro > p { margin-top: 15px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.model-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0 25px; }
.model-tags span { padding: 5px 8px; border: 1px solid var(--hair); border-radius: 5px; font: 10px var(--mono); color: var(--muted); }
.size-comparison { margin: 0 0 20px; padding: 22px 0 18px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.comparison-layout { display: flex; flex-direction: column; gap: 13px; }
.size-diagram { display: block; width: 100%; margin-top: 13px; overflow: visible; }
.qwen-circle { fill: var(--paper-deep); stroke: var(--hair); stroke-width: 1.5; }
.larry-circle { fill: var(--sage); stroke: var(--gold); stroke-width: 1.5; }
.size-arrow-line { fill: none; stroke: var(--gold); stroke-width: 2; }
.size-arrowhead { fill: var(--gold); }
.diagram-model, .diagram-larry { fill: var(--ink); font: 18px var(--display); }
.diagram-value { fill: var(--ink); font: 36px var(--display); }
.diagram-small-value { font-size: 29px; }
.diagram-format { fill: var(--muted); font: 12px var(--mono); }
.comparison-metrics { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 20px; margin: 8px 0 13px; }
.comparison-stat { display: flex; flex-direction: column; gap: 6px; }
.comparison-value { font: 37px/1 var(--display); letter-spacing: -.035em; }
.comparison-label { color: var(--muted); font-size: 11px; line-height: 1.5; }
.comparison-benchmark { color: var(--muted); font: 9px/1.5 var(--mono); }
.comparison-details, .about-section { color: var(--muted); font-size: 11px; line-height: 1.7; }
.comparison-details summary, .about-section summary { cursor: pointer; padding: 5px 0; }
.comparison-details p, .about-section p { margin-top: 10px; }
.about-section { margin-bottom: 12px; }
.about-section summary { color: var(--ink); font-size: 12px; }
.labs-link { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--hair); color: var(--muted); text-decoration: none; font-size: 11px; }
@keyframes breathe { 50% { opacity: .4; } }
@media (max-width: 1200px) {
  .workspace { grid-template-columns: minmax(0,1fr) 325px; }
  .chat-log { padding-left: 22px; padding-right: 22px; }
  .composer-area { padding-left: 22px; padding-right: 22px; }
  .details-heading { padding-left: 22px; padding-right: 22px; }
  .details-scroll { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 960px) {
  body { padding: 0; }
  .shell { border: 0; border-radius: 0; }
  .workspace { display: flex; }
  .chat-panel { flex: 1; }
  .details-toggle, .close-details { display: inline-flex; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(15,23,12,.4); backdrop-filter: blur(3px); border: 0; }
  .details-panel { position: fixed; z-index: 21; inset: 0 0 0 auto; width: min(385px,100%); transform: translateX(105%); visibility: hidden; transition: transform .2s ease, visibility .2s; border-left: 1px solid var(--hair); box-shadow: -15px 0 50px rgba(0,0,0,.1); }
  .details-panel[data-open="true"] { transform: translateX(0); visibility: visible; }
  .details-heading { padding-top: 20px; }
}
@media (max-width: 540px) {
  .topbar { min-height: 70px; padding: 12px 15px; gap: 5px; }
  .brand { gap: 9px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  h1 { font-size: 25px; }
  .brand .eyebrow { font-size: 8px; }
  .model-badge { display: none; }
  .header-actions { gap: 2px; }
  .quiet-button { padding: 7px 8px; font-size: 11px; }
  .chat-toolbar { padding: 9px 15px; align-items: center; }
  .live-status { gap: 4px; flex-direction: column; align-items: flex-start; }
  .status-pill { font-size: 10px; }
  .online-count { font-size: 9px; }
  .chat-log { padding: 12px 20px 22px; }
  .empty-state { padding: 16px 0 20px; }
  .welcome-mark { width: 76px; height: 76px; border-radius: 19px; margin-bottom: 20px; }
  .empty-state .eyebrow { font-size: 8px; }
  .empty-state h2 { font-size: 30px; }
  .empty-state > p { max-width: 270px; font-size: 12px; }
  .examples { grid-template-columns: 1fr; gap: 7px; margin-top: 25px; }
  .example { padding: 12px 35px 12px 40px; gap: 3px; border-radius: 10px; }
  .example-icon { position: absolute; left: 13px; top: 13px; font-size: 18px; }
  .example-arrow { top: 20px; }
  .example strong { font-size: 11px; }
  .example > span:not(.example-icon):not(.example-arrow) { font-size: 10px; }
  .composer-area { padding: 5px 13px max(12px,env(safe-area-inset-bottom)); }
  .composer { border-radius: 16px; padding: 12px 13px 9px; }
  .composer textarea { font-size: 16px; }
  .composer-footnote { font-size: 8px; }
  #composer-hint { display: none; }
  .user-copy { max-width: 92%; }
  .assistant-copy { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
