/* Quiet and dense, in the manner of Linear: near-black neutrals, hairline borders, one indigo accent. */
@import url("usage.css");
@import url("teams.css");
:root {
  color-scheme: dark;
  --bg: #0f1011; --panel: #141516; --raised: #1c1d20; --hover: #ffffff0b; --active: #ffffff12;
  --line: #ffffff12; --line-strong: #ffffff22;
  --text: #f7f8f8; --muted: #9aa0a9; --faint: #858a92;
  --accent: #7c7fff; --accent-bg: #5e6ad2; --accent-soft: #5e6ad22e;
  --ok: #4cb782; --warn: #f2c94c; --bad: #f26a6a;
  --radius: 6px;
  --sans: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 0 0 1px #ffffff10, 0 8px 12px -4px #0000004d, 0 20px 40px -8px #00000080;
}
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("/vendor/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap; src: url("/vendor/jetbrains-mono-700.woff2") format("woff2"); }
* { box-sizing: border-box; }
body { margin: 0; font: 13px/1.45 var(--sans); letter-spacing: -.005em; background: var(--bg); color: var(--text); display: flex; height: 100dvh; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
input, select, textarea { width: 100%; padding: 7px 10px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius); transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--radius); background: var(--raised); border: 1px solid var(--line-strong); font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
a.btn { color: inherit; text-decoration: none; }
.btn:hover { background: #26272b; }
.btn.primary { background: var(--accent-bg); border-color: #ffffff1f; color: #fff; }
.btn.primary:hover { background: #5f69cd; }
.btn.danger { color: var(--bad); }
.btn.small { height: 26px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon { width: 28px; height: 28px; border-radius: var(--radius); color: var(--muted); display: inline-grid; place-items: center; flex: none; transition: background .12s, color .12s; }
.icon:hover { background: var(--active); color: var(--text); }
.icon.danger { color: var(--bad); }
.icon.on { color: var(--accent); }
.icon.recording { color: var(--bad); background: var(--active); }
.i { display: block; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[hidden] { display: none !important; }
.count { font: 500 11px/16px var(--sans); color: var(--muted); padding: 0 5px; border-radius: 4px; background: var(--active); flex: none; font-variant-numeric: tabular-nums; }

/* An agent's icon, coloured per agent, with a dot while it runs. */
.agent { position: relative; width: 16px; height: 16px; display: grid; place-items: center; flex: none; color: var(--muted); }
.agent.claude { color: #e5a57b; } .agent.codex { color: #6fd6b5; } .agent.cursor { color: #86b7ff; } .agent.shell { color: #a0a4ab; }
.agent.idle { opacity: .45; }
.agent.busy::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--ring, var(--panel)); }
.agent.prompting::after { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.agent.working.blink::after { animation: pulse .8s ease-in-out; }
@media (prefers-reduced-motion: reduce) { .agent.prompting::after, .agent.working.blink::after { animation: none; } * { transition: none !important; } }

/* Each project's colour (project-color.js) as a hint, as JetBrains IDEs do: a fade from the left of the bar, a square beside its name. */
.swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--project, var(--line-strong)); }
#tabbar, #mbar, .project-row { background-image: linear-gradient(90deg, color-mix(in srgb, var(--project, transparent) 14%, transparent), transparent 320px); }
.project.current .project-row { background-image: linear-gradient(90deg, color-mix(in srgb, var(--project) 18%, transparent), transparent 85%); }

/* Tabs on top: soft pills rather than boxes; the selected one is lifted, not outlined. */
#tabbar { display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 8px; background-color: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.proj { display: flex; align-items: center; gap: 6px; max-width: 200px; height: 28px; padding: 0 8px; margin-right: 6px; border-radius: var(--radius); font-weight: 600; }
.proj:hover { background: var(--hover); }
.proj > .i { color: var(--faint); }
.elsewhere { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; }
.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; height: 100%; align-items: center; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: 1 1 0; min-width: 120px; max-width: 240px; height: 28px; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 10px; border-radius: var(--radius); color: var(--muted); cursor: pointer; user-select: none; transition: background .12s, color .12s; }
.tab:hover { color: var(--text); background: var(--hover); }
.tab[aria-selected="true"] { color: var(--text); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); --ring: var(--raised); }
.tab .label { flex: 1; min-width: 0; font-size: 12.5px; }
.tab .x { width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center; color: var(--muted); flex: none; opacity: 0; }
.tab:hover .x, .tab[aria-selected="true"] .x, .tab .x:focus-visible { opacity: 1; }
.tab .x:hover { background: var(--active); color: var(--text); }
@media (pointer: coarse) { .tab .x { opacity: 1; } }
/* Every project's tabs together: a label per project, and its tabs underlined in its colour, like Chrome's tab groups. */
.tabgroup { display: flex; align-items: center; flex: none; max-width: 160px; height: 22px; margin: 0 2px 0 8px; padding-left: 8px; border-radius: 999px; background: color-mix(in srgb, var(--project) 16%, transparent); color: var(--project); font: 600 11.5px/22px var(--sans); }
.tabgroup:first-child { margin-left: 0; }
.tabgroup.current { background: color-mix(in srgb, var(--project) 28%, transparent); }
.tabgroup > button:first-child { min-width: 0; }
.tabgroup .icon { width: 22px; height: 22px; border-radius: 999px; color: inherit; }
.tab.grouped { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--project) 55%, transparent); }
.tab.grouped[aria-selected="true"] { background: linear-gradient(color-mix(in srgb, var(--project) 12%, transparent), transparent), var(--raised); box-shadow: inset 0 0 0 1px var(--line), inset 0 -2px 0 var(--project); }
#tabbar > .newtab { margin-left: 2px; }
.bar-end { display: flex; align-items: center; gap: 2px; margin-left: auto; padding-left: 8px; flex: none; }
.tabswitch { display: none; }
#mbar { display: none; }

/* Sidebar layout: every project with its tabs. */
aside { width: 256px; flex: none; display: flex; flex-direction: column; background-color: var(--panel); border-right: 1px solid var(--line); }
body[data-layout="top"] aside, body[data-layout="side"] #tabbar { display: none; }
aside > header { display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 8px 0 16px; }
aside > header b { flex: 1; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
#projects { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.project { margin-top: 10px; }
.project-row { display: flex; align-items: center; gap: 1px; height: 28px; padding-left: 6px; border-radius: var(--radius); }
.project-row:hover { background-color: var(--hover); }
.project-row .name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; height: 100%; text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); }
.project-row:hover .name { color: var(--text); }
.project-row .name .i { color: var(--faint); transition: transform .15s; }
.project-row .name .swatch { margin: 0 2px; }
.project.collapsed .name .i { transform: rotate(-90deg); }
.project.collapsed .entries { display: none; }
.project-row .running { font-size: 11px; color: var(--ok); margin-right: 4px; font-variant-numeric: tabular-nums; }
.project-row .icon { width: 24px; height: 24px; }
.project-row .more, .project-row .newtab { opacity: 0; }
.project-row:hover .more, .project-row:hover .newtab, .project-row .icon:focus-visible { opacity: 1; }
@media (pointer: coarse) { .project-row .more, .project-row .newtab { opacity: 1; } }
.entries { margin-top: 1px; }
.entry { width: 100%; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 4px 0 24px; border-radius: var(--radius); text-align: left; color: var(--muted); cursor: pointer; transition: background .12s, color .12s; }
.entry:hover { background: var(--hover); color: var(--text); }
.entry.active { background: var(--active); color: var(--text); --ring: #232426; }
.entry .x { width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; opacity: 0; flex: none; }
.entry:hover .x { opacity: 1; }
.entry .x:hover { background: var(--active); }
.entry .time { font-size: 11px; color: var(--faint); flex: none; font-variant-numeric: tabular-nums; }
.entry.nested { height: 26px; padding-left: 40px; font-size: 12px; }
.entry.nested.focused { color: var(--text); }
.older { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 24px; font-size: 12px; color: var(--faint); }
.older:hover { color: var(--text); }
#sideFooter { padding: 8px; border-top: 1px solid var(--line); }
.side-new { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 10px; border-radius: var(--radius); color: var(--muted); }
.side-new:hover { background: var(--hover); color: var(--text); }

/* Panes: splits with a 1px divider; the panes without focus are dimmed, as in Ghostty. */
main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
#panes { flex: 1; min-height: 0; display: flex; }
.split { flex: 1; min-width: 0; min-height: 0; display: flex; }
.split-col { flex-direction: column; }
.slot { display: flex; min-width: 0; min-height: 0; }
.divider { flex: none; position: relative; z-index: 2; background: var(--line); }
.split-row > .divider { width: 1px; cursor: col-resize; }
.split-col > .divider { height: 1px; cursor: row-resize; }
.divider::after { content: ""; position: absolute; inset: -4px; }
.divider:hover, .divider.dragging { background: var(--accent); }
.pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; --ring: var(--bg); }
.pane:not(.solo):not(.focused) .pane-body::after { content: ""; position: absolute; inset: 0; background: #000; opacity: .35; pointer-events: none; }
.phead { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); flex: none; }
.pane.focused .phead { color: var(--text); }
.phead .title { flex: 0 1 auto; min-width: 0; font-weight: 500; cursor: text; }
.phead input { width: 240px; max-width: 100%; height: 24px; padding: 0 6px; font: inherit; border-radius: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line-strong); font: 11px var(--mono); color: var(--muted); white-space: nowrap; flex: none; }
button.chip:hover { color: var(--text); background: var(--hover); }
.chip .n { color: var(--text); }
.phead .runinfo { white-space: nowrap; font: 11px var(--mono); font-variant-numeric: tabular-nums; }
.phead .tools { display: flex; align-items: center; margin-left: auto; opacity: .55; flex: none; transition: opacity .12s; }
.pane.focused .phead .tools, .phead:hover .tools { opacity: 1; }
.phead .tools .icon { width: 26px; height: 26px; }
.pane-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.term { flex: 1; min-height: 0; padding: 8px 0 0 12px; overflow: hidden; }
.term.dropping { outline: 2px dashed var(--accent); outline-offset: -4px; }
.log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 72px; font: 12px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.log > div { margin-bottom: 6px; }
.log-text, .log-partial { font: 13.5px/1.55 var(--sans); }
.log-partial { opacity: .8; }
.log-tool { color: #b4a7ff; }
.log-tool::before { content: "▸ "; }
.log-error { color: var(--bad); }
.log-stderr, .log-meta, .log-thinking, .log-exit { color: var(--muted); }
.log-thinking { font-style: italic; }
.log-result { color: var(--ok); padding-top: 6px; border-top: 1px solid var(--line); }
.log-result.bad, .log-exit.bad { color: var(--bad); }
.ended { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1; display: flex; align-items: center; gap: 12px; padding: 5px 5px 5px 14px; background: var(--raised); border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap; font-size: 12px; }
.empty { flex: 1; display: grid; place-items: center; padding: 24px; text-align: center; }
.empty h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.empty .row { justify-content: center; flex-wrap: wrap; margin-top: 18px; }
#banner { padding: 12vh 16px 24px; display: grid; justify-items: center; }
.signin-panel { width: min(100%, 380px); display: grid; gap: 10px; }
.signin-panel h2 { margin: 0; }
.signin-panel .signin { justify-items: stretch; }
.signin-panel .row input { flex: 1; min-width: 0; }
#tokenDetails summary { cursor: pointer; color: var(--muted, #8a8f98); }
#tokenDetails form { margin-top: 8px; }
.signin { display: grid; justify-items: start; gap: 6px; margin-top: 8px; }
.signin form:not(.row) { display: grid; gap: 6px; }
.signin-error { color: #ffb3b0; font-weight: 500; }
#keys { display: none; gap: 6px; padding: 6px; border-top: 1px solid var(--line); overflow-x: auto; }
#keys button { flex: 1; height: 34px; padding: 0 10px; border-radius: var(--radius); background: var(--raised); border: 1px solid var(--line); font-size: 12px; }
@media (pointer: coarse) { #keys.on { display: flex; } }

/* Popovers read like a command menu: compact rows, a soft highlight that follows the pointer or the arrow keys. */
[popover] { position: fixed; inset: auto; margin: 0; padding: 4px; min-width: 200px; background: #1c1d20f2; backdrop-filter: blur(16px); color: var(--text); border: 0; border-radius: 10px; box-shadow: var(--shadow); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; text-align: left; padding: 5px 8px; border-radius: var(--radius); }
.menu button:hover, .menu button:focus-visible { background: var(--active); outline: none; }
.menu button.bad { color: var(--bad); }
.menu h4 { margin: 0; padding: 8px 8px 4px; font-size: 11px; font-weight: 500; color: var(--faint); }
.menu .meta { margin-left: auto; padding-left: 8px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.menu .current { background: var(--accent-soft); }
.menu .sub { display: block; font-size: 11px; color: var(--muted); }
.menu .account { margin-left: 6px; color: var(--muted); }
.menu .mrow { display: flex; align-items: center; border-radius: var(--radius); }
.menu .mrow:hover { background: var(--active); }
.menu .mrow > button:first-child { flex: 1; min-width: 0; }
.menu .mrow > button:first-child:hover { background: none; }
.menu button.icon { width: 28px; min-height: 28px; padding: 0; justify-content: center; margin-right: 2px; }
.menu .btn { width: auto; min-height: 0; padding: 0 10px; }
.menu .segmented { flex-wrap: nowrap; padding: 2px 4px 4px; }
.menu .segmented button { flex: 1; justify-content: center; gap: 6px; min-height: 28px; }
.toggle { width: 28px; height: 16px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; margin-left: auto; transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.toggle.on { background: var(--accent-bg); }
.toggle.on::after { transform: translateX(12px); }
.confirm { display: grid; gap: 10px; max-width: 280px; padding: 10px; }
.confirm p { margin: 0; }
.menu h4.row { gap: 6px; }
#moreMenu { width: 320px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px -4px; }
.menu .info { padding: 6px 8px; font-size: 12px; color: var(--muted); }

/* A login's 5-hour and weekly usage: a hairline meter per window. */
.limits { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; flex: none; max-width: 55%; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.limit { display: inline-flex; align-items: center; gap: 5px; --meter: var(--muted); }
.limit.warn { --meter: var(--warn); color: var(--warn); }
.limit.bad { --meter: var(--bad); color: var(--bad); }
.limit i { width: 22px; height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--meter) var(--p), var(--line-strong) var(--p)); }
.list .limits { margin: 4px 0 0; max-width: none; }

.field { display: block; margin: 0 0 12px; }
.field > span, .field > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; }
.segmented button { padding: 5px 10px; border-radius: var(--radius); border: 1px solid var(--line-strong); color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--active); border-color: var(--line-strong); color: var(--text); }
dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 0; background: var(--panel); color: var(--text); border: 0; border-radius: 12px; box-shadow: var(--shadow); }
dialog::backdrop { background: #000000a6; }
dialog > header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; padding: 14px 12px 10px 20px; background: var(--panel); }
dialog > header h2 { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
dialog .body { padding: 0 20px 20px; }
dialog h3 { margin: 22px 0 8px; font-size: 11px; font-weight: 500; color: var(--faint); }
dialog h3:first-child { margin-top: 4px; }
/* Settings: one row per section, with its state at a glance; the details open on demand. */
.setting { border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting[open] { padding-bottom: 16px; }
.setting > summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; font-weight: 500; }
.setting > summary::-webkit-details-marker { display: none; }
.setting > summary > :last-child { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: normal; color: var(--muted); }
.setting > summary::after { content: "›"; color: var(--faint); font-size: 18px; line-height: 1; transition: transform .15s; }
.setting[open] > summary::after { transform: rotate(90deg); }
.setting > p:first-of-type { margin-top: 0; }
.list > * { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list > :last-child { border-bottom: 0; }
.ok { color: var(--ok); } .bad { color: var(--bad); }
.list .switch { width: auto; margin: 0; flex: none; accent-color: var(--accent-bg); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
td, th { padding: 6px 0; text-align: left; border-bottom: 1px solid var(--line); font-weight: normal; }
th { color: var(--muted); font-size: 11px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.changes { max-height: 180px; overflow-y: auto; font: 12px var(--mono); }
.changes div { padding: 2px 0; }
.changes b { display: inline-block; width: 24px; color: var(--muted); font-weight: normal; }
pre { max-height: 50dvh; overflow: auto; font: 12px var(--mono); background: var(--bg); padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); }
dialog.template { width: min(900px, calc(100vw - 24px)); }
dialog.template textarea { min-height: 60dvh; resize: vertical; font: 12px/1.5 var(--mono); }
dialog.file { width: min(1100px, calc(100vw - 24px)); height: calc(100dvh - 24px); overflow: hidden; }
dialog.file[open] { display: flex; flex-direction: column; }
dialog.file > header { gap: 6px; border-bottom: 1px solid var(--line); }
dialog.file .path { font: 13px var(--mono); color: var(--text); min-width: 0; flex: 0 1 auto; text-align: left; }
dialog.file .path:hover { color: var(--accent); }
dialog.file .info { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
dialog.file .icon.on { color: var(--accent); background: var(--accent-soft); }
.file-body { flex: 1; min-height: 0; overflow: auto; display: flex; outline: none; }
.file-body iframe { flex: 1; border: 0; background: #fff; }
.file-body img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; background: repeating-conic-gradient(#ffffff14 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.file-body img.actual { max-width: none; max-height: none; cursor: zoom-out; }
.file-body video, .file-body audio { margin: auto; max-width: 100%; max-height: 100%; }
.file-body p { margin: auto; }
.code { flex: 1; align-self: flex-start; min-width: max-content; padding: 8px 0; font: 12px/1.6 var(--mono); tab-size: 4; }
.code.wrap { min-width: 0; }
.code .line { display: grid; grid-template-columns: calc(var(--digits) * 1ch + 24px) 1fr; }
.code .line::before { content: attr(data-n); padding-right: 12px; text-align: right; color: var(--faint); user-select: none; }
.code .line > span { white-space: pre; padding-right: 16px; }
.code.wrap .line > span { white-space: pre-wrap; overflow-wrap: anywhere; }
.code .line.target { background: var(--accent-soft); }
.code .line.target::before { color: var(--accent); }
/* highlight.js tokens, in the page's palette. */
.hljs-comment, .hljs-quote { color: var(--faint); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-doctag, .hljs-meta .hljs-keyword { color: #c792ea; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-meta .hljs-string { color: #a5d6a7; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: #f7a26b; }
.hljs-title, .hljs-section, .hljs-title.function_ { color: #82aaff; }
.hljs-type, .hljs-built_in, .hljs-title.class_, .hljs-selector-class { color: #ffcb6b; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-property { color: #89ddff; }
.hljs-name, .hljs-tag, .hljs-selector-id, .hljs-deletion { color: #f07178; }
.hljs-meta, .hljs-subst, .hljs-params { color: var(--text); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
.hljs-link { text-decoration: underline; }
dialog.models { width: min(720px, calc(100vw - 24px)); height: calc(100dvh - 24px); overflow: hidden; }
dialog.models[open] { display: flex; flex-direction: column; }
dialog.models .body { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; }
dialog.models .models { overflow-y: auto; min-height: 0; flex: 1; margin: 0 -8px; }
dialog.models .models h3 { margin: 16px 8px 4px; }
dialog.models .model { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 8px; text-align: left; border-radius: var(--radius); }
dialog.models .model:hover, dialog.models .model:focus-visible { background: var(--accent-soft); outline: none; }
dialog.models .model.on { color: var(--accent); }
dialog.models .model > .muted:last-child { flex-shrink: 0; }
@media (max-width: 560px) {
  dialog.models .model { flex-wrap: wrap; gap: 2px; }
  dialog.models .model > .grow { flex-basis: 100%; }
}
dialog.palette { width: min(600px, calc(100vw - 24px)); margin-top: 12dvh; overflow: hidden; }
dialog.palette[open] { display: flex; flex-direction: column; max-height: 70dvh; }
dialog.palette input { height: 46px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; font-size: 14px; }
.palette-list { overflow-y: auto; padding: 4px; }
.palette-list p { margin: 12px; }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 5px 10px; border-radius: var(--radius); text-align: left; }
.palette-item[aria-selected="true"] { background: var(--active); }
.palette-item > .swatch { margin: 0 4px; }
.palette-item .meta { margin-left: auto; padding-left: 8px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.warn { color: var(--warn); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 9px 14px; border-radius: 8px; background: var(--raised); box-shadow: var(--shadow); font-size: 12.5px; z-index: 10; }
#toast.bad { color: #ffb3b0; box-shadow: 0 0 0 1px #eb575766, 0 8px 24px #0009; }

@media (max-width: 700px) {
  .tabs { display: none; }
  .tabswitch { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 28px; padding: 0 8px; border-radius: var(--radius); text-align: left; }
  .tabswitch:hover { background: var(--hover); }
  .proj { max-width: 34vw; }
  .phead .tools .wide { display: none; }
  body[data-layout="side"] #mbar { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 8px; background-color: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
  aside { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 5; transform: translateX(-100%); transition: transform .2s; }
  body.drawer aside { transform: none; box-shadow: 0 0 0 100vw #0009; }
  .limits { max-width: 45%; }
}
.viewers { display: inline-flex; align-items: center; flex: none; }
.viewers .avatar { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 600 9px/1 var(--sans); color: #0f1011; background: hsl(var(--hue) 55% 68%); box-shadow: 0 0 0 2px var(--bg); }
.viewers .avatar + .avatar { margin-left: -4px; }
.viewers .more { margin-left: 4px; font: 11px var(--mono); color: var(--muted); }
