:root {
  color-scheme: light;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  --accent: #f97316;
  --accent-ink: #211711;
  --fg: #27241f;
  --heading: #211711;
  --muted: #6e6963;
  --faint: #79746d;
  --paper: #f7f7f6;
  --surface: #fff;
  --surface-2: #fbfaf9;
  --border: #e4e0dc;
  --border-strong: #d6d0c9;
  --hover: #f4f1ee;
  --accent-text: #9b3b0b;
  --accent-soft: color-mix(in srgb, var(--accent) 13%, var(--surface));
  --accent-border: color-mix(in srgb, var(--accent) 42%, var(--surface));
  --editor-bg: #fffefd;
  --editor-gutter: #79736b;
  --editor-line: #f7f4ef;
  --selection: #f5d5b8;
  --syntax-keyword: #9a2472;
  --syntax-tag: #a8303a;
  --syntax-attribute: #06578c;
  --syntax-string: #4c6b24;
  --syntax-number: #9f4820;
  --syntax-comment: #777568;
  --syntax-function: #4d4899;
  --preview-back: #edece9;
  --good: #197547;
  --good-soft: #e7f6eb;
  --warn: #8a5700;
  --bad: #a82929;
  --shadow: 0 2px 7px #33231a08;
  --editor-font: "Cascadia Code", Consolas, monospace;
  --editor-size: 14px;
  --editor-line-height: 1.65;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fg: #efedea;
  --heading: #fff5eb;
  --muted: #b2aba4;
  --faint: #b0a7a0;
  --paper: #1b1b1c;
  --surface: #232325;
  --surface-2: #29292c;
  --border: #39383a;
  --border-strong: #4c4846;
  --hover: #302c2b;
  --accent-text: #ffb36b;
  --editor-bg: #202024;
  --editor-gutter: #aea59b;
  --editor-line: #2e2b2e;
  --selection: #5c3a2a;
  --syntax-keyword: #f3a4d4;
  --syntax-tag: #ff9d93;
  --syntax-attribute: #8ccbf0;
  --syntax-string: #c0de89;
  --syntax-number: #ffbe8a;
  --syntax-comment: #aba59a;
  --syntax-function: #c2afff;
  --preview-back: #313033;
  --good: #89d9a4;
  --good-soft: #244032;
  --warn: #f2c17a;
  --bad: #ffa3a3;
  --shadow: 0 2px 8px #11111125;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--fg); background: var(--paper); }
button, select, input, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
button, a, input, select, textarea, summary { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
strong { font-weight: 650; }
p { line-height: 1.55; }
svg.icon { flex: 0 0 auto; vertical-align: middle; }
small { color: var(--muted); }
.muted { color: var(--muted); }
.boot { min-height: 80vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 14px; }
.boot h1 { font-size: 29px; }
.app-shell { height: 100dvh; display: grid; grid-template-columns: 225px minmax(0, 1fr); grid-template-rows: 61px minmax(0, 1fr) 30px; }
.app-shell.sidebar-folded { grid-template-columns: 60px minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 17px; padding: 0 19px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 2; }
.wordmark { display: flex; align-items: center; gap: 10px; border: 0; padding: 0; background: none; color: var(--heading); font-weight: 700; font-size: 19px; white-space: nowrap; letter-spacing: -.045em; }
.wordmark strong { font-weight: 620; }
.mark { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 9px; color: var(--accent-ink); background: var(--accent); }
.mark .icon, .sidebar-sign .icon, .eyebrow .icon { view-transition-name: none; }
.top-divider, .toolbar-rule { height: 24px; width: 1px; background: var(--border); }
.top-label { color: var(--muted); font-size: 12px; letter-spacing: .01em; }
.top-spacer { flex: 1; }
.global-search, .local-indicator { display: inline-flex; align-items: center; gap: 9px; padding: 6px 9px; border: 0; color: var(--muted); background: transparent; white-space: nowrap; }
.global-search { width: min(30vw, 320px); min-width: 178px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); height: 35px; text-align: left; }
.global-search:hover { background: var(--hover); }
.global-search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
kbd { border: 1px solid var(--border); border-radius: 4px; padding: 2px 5px; font: 11px "Segoe UI", sans-serif; background: var(--surface); }
.local-indicator { font-size: 11px; font-weight: 600; }
.local-indicator i, .preview-heading i { background: #329866; width: 7px; height: 7px; border-radius: 50%; }
.sidebar { display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); min-height: 0; }
.sidebar-top { height: 59px; padding: 14px 12px 9px 19px; display: flex; align-items: center; justify-content: space-between; }
.sidebar-top > span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; white-space: nowrap; }
.sidebar nav { display: grid; gap: 3px; padding: 0 10px 10px; overflow: auto; }
.nav-item { width: 100%; height: 40px; font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 12px; text-align: left; padding: 0 10px; border: 1px solid transparent; border-radius: 7px; position: relative; background: transparent; white-space: nowrap; }
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: var(--hover); }
.nav-item.selected { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-border); font-weight: 700; }
.nav-item.selected .icon { color: var(--accent-text); }
.nav-settings { margin-top: 12px; }
.nav-settings::before { content: ''; height: 1px; background: var(--border); position: absolute; top: -10px; left: 6px; right: 6px; }
.sidebar-foot { margin: auto 11px 14px; padding: 12px 8px 2px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.sidebar-foot strong, .sidebar-foot small { display: block; font-size: 11px; }
.sidebar-foot small { font-size: 10px; margin-top: 2px; }
.sidebar-sign { color: var(--accent-text); }
.sidebar-folded .sidebar-top { padding-inline: 13px; }
.sidebar-folded .sidebar-top > span, .sidebar-folded .nav-item > span, .sidebar-folded .sidebar-foot > span:nth-child(2) { display: none; }
.sidebar-folded .sidebar nav { padding-inline: 8px; }
.sidebar-folded .nav-item { justify-content: center; padding: 0; }
.statusbar { grid-column: 1 / -1; display: flex; align-items: center; min-width: 0; gap: 15px; background: var(--surface); border-top: 1px solid var(--border); color: var(--muted); padding: 0 16px; font-size: 10.5px; }
.statusbar > div { flex: 1; }
.statusbar > span { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.statusbar > span:first-child { overflow: hidden; min-width: 0; color: var(--fg); }
.statusbar > span:first-child > span { overflow: hidden; text-overflow: ellipsis; }
#save-status { color: var(--good); }
#status-details span { border-left: 1px solid var(--border); padding-left: 7px; }
#status-details span:first-child { border-left: 0; padding-left: 0; }
.main-pages { min-width: 0; overflow: auto; }
.page-wrap { width: min(100%, 1400px); margin: 0 auto; padding: 28px clamp(20px, 3.2vw, 53px) 44px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 2px 0 24px; }
.eyebrow { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 750; letter-spacing: .14em; color: var(--accent-text); }
.page-header h1 { margin: 7px 0 4px; font-size: clamp(26px, 3.3vw, 37px); letter-spacing: -.043em; line-height: 1.12; color: var(--heading); }
.page-header p { color: var(--muted); font-size: 13px; }
.header-actions, .wrap-actions, .hero-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn, .icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; min-height: 33px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--fg); font-weight: 620; font-size: 12px; text-decoration: none; white-space: nowrap; }
.icon-btn { width: 31px; min-height: 31px; padding: 0; border-color: transparent; background: transparent; color: var(--muted); }
.btn:hover:not(:disabled), .icon-btn:hover:not(:disabled), button[aria-pressed="true"] { background: var(--hover); color: var(--fg); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, var(--heading)); color: var(--accent-ink); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--accent-text); }
.btn.danger { background: #a82e2e; border-color: #a82e2e; color: #fff; }
.danger-text { color: var(--bad); }
.date-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; min-height: 34px; padding-inline: 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.date-chip:first-letter { text-transform: capitalize; }
.welcome { min-height: 200px; position: relative; overflow: hidden; display: flex; align-items: center; padding: 26px 28px; margin-bottom: 17px; border: 1px solid var(--accent-border); border-radius: 11px; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.welcome > div:first-child { position: relative; z-index: 1; }
.welcome h2 { margin: 8px 0 4px; font-size: clamp(26px, 3vw, 37px); letter-spacing: -.045em; color: var(--heading); }
.welcome p { color: var(--muted); font-size: 13px; max-width: 390px; }
.welcome .hero-actions { margin-top: 19px; }
.welcome > .icon-btn { position: absolute; right: 9px; top: 8px; z-index: 2; }
.hero-art { position: absolute; right: 0; inset-block: 0; width: min(44%, 430px); display: grid; place-items: center; overflow: hidden; background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 11%, transparent)); color: var(--accent-text); }
.hero-art::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--accent-border) 1px, transparent 1px), linear-gradient(90deg, var(--accent-border) 1px, transparent 1px); background-size: 28px 28px; opacity: .47; mask-image: linear-gradient(90deg, transparent, black 40%); }
.hero-art > .icon { position: relative; transform: rotate(-11deg); width: 79px; height: 79px; stroke-width: 1; }
.hero-art > i, .hero-art > b { position: absolute; width: 147px; height: 147px; border: 1px solid var(--accent-border); border-radius: 17px; transform: rotate(-13deg); }
.hero-art > b { width: 114px; height: 114px; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); box-shadow: 10px 15px 0 color-mix(in srgb, var(--accent) 9%, transparent); }
.hero-art > i:nth-of-type(2) { width: 176px; height: 176px; opacity: .45; }
.hero-art > i:nth-of-type(3), .hero-art > i:nth-of-type(4), .hero-art > i:nth-of-type(5) { width: 9px; height: 9px; border-radius: 0; background: var(--accent); opacity: .6; left: 26%; top: 68%; }
.hero-art > i:nth-of-type(4) { left: 77%; top: 30%; width: 6px; height: 6px; }
.hero-art > i:nth-of-type(5) { left: 68%; top: 76%; width: 5px; height: 5px; }
.quick-continue { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.metric { min-width: 0; padding: 13px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.metric-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 620; }
.metric-icon, .row-icon, .empty-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 7px; background: var(--accent-soft); color: var(--accent-text); }
.metric > strong { display: block; margin: 8px 0 2px; color: var(--heading); font-size: 26px; font-weight: 670; letter-spacing: -.045em; }
.metric > small { font-size: 11px; display: block; overflow-wrap: anywhere; }
.dashboard-grid, .settings-grid, .record-grid { display: grid; gap: 15px; align-items: start; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.record-grid { grid-template-columns: minmax(250px, .78fr) minmax(0, 1.35fr); }
.surface { border: 1px solid var(--border); border-radius: 9px; background: var(--surface); min-width: 0; margin-bottom: 15px; box-shadow: var(--shadow); overflow: hidden; }
.section-head { min-height: 52px; padding: 9px 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.section-head h2 { margin-right: auto; font-size: 14px; color: var(--heading); font-weight: 680; overflow-wrap: anywhere; }
.section-note { color: var(--muted); font-size: 12px; padding: 14px 15px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 53px; padding: 4px 11px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.row-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px; border: 0; background: transparent; color: var(--fg); text-align: left; }
button.row-link { border-radius: 5px; }
button.row-link:hover { color: var(--accent-text); background: var(--hover); }
.row-link strong, .row-link small { display: block; overflow-wrap: anywhere; }
.row-link strong { font-size: 12.5px; }
.row-link small { font-size: 11px; margin-top: 2px; }
.row-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; }
.row-date { font-size: 11px; }
.quick-list { display: grid; padding: 7px 11px 10px; gap: 2px; }
.quick-button { justify-content: flex-start; padding-inline: 9px; border-color: transparent; width: 100%; background: transparent; }
.quick-button .icon { color: var(--accent-text); }
.quick-button::after { content: '›'; margin-left: auto; color: var(--muted); }
.objective { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 14px; }
.objective label { display: flex; align-items: center; gap: 7px; }
.objective:has(input:checked) span { text-decoration: line-through; color: var(--muted); }
.empty { padding: 23px 17px; display: grid; gap: 5px; justify-items: start; text-align: left; }
.empty .empty-icon { margin-bottom: 4px; }
.empty p { color: var(--muted); font-size: 12px; }
.empty .btn { margin-top: 6px; }
.pill-list { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 13px 15px; }
.pill-list.compact { padding: 0; }
.pill { display: inline-flex; padding: 4px 7px; border-radius: 5px; border: 1px solid var(--border); font-size: 11px; color: var(--muted); background: var(--surface-2); }
.filter-bar { padding: 11px 13px; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-bar.slim { padding-top: 4px; padding-bottom: 7px; }
.filter-search { display: inline-flex; align-items: center; color: var(--muted); gap: 8px; flex: 1; min-width: 125px; min-height: 34px; padding: 1px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.filter-search input { width: 100%; min-width: 0; border: 0; background: transparent; padding: 3px 0; font-size: 12px; }
.filter-search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-search input:focus-visible { outline: 0; }
.line-input, .field input, .field textarea, select { width: 100%; min-width: 0; border-radius: 6px; border: 1px solid var(--border-strong); min-height: 34px; background: var(--surface-2); padding: 6px 8px; font-size: 12px; }
.field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; min-width: 0; }
.field textarea { resize: vertical; line-height: 1.58; }
.field input[type="color"] { height: 38px; width: 62px; padding: 3px; }
input[type="checkbox"] { accent-color: var(--accent); }
.filter-bar select, .tool-controls select, .lab-toolbar select, .inline-control select { width: auto; max-width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.record-body, .settings-fields { display: grid; gap: 13px; padding: 17px; overflow-wrap: anywhere; }
.record-body h3, .settings-fields h3 { font-size: 13px; }
.record-body ul { margin: 0; padding-left: 22px; line-height: 1.6; }
.record-body > .btn, .settings-fields > .btn { justify-self: start; }
.record-body .list-row { padding-inline: 0; }
.tab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.page-tabs { margin-bottom: 14px; }
.page-tabs .active { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-border); }
.syllabus { padding: 9px 16px 16px; }
details > summary { cursor: pointer; }
.syllabus > details { padding-block: 9px; border-bottom: 1px solid var(--border); }
.syllabus summary { font-size: 13px; font-weight: 650; }
.syllabus .pill-list { padding: 7px 0 0; }
.syllabus .pill-list button { min-height: 27px; padding-inline: 5px; }
.code-block, .diff { margin: 0; padding: 10px 11px; background: var(--editor-bg); border: 1px solid var(--border); border-radius: 6px; overflow: auto; font-family: var(--editor-font); font-size: 12px; line-height: 1.55; tab-size: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff span { display: block; }
.diff .added { background: var(--good-soft); color: var(--good); }
.diff .removed { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); }
.reference { padding: 14px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); }
.markdown > * + * { margin-top: 11px; }
.markdown ul, .markdown ol { margin-left: 14px; padding-left: 12px; }
.markdown h1, .markdown h2, .markdown h3 { font-size: 19px; }
.markdown pre { border: 1px solid var(--border); border-radius: 5px; padding: 9px; overflow: auto; }
.markdown code { font-family: var(--editor-font); font-size: .91em; }
.markdown table { width: auto; border-collapse: collapse; }
.markdown td, .markdown th { border: 1px solid var(--border); padding: 5px 8px; }
.markdown img { max-width: 100%; max-height: 420px; border-radius: 7px; }
.markdown figure { margin-inline: 0; }
.markdown figcaption { font-size: 11px; color: var(--muted); }
.note-preview { border-top: 1px solid var(--border); padding-top: 13px; }
.note-body > p { font-size: 12px; }
.toggle { color: var(--fg); position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 31px; font-size: 12px; cursor: pointer; }
.toggle small { display: block; font-size: 11px; margin-top: 2px; }
.toggle input { position: absolute; opacity: 0; right: 3px; }
.toggle i { width: 31px; height: 17px; flex: 0 0 auto; border: 1px solid var(--border-strong); border-radius: 50px; background: var(--hover); padding: 2px; }
.toggle i::after { content: ''; display: block; border-radius: 50%; background: var(--muted); width: 11px; height: 11px; }
.toggle input:checked + i { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + i::after { margin-left: auto; background: var(--accent-ink); }
.toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 3px; }
.settings-fields > p { font-size: 12px; }
.settings-fields .field > span { color: var(--muted); }
.inline-control { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.chart { display: flex; gap: clamp(3px, 1.1vw, 13px); padding: 20px 18px 5px; height: 140px; }
.chart > div { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; align-items: center; }
.chart span { display: block; width: 100%; max-width: 34px; height: var(--bar); min-height: 2px; border-radius: 4px 4px 1px 1px; background: var(--accent); }
.chart small { font-size: 10px; }
.chart-compare { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 18px 14px; color: var(--muted); font-size: 11px; }
.chart-compare span { width: 12px; }
.skill-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 12px; }
.arena { --arena-ink: #e9e4ed; --arena-accent: #f6a86f; }
.arena-banner { background: #282135; border: 1px solid #554165; border-radius: 10px; padding: 21px; color: var(--arena-ink); display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.arena-rank { display: grid; place-items: center; width: 68px; height: 68px; flex: 0 0 auto; background: #3b2b49; color: var(--arena-accent); font-size: 28px; font-weight: 800; border: 1px solid #775271; border-radius: 13px; }
.arena-banner h2 { font-size: 22px; color: #fff5eb; }
.arena-banner p { font-size: 12px; }
.arena-banner .icon { margin-left: auto; color: var(--arena-accent); width: 52px; height: 52px; }
.arena progress { width: min(240px, 34vw); height: 7px; color: var(--arena-accent); accent-color: var(--arena-accent); }
.arena-tree { display: grid; gap: 5px; padding: 12px; }
.arena-skill { display: flex; gap: 9px; align-items: center; min-height: 51px; padding: 6px; font-size: 12px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); }
.arena-skill > span { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; background: var(--hover); border-radius: 6px; font-weight: 700; }
.arena-skill > div { flex: 1; min-width: 0; }
.arena-skill small { display: block; font-size: 10px; }
.arena-skill.unlocked > span { background: var(--accent-soft); color: var(--accent-text); }
.arena-skill.unlocked { animation: unlock .28s ease-out both; }
@keyframes unlock { from { opacity: .45; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

.main-lab { min-width: 0; min-height: 0; overflow: hidden; display: grid; }
.workbench { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; min-width: 0; padding: 9px 10px 10px; }
.lab-toolbar { display: flex; align-items: center; gap: 9px; padding: 2px 0 9px; min-width: 0; }
.breadcrumb { display: flex; flex: 1; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; min-width: 0; }
.breadcrumb strong { color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb > .icon:first-child { color: var(--accent-text); }
.lab-run, .lab-view-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.lab-toolbar select { min-height: 30px; padding: 3px; }
.lab-toolbar .icon-btn { width: 29px; height: 30px; }
.run-btn { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 25%, var(--surface)); color: var(--good); min-height: 31px; }
.run-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--good) 20%, var(--surface)); color: var(--good); }
.segmented { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.segmented .icon-btn { border-radius: 4px; width: 26px; height: 28px; min-height: 28px; }
.segmented [aria-pressed="true"], .lab-card-head [aria-pressed="true"], #focus-mode[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-border); }
.lab-grid { display: grid; grid-template-columns: minmax(147px, 17fr) minmax(0, var(--editor-share, 53fr)) 6px minmax(0, var(--preview-share, 47fr)) minmax(154px, 17fr); grid-template-rows: minmax(150px, 1fr) minmax(153px, 27%); gap: 8px 5px; min-width: 0; min-height: 0; }
.lab-card { display: flex; flex-direction: column; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); overflow: hidden; min-height: 0; min-width: 0; box-shadow: var(--shadow); }
.lab-files { grid-area: 1 / 1; }
.lab-editor { grid-area: 1 / 2; }
.splitter { grid-area: 1 / 3; align-self: stretch; background: transparent; border: 0; padding: 0; cursor: col-resize; border-radius: 4px; touch-action: none; }
.splitter:hover, .splitter:focus-visible { background: var(--accent-border); }
.lab-preview { grid-area: 1 / 4; position: relative; }
.lab-inspector { grid-area: 1 / 5 / 3; }
.lab-tools { grid-area: 2 / 1 / 3 / 5; }
.workbench.without-files .lab-grid, .workbench.focus-mode .lab-grid { grid-template-columns: 0 minmax(0, var(--editor-share, 53fr)) 6px minmax(0, var(--preview-share, 47fr)) minmax(154px, 17fr); }
.workbench.without-files .lab-files, .workbench.focus-mode .lab-files, .workbench.without-inspector .lab-inspector, .workbench.focus-mode .lab-inspector { display: none; }
.workbench.without-inspector .lab-grid, .workbench.focus-mode .lab-grid { grid-template-columns: minmax(147px, 17fr) minmax(0, var(--editor-share, 53fr)) 6px minmax(0, var(--preview-share, 47fr)) 0; }
.workbench.without-files.without-inspector .lab-grid, .workbench.focus-mode .lab-grid { grid-template-columns: 0 minmax(0, var(--editor-share, 53fr)) 6px minmax(0, var(--preview-share, 47fr)) 0; }
.workbench.without-tools:not(.focus-mode) .lab-tools { display: none; }
.workbench.without-tools:not(.focus-mode) .lab-grid { grid-template-rows: minmax(0, 1fr); }
.workbench.without-tools:not(.focus-mode) .lab-inspector { grid-row: 1; }
.workbench.focus-mode .tool-tabs > button:not([data-id="diagnostic"]) { display: none; }
.lab-card-head { height: 42px; flex: 0 0 42px; display: flex; align-items: center; justify-content: space-between; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 8px; background: var(--surface-2); min-width: 0; }
.lab-card-head strong { font-size: 12px; white-space: nowrap; }
.lab-card-head > div { display: flex; align-items: center; min-width: 0; }
.lab-card-head .icon-btn { width: 24px; min-height: 27px; }
.lab-card-head .icon-btn .icon { width: 15px; height: 15px; }
.workspace-label { min-height: 35px; display: flex; align-items: center; justify-content: space-between; padding: 0 7px 0 10px; gap: 3px; color: var(--muted); }
.workspace-label span { font-weight: 650; font-size: 11px; white-space: nowrap; }
.workspace-label .icon-btn { width: 24px; min-height: 26px; }
.explorer-tree { flex: 1; min-height: 0; overflow: auto; padding: 0 5px 7px; }
.explorer-foot { display: flex; align-items: center; border-top: 1px solid var(--border); padding: 4px 5px; gap: 2px; overflow: hidden; }
.explorer-foot .btn { overflow: hidden; text-overflow: ellipsis; min-width: 0; padding: 0 3px; font-size: 10px; }
.explorer-foot .btn span { overflow: hidden; text-overflow: ellipsis; }
.tree-row { display: flex; align-items: center; justify-content: space-between; border: 1px solid transparent; border-radius: 5px; height: 29px; min-width: 0; }
.tree-row.current { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-border); }
.tree-row:hover { background: var(--hover); }
.tree-row > button:first-child { padding-left: calc(7px + var(--indent) * 12px); flex: 1; text-align: left; min-width: 0; background: transparent; border: 0; display: flex; gap: 5px; align-items: center; height: 100%; font-size: 11px; }
.tree-row > button:first-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row > .icon-btn { width: 24px; min-height: 26px; opacity: .5; }
.tree-row:hover > .icon-btn, .tree-row:focus-within > .icon-btn { opacity: 1; }
.tree-empty { padding: 8px; color: var(--muted); font-size: 11px; }
.file-icon { display: inline-flex; color: var(--muted); }
.file-icon.html { color: var(--accent-text); }
.file-icon.css { color: var(--syntax-attribute); }
.file-icon.javascript { color: var(--warn); }
.entry-dot, .change-dot { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); }
.editor-tabs { padding: 0 4px 0 0; }
#editor-tabs { flex: 1; height: 100%; overflow: auto hidden; scrollbar-width: thin; align-items: stretch; }
.editor-tab { display: flex; align-items: center; border-right: 1px solid var(--border); padding-right: 3px; min-width: 92px; flex: 0 0 auto; border-bottom: 2px solid transparent; }
.editor-tab.selected { border-bottom-color: var(--accent); background: var(--surface); }
.editor-tab > button:first-child { padding: 0 4px 0 8px; display: flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; background: transparent; border: 0; height: 100%; }
.editor-tab > .icon-btn { min-height: 25px; width: 19px; }
.editor-tab > .icon-btn .icon { width: 12px; height: 12px; }
.editor-body { min-height: 0; flex: 1; min-width: 0; display: flex; background: var(--editor-bg); }
#editor { flex: 1; min-width: 0; min-height: 0; }
#editor .cm-editor.cm-focused { outline: none; }
#minimap { flex: 0 0 60px; border-left: 1px solid var(--border); padding: 9px 3px 0; overflow: auto; }
#minimap button { display: flex; height: 3px; width: 100%; border: none; background: none; padding: 0; }
#minimap button > i { margin-left: calc(var(--offset) * .7px); width: calc(var(--length) * .75px); height: 2px; background: var(--syntax-comment); opacity: .5; }
.preview-heading { display: flex; gap: 7px; min-width: 0; }
.preview-heading small { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-heading i { background: var(--faint); flex: 0 0 auto; }
.preview-heading i[data-state="ready"] { background: #359865; }
.preview-heading i[data-state="loading"] { background: #dc9827; }
.preview-heading i[data-state="failed"], .preview-heading i[data-state="blocked"] { background: var(--bad); }
.preview-viewport { flex: 1; overflow: auto; position: relative; min-height: 0; background: var(--preview-back); }
.preview-viewport.device-view { padding: 9px; }
#preview-mat { position: relative; isolation: isolate; zoom: var(--preview-zoom, 1); min-width: 1px; min-height: 1px; overflow: hidden; }
#preview-mat.device-surface { margin-inline: auto; box-shadow: 0 0 0 1px var(--border-strong); border-radius: 4px; }
#preview-mat iframe { display: block; border: 0; background: #fff; color-scheme: light; width: 100%; height: 100%; }
.preview-empty { position: absolute; inset: 0; padding: 14px; display: grid; align-content: center; justify-items: center; gap: 7px; text-align: center; }
#preview-mat[data-stage="ready"] .preview-empty, #preview-mat[data-stage="loading"]:has(iframe) .preview-empty { display: none; }
.preview-foot { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 0 7px; min-height: 26px; border-top: 1px solid var(--border); font-size: 10px; color: var(--muted); }
.preview-foot span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.preview-alert { display: grid; place-items: center; position: absolute; inset: 42px 0 26px; z-index: 1; background: #21171165; padding: 11px; }
.preview-alert > div { display: grid; justify-items: start; gap: 8px; border: 1px solid var(--border); border-radius: 7px; padding: 12px; width: min(100%, 280px); background: var(--surface); color: var(--fg); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.preview-alert strong { font-size: 12px; }
.preview-alert p { max-height: 170px; overflow: auto; width: 100%; }
.preview-alert .btn { justify-self: end; }
.inspector-tabs { padding: 0; justify-content: stretch; }
.inspector-tabs button, .tool-tabs button { align-self: stretch; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 650; font-size: 11px; }
.inspector-tabs button { flex: 1; padding: 0 5px; }
.tool-tabs { justify-content: start; overflow: auto hidden; padding: 0 4px; }
.tool-tabs button { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 0 9px; white-space: nowrap; }
.inspector-tabs button.selected, .tool-tabs button.selected { border-bottom-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.inspector-tabs button:hover, .tool-tabs button:hover { color: var(--accent-text); }
#tool-body, #inspector-body { flex: 1; min-height: 0; overflow: auto; }
.inspector-empty { padding: 15px 9px; display: grid; gap: 8px; justify-items: start; font-size: 11px; }
.inspector-empty > .icon { color: var(--accent-text); }
.inspector-empty p { color: var(--muted); }
.inspector-empty .btn { font-size: 10px; padding: 0 5px; }
.inspector-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px; padding: 8px; border-bottom: 1px solid var(--border); }
.inspector-heading > div { overflow: hidden; }
.inspector-heading small { color: var(--muted); font-size: 8px; display: block; letter-spacing: .06em; font-weight: 670; }
.inspector-heading strong { color: var(--accent-text); font-size: 12px; display: block; overflow-wrap: anywhere; }
.inspector-heading .btn { padding: 0 3px; min-height: 23px; font-size: 10px; }
.inspector-body { padding: 8px; font-size: 11px; }
.inspector-body h3 { font-size: 11px; margin-block: 4px 6px; }
.style-list { margin: 0 0 12px; }
.style-list div { display: flex; gap: 3px; justify-content: space-between; border-bottom: 1px solid var(--border); padding-block: 4px; align-items: center; }
.style-list dd { display: flex; align-items: center; gap: 4px; margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: 10px; }
.style-list dd i { width: 10px; height: 10px; display: block; border: 1px solid var(--border-strong); }
.box-diagram div { margin-top: 4px; border: 1px solid var(--accent-border); background: var(--accent-soft); padding: 4px; border-radius: 3px; font-size: 9px; overflow-wrap: anywhere; }
.box-diagram small, .box-diagram strong { display: block; font-size: 8px; }
.css-rule { padding: 5px 0; border-bottom: 1px solid var(--border); }
.css-rule pre { white-space: pre-wrap; margin-block: 4px; overflow-wrap: anywhere; }
.diagnostic-layout { display: grid; gap: 9px; padding: 9px 10px; grid-template-columns: minmax(0, 1fr) minmax(130px, 24%); }
.diagnostic-summary { display: flex; align-items: center; gap: 9px; padding: 4px 0 7px; }
.diagnostic-summary > span { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; background: var(--good-soft); color: var(--good); border-radius: 50%; }
.diagnostic-summary strong { color: var(--good); font-size: 12px; }
.diagnostic-summary p { font-size: 11px; color: var(--muted); }
.diagnostic-count { align-self: start; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); font-size: 10px; }
.diagnostic-count > strong { font-size: 11px; margin-bottom: 2px; }
.diagnostic-count > div { display: flex; gap: 5px; align-items: center; }
.diagnostic-count b { margin-left: auto; }
.diagnostic-count > div.error .icon, .issue-row.error > .icon, .diagnostic-error, .console-line.error > .icon { color: var(--bad); }
.diagnostic-count > div.warning .icon, .issue-row.warning > .icon, .console-line.warn > .icon { color: var(--warn); }
.diagnostic-count > div.recommendation .icon, .issue-row.recommendation > .icon { color: var(--syntax-attribute); }
.issue-row { min-height: 33px; display: flex; align-items: center; gap: 5px; border-bottom: 1px solid var(--border); }
.issue-message { flex: 1; background: none; border: 0; text-align: left; padding: 4px; min-width: 0; overflow-wrap: anywhere; }
.issue-message strong, .issue-message small { display: block; }
.issue-message strong { font-size: 11px; }
.issue-message small { font-size: 10px; }
.tool-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 5px 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
.tool-controls .btn, .tool-controls select, .tool-controls .filter-search { min-height: 26px; font-size: 10px; }
.tool-controls .btn { padding-inline: 6px; }
.tool-controls .btn .icon { width: 13px; height: 13px; }
.tool-controls .filter-search { flex: initial; }
.tool-controls .filter-search input { font-size: 10px; }
.tool-note { color: var(--muted); font-size: 11px; padding: 8px 10px; }
.console-line { padding: 4px 8px; display: grid; grid-template-columns: 54px 15px minmax(0, 1fr) minmax(0, 20%); align-items: start; gap: 4px; border-bottom: 1px solid var(--border); font: 10.5px var(--editor-font); overflow-wrap: anywhere; }
.console-line time, .console-line small { color: var(--muted); }
.console-line small { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.console-object { display: inline-block; }
.console-object > div { padding-left: 10px; }
.history-row { display: flex; gap: 6px; align-items: center; width: 100%; padding: 5px 8px; border: 0; border-bottom: 1px solid var(--border); font-size: 11px; background: none; text-align: left; }
.history-row small { margin-left: auto; white-space: nowrap; }
.perf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px; }
.perf-grid > div { display: grid; gap: 3px; border: 1px solid var(--border); border-radius: 5px; padding: 6px; }
.perf-grid small { font-size: 10px; }
.perf-grid strong { font-size: 15px; }
.variable-content, .practice-content { padding: 7px 8px; font-size: 11px; }
.variable-content > * + *, .practice-content > * + * { margin-top: 6px; }
.simple-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.simple-table th, .simple-table td { padding: 4px 5px; text-align: left; border-bottom: 1px solid var(--border); }
.simple-table th { color: var(--muted); }
.evaluation-results { border: 1px solid var(--border); background: var(--surface-2); border-radius: 6px; padding: 7px; }
.evaluation-results p { display: flex; gap: 5px; align-items: center; }
.evaluation-results p .icon { color: var(--accent-text); }
.hints { padding-inline-start: 19px; }
.css-lab { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 7px; }
.css-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.css-controls .field { font-size: 10px; gap: 1px; }
.css-controls .field input { min-height: 23px; height: 23px; font-size: 10px; padding: 0 4px; }
.css-sandbox { overflow: hidden; min-height: 47px; max-height: 145px; background: var(--preview-back); border: 1px solid var(--border); border-radius: 6px; padding: 6px; position: relative; }
.css-sample span { padding: 4px; border-radius: 4px; background: #ffffff99; color: #211711; white-space: nowrap; }
.css-result { display: grid; gap: 5px; align-content: start; font-size: 11px; }
.css-result h3 { font: 12px var(--editor-font); }
.loading { padding: 22px; color: var(--muted); }

dialog { max-width: calc(100vw - 28px); width: 465px; max-height: min(90vh, 760px); color: var(--fg); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; padding: 0; box-shadow: 0 18px 56px #31201645; }
dialog::backdrop { background: #251e1b68; }
dialog.wide { width: 740px; }
dialog > form { display: flex; flex-direction: column; max-height: min(90vh - 3px, 757px); }
dialog header, dialog footer { display: flex; align-items: center; gap: 8px; padding: 11px 13px; }
dialog header { border-bottom: 1px solid var(--border); justify-content: space-between; }
dialog header h2 { font-size: 17px; }
dialog header p { font-size: 11px; color: var(--muted); }
dialog footer { justify-content: flex-end; border-top: 1px solid var(--border); }
.dialog-body { min-height: 0; overflow: auto; padding: 13px; display: grid; gap: 9px; }
.dialog-body > p { font-size: 12px; }
.dialog-body details { border: 1px solid var(--border); border-radius: 5px; padding: 7px; font-size: 12px; }
.dialog-body details p { padding-top: 5px; }
.menu-stack { display: grid; gap: 3px; }
.menu-stack .btn { justify-content: flex-start; }
dialog.search-dialog { width: 650px; max-height: 68vh; margin-top: clamp(34px, 12vh, 120px); }
.search-input { padding: 9px 11px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.search-input > .icon { color: var(--accent-text); }
.search-input input { flex: 1; border: 0; padding: 5px; background: transparent; outline: none; min-width: 0; }
.search-results { padding: 5px; max-height: 55vh; overflow: auto; }
.search-results > p { padding: 7px; }
.search-results button { background: transparent; width: 100%; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 6px; text-align: left; padding: 8px; }
.search-results button:hover, .search-results button:focus-visible { background: var(--accent-soft); }
.search-results button span { flex: 1; }
.search-results button small { font-size: 10px; }
.toasts { position: fixed; right: 12px; bottom: 39px; z-index: 20; display: grid; gap: 5px; max-width: min(390px, 94vw); }
.toast { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 7px; box-shadow: 0 6px 18px #21171124; font-size: 12px; }
.toast.error > .icon { color: var(--bad); }
.toast.success > .icon { color: var(--good); }
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 1250px) {
  .app-shell { grid-template-columns: 195px minmax(0, 1fr); }
  .lab-grid { grid-template-columns: minmax(124px, 15fr) minmax(0, var(--editor-share, 53fr)) 5px minmax(0, var(--preview-share, 47fr)) minmax(135px, 15fr); }
  .lab-toolbar { gap: 4px; }
  .lab-run, .lab-view-actions { gap: 1px; }
  .preview-heading small { display: none; }
}
@media (max-width: 1050px) {
  .app-shell:has(.main-lab) { grid-template-columns: 60px minmax(0, 1fr); }
  .app-shell:has(.main-lab) .sidebar-top { padding-inline: 13px; }
  .app-shell:has(.main-lab) .sidebar-top > span, .app-shell:has(.main-lab) .nav-item > span, .app-shell:has(.main-lab) .sidebar-foot > span:nth-child(2) { display: none; }
  .app-shell:has(.main-lab) .sidebar nav { padding-inline: 8px; }
  .app-shell:has(.main-lab) .nav-item { justify-content: center; padding: 0; }
  .row-date { display: none; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 56px minmax(0, 1fr); }
  .sidebar-top { padding-inline: 12px; }
  .sidebar-top > span, .nav-item > span, .sidebar-foot > span:nth-child(2), .top-label, .top-divider, .local-indicator span { display: none; }
  .sidebar nav { padding-inline: 7px; }
  .nav-item { justify-content: center; padding: 0; }
  .topbar { gap: 7px; padding-inline: 9px; }
  .lab-toolbar { flex-wrap: wrap; }
  .breadcrumb { min-width: 210px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .record-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-art { opacity: .48; }
  .lab-inspector { grid-area: 2 / 4 / 3 / 6; }
  .lab-tools { grid-area: 2 / 1 / 3 / 4; }
  .lab-grid, .workbench.without-inspector .lab-grid { grid-template-columns: minmax(106px, 14fr) minmax(0, var(--editor-share, 53fr)) 4px minmax(0, var(--preview-share, 47fr)) 0; }
  .workbench.without-files .lab-grid, .workbench.focus-mode .lab-grid { grid-template-columns: 0 minmax(0, var(--editor-share, 53fr)) 4px minmax(0, var(--preview-share, 47fr)) 0; }
  .workbench.without-inspector .lab-tools, .workbench.focus-mode .lab-tools { grid-column: 1 / 5; }
}
@media (max-width: 550px) {
  .topbar { overflow: hidden; }
  .wordmark { font-size: 15px; gap: 5px; }
  .mark { width: 27px; height: 27px; }
  .global-search { min-width: 80px; }
  .global-search kbd, .local-indicator, .sidebar-foot, #status-details span:nth-child(n+4) { display: none; }
  .page-wrap { padding: 18px 13px; }
  .page-header { display: grid; }
  .welcome { min-height: 0; padding: 15px; }
  .hero-art { display: none; }
  .settings-grid { display: block; }
  .workbench { overflow: auto; }
  .lab-grid, .workbench.without-files .lab-grid, .workbench.without-inspector .lab-grid, .workbench.focus-mode .lab-grid { display: flex; flex-direction: column; min-height: 740px; }
  .lab-files { min-height: 110px; }
  .lab-editor, .lab-preview { flex: 1; min-height: 205px; }
  .lab-inspector:has(.inspector-empty), .splitter { display: none; }
  .lab-tools { min-height: 160px; }
}
