:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #ece9df;
  background: #090a0e;
  --ink: #ece9df;
  --night: #090a0e;
  --panel: #15161c;
  --paper: #111218;
  --line: #363640;
  --muted: #858796;
  --yellow: #e8c65b;
  --coral: #d95858;
  --cyan: #4fc3c8;
  --violet: #8e7dc1;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; background: var(--night); }
body { min-width: 320px; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.app-bar {
  width: 100%;
  height: 72px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 650px) minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  color: #fff;
  background: #090a0e;
  border-bottom: 2px solid #7f2f34;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { position: relative; width: 26px; height: 26px; border: 2px solid var(--cyan); border-radius: 2px; background: #161820; transform: rotate(45deg); flex: 0 0 auto; box-shadow: inset 0 0 0 5px #7f2f34; }
.brand-mark::after { content: ""; position: absolute; inset: 7px; border: 1px solid var(--yellow); }
.eyebrow, .panel-kicker { margin: 0 0 2px; color: #8d93a3; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-size: 21px; line-height: 1.1; }
h2 { margin: 0; font-size: 22px; line-height: 1.15; }
h3 { margin: 0; font-size: 14px; line-height: 1.2; }
.header-model { min-width: 0; width: 100%; min-height: 45px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 11px; padding: 8px 11px 8px 14px; border: 1px solid #43414a; border-left: 3px solid #7f2f34; border-radius: 4px; background: #15161c; color: #fff; text-align: left; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.header-model:hover { border-color: var(--cyan); background: #1c1e26; transform: translateY(-1px); }
.header-model:focus-visible { outline: 3px solid #43d8d035; border-color: var(--cyan); }
.model-launcher-kicker { color: var(--yellow); font-size: 10px; font-weight: 900; letter-spacing: .11em; }
.header-model strong { min-width: 0; overflow: hidden; color: #f4f5f8; font: 750 13px/1.2 "Cascadia Code", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.model-launcher-meta { padding: 5px 7px; border: 1px solid #304b4d; border-radius: 3px; background: #182326; color: var(--cyan); font: 850 9px/1 "Cascadia Code", Consolas, monospace; white-space: nowrap; }
.model-launcher-arrow { color: #9299a9; font-size: 15px; line-height: 1; }
.connection-status { justify-self: end; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #373b49; border-radius: 999px; background: #20222d; color: #d5d8e1; font-size: 12px; font-weight: 750; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #8a8f9d; }
.connection-status[data-state="ready"] .status-dot { background: #6be69c; box-shadow: 0 0 0 4px #6be69c20; }
.connection-status[data-state="loading"] .status-dot, .connection-status[data-state="running"] .status-dot { background: var(--yellow); animation: pulse 1s infinite; }
.connection-status[data-state="error"] .status-dot { background: var(--coral); }

.workspace {
  width: 100%;
  height: calc(100dvh - 72px);
  display: grid;
  grid-template-columns: clamp(340px, 20vw, 400px) minmax(600px, 1fr) clamp(390px, 23vw, 460px);
  overflow: hidden;
  background: #0e0f14;
}
.settings-panel, .chat-panel, .inspect-panel { min-width: 0; min-height: 0; }

.settings-panel {
  padding: 22px 24px 34px;
  overflow-y: auto;
  color: #f2f3f7;
  background: #121319;
  border-right: 1px solid #3a343b;
  scrollbar-color: #4f5362 transparent;
}
.panel-title { min-height: 54px; display: flex; align-items: flex-start; justify-content: space-between; }
.settings-panel .panel-kicker, .inspect-panel .panel-kicker { color: #828899; }
.settings-panel h2, .inspect-panel h2 { color: #f8f8fa; }
.settings-section { padding: 21px 0; border-top: 1px solid #343640; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-section h3 { color: #f4f4f7; font-size: 15px; }
.required-label { padding: 3px 7px; border-radius: 999px; background: #ff665c20; color: #ff948d; font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
label { display: block; margin: 14px 0 7px; color: #aeb3c0; font-size: 12px; font-weight: 750; }
input, select, textarea {
  width: 100%;
  border: 1px solid #414552;
  border-radius: 3px;
  outline: none;
  background: #272a35;
  color: #f5f6f8;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input, select { padding: 11px 12px; }
textarea { padding: 12px 14px; line-height: 1.55; resize: vertical; }
input::placeholder, textarea::placeholder { color: #777d8d; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px #43d8d021; }
.key-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.quiet-button { border: 1px solid #414552; border-radius: 3px; background: #292c37; color: #d9dce4; padding: 8px 11px; font-size: 12px; font-weight: 750; }
.quiet-button:hover { border-color: #626878; background: #333743; color: #fff; }
.quiet-button.compact { padding: 5px 8px; font-size: 11px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: #9fa5b3; font-weight: 600; }
.checkbox-label input { width: auto; accent-color: var(--cyan); }
.credit-widget { margin-top: 14px; padding: 12px; border: 1px solid #3d414d; border-radius: 3px; background: #202128; }
.credit-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.credit-heading > span { color: #858c9c; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.credit-heading button { border: 0; background: transparent; color: #9299a9; padding: 2px; font-size: 10px; font-weight: 750; }
.credit-heading button:hover { color: var(--cyan); }
.credit-balance { margin-top: 5px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.credit-balance strong { color: var(--yellow); font: 900 25px/1.1 "Cascadia Code", Consolas, monospace; }
.credit-balance span { color: #f0d87c; font-size: 11px; font-weight: 800; white-space: nowrap; }
.credit-widget > p { margin: 4px 0 9px; color: #a5abb8; font-size: 10px; line-height: 1.35; }
.exchange-rate-label { display: block; margin: -4px 0 8px; color: #747b8b; font: 650 8px/1.2 "Cascadia Code", Consolas, monospace; }
.credit-usage { padding-top: 8px; display: flex; align-items: center; gap: 14px; border-top: 1px solid #393d48; color: #8d94a3; font-size: 9px; }
.credit-usage b { margin-left: 4px; color: #d9dce4; font: 750 10px/1 "Cascadia Code", Consolas, monospace; }
.credit-usage small { display: block; margin: 3px 0 0; color: #b3a96e; font-size: 8px; font-weight: 700; }
.credit-widget[data-state="loading"] .credit-balance strong { color: #9ca2b0; animation: pulse 1s infinite; }
.credit-widget[data-state="error"] { border-color: #70403e; background: #302427; }
.credit-widget[data-state="error"] .credit-balance strong { color: #ff918a; font-size: 18px; }
.model-picker { width: min(1160px, calc(100vw - 40px)); max-width: none; height: min(790px, calc(100dvh - 96px)); max-height: none; margin: 82px auto auto; padding: 0; overflow: hidden; border: 1px solid #68616b; border-top: 3px solid #8d353b; border-radius: 4px; background: #121319; color: #f2f3f7; box-shadow: 0 28px 80px #05060a; }
.model-picker::backdrop { background: #06070bd9; }
.model-picker-frame { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.model-picker-header { min-height: 72px; padding: 14px 18px 14px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #45404a; border-left: 5px solid var(--cyan); background: #0f1015; }
.model-picker-header h2 { margin: 0; color: #fff; font-size: 22px; }
.model-picker-header-actions { display: flex; align-items: center; gap: 8px; }
.model-picker-close { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #4b4852; border-radius: 3px; background: #1b1c23; color: #c4c8d2; padding: 0; font-size: 24px; line-height: 1; }
.model-picker-close:hover { border-color: #696f7f; color: #fff; }
.model-picker-body { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(540px, 1.35fr) minmax(360px, .65fr); overflow: hidden; }
.model-picker-catalog { min-width: 0; min-height: 0; padding: 18px 20px 20px; display: flex; flex-direction: column; border-right: 1px solid #45404a; background: #15161c; }
.model-picker-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .7fr); gap: 10px; }
.model-picker-toolbar label { min-width: 0; margin: 0; }
.model-picker-toolbar label > span { display: block; margin-bottom: 6px; color: #aeb3c0; font-size: 10px; font-weight: 800; }
.model-picker-toolbar input, .model-picker-toolbar select { min-height: 40px; }
.model-picker .filter-heading { margin-top: 14px; }
.model-picker .model-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.model-roster { flex: 1; min-height: 230px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 166px; gap: 8px; padding: 2px 5px 2px 0; overflow-y: auto; align-content: start; scrollbar-color: #55505a transparent; }
.model-card { --affinity: #4fc3c8; position: relative; min-width: 0; height: 166px; overflow: hidden; border: 1px solid #44434c; border-left: 3px solid var(--affinity); border-radius: 3px; background: #1c1d24; color: #eceef3; padding: 10px 11px; display: flex; flex-direction: column; text-align: left; transition: border-color .16s ease, background .16s ease, transform .16s ease, opacity .16s ease, box-shadow .16s ease; }
.model-card[data-affinity="0"], .model-emblem[data-affinity="0"] { --affinity: #4fc3c8; }
.model-card[data-affinity="1"], .model-emblem[data-affinity="1"] { --affinity: #d95858; }
.model-card[data-affinity="2"], .model-emblem[data-affinity="2"] { --affinity: #e8c65b; }
.model-card[data-affinity="3"], .model-emblem[data-affinity="3"] { --affinity: #78b987; }
.model-card[data-affinity="4"], .model-emblem[data-affinity="4"] { --affinity: #9a87cf; }
.model-card:hover { border-color: var(--affinity); background: #24252e; transform: translateY(-1px); }
.model-card:focus-visible { outline: 2px solid var(--affinity); outline-offset: 1px; }
.model-card.is-selected { border-color: var(--yellow); border-left-color: var(--yellow); background: #28252a; box-shadow: inset 0 0 0 1px #e8c65b4a, 0 0 18px #e8c65b1d; }
.model-card-top { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.model-card-emblem, .model-emblem { display: grid; place-items: center; border: 1px solid var(--affinity); background: #111319; color: var(--affinity); font: 900 11px/1 "Cascadia Code", Consolas, monospace; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.model-card-emblem { width: 38px; height: 38px; }
.model-card-contract { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.model-card-rank { color: var(--affinity); font: 900 9px/1 "Cascadia Code", Consolas, monospace; }
.model-card-maker { overflow: hidden; color: #8f93a0; font-size: 9px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.model-card-price { align-self: start; padding: 4px 5px; border: 1px solid #474852; border-radius: 2px; background: #13151a; color: var(--yellow); font: 850 8px/1 "Cascadia Code", Consolas, monospace; white-space: nowrap; }
.model-card-name { min-height: 34px; margin-top: 8px; overflow: hidden; color: #f1f0ec; font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.model-card-id { overflow: hidden; margin-top: 2px; color: #6f7380; font: 650 8px/1.2 "Cascadia Code", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.model-card-stats { margin-top: auto; padding-top: 7px; display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid #353640; color: #b8bbc5; font: 750 9px/1 "Cascadia Code", Consolas, monospace; }
.model-card-loadout { min-height: 18px; margin-top: 7px; display: flex; gap: 4px; overflow: hidden; }
.model-card-loadout span { padding: 3px 5px; border: 1px solid #384f51; border-radius: 2px; background: #172325; color: #74cfd2; font: 850 8px/1 "Cascadia Code", Consolas, monospace; }
.model-card-loadout .is-source { border-color: #65592f; background: #252116; color: var(--yellow); }
.model-card-loadout .is-empty { border-color: #41424b; background: #202128; color: #767a87; }
.model-card.is-dismissing { animation: contract-decay .26s ease forwards; }
.model-card.is-summoning { animation: contract-summon .62s ease; }
.model-picker-preview { min-width: 0; min-height: 0; padding: 22px; overflow-y: auto; background: #101116; scrollbar-color: #4f5362 transparent; }
.model-picker-preview .model-name { margin-top: 7px; color: #f2f3f7; font-size: 17px; font-weight: 850; }
.model-picker-preview .price-board { margin-top: 14px; }
.model-picker-footer { min-height: 68px; padding: 11px 16px 11px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #45404a; background: #0f1015; }
.model-picker-footer > div { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.model-picker-footer span { color: #7f8696; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.model-picker-footer strong { min-width: 0; overflow: hidden; color: #f4f5f8; font: 750 12px/1.2 "Cascadia Code", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.picker-confirm { flex: 0 0 auto; border: 1px solid #a24449; border-radius: 3px; background: #8d353b; color: #fff4ea; padding: 10px 15px; font-size: 12px; font-weight: 900; box-shadow: 0 3px 0 #592126; }
.picker-confirm:hover { transform: translateY(1px); background: #a94249; box-shadow: 0 2px 0 #592126; }
.sort-row { margin-top: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.sort-row label { margin: 0; }
.sort-row select { min-height: auto; }
.filter-heading { margin: 17px 0 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filter-heading > span { color: #d5d8e0; font-size: 12px; font-weight: 850; }
.filter-reset { border: 0; background: transparent; color: #8f96a6; padding: 3px; font-size: 10px; font-weight: 750; }
.filter-reset:hover { color: var(--cyan); }
.model-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.model-filters label { min-width: 0; margin: 0; }
.model-filters label > span { display: block; margin: 0 0 5px; color: #858c9c; font-size: 9px; font-weight: 850; letter-spacing: .04em; }
.model-filters select { min-height: auto; padding: 8px 9px; font-size: 11px; }
.nsfw-filter { min-width: 0; margin: 1px 0 0; padding: 0; grid-column: 1 / -1; border: 0; }
.nsfw-filter legend { margin-bottom: 6px; color: #858c9c; font-size: 9px; font-weight: 850; letter-spacing: .04em; cursor: help; }
.segmented-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 3px; gap: 3px; border: 1px solid #393d49; border-radius: 3px; background: #20222b; }
.segmented-filter button { min-width: 0; min-height: 31px; overflow: hidden; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #858c9c; padding: 6px 4px; font-size: 10px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.segmented-filter button:hover { background: #2b2e38; color: #e1e4eb; }
.segmented-filter button[aria-pressed="true"] { border-color: #5b606e; background: #353843; color: #fff; box-shadow: 0 1px 4px #0004; }
.segmented-filter button[data-value="confirmed"][aria-pressed="true"] { border-color: #2f7165; background: #1e3a35; color: #80ead2; }
.segmented-filter button[data-value="moderated"][aria-pressed="true"] { border-color: #78433f; background: #442b2d; color: #ffaaa3; }
.model-result-heading { margin-top: 15px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.model-result-heading > span:first-child { color: #c9ccd4; font-size: 11px; font-weight: 850; }
.model-result-heading #model-result-count { color: #818899; font: 700 10px/1 "Cascadia Code", Consolas, monospace; }
#model-select.sr-only { min-height: 0; padding: 0; border: 0; }
.price-board { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; overflow: hidden; border: 3px solid #0b0c10; border-radius: 3px; background: #0b0c10; }
.price-item { min-width: 0; padding: 13px 12px 14px; color: var(--ink); }
.input-price { background: var(--yellow); }
.output-price { background: #ff9088; }
.price-item span { display: block; margin-bottom: 6px; color: #4c4322; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.price-item strong { display: block; overflow-wrap: anywhere; font-size: clamp(24px, 1.55vw, 32px); font-weight: 950; line-height: 1; }
.price-item small { display: block; margin-top: 6px; color: #514725; font-size: 10px; font-weight: 850; }
.model-name { margin: 9px 1px 0; overflow-wrap: anywhere; color: #c1c5cf; font-size: 12px; font-weight: 700; line-height: 1.45; }
.model-identity { margin-top: 8px; display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 11px; }
.model-emblem { width: 54px; height: 54px; font-size: 14px; }
.model-rank { display: block; color: var(--yellow); font: 900 9px/1 "Cascadia Code", Consolas, monospace; }
.model-rank[data-rank="s"] { color: #f0d66d; }
.model-rank[data-rank="a"] { color: #75d5d8; }
.model-rank[data-rank="b"] { color: #9f8cd5; }
.model-rank[data-rank="c"] { color: #9ba0ac; }
.model-description { min-height: 36px; margin: 10px 0 0; overflow: hidden; color: #888d99; font-size: 10px; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.model-facts { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.model-facts span { padding: 5px 7px; border: 1px solid #3d414e; border-radius: 2px; background: #202129; color: #b8bdc9; font: 750 9px/1.15 "Cascadia Code", Consolas, monospace; }
.model-facts #model-manufacturer { color: var(--yellow); }
.model-facts #model-moderation[data-value="confirmed"] { border-color: #2f7165; background: #1e3734; color: #7be4cc; }
.model-facts #model-moderation[data-value="moderated"] { border-color: #78433f; background: #3b292b; color: #ff9f98; }
.model-score-visual { margin-top: 10px; padding: 11px 12px 12px; border: 1px solid #46424b; border-left: 3px solid #6d3035; border-radius: 3px; background: #191a21; transition: border-color .18s ease, opacity .18s ease; }
.model-score-visual.is-recalibrating { border-color: var(--cyan); opacity: .84; }
.score-visual-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.score-visual-heading strong { color: #eef0f5; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.score-visual-heading span { max-width: 58%; overflow: hidden; color: #747b8b; font: 700 8px/1 "Cascadia Code", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.score-row + .score-row { margin-top: 9px; }
.score-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.score-label span { color: #9ba1af; font-size: 9px; font-weight: 800; }
.score-label small { margin-left: 5px; color: #626774; font: 650 7px/1 "Cascadia Code", Consolas, monospace; }
.score-label strong { color: #eef0f5; font: 850 11px/1 "Cascadia Code", Consolas, monospace; font-variant-numeric: tabular-nums; }
.score-track { width: 100%; height: 8px; overflow: hidden; border: 1px solid #3c404c; border-radius: 3px; background: #171920; }
.score-track > span { display: block; width: 0; height: 100%; border-radius: 2px; transition: width .24s ease; }
.score-row[data-score="intelligence"] .score-track > span { background: var(--yellow); }
.score-row[data-score="coding"] .score-track > span { background: var(--cyan); }
.score-row[data-score="agentic"] .score-track > span { background: #ff9088; }
.score-row[data-score="design"] .score-track > span { background: var(--violet); }
.score-row[data-score="versatility"] .score-track > span { background: #78b987; }
.score-row[data-score="intelligence"] .score-label strong { color: var(--yellow); }
.score-row[data-score="coding"] .score-label strong { color: var(--cyan); }
.score-row[data-score="agentic"] .score-label strong { color: #ffaaa3; }
.score-row[data-score="design"] .score-label strong { color: #ad9bdd; }
.score-row[data-score="versatility"] .score-label strong { color: #90d09d; }
.capability-board { margin-top: 10px; padding: 10px 11px 11px; border: 1px solid #3e4049; border-radius: 3px; background: #17181e; }
.capability-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.capability-heading strong { color: #d9dbe2; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.capability-heading span { color: var(--cyan); font: 800 9px/1 "Cascadia Code", Consolas, monospace; }
.capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.capability-item { min-width: 0; min-height: 36px; padding: 6px; display: flex; flex-direction: column; justify-content: center; gap: 3px; border: 1px solid #30313a; background: #121319; color: #535762; }
.capability-item[data-active="true"] { border-color: #345b5d; background: #172426; color: #77cdd0; }
.capability-item strong { font: 900 9px/1 "Cascadia Code", Consolas, monospace; }
.capability-item span { overflow: hidden; font-size: 7px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.advanced-model { margin-top: 12px; color: #aeb3c0; font-size: 12px; }
.advanced-model summary { cursor: pointer; font-weight: 700; }
.advanced-model input { margin-top: 10px; }
.generation-settings label { display: flex; align-items: center; justify-content: space-between; }
.generation-settings output { color: var(--yellow); font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
.generation-settings input[type="range"] { height: 5px; padding: 0; border: 0; border-radius: 0; background: #3b3c45; accent-color: var(--coral); appearance: none; }
.generation-settings input[type="range"]::-webkit-slider-thumb { width: 15px; height: 15px; border: 2px solid #14151b; border-radius: 2px; background: var(--coral); appearance: none; }
.generation-settings .routing-control { justify-content: flex-start; gap: 9px; margin: 18px 0 0; padding: 10px 11px; border: 1px solid #3d414d; border-radius: 3px; background: #202128; color: #c6cad4; font-size: 11px; line-height: 1.35; }
.generation-settings .routing-control + .routing-control { margin-top: 7px; }
.generation-settings .routing-control input { flex: 0 0 auto; accent-color: var(--cyan); }
.generation-settings .routing-control span { min-width: 0; }
.generation-settings .paid-routing-control input { accent-color: var(--coral); }

.chat-panel { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; overflow: hidden; background: #111218; }
.chat-toolbar { min-height: 76px; padding: 17px 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #3c373e; background: #14151b; }
.chat-toolbar .panel-kicker { color: #8a8e99; }
.chat-toolbar h2 { color: #f1eee5; }
.chat-toolbar-actions { display: flex; align-items: center; gap: 12px; }
.chat-toolbar-actions > span { color: #858995; font-size: 12px; font-weight: 700; }
.chat-toolbar .quiet-button, .composer .quiet-button { border-color: #44424c; background: #1d1e25; color: #aeb1bb; }
.chat-toolbar .quiet-button:hover, .composer .quiet-button:hover { border-color: #68636d; color: #fff; }
.system-drawer { background: #1c1919; border-bottom: 1px solid #594044; }
.system-drawer summary { min-height: 43px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; color: #d2b965; font-size: 12px; font-weight: 850; list-style: none; }
.system-drawer summary::-webkit-details-marker { display: none; }
.system-drawer summary::before { content: "+"; margin-right: 8px; font-size: 17px; line-height: 1; }
.system-drawer[open] summary::before { content: "-"; }
.system-drawer summary > span:first-child { margin-right: auto; }
.system-prompt-state { padding: 4px 8px; border: 1px solid #5a4d2c; border-radius: 2px; background: #242018; color: #d4ba61; font-size: 10px; }
.system-drawer textarea { display: block; width: calc(100% - 52px); min-height: 72px; margin: 0 26px 16px; border-color: #59494b; background: #151416; color: #ece8df; resize: vertical; }
.system-drawer textarea:focus { border-color: #a8873f; box-shadow: 0 0 0 3px #e8c65b20; }

.run-banner { min-height: 58px; margin: 14px 26px 0; padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; border: 1px solid #3c3e48; border-left: 3px solid #686b78; border-radius: 3px; background: #191a21; }
.run-indicator { width: 13px; height: 13px; border: 3px solid #a0a5b0; border-radius: 50%; }
.run-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.run-copy strong { color: #e4e2dc; font-size: 13px; }
.run-copy span { overflow: hidden; color: #878b97; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.run-banner time { color: #9a9da7; font: 800 12px/1 "Cascadia Code", Consolas, monospace; }
.run-banner[data-state="sending"], .run-banner[data-state="waiting"], .run-banner[data-state="thinking"], .run-banner[data-state="streaming"] { border-color: #79672d; border-left-color: var(--yellow); background: #201e18; }
.run-banner[data-state="sending"] .run-indicator, .run-banner[data-state="waiting"] .run-indicator, .run-banner[data-state="thinking"] .run-indicator { border-color: #d7ae17; border-top-color: transparent; animation: spin .8s linear infinite; }
.run-banner[data-state="streaming"] { border-color: #36696b; border-left-color: var(--cyan); background: #162123; }
.run-banner[data-state="streaming"] .run-indicator { border-color: var(--cyan); animation: pulse 1s infinite; }
.run-banner[data-state="complete"] { border-color: #40664a; border-left-color: #78b987; background: #172019; }
.run-banner[data-state="complete"] .run-indicator { border-color: #42b76d; background: #42b76d; }
.run-banner[data-state="error"] { border-color: #774044; border-left-color: var(--coral); background: #251719; }
.run-banner[data-state="error"] .run-indicator { border-color: var(--coral); background: var(--coral); }
.stop-button { border: 1px solid #8f4145; border-radius: 3px; background: #291719; color: #e98181; padding: 7px 11px; font-size: 11px; font-weight: 850; }
.stop-button:hover { background: #371d20; }

.messages { min-height: 0; padding: 30px clamp(28px, 5vw, 90px); overflow-y: auto; display: flex; flex-direction: column; gap: 20px; background: #0f1015; scrollbar-color: #4a4c56 transparent; }
.empty-state { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; color: #989ca7; }
.empty-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #66535b; border-radius: 2px; color: var(--cyan); font-size: 25px; transform: rotate(45deg); }
.empty-mark + strong { color: #858895; }
.empty-state strong { font-size: 14px; }
.message { width: fit-content; max-width: min(78%, 920px); padding: 14px 16px; border: 1px solid #3d3e47; border-radius: 3px; box-shadow: 0 3px 10px #05060a66; }
.message.assistant { align-self: flex-start; border-left: 4px solid var(--cyan); background: #142225; }
.message.user { align-self: flex-end; border-right: 4px solid var(--violet); background: #211d2b; }
.message.error { align-self: stretch; width: auto; max-width: 100%; border-color: #754045; border-left: 4px solid var(--coral); background: #28191b; }
.message.status { align-self: center; max-width: 90%; padding: 7px 13px; border: 1px solid #373943; border-radius: 3px; box-shadow: none; background: #1c1d24; }
.message.status .message-meta { display: none; }
.message.status .message-body { color: #9ea2ad; font-size: 11px; font-weight: 750; }
.message-meta { margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.message-role { color: #747986; font-size: 9px; font-weight: 950; letter-spacing: .11em; }
.message-time { color: #9da1ab; font: 600 10px/1 "Cascadia Code", Consolas, monospace; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; color: #e8e5dd; font-size: 15px; line-height: 1.68; }
.typing-indicator { min-width: 42px; min-height: 20px; display: flex; align-items: center; gap: 5px; }
.typing-indicator i { width: 6px; height: 6px; border-radius: 50%; background: #55bdb8; animation: typing 1s ease-in-out infinite; }
.typing-indicator i:nth-child(2) { animation-delay: .13s; }
.typing-indicator i:nth-child(3) { animation-delay: .26s; }

.composer { padding: 16px 26px 20px; border-top: 1px solid #3c373e; background: #15161c; }
.composer textarea { min-height: 78px; max-height: 180px; resize: none; border: 1px solid #4a4650; border-left: 3px solid #6d3035; border-radius: 3px; background: #0f1015; color: #f0ede5; font-size: 15px; }
.composer textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px #4fc3c81c; }
.composer-footer { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.composer-context { min-width: 0; display: flex; align-items: center; gap: 10px; color: #777c88; font-size: 11px; }
.composer-context span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keyboard-hint { flex: 0 0 auto; padding: 4px 7px; border: 1px solid #3e4048; border-radius: 2px; background: #101116; color: #777c88; font: 700 10px/1 "Cascadia Code", Consolas, monospace; }
.send-button { min-width: 104px; border: 1px solid #a24449; border-radius: 3px; background: #8d353b; color: #fff; padding: 10px 13px 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 13px; font-weight: 900; box-shadow: 0 3px 0 #592126; }
.send-button:hover { transform: translateY(1px); background: #a94249; box-shadow: 0 2px 0 #592126; }
.send-arrow { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 5px; background: #ffffff24; font-size: 16px; }

.inspect-panel { display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr); overflow: hidden; color: #eef0f5; background: #0f1015; border-left: 1px solid #3c373e; }
.inspect-title { padding: 21px 22px 13px; }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 22px; overflow: hidden; border: 1px solid #3e3b44; border-radius: 3px; background: #3e3b44; }
.metrics-grid > div { min-width: 0; padding: 13px; background: #20222b; }
.metrics-grid span { display: block; margin-bottom: 6px; color: #818797; font-size: 9px; font-weight: 900; letter-spacing: .09em; }
.metrics-grid strong { display: block; overflow: hidden; color: #f5f6f8; font: 850 21px/1.1 "Cascadia Code", Consolas, monospace; text-overflow: ellipsis; }
.metrics-grid > div:nth-child(2) strong { color: var(--cyan); }
.metrics-grid > div:nth-child(4) strong { color: var(--yellow); }
.metrics-grid .cost-metric { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 14px; background: #27251d; }
.metrics-grid .cost-metric span { grid-column: 1 / -1; }
.metrics-grid .cost-metric strong { color: var(--yellow); font-size: 25px; }
.metrics-grid .cost-metric em { color: #e5d488; font-size: 12px; font-style: normal; font-weight: 800; }
.metrics-grid .cost-metric small { grid-column: 1 / -1; color: #9da292; font-size: 9px; font-weight: 700; }
.finish-row { margin: 14px 22px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #30323c; border-bottom: 1px solid #30323c; }
.finish-row span { color: #858a99; font-size: 11px; }
.finish-row strong { color: #e1e4eb; font: 700 11px/1 "Cascadia Code", Consolas, monospace; }
.inspect-tabs { display: flex; padding: 0 22px; border-bottom: 1px solid #30323c; }
.tab-button { flex: 1; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #828797; padding: 11px 8px; font-size: 12px; font-weight: 850; }
.tab-button:hover { color: #d8dbe3; }
.tab-button.active { border-bottom-color: var(--yellow); color: #fff; }
.inspector { min-width: 0; min-height: 0; margin: 0; padding: 18px 22px 30px; overflow: auto; background: #101116; color: #bbc5d3; font: 12px/1.7 "Cascadia Code", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-color: #3b3e49 transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .4; transform: scale(.82); } }
@keyframes typing { 0%, 70%, 100% { transform: translateY(0); opacity: .35; } 35% { transform: translateY(-4px); opacity: 1; } }
@keyframes contract-decay { 0% { opacity: 1; transform: scale(1); } 55% { opacity: .18; transform: scale(.97); } 100% { opacity: .48; transform: scale(.985); } }
@keyframes contract-summon { 0% { opacity: .12; transform: scale(.95); box-shadow: 0 0 0 transparent; } 38% { opacity: 1; transform: scale(1.015); box-shadow: 0 0 24px var(--affinity); } 100% { opacity: 1; transform: scale(1); box-shadow: inset 0 0 0 1px #e8c65b4a, 0 0 18px #e8c65b1d; } }

@media (max-width: 1500px) {
  body { overflow: auto; }
  .workspace { height: auto; min-height: calc(100dvh - 72px); grid-template-columns: 330px minmax(0, 1fr); grid-template-rows: minmax(720px, calc(100dvh - 72px)) 330px; overflow: visible; }
  .inspect-panel { grid-column: 1 / -1; grid-template-columns: 270px 360px 1fr; grid-template-rows: auto auto 1fr; border-top: 1px solid #30323c; border-left: 0; }
  .inspect-title { grid-row: 1 / 4; }
  .metrics-grid { margin-top: 22px; }
  .finish-row { grid-column: 2; }
  .inspect-tabs { grid-column: 3; grid-row: 1; align-self: end; }
  .inspector { grid-column: 3; grid-row: 2 / 4; }
}

@media (max-width: 900px) {
  .app-bar { height: auto; min-height: 66px; padding: 10px 16px 12px; grid-template-columns: 1fr auto; gap: 9px 14px; }
  .header-model { grid-column: 1 / -1; grid-row: 2; }
  .connection-status { font-size: 10px; }
  .model-picker { width: calc(100vw - 16px); height: calc(100dvh - 16px); margin: 8px auto auto; }
  .model-picker-body { display: block; overflow-y: auto; }
  .model-picker-catalog { min-height: 680px; border-right: 0; }
  .model-roster { min-height: 300px; }
  .model-picker-preview { min-height: 430px; overflow: visible; border-top: 1px solid #383b46; }
  .workspace { display: block; min-height: auto; }
  .settings-panel { max-height: none; border-right: 0; }
  .chat-panel { min-height: 720px; }
  .inspect-panel { display: block; min-height: 520px; }
  .inspect-title, .metrics-grid, .finish-row, .inspect-tabs { margin-left: 18px; margin-right: 18px; }
  .message { max-width: 92%; }
}

@media (max-width: 560px) {
  h1 { font-size: 18px; }
  .brand-mark { width: 25px; height: 25px; border-width: 2px; }
  .header-model { grid-template-columns: minmax(0, 1fr) auto auto; padding-left: 11px; }
  .model-launcher-kicker { display: none; }
  .model-picker-header { min-height: 64px; padding-left: 14px; padding-right: 10px; }
  .model-picker-header h2 { font-size: 18px; }
  .model-picker-header .quiet-button { display: none; }
  .model-picker-catalog, .model-picker-preview { padding-left: 14px; padding-right: 14px; }
  .model-picker-toolbar { grid-template-columns: 1fr; }
  .model-picker .model-filters { grid-template-columns: 1fr 1fr; }
  .model-roster { grid-template-columns: 1fr; grid-auto-rows: 158px; }
  .model-picker-footer { padding-left: 14px; gap: 10px; }
  .model-picker-footer > div { max-width: calc(100% - 132px); }
  .picker-confirm { padding-left: 11px; padding-right: 11px; }
  .settings-panel { padding-left: 18px; padding-right: 18px; }
  .chat-toolbar, .system-drawer summary, .composer { padding-left: 16px; padding-right: 16px; }
  .system-drawer textarea { width: calc(100% - 32px); margin-left: 16px; margin-right: 16px; }
  .run-banner { margin-left: 16px; margin-right: 16px; }
  .messages { padding: 24px 16px; }
  .chat-toolbar-actions > span { display: none; }
  .composer-context span:last-child { display: none; }
}
