:root {
  color-scheme: light;
  --surface: oklch(0.976 0.008 82);
  --paper: oklch(0.992 0.004 82);
  --rail: oklch(0.952 0.010 80);
  --line: oklch(0.875 0.012 78);
  --control-border: oklch(0.62 0.016 74);
  --ink: oklch(0.195 0.015 65);
  --secondary: oklch(0.41 0.014 72);
  --muted: oklch(0.45 0.014 75);
  --accent: oklch(0.485 0.172 32);
  --accent-fg: oklch(0.995 0.004 82);
  --green: oklch(0.45 0.095 155);
  --gold: oklch(0.54 0.115 68);
  --blue: oklch(0.48 0.079 225);
  --violet: oklch(0.46 0.073 324);
  --teal: oklch(0.49 0.08 202);
  --rose: oklch(0.50 0.13 354);
  --specular: oklch(0.985 0.006 220);
  --signal: oklch(0.67 0.153 153);
  --danger: oklch(0.51 0.179 29);
  --wash: color-mix(in oklch, var(--accent) 8%, var(--paper));
  --grid: color-mix(in oklch, var(--line) 57%, transparent);
  --shadow: oklch(0.22 0.03 67 / 0.12);
  --display: "Newsreader", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: oklch(0.142 0.008 250);
  --paper: oklch(0.182 0.010 250);
  --rail: oklch(0.122 0.008 250);
  --line: oklch(0.265 0.012 250);
  --control-border: oklch(0.46 0.016 248);
  --ink: oklch(0.945 0.008 85);
  --secondary: oklch(0.74 0.012 245);
  --muted: oklch(0.68 0.012 245);
  --accent: oklch(0.76 0.145 72);
  --accent-fg: oklch(0.15 0.024 72);
  --green: oklch(0.72 0.14 162);
  --gold: oklch(0.79 0.123 88);
  --blue: oklch(0.76 0.10 225);
  --violet: oklch(0.77 0.085 324);
  --teal: oklch(0.77 0.09 202);
  --rose: oklch(0.74 0.12 354);
  --danger: oklch(0.76 0.145 30);
  --shadow: oklch(0.04 0.006 250 / 0.55);
}
*, *::before, *::after { box-sizing: border-box; }
* { min-width: 0; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: var(--surface); color: var(--ink); font: 500 14px/1.55 var(--sans); font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; font-variant-numeric: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.6; }
input, textarea, select { accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; text-wrap: balance; font-weight: 500; }
h1 { font: 500 clamp(2.65rem, 5.4cqi, 4.7rem)/1.25 var(--display); letter-spacing: -0.049em; }
h2 { font-size: 1.02rem; font-weight: 750; letter-spacing: -0.025em; }
h3 { font: 500 1.56rem/1.25 var(--display); letter-spacing: -0.02em; }
h4 { font-size: 0.86rem; font-weight: 750; }
p, dl, dd, ul { margin: 0; }
p { text-wrap: pretty; overflow-wrap: anywhere; }
a { color: var(--accent); }
.technical, .eyebrow, kbd, pre, code { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.technical { color: var(--secondary); font-size: 0.73rem; overflow-wrap: anywhere; }
.eyebrow { letter-spacing: 0.15em; font-size: 0.66rem; font-weight: 600; color: var(--secondary); }
.icon { display: block; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px; background: var(--paper); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.clipboard-snapshot { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.masthead { height: 68px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.masthead-start, .masthead-end { display: flex; align-items: center; gap: 12px; }
.wordmark { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 11px; padding: 0; min-height: 40px; color: var(--ink); }
.wordmark span { font: 600 2rem/1.25 var(--display); letter-spacing: -0.055em; margin-block-start: 3px; }
.wordmark small { font: 600 0.62rem/1.25 var(--mono); color: var(--secondary); letter-spacing: 0.15em; padding-left: 11px; border-left: 1px solid var(--line); }
.brand-mark { color: var(--accent); }
.header-divider { height: 24px; border-left: 1px solid var(--line); }
.button, .icon-button, .chip, .nav-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; border: 1px solid var(--line); background: var(--paper); border-radius: 4px; padding: 0 12px; font-size: 0.77rem; line-height: 1.3; font-weight: 750; text-align: center; }
.button:active, .icon-button:active, .chip:active { transform: translateY(1px); }
@media (hover: hover) {
  .button:hover, .icon-button:hover, .chip:hover { border-color: var(--muted); }
  .nav-button:hover, .index-row:hover, .result-button:hover { background: var(--surface); }
}
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.button.primary:hover { filter: brightness(0.92); }
.icon-button { width: 38px; padding: 0; flex: 0 0 38px; }
.theme-button, .mobile-menu { border-color: transparent; }
.command-button { min-width: 198px; justify-content: flex-start; color: var(--secondary); background: var(--surface); }
.command-button kbd { margin-left: auto; font-size: 0.65rem; color: var(--secondary); padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; white-space: nowrap; }
.drawer-shade, .mobile-menu { display: none; }

.studio { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100dvh - 68px); }
.rail { display: flex; flex-direction: column; padding: 34px 15px 20px; background: var(--rail); border-right: 1px solid var(--line); }
.rail-label { padding-left: 13px; margin-bottom: 14px; }
#navigation { display: grid; gap: 4px; }
.nav-button { width: 100%; justify-content: flex-start; text-align: start; min-height: 44px; gap: 10px; background: transparent; border-color: transparent; color: var(--secondary); }
.nav-button[aria-current="page"] { color: var(--accent); border-color: color-mix(in oklch, var(--accent) 23%, var(--line)); background: var(--wash); }
.nav-button[aria-current="page"]::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-left: auto; flex-shrink: 0; }
.rail-footer { position: sticky; top: calc(100dvh - 88px); margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--line); }
.connection { display: flex; align-items: center; gap: 8px; font-size: 0.74rem; font-weight: 750; }
.signal { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--muted); }
.signal[data-mode="static"], .signal[data-mode="live"] { background: var(--signal); box-shadow: 0 0 0 3px color-mix(in oklch, var(--signal) 18%, transparent); }
.rail-meta { display: flex; justify-content: space-between; gap: 5px; margin-top: 8px; color: var(--secondary); font: 400 0.64rem/1.4 var(--mono); }
main { container-type: inline-size; padding: 29px clamp(20px, 3vw, 48px) 38px; }
.bench { max-width: 1550px; margin-inline: auto; }
.bench-heading { display: flex; justify-content: space-between; align-items: end; gap: 22px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.path-label { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.path-label span:empty { width: 15px; height: 1px; background: currentColor; }
.subtitle { color: var(--secondary); font-size: 0.87rem; line-height: 1.55; max-width: 60ch; }
.atlas-stats { display: flex; gap: 0; align-self: end; padding-bottom: 3px; }
.atlas-stats > div { display: grid; min-width: 82px; padding: 0 14px; border-left: 1px solid var(--line); }
.atlas-stats > div:last-child { padding-right: 0; }
.atlas-stats dt { grid-row: 2; white-space: nowrap; font: 400 0.65rem/1.4 var(--mono); color: var(--secondary); }
.atlas-stats dd { font: 500 1.6rem/1.25 var(--mono); letter-spacing: -0.08em; }
.bench-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; margin: 15px 0; gap: 12px; }
.filter-strip, .row, .actions, .badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-strip { gap: 7px; }
.chip { background: transparent; min-height: 36px; white-space: normal; font-size: 0.71rem; color: var(--secondary); padding-inline: 10px; }
.chip[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in oklch, var(--accent) 35%, var(--line)); background: var(--wash); }
.filter-select { width: auto; max-width: 150px; }
.atlas-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(273px, 1fr); gap: 16px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.panel-heading { min-height: 53px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; gap: 8px; align-items: center; }
.panel-title .icon { color: var(--accent); }
.panel-body { padding: 17px; }
.graph-panel { position: relative; }
.graph-panel::before, .graph-panel::after { position: absolute; z-index: 1; content: ""; width: 8px; height: 8px; pointer-events: none; border-color: var(--accent); border-style: solid; }
.graph-panel::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; border-top-left-radius: 4px; }
.graph-panel::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; border-bottom-right-radius: 4px; }
.graph-stage { position: relative; height: clamp(400px, calc(100dvh - 464px), 590px); background-color: var(--rail); background-image: radial-gradient(circle, var(--grid) 1px, transparent 1.2px); background-size: 18px 18px; }
#lineage { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline-offset: -3px; }
#lineage[data-dragging="true"] { cursor: grabbing; }
#lineage[data-hover="true"] { cursor: pointer; }
.graph-tools { position: absolute; top: 12px; right: 12px; display: grid; gap: 4px; }
.graph-tools .icon-button { width: 36px; height: 36px; min-height: 36px; box-shadow: 0 2px 4px var(--shadow); }
.graph-readout { position: absolute; left: 12px; bottom: 12px; max-width: min(280px, calc(100% - 152px)); display: grid; gap: 4px; padding: 9px 11px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 3px 12px var(--shadow); }
.graph-readout strong { font: 500 1.02rem/1.25 var(--display); overflow-wrap: anywhere; }
.graph-readout .button { justify-self: start; }
.graph-footer { min-height: 48px; padding: 7px 14px; display: flex; justify-content: space-between; align-items: center; gap: 9px; border-top: 1px solid var(--line); }
#zoom-level { white-space: nowrap; flex-shrink: 0; }
.edge-key { display: flex; gap: 7px 14px; flex-wrap: wrap; padding: 0; list-style: none; color: var(--secondary); font-size: 0.65rem; }
.edge-key li, .pack-key li { display: flex; align-items: center; gap: 6px; }
.edge-mark { display: inline-block; width: 15px; border-top: 2px solid var(--accent); flex-shrink: 0; }
.edge-mark.contradicts { border-top: 2px dashed var(--gold); }
.edge-mark.relates { border-top: 1.5px solid var(--blue); }
.edge-mark.verified { width: 10px; height: 10px; border: 3px double var(--green); border-radius: 50%; }
.pack-body { display: grid; gap: 15px; padding: 15px; }
.field { display: grid; gap: 6px; align-content: start; color: var(--secondary); font-size: 0.76rem; font-weight: 750; }
input:not([type="checkbox"], [type="range"]), select, textarea { min-height: 38px; width: 100%; padding: 7px 9px; border: 1px solid var(--control-border); border-radius: 4px; background: var(--surface); color: var(--ink); font-weight: 500; }
select.filter-select { width: auto; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; }
input[type="range"] { width: 100%; min-height: 36px; margin: 0; cursor: pointer; }
input[type="checkbox"] { margin: 0; width: 17px; height: 17px; flex: 0 0 17px; }
.budget-control { display: grid; grid-template-columns: 1fr auto; column-gap: 6px; font-size: 0.76rem; font-weight: 750; color: var(--secondary); }
.budget-control output { color: var(--accent); font-weight: 600; }
.budget-control input, .range-ends { grid-column: 1 / -1; }
.range-ends { display: flex; justify-content: space-between; margin-top: -2px; font-size: 0.62rem; }
.pack-run { width: 100%; min-height: 41px; }
.pack-result { display: grid; gap: 9px; }
.pack-result:empty { display: none; }
.pack-totals { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 0.73rem; }
.pack-totals strong { color: var(--ink); font: 600 0.86rem/1.25 var(--mono); }
.meter { display: block; width: 100%; height: 9px; overflow: hidden; border-radius: 4px; }
.meter-track { fill: color-mix(in oklch, var(--line) 73%, var(--surface)); }
.meter-profile { fill: var(--violet); }
.meter-preferences { fill: var(--blue); }
.meter-gotchas { fill: var(--accent); }
.meter-decisions { fill: var(--green); }
.meter-lease { fill: var(--gold); }
.pack-key { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; padding: 0; gap: 5px; color: var(--secondary); font-size: 0.63rem; }
.swatch { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; background: var(--green); }
.swatch.meter-profile { background: var(--violet); }
.swatch.meter-preferences { background: var(--blue); }
.swatch.meter-gotchas { background: var(--accent); }
.preview { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 310px; overflow: auto; background: var(--rail); border-radius: 4px; padding: 11px; color: var(--secondary); font-size: 0.73rem; line-height: 1.58; }
.pack-result .preview { max-height: 169px; font-size: 0.67rem; }
.pack-result .button { justify-self: start; }
.empty, .notice { color: var(--secondary); font-size: 0.81rem; }
.notice, .privacy-banner { padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.privacy-banner { color: var(--accent); background: var(--wash); font-weight: 750; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.index-split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.timeline-split { grid-template-columns: minmax(0, 0.66fr) minmax(0, 1.34fr); }
.stack { display: grid; gap: 13px; align-content: start; }
.stack > header { display: grid; gap: 3px; }
.bench-section { margin-top: 16px; }
.form-grid, .filter-grid, .card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }
.index-list { display: grid; }
.index-row { display: grid; text-align: start; gap: 4px; width: 100%; padding: 12px 16px; min-height: 56px; background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.index-row:last-child { border-bottom: 0; }
.index-row[aria-pressed="true"] { box-shadow: inset 2px 0 var(--accent); background: var(--wash); }
.index-row strong { font: 550 1.13rem/1.25 var(--display); overflow-wrap: anywhere; }
.index-list > .empty { padding: 14px 16px; }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; background: var(--rail); padding: 3px 6px; color: var(--secondary); font-size: 0.67rem; font-weight: 750; overflow-wrap: anywhere; }
.badge.accent { color: var(--accent); background: var(--wash); }
.badge.good { color: var(--green); }
.lined > * + * { border-top: 1px solid var(--line); padding-top: 11px; }
.check, .switch { min-height: 36px; display: flex; gap: 9px; align-items: center; color: var(--secondary); font-size: 0.78rem; font-weight: 750; }
.switch input { appearance: none; width: 33px; height: 19px; flex: 0 0 33px; background: var(--line); border: 1px solid var(--muted); border-radius: 12px; position: relative; cursor: pointer; }
.switch input::after { content: ""; position: absolute; width: 11px; height: 11px; top: 3px; left: 3px; border-radius: 50%; background: var(--secondary); transition: transform 140ms var(--ease-out); }
.switch input:checked { border-color: var(--green); background: var(--green); }
.switch input:checked::after { transform: translateX(14px); background: var(--paper); }
.profile-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.profile-row h4 { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.profile-row p { color: var(--secondary); font-size: 0.76rem; }
.profile-row .switch { justify-self: end; }
.field-editor { display: grid; gap: 8px; padding-top: 6px; }
.three-way { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.three-way > section { border-top: 2px solid var(--line); padding-top: 6px; display: grid; gap: 6px; align-content: start; }
.three-way > section:last-child { border-color: var(--accent); }
.diff-add { background: color-mix(in oklch, var(--green) 13%, var(--rail)); }
.diff-remove { background: color-mix(in oklch, var(--danger) 12%, var(--rail)); }
.danger-button { color: var(--danger); border-color: var(--danger); background: var(--wash); box-shadow: inset 0 -2px 0 color-mix(in oklch, var(--danger) 22%, transparent); letter-spacing: 0.06em; font-family: var(--mono); }
.lease-table { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
.lease-table th, .lease-table td { padding: 5px; overflow-wrap: anywhere; text-align: start; vertical-align: middle; border-bottom: 1px solid var(--line); }
.lease-table .button { white-space: nowrap; flex-shrink: 0; }
.lease-table th { font-size: 0.65rem; }
.lease-table .meter { margin-top: 4px; }
.turn-stream { padding-left: 18px; border-left: 1px solid var(--line); margin-left: 4px; }
.turn { position: relative; }
.turn::before { content: ""; position: absolute; left: -22px; top: 12px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.score-line { display: flex; align-items: baseline; gap: 10px; }
.score-line strong { color: var(--green); font: 500 2.5rem/1.25 var(--mono); letter-spacing: -0.07em; }
.score-line strong.score-good { color: var(--green); }
.score-line strong.score-warn { color: var(--gold); }
.score-line strong.score-bad { color: var(--danger); }
.report-list { padding-left: 0; list-style: none; }
.report-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.report-text { flex: 1 1 220px; font-size: 0.78rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.studio-dialog { width: min(650px, calc(100% - 30px)); max-height: calc(100dvh - 34px); overflow: auto; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 15px 45px var(--shadow); padding: 0; }
.studio-dialog::backdrop { background: oklch(0.20 0.017 65 / 0.57); }
.studio-dialog[open] { animation: dialog-show 160ms var(--ease-out) both; }
@keyframes dialog-show { from { opacity: 0; transform: translateY(5px); } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font: 550 1.65rem/1.25 var(--display); }
#dialog-content { padding: 16px; }
.form-error { color: var(--danger); font-size: 0.77rem; overflow-wrap: anywhere; }
.result-button { background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 7px; text-align: start; width: 100%; min-height: 38px; padding: 6px 4px; }
.result-button:focus-visible { background: var(--wash); }
.toast { position: fixed; z-index: 10; right: 16px; bottom: 16px; max-width: min(380px, calc(100% - 32px)); padding: 10px 15px; background: var(--ink); color: var(--paper); border-radius: 4px; box-shadow: 0 3px 12px var(--shadow); font-size: 0.8rem; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .studio { grid-template-columns: 220px minmax(0, 1fr); }
  .rail { padding-inline: 10px; }
  .atlas-layout { grid-template-columns: minmax(0, 1.65fr) minmax(265px, 1fr); }
  .atlas-stats > div { min-width: 67px; padding-inline: 9px; }
}
@media (max-width: 899px) {
  .masthead { height: 60px; padding-inline: 17px; }
  .studio { display: block; min-height: calc(100dvh - 60px); }
  .mobile-menu { display: inline-flex; }
  .rail { display: none; position: fixed; top: 60px; bottom: 0; left: 0; z-index: 5; width: min(270px, calc(100% - 56px)); box-shadow: 4px 0 22px var(--shadow); }
  .rail[data-open="true"] { display: flex; }
  .drawer-shade { display: block; position: fixed; inset: 60px 0 0; width: 100%; z-index: 4; border: 0; background: oklch(0.20 0.017 65 / 0.45); }
  .rail-footer { position: static; }
  main { padding-top: 23px; }
  #lineage { touch-action: none; }
  .button, .icon-button, .chip { min-height: 44px; }
  .icon-button { width: 44px; flex: 0 0 44px; }
}
@media (max-width: 680px) {
  .atlas-layout, .split, .index-split, .timeline-split { grid-template-columns: minmax(0, 1fr); }
  .bench-heading { display: grid; gap: 13px; padding-bottom: 15px; }
  .atlas-stats { justify-self: start; }
  .atlas-stats > div:first-child { border-left: 0; padding-left: 0; }
  .graph-stage { height: 350px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 430px) {
  .masthead { padding-inline: 9px; gap: 6px; }
  .masthead-start, .masthead-end { gap: 5px; }
  .wordmark { gap: 6px; }
  .wordmark small { display: none; }
  .command-button { min-width: 36px; padding-inline: 7px; }
  .command-button kbd, .header-divider { display: none; }
  main { padding-inline: 13px; }
  .bench-toolbar { gap: 7px; }
  .graph-stage { height: 325px; }
  .graph-readout { max-width: calc(100% - 129px); }
  .graph-tools { top: 7px; right: 7px; }
  .panel-heading { padding-inline: 12px; }
  .panel-body { padding: 12px; }
  .three-way { grid-template-columns: minmax(0, 1fr); }
  .lease-table .button { padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .button:active, .icon-button:active, .chip:active { transform: none; }
}

main { position: relative; }
#boot-loader { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: var(--surface); color: var(--secondary); padding: 32px; transition: opacity 160ms ease; }
#boot-loader.hidden { opacity: 0; visibility: hidden; transition: opacity 160ms ease, visibility 0s 160ms; }
.rail-head, .toolbar-actions, .lang-pill { display: flex; align-items: center; gap: 8px; }
.rail-head { justify-content: space-between; margin-block-end: 12px; }
.rail-label { margin: 0; }
#rail-toggle { width: 30px; min-height: 30px; flex-basis: 30px; background: transparent; }
.lang-pill { position: relative; display: inline-grid; grid-template-columns: auto 0fr; align-items: center; gap: 0; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); transition: grid-template-columns 220ms cubic-bezier(.22, 1, .36, 1), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease; }
.lang-pill:hover:not([data-picked="true"]), .lang-pill:focus-within:not([data-picked="true"]), .lang-pill[data-open="true"] { grid-template-columns: auto 1fr; border-color: var(--muted); background: var(--paper); box-shadow: 0 2px 10px var(--shadow); }
.lang-tray { overflow: hidden; min-width: 0; }
.lang-tray-inner { display: inline-flex; align-items: center; gap: 2px; padding-inline-start: 2px; opacity: 0; visibility: hidden; transform: translateX(-6px); pointer-events: none; transition: opacity 160ms ease, transform 220ms cubic-bezier(.22, 1, .36, 1), visibility 0s 180ms; }
.lang-pill:hover:not([data-picked="true"]) .lang-tray-inner, .lang-pill:focus-within:not([data-picked="true"]) .lang-tray-inner, .lang-pill[data-open="true"] .lang-tray-inner { opacity: 1; visibility: visible; transform: translateX(0); pointer-events: auto; transition: opacity 160ms ease, transform 220ms cubic-bezier(.22, 1, .36, 1), visibility 0s; }
.lang-pill button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 0; border-radius: 999px; min-width: 32px; min-height: 28px; padding: 0 9px; font: 650 .7rem/1 var(--mono); letter-spacing: 0.04em; color: var(--secondary); background: transparent; cursor: pointer; white-space: nowrap; transition: background 160ms ease, color 160ms ease; }
.lang-pill [aria-pressed="true"] { color: var(--ink); background: var(--rail); }
@media (hover: hover) {
  .lang-pill [aria-pressed="false"]:hover { color: var(--ink); background: var(--surface); }
}
.toolbar-actions { flex-wrap: wrap; }
#graph-search { width: 142px; min-height: 36px; }
.graph-stage { background-image: radial-gradient(ellipse at 46% 45%, var(--paper), transparent 78%), radial-gradient(circle, var(--grid) 1px, transparent 1px); background-size: auto, 22px 22px; }
.graph-popover { position: absolute; z-index: 3; top: 10px; right: 54px; width: min(266px, calc(100% - 66px)); max-height: calc(100% - 20px); overflow: auto; overscroll-behavior: contain; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); box-shadow: 0 8px 24px var(--shadow); display: grid; gap: 6px; }
.graph-popover h3 { font: 650 .93rem var(--sans); }
.graph-popover .field { display: grid; grid-template-columns: 1fr auto; gap: 2px; }
.graph-popover .field :is(input,select) { grid-column: 1 / -1; width: 100%; }
.graph-popover input[type=range], .graph-popover .check { min-height: 24px; }
.graph-popover .actions .button { min-height: 30px; }
.graph-popover output { grid-column: 2; grid-row: 1; font-family: var(--mono); color: var(--accent); }
.graph-tools, .graph-readout { z-index: 1; }
.graph-tools .icon-button { border-radius: 7px; }
.settings-layout { align-items: start; }
.source-card { display: grid; gap: 5px; padding-block: 12px; border-top: 1px solid var(--line); }
.source-card:first-child { border-top: none; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.danger-zone .panel-heading { color: var(--danger); }
.settings-layout .field select { width: 100%; }
:root[data-reduced-motion="true"] *, :root[data-reduced-motion="true"] *::before { animation-duration: 0s !important; transition-duration: 0s !important; }
@media (min-width: 900px) {
  .studio { transition: grid-template-columns 160ms var(--ease-out); }
  .studio[data-collapsed="true"] { grid-template-columns: 64px minmax(0, 1fr); }
  .rail[data-collapsed="true"] { padding-inline: 7px; }
  .rail[data-collapsed="true"] :is(.rail-label,.nav-label,.rail-meta,#mode-label) { display: none; }
  .rail[data-collapsed="true"] :is(.rail-head,.connection,.nav-button) { justify-content: center; }
  .rail[data-collapsed="true"] .nav-button { position: relative; padding: 0; }
  .rail[data-collapsed="true"] .nav-button[aria-current="page"]::after { position: absolute; right: 5px; width: 4px; height: 4px; }
  .rail[data-collapsed="true"] #rail-toggle svg { transform: rotate(180deg); }
}
@media (max-width: 899px) {
  #rail-toggle { display: none; }
  .rail[data-open="true"] { width: 100%; }
  .rail { overflow-y: auto; }
}
@media (max-width: 430px) {
  .masthead { gap: 4px; padding-inline: 8px; }
  .masthead-start,.masthead-end,.wordmark { gap: 3px; }
  .wordmark small { display: none; }
}
@media (prefers-reduced-motion: reduce) { .studio, #boot-loader, .lang-pill, .lang-tray-inner, .lang-pill button { transition: none; } }

@media (max-width: 600px) {
  .command-button { min-width: 38px; width: 38px; justify-content: center; padding: 0; }
  .command-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .command-button kbd { display: none; }
  .lang-pill { flex-shrink: 0; }
}
