/* Right of Way — editor styles.
   The plan is drawn on a modeler's green cutting mat; tables are plywood. */

:root {
  --mat: #2E5E4E;
  --mat-deep: #244B3E;
  --mat-line: rgba(255, 255, 255, 0.07);
  --mat-major: rgba(236, 214, 104, 0.42);
  --ply: #DDBE8E;
  --ply-edge: #7B5B33;
  --ply-ink: #3D2C15;
  --signal: #F5B700;
  --stop: #C7372F;

  --ink: #17241F;
  --ink-soft: #4F5E58;
  --paper: #EEF1EE;
  --panel: #FFFFFF;
  --rule: #D3D9D5;
  --field: #F7F9F7;
  --primary: #2E5E4E;
  --primary-ink: #FFFFFF;
  --focus: #F5B700;

  --font-ui: 'Barlow', system-ui, sans-serif;
  --font-head: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
  --topbar-h: 56px;
  --status-h: 30px;
  --footer-h: 26px;
  --rail-w: 88px;
  --inspector-w: 344px;
  color-scheme: light;
}

/* Theme (Settings): the device's choice unless data-theme on <html> says light, dark, print or aero (Frutiger Aero: see the end of this file). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="print"]):not([data-theme="aero"]):not([data-theme="steampunk"]):not([data-theme="unix"]):not([data-theme="okc"]):not([data-theme="recroom"]):not([data-theme="seventies"]):not([data-theme="hifi"]):not([data-theme="kpop"]):not([data-theme="winter"]):not([data-theme="holiday"]):not([data-theme="deco"]):not([data-theme="catalog"]) {
    --ink: #E4EAE6;
    --ink-soft: #A2B0AA;
    --paper: #131B18;
    --panel: #1B2521;
    --rule: #2F3C37;
    --field: #222E29;
    --primary: #4E8F78;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #E4EAE6;
  --ink-soft: #A2B0AA;
  --paper: #131B18;
  --panel: #1B2521;
  --rule: #2F3C37;
  --field: #222E29;
  --primary: #4E8F78;
  color-scheme: dark;
}
/* High contrast: black on white, the plan drawn the way it prints. */
:root[data-theme="print"] {
  --mat: #FFFFFF;
  --mat-deep: #1A1A1A;
  --mat-line: rgba(0, 0, 0, 0.14);
  --mat-major: rgba(0, 0, 0, 0.45);
  --ink: #000000;
  --ink-soft: #262626;
  --paper: #FFFFFF;
  --panel: #FFFFFF;
  --rule: #000000;
  --field: #FFFFFF;
  --primary: #000000;
  --primary-ink: #FFFFFF;
  --focus: #0047AB;
  color-scheme: light;
}
:root[data-theme="print"] .lib-add { background: #1A1A1A; }
:root[data-theme="print"] .plan-wrap { box-shadow: inset 0 0 0 1px #000; }

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr var(--status-h) var(--footer-h);
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 var(--font-ui);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---- Top bar ----------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font: 700 19px/1 var(--font-head);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.wordmark .wordmark-mark { width: 36px; height: 36px; flex-shrink: 0; display: block; }
.wordmark a { color: inherit; text-decoration: none; }
.wordmark-home { display: block; border-radius: 9px; }
.wordmark-name { color: var(--ink); }
a.wordmark-by:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.wordmark-text { display: grid; gap: 1px; }
.wordmark-name { font: 700 18px/1.05 var(--font-head); }
.wordmark-sub { font-weight: 500; color: var(--ink-soft); }
.wordmark-by { font: 500 12px/1.1 var(--font-ui); color: var(--ink-soft); letter-spacing: 0.01em; }

.doc-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1;
  padding-left: 18px;
  border-left: 1px solid var(--rule);
}

.layout-name {
  min-width: 0;
  width: min(32ch, 100%);
  padding: 4px 6px;
  margin-left: -6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font: 600 17px/1.2 var(--font-head);
  text-overflow: ellipsis;
}
.layout-name:hover { border-color: var(--rule); }
.layout-name:focus { border-color: var(--primary); background: var(--field); outline: none; }

.save-state { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.save-state[data-state="dirty"]:not(:empty)::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--signal);
  vertical-align: 1px;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.compact-field { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.compact-field select {
  padding: 6px 8px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  font-weight: 500;
}

.segmented {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--field);
}
.segmented button {
  padding: 4px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.segmented button[aria-checked="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); }

.btn {
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--panel);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-soft); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--mat-deep); border-color: var(--mat-deep); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-account.is-avatar {
  width: 34px; height: 34px;
  flex: 0 0 34px;          /* never squashed into an ellipse when the row is tight */
  padding: 0;
  border-radius: 50%;
  background: var(--ply);
  border-color: var(--ply-edge);
  color: var(--ply-ink);
  font: 700 15px/1 var(--font-head);
  overflow: hidden;
}
.btn-account.is-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.btn-link {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-danger { color: var(--stop); }

/* ---- Workspace --------------------------------------------------------- */

.workspace {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr var(--inspector-w);
  min-height: 0;
}

.toolrail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  background: var(--panel);
  border-right: 1px solid var(--rule);
  overflow-y: auto;
  /* A tab with many tools (Scenery) can be taller than the window: it still scrolls, but without a
     scrollbar eating into the buttons' width, so the rail looks the same on every tab. */
  scrollbar-width: none;
}
.toolrail::-webkit-scrollbar { display: none; }

.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.tool svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover:not(:disabled) { background: var(--field); }
.tool[data-action="add"] svg rect { fill: var(--ply); stroke: var(--ply-edge); }
.tool[data-action="add"] svg path { stroke: var(--ply-ink); }
.tool:disabled { color: var(--ink-soft); opacity: 0.45; cursor: default; }
.tool-sep { height: 1px; margin: 6px 8px; background: var(--rule); }

.canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--mat);
  overflow: hidden;
}

.plan {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}
.plan.can-pan, .plan.is-panning { cursor: grab; }
.plan.is-panning { cursor: grabbing; }

.grid-minor { stroke: var(--mat-line); stroke-width: 1; fill: none; shape-rendering: crispEdges; }
.grid-major { stroke: var(--mat-major); stroke-width: 1; fill: none; shape-rendering: crispEdges; }
.grid-origin { stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.5; }

.room { fill: rgba(255, 255, 255, 0.04); stroke: #F2F4F1; stroke-width: 4; stroke-dasharray: none; }
.room-label { fill: #F2F4F1; font: 600 13px var(--font-head); letter-spacing: 0.02em; }

.table { cursor: move; }
.table-top { fill: var(--ply); stroke: var(--ply-edge); stroke-width: 1.5; }
.water-island { stroke-dasharray: none; }
.table-fascia { fill: none; stroke-width: 4; stroke-linecap: butt; }
.fascia-run { grid-template-columns: 70px 1fr 1fr; align-items: end; margin-top: 6px; }
.fascia-run-name { font-size: 13px; font-weight: 600; padding-bottom: 8px; }
.fascia-run-name small { font-weight: 400; color: var(--ink-soft); }
.fascia-run .btn-link { grid-column: 2 / -1; justify-self: start; font-size: 12.5px; }
.fascia-sides button[aria-checked="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); }
.table-joists { stroke: rgba(123, 91, 51, 0.28); stroke-width: 1; fill: none; }
.table-dims, .table-label {
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  fill: var(--ply-ink);
}
.table-dims { font: 600 13px var(--font-head); }
.table-label { font: 500 12px var(--font-ui); opacity: 0.75; }
.table.is-selected .table-top { stroke: var(--signal); stroke-width: 3; }
.table.is-overlapping .table-top { stroke: var(--stop); stroke-width: 3; stroke-dasharray: 8 5; }
.table.is-overlapping.is-selected .table-top { stroke-dasharray: none; }

.handle { fill: #FFFFFF; stroke: var(--ink); stroke-width: 1.5; }
.handle:hover { fill: var(--signal); }
.snap-guide { stroke: var(--signal); stroke-width: 1.5; stroke-dasharray: 6 4; }

.empty-state {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(380px, calc(100% - 32px));
  padding: 24px 26px;
  border-radius: 10px;
  background: rgba(20, 42, 34, 0.82);
  color: #EEF1EE;
  text-align: center;
  backdrop-filter: blur(3px);
}
.empty-state[hidden] { display: none; }
.empty-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #C9D6D0;
  cursor: pointer;
}
.empty-close:hover { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }
.empty-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.empty-state p { margin: 0 0 16px; color: #C9D6D0; }
.empty-state .empty-title { margin-bottom: 6px; color: #FFFFFF; font: 700 22px/1.2 var(--font-head); }
.empty-state .btn-primary { background: var(--ply); border-color: var(--ply); color: var(--ply-ink); font-weight: 600; }
.empty-state .btn-primary:hover { background: #E8CDA3; }

.zoom-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  background: rgba(20, 42, 34, 0.82);
  color: #EEF1EE;
  font-size: 13px;
}
.zoom-controls button {
  width: 34px; height: 32px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}
.zoom-controls output { min-width: 46px; text-align: center; }
.zoom-controls .grid-info { min-width: 0; padding: 0 10px 0 8px; border-left: 1px solid rgba(255, 255, 255, 0.25); font-size: 12px; color: rgba(238, 241, 238, 0.85); white-space: nowrap; }
.zoom-controls .grid-info:empty { display: none; }

/* ---- Inspector --------------------------------------------------------- */

.inspector {
  background: var(--panel);
  border-left: 1px solid var(--rule);
  overflow-y: auto;
  overflow-x: hidden;
  /* Keep room for the scrollbar whether or not there is one, so the panel doesn't get narrower on long tabs,
     and keep the bar itself slim and quiet so a long tab doesn't look different from a short one. */
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #C9D1CC transparent;
}
.inspector::-webkit-scrollbar { width: 8px; }
.inspector::-webkit-scrollbar-track { background: transparent; }
.inspector::-webkit-scrollbar-thumb { background: #C9D1CC; border-radius: 4px; border: 2px solid var(--panel); }
.inspector::-webkit-scrollbar-thumb:hover { background: #A9B3AD; }

.panel { padding: 16px 18px 18px; border-bottom: 1px solid var(--rule); }
.panel-quiet { color: var(--ink-soft); }
.panel-title { margin: 0 0 12px; font: 700 17px/1.2 var(--font-head); display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
/* "Help" beside a panel title opens the tab's notes in a popup instead of taking up the panel. */
.help-link { border: 0; background: none; padding: 0; color: var(--primary); font: 500 13px var(--font-body, inherit); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.help-link:hover { color: var(--ink); }
.help-body p { margin: 0 0 10px; line-height: 1.5; color: var(--ink); }
.help-body p:last-child { margin-bottom: 0; }
.panel-note { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); }
.panel-warning {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-left: 3px solid var(--stop);
  background: rgba(199, 55, 47, 0.08);
  font-size: 13px;
}

.field { display: block; margin-bottom: 10px; }
.field > span { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.field input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--field);
}
.field input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(46, 94, 78, 0.18); }
.field input[aria-invalid="true"] { border-color: var(--stop); box-shadow: 0 0 0 3px rgba(199, 55, 47, 0.15); }

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-inline { position: relative; margin-bottom: 10px; }
.field-inline input { padding-right: 30px; }
.field-inline .unit {
  position: absolute;
  right: 9px;
  bottom: 8px;
  font-style: normal;
  font-size: 12px;
  color: var(--ink-soft);
  pointer-events: none;
}

.field-error { display: block; min-height: 0; margin-top: 4px; color: var(--stop); font-size: 13px; }
.field-error:empty { display: none; }

.facts { margin: 0; display: grid; gap: 6px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }

.shortcuts { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
kbd {
  display: inline-block;
  min-width: 22px;
  margin-right: 4px;
  padding: 1px 5px;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--field);
  color: var(--ink);
  font: 500 12px var(--font-ui);
  text-align: center;
}

/* ---- Status bar -------------------------------------------------------- */

.statusbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 16px;
  background: var(--panel);
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
}
.statusbar .status-hint:first-of-type { margin-left: auto; }
#cursor-pos { min-width: 130px; color: var(--ink); }

/* ---- Dialogs ----------------------------------------------------------- */

.dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 22px 24px 20px;
  border: 0;
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(10, 30, 22, 0.35);
}
.dialog-wide { width: min(560px, calc(100vw - 32px)); }
.dialog { position: relative; }
.dialog > .dialog-x { position: absolute; top: 10px; left: 10px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); cursor: pointer; }
.dialog > .dialog-x:hover { background: var(--field); color: var(--ink); }
.dialog > .dialog-x:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
/* Headings make way for the X. */
.dialog > h2, .dialog > form > h2, .dialog > .dialog-head, .dialog > section:first-of-type > .dialog-head { padding-left: 34px; }
.dialog::backdrop { background: rgba(20, 42, 34, 0.55); }
.dialog h2 { margin: 0 0 6px; font: 700 22px/1.2 var(--font-head); }
.dialog-lede { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.dialog-actions .spacer { flex: 1; }
.btn-settings { display: inline-flex; align-items: center; justify-content: center; padding-inline: 9px; }
.form-error { margin: 4px 0 0; color: var(--stop); font-size: 14px; }
.form-error:empty { display: none; }
.account-line { font-size: 13px; color: var(--ink-soft); }

.layout-list { max-height: min(420px, 60vh); overflow-y: auto; border-top: 1px solid var(--rule); }
.layout-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--rule); }
.layout-row.is-current .layout-row-name::after { content: ' (open)'; color: var(--ink-soft); font-weight: 400; }
.layout-open {
  flex: 1;
  display: grid;
  gap: 2px;
  padding: 11px 4px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.layout-open:hover .layout-row-name { text-decoration: underline; text-underline-offset: 3px; }
.layout-row-name { font-weight: 600; }
.layout-row-meta { font-size: 13px; color: var(--ink-soft); }
.list-empty { margin: 18px 0; color: var(--ink-soft); }

/* ---- Toast ------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--status-h) + var(--footer-h) + 18px);
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind="error"] { background: var(--stop); color: #FFFFFF; }

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

/* ---- Narrow screens (phones, small tablets) ---------------------------- */

/* Wherever the top bar's buttons don't all fit on one line (small tablets in every theme, wider screens in the themes
   with big buttons), they used to run off the
   right-hand edge, which made the page wider than the screen: on Android tablets Chrome then stretches the page to
   that width, and because the width differs from theme to theme it changed in the middle of a Transform and Chrome
   dropped the wipe ("Viewport size changed"). So the bar is allowed further lines when it needs them, and the page
   never overflows. Where everything fits it is one line, as before. Phones (640px and under) have their own layout
   just below. */
body { grid-template-rows: minmax(var(--topbar-h), auto) 1fr var(--status-h) var(--footer-h); }
.topbar { flex-wrap: wrap; row-gap: 6px; padding-top: 6px; padding-bottom: 6px; }
.topbar-actions { flex-wrap: wrap; margin-left: auto; row-gap: 6px; }
@media (max-width: 900px) {   /* small tablets: the buttons get a line of their own, a little tighter, so two lines do it */
  .topbar-actions { width: 100%; margin-left: 0; justify-content: flex-start; column-gap: 5px; }
  .topbar-actions .btn { padding-left: 9px; padding-right: 9px; }
}
@media (max-width: 640px) { .topbar-actions { flex-wrap: nowrap; } }   /* phones keep their one sideways-scrolling row */

@media (max-width: 900px) {
  :root { --inspector-w: 0px; }
  .workspace { grid-template-columns: var(--rail-w) 1fr; grid-template-rows: 1fr auto; }
  .inspector {
    grid-column: 1 / -1;
    max-height: 38vh;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
  .panel-quiet { display: none; }
  .status-hint { display: none; }
  .compact-field > span { display: none; }
}

@media (max-width: 640px) {
  :root { --topbar-h: auto; --rail-w: 100%; }
  body { grid-template-rows: auto 1fr var(--status-h) var(--footer-h); }
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .wordmark-by { font-size: 11px; }
  .doc-title { order: 0; flex: 1 1 0; padding-left: 10px; }
  .save-state { display: none; }
  .topbar-actions { order: 1; width: 100%; justify-content: flex-start; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .topbar-actions::-webkit-scrollbar { display: none; }
  .topbar-actions > * { flex: 0 0 auto; }   /* buttons keep their size; the row scrolls sideways instead */
  .topbar-actions .compact-field { margin-right: auto; }
  .inspector { max-height: 30vh; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .toolrail { flex-direction: row; overflow-x: auto; padding: 6px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .tool { flex: 0 0 64px; }
  .tool-sep { width: 1px; height: auto; margin: 6px 4px; }
  .statusbar { gap: 14px; padding: 0 12px; }
}

/* ---- Modes ------------------------------------------------------------- */

.mode-tabs {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--field);
}
.mode-tabs button {
  padding: 6px 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font: 600 13px/1.1 var(--font-head);
  cursor: pointer;
}
.mode-tabs button[aria-selected="true"] { background: var(--primary); color: var(--primary-ink); }
.tool[hidden] { display: none; }
.tool[aria-pressed="true"] { background: var(--field); box-shadow: inset 0 0 0 1.5px var(--primary); }

.plan[data-mode="track"] .table { cursor: inherit; }
.plan[data-mode="track"] .table-top { fill: #D2B88F; }
.plan[data-mode="track"][data-tool="flex"] { cursor: crosshair; }
.plan[data-mode="benchwork"] .layer-track { opacity: 0.55; pointer-events: none; }

/* ---- Track ------------------------------------------------------------- */

.track-piece path { fill: none; stroke-linecap: butt; }
.plan[data-mode="track"][data-tool="select"] .track-piece { cursor: move; }
.track-halo { stroke: var(--signal); stroke-opacity: 0.85; }
.track-piece.is-warning .track-halo { stroke: var(--stop); }
.track-bed-top { stroke: rgba(255, 255, 255, 0.07); }
.track-bed.is-diverging, .track-ties.is-diverging { stroke-opacity: 0.85; }
.track-rail { stroke: #D9DDE0; stroke-width: 1.4; }
.track-rail-centre { stroke: #A9AEB3; stroke-width: 1.1; }
.track-centreline { stroke: #ECEFF1; stroke-width: 2; }
.track-points { fill: var(--signal); stroke: #3A2A00; stroke-width: 1; }
.track-piece.is-preview { opacity: 0.8; }

.track-end { cursor: pointer; }
.track-end-bar { stroke: var(--signal); stroke-width: 3; stroke-linecap: round; }
.track-end-arrow { fill: none; stroke: var(--signal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.track-end-hit { fill: transparent; }
.track-end:hover .track-end-hit { fill: rgba(245, 183, 0, 0.18); }
.track-end.is-active .track-end-hit { fill: rgba(245, 183, 0, 0.32); stroke: var(--signal); stroke-width: 2; }
.track-end.is-hot .track-end-hit { fill: rgba(255, 255, 255, 0.35); stroke: #FFFFFF; stroke-width: 2; }

.flex-label {
  fill: #FFFFFF;
  font: 600 13px var(--font-head);
  paint-order: stroke;
  stroke: rgba(20, 42, 34, 0.85);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.flex-label.is-warning { fill: #FFB4AE; }
.track-bumper { stroke: #C7372F; stroke-linecap: round; }
.track-bridge-side { stroke-linecap: butt; stroke-opacity: 0.95; }
.track-bridge-truss { fill: none; stroke-width: 1.2; stroke-opacity: 0.8; }
.track-pit { fill: #5C6063; stroke: #B5B9BC; stroke-width: 2; }
.track-pit-floor { fill: #3E4245; }
.track-pit-stub { stroke: #D9DDE0; stroke-opacity: 0.9; stroke-linecap: butt; }
.tt-rim { fill: none; stroke: var(--signal); stroke-opacity: 0.18; cursor: copy; }
.tt-rim:hover { stroke-opacity: 0.35; }
.tt-pos { fill: #FFFFFF; stroke: var(--signal); stroke-width: 2.5; }
.tt-pos.is-active { fill: var(--signal); }
.tt-positions { margin: 4px 0 8px; padding: 0; list-style: none; }
.tt-positions li { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.tt-positions input { width: 64px; }
.tt-positions .unit { margin-right: 6px; }
.piece-label { pointer-events: none; }
.piece-label text {
  fill: #FFFFFF;
  font: 600 13px var(--font-head);
  paint-order: stroke;
  stroke: rgba(20, 42, 34, 0.85);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}
.piece-label text.piece-label-sub { font-weight: 500; font-size: 11px; fill: #D9E2DD; }

/* ---- Track library and parts list -------------------------------------- */

.field select {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
}
.lib-hint { margin: 8px 0 4px; padding-left: 10px; border-left: 3px solid var(--rule); font-size: 13px; color: var(--ink-soft); }
.lib-hint.is-active { border-left-color: var(--signal); color: var(--ink); }
.lib-group { margin: 14px 0 4px; font: 700 14px var(--font-head); color: var(--ink-soft); }
.lib-list { margin: 0; padding: 0; list-style: none; }
.lib-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
}
.lib-name { display: grid; font-size: 14px; font-weight: 500; line-height: 1.25; }
.lib-name small { font-size: 12px; font-weight: 400; color: var(--ink-soft); }
.lib-buttons { display: flex; gap: 4px; flex-shrink: 0; }
.lib-add {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--mat);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.lib-add:hover { border-color: var(--signal); box-shadow: 0 0 0 2px rgba(245, 183, 0, 0.35); }
.lib-add:active { cursor: grabbing; }
.lib-add .lib-thumb { display: block; grid-area: 1 / 1; pointer-events: none; }
.lib-add .lib-label {
  grid-area: 1 / 1;
  align-self: end;
  justify-self: end;
  margin: 0 3px 2px 0;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.lib-tiles { gap: 6px; margin-top: 4px; }
.lib-custom { align-items: flex-end; }
.lib-custom .lib-add { margin-bottom: 8px; }
.lib-custom-note { margin-top: 0; }
.lib-gap { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 4px; padding: 8px 10px; border-radius: 8px; background: rgba(245, 183, 0, 0.14); border: 1px solid rgba(245, 183, 0, 0.6); font-size: 13px; }
.lib-gap .btn { flex-shrink: 0; }
.lib-tiles .lib-add { width: auto; flex: 1; min-width: 0; height: 52px; grid-template-rows: 34px auto; }
.lib-tiles .lib-add .lib-thumb { grid-area: 1 / 1; }
.lib-tiles .lib-add .lib-label { grid-area: 2 / 1; align-self: start; justify-self: center; margin: 0; padding: 0 0 3px; background: none; font-weight: 600; }
.plan.is-dropping { cursor: grabbing; }
.est { color: #9A6B00; text-decoration: none; cursor: help; font-weight: 600; }

.lib-generic { margin-top: 10px; }
.lib-row { display: flex; align-items: flex-end; gap: 8px; }
.lib-row .field { margin-bottom: 8px; }
.lib-grow { flex: 1; }
.lib-row > .btn-small { margin-bottom: 8px; }
.lib-row-end { justify-content: flex-end; }

.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-danger-outline { color: var(--stop); }
.btn-danger-outline:hover { border-color: var(--stop); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.bom { width: 100%; border-collapse: collapse; font-size: 14px; }
.bom td { padding: 6px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.bom td small { display: block; font-size: 12px; color: var(--ink-soft); }
.bom-qty { width: 36px; font-weight: 700; font-family: var(--font-head); font-size: 15px; }

@media (max-width: 640px) {
  .mode-tabs { display: flex; flex: 0 0 auto; margin: 0 6px 0 0; align-self: center; }
  .mode-tabs button { padding: 8px 10px; }
}

.scn-group-box { fill: none; stroke: var(--signal); stroke-width: 1.5; stroke-dasharray: 6 4; pointer-events: none; }
.marquee { fill: rgba(245, 183, 0, 0.1); stroke: var(--signal); stroke-width: 1.5; stroke-dasharray: 5 4; }
.marquee.is-cut { fill: rgba(199, 55, 47, 0.12); stroke: var(--stop); }
.plan[data-tool="cut"], .plan[data-tool="cut"] .table { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg transform='translate(5 1) scale(1.15)' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23fff' stroke-width='4.2'%3E%3Cpath d='M6 10V5.5A2.5 2.5 0 0 1 8.5 3h7A2.5 2.5 0 0 1 18 5.5V8'/%3E%3Cpath d='M9 6.5h5'/%3E%3Cpath d='M6 10h12.5a1.5 1.5 0 0 1 1.5 1.5V14a1.5 1.5 0 0 1-1.5 1.5H14'/%3E%3Cpath d='M6 10v5.5h3'/%3E%3Cpath d='M3 17.5h12l-1.5-2H4.5z'/%3E%3Cpath d='M8.5 17.5v4M8.5 18.6h1.2M8.5 20.1h1.2'/%3E%3Cpath d='M14.5 12h3M14.5 13.6h3'/%3E%3C/g%3E%3Cg stroke='%23C7372F' stroke-width='1.8'%3E%3Cpath d='M6 10V5.5A2.5 2.5 0 0 1 8.5 3h7A2.5 2.5 0 0 1 18 5.5V8'/%3E%3Cpath d='M9 6.5h5'/%3E%3Cpath d='M6 10h12.5a1.5 1.5 0 0 1 1.5 1.5V14a1.5 1.5 0 0 1-1.5 1.5H14'/%3E%3Cpath d='M6 10v5.5h3'/%3E%3Cpath d='M3 17.5h12l-1.5-2H4.5z'/%3E%3Cpath d='M8.5 17.5v4M8.5 18.6h1.2M8.5 20.1h1.2'/%3E%3Cpath d='M14.5 12h3M14.5 13.6h3'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 15 26, crosshair; }
.marquee.is-pending { fill: rgba(199, 55, 47, 0.18); stroke-dasharray: none; stroke-width: 2; cursor: move; }
.cut-stem { stroke: var(--stop); stroke-width: 1.5; }
.cut-rotate { stroke: var(--stop); stroke-width: 1.5; fill: var(--panel); }
.cut-glyph { fill: none; stroke: var(--stop); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.cut-go { cursor: pointer; }
.cut-go > circle:first-child { fill: var(--stop); stroke: var(--panel); stroke-width: 2; }
.cut-go:hover > circle:first-child { fill: #A52D27; }
.cut-jig path { fill: none; stroke: #fff; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.cut-corner { fill: var(--panel); stroke: var(--stop); stroke-width: 2; }
.cut-corner.is-first { fill: var(--stop); fill-opacity: 0.35; }
.field-label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }

/* ---- Site footer ------------------------------------------------------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: var(--mat-deep);
  color: #C9D6D0;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .wordmark-sub { display: none; }
}
@media (max-width: 640px) {
  body { grid-template-rows: auto 1fr var(--status-h) var(--footer-h); }
  .wordmark-text { display: grid; }
  .wordmark-name { font-size: 16px; }
}

/* ---- Room -------------------------------------------------------------- */

.wall-outline { stroke: #26302C; stroke-linecap: square; }
.wall-fill { stroke: var(--wall, #E4DFD3); stroke-linecap: square; }
.wall-fill.is-selected { stroke: #F7E3A6; }
.wall-preview { stroke: rgba(228, 223, 211, 0.55); stroke-linecap: square; }
.wall-cursor { fill: none; stroke: var(--signal); stroke-width: 2; }
.opening-gap { stroke: var(--mat); stroke-linecap: butt; }
.opening-selected { stroke: var(--signal); stroke-opacity: 0.45; stroke-linecap: butt; }
.jamb { stroke: #26302C; stroke-width: 2; }
.flex-snap-ring { fill: none; stroke: var(--signal); stroke-width: 3; }
.window-pane { stroke: #A8D4EC; stroke-width: 1.5; }
.tunnel-bore { stroke: #2A2622; stroke-linecap: butt; opacity: 0.85; }
.tunnel-axis { stroke: #E8E3D6; stroke-width: 1.5; stroke-dasharray: 4 3; }
.door-leaf { stroke: #F2F4F1; stroke-width: 2.5; stroke-linecap: round; }
.door-arc { fill: none; stroke: #F2F4F1; stroke-width: 1.2; stroke-dasharray: 5 4; }
.door-swing-area { fill: rgba(242, 244, 241, 0.06); stroke: none; }
.door-swing-area.is-blocked { fill: rgba(199, 55, 47, 0.35); }
.slider-panel { stroke: #A8D4EC; stroke-width: 3; stroke-linecap: butt; }
.slider-arrow { fill: none; stroke: #F2F4F1; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.slider-walk { stroke: #F2F4F1; stroke-opacity: 0.25; stroke-width: 1; stroke-dasharray: 4 4; }

.access-zone { fill: url(#hatch-access); stroke: rgba(245, 183, 0, 0.6); stroke-width: 1; stroke-dasharray: 4 3; }
.access-zone.is-blocked { fill: url(#hatch-blocked); stroke: var(--stop); }
.hatch-access-bg { fill: rgba(245, 183, 0, 0.05); }
.hatch-access-line { stroke: rgba(245, 183, 0, 0.35); stroke-width: 2; }
.hatch-blocked-bg { fill: rgba(199, 55, 47, 0.12); }
.hatch-blocked-line { stroke: rgba(255, 120, 110, 0.6); stroke-width: 2.5; }

.room-item .item-body { fill: #C9D1CD; stroke: #2B3632; stroke-width: 1.5; }
.room-item-soft .item-body { fill: #B9C3D6; }
.room-item-stairs .item-body { fill: #D8D2C4; }
.room-item-closet .item-body { fill: #CFC6B4; }
.room-item .item-ghost { fill: none; stroke: rgba(43, 54, 50, 0.35); stroke-dasharray: 3 3; }
.room-item .item-detail { fill: rgba(43, 54, 50, 0.18); }
.room-item .item-tv-screen { fill: #1E2228; stroke: #5E6B7A; stroke-width: 1; }
.room-item .item-shelf { fill: #D6DADF; stroke: #5E6B7A; }
.room-item .item-detail-line { stroke: rgba(43, 54, 50, 0.45); stroke-width: 1; }
.room-item .item-detail-line { stroke: rgba(43, 54, 50, 0.55); stroke-width: 1; fill: none; }
.room-item .stairs-arrow { stroke: #2B3632; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.room-item .closet-door { stroke: #2B3632; stroke-width: 2; stroke-dasharray: 6 3; }
.room-item .item-post { fill: #2B3632; stroke: #E4DFD3; stroke-width: 1; }
.room-item .item-label, .room-item .item-dims {
  text-anchor: middle; dominant-baseline: middle; pointer-events: none; fill: #1E2925;
}
.room-item .item-label { font: 600 12px var(--font-head); }
.room-item .item-dims { font: 500 11px var(--font-ui); opacity: 0.7; }
.room-item.is-selected .item-body, .room-item.is-selected .item-post { stroke: var(--signal); stroke-width: 3; }
.room-item-tv.is-selected .item-ghost { stroke: var(--signal); stroke-width: 3; stroke-dasharray: none; }
.room-item-tv.is-selected .item-tv-screen { stroke: var(--signal); stroke-width: 2.5; }
.room-item.is-blocked .item-body { stroke: var(--stop); stroke-width: 2.5; }

.plan[data-mode="room"] .layer-tables { opacity: 0.5; }
.plan[data-mode="room"] .layer-track { opacity: 0.35; }
.plan[data-mode="room"][data-tool="select"] .room-item { cursor: move; }
.plan[data-mode="room"][data-tool="wall"] { cursor: crosshair; }
.plan[data-mode="track"] .layer-room, .plan[data-mode="benchwork"] .layer-room, .plan[data-mode="track"] .layer-roomTop, .plan[data-mode="benchwork"] .layer-roomTop { opacity: 0.9; }
.table.is-overlapping .table-top { stroke: var(--stop); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--panel);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.chip:hover { border-color: var(--primary); background: var(--field); }
.shape-pick { margin-bottom: 10px; }
.aisle-row { margin-top: 12px; }

.conflicts { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.conflict-btn {
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-left: 3px solid var(--signal);
  border-radius: 0 6px 6px 0;
  background: rgba(245, 183, 0, 0.1);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.conflict { display: flex; align-items: stretch; }
.conflict .conflict-btn { flex: 1; min-width: 0; border-radius: 0; }
.conflict-dismiss {
  flex: none; width: 28px; padding: 0; border: 0; border-radius: 0 6px 6px 0;
  background: rgba(245, 183, 0, 0.1); color: var(--ink-soft); font-size: 17px; line-height: 1; cursor: pointer;
}
.conflict-dismiss:hover { background: rgba(245, 183, 0, 0.25); color: var(--ink); }
.conflict-error .conflict-btn, .conflict-error .conflict-dismiss { background: rgba(199, 55, 47, 0.09); }
.conflict-error .conflict-btn { border-left-color: var(--stop); }
.conflict-error .conflict-dismiss:hover { background: rgba(199, 55, 47, 0.2); }
.conflicts-dismissed .btn-link { padding: 0; font-size: 13px; }
.conflict-btn:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Free-rotate zones outside each corner of the selected item. */
.rotate-zone { fill: transparent; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13a7 7 0 1 0 2-6' stroke='%23fff' stroke-width='4'/%3E%3Cpath d='M3 4v5h5' stroke='%23fff' stroke-width='4'/%3E%3Cpath d='M5 13a7 7 0 1 0 2-6' stroke='%2317241F' stroke-width='2'/%3E%3Cpath d='M3 4v5h5' stroke='%2317241F' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E") 12 12, alias; }
.rotate-zone:hover { fill: rgba(245, 183, 0, 0.16); }
.track-rotate-stem { stroke: #F5B700; stroke-width: 1.5; stroke-dasharray: 3 3; }
.track-rotate-knob { fill: #F5B700; stroke: #17241F; stroke-width: 1.5; }
.track-rotate-icon { fill: none; stroke: #17241F; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.track-rotate.is-active .track-rotate-knob { fill: #FFFFFF; }
.plan.is-rotating { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13a7 7 0 1 0 2-6' stroke='%23fff' stroke-width='4'/%3E%3Cpath d='M3 4v5h5' stroke='%23fff' stroke-width='4'/%3E%3Cpath d='M5 13a7 7 0 1 0 2-6' stroke='%2317241F' stroke-width='2'/%3E%3Cpath d='M3 4v5h5' stroke='%2317241F' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E") 12 12, alias; }

/* ---- Floor ------------------------------------------------------------- */

.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--rule);
  cursor: pointer;
}
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch-name { margin-top: 6px; }
.chip[aria-checked="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Softer grid over a finished floor. */
.plan[data-grid-over-floor="on"] .grid-minor { stroke: rgba(0, 0, 0, 0.07); }
.plan[data-grid-over-floor="on"] .grid-major { stroke: rgba(150, 120, 20, 0.32); }
.plan[data-grid-over-floor="on"][data-floor-tone="dark"] .grid-minor { stroke: rgba(255, 255, 255, 0.07); }
.plan[data-grid-over-floor="on"][data-floor-tone="dark"] .grid-major { stroke: rgba(236, 214, 104, 0.3); }
/* A grid color chosen in Settings overrides the mat's and the floor's lines. */
.plan.plan[data-grid-color="custom"] .grid-minor { stroke: var(--grid-color); stroke-opacity: 0.35; }
.plan.plan[data-grid-color="custom"] .grid-major { stroke: var(--grid-color); stroke-opacity: 0.85; }

/* Door swings stay visible on light floors. */
.plan[data-floor-tone="light"] .door-leaf { stroke: #2B3632; }
.plan[data-floor-tone="light"] .door-arc { stroke: #2B3632; }
.plan[data-floor-tone="light"] .door-swing-area { fill: rgba(43, 54, 50, 0.06); }
.plan[data-floor-tone="light"] .slider-arrow { stroke: #2B3632; }
.plan[data-floor-tone="light"] .slider-walk { stroke: #2B3632; }
.plan[data-floor-tone="light"] .slider-panel { stroke: #5A9BC4; }
.plan[data-floor-tone="light"] .hatch-access-line { stroke: rgba(170, 120, 0, 0.45); }
.plan[data-floor-tone="light"] .access-zone { stroke: rgba(170, 120, 0, 0.7); }

/* ---- 3D view ----------------------------------------------------------- */

.tool-3d svg { stroke-width: 1.5; }
/* The tape measure: its rail icon, and the tape on the plan. */
.tool-tape .tape-icon-case { fill: #F2C230; }
.tool-tape .tape-icon-blade { fill: #FBE7A1; }
.tool-tape .tape-icon-hub { fill: var(--panel); }
.tool-tape .tape-icon-marks { stroke-width: 1; }
.plan.is-measuring { cursor: crosshair; }
.layer-measure { pointer-events: none; }
.tape-blade { fill: #F2C230; stroke: #8A6A0C; stroke-width: 1; }
.tape-tick { stroke: #3A2E08; stroke-width: 1; }
.tape-tick.is-major { stroke-width: 1.6; }
.tape-hook { fill: #6B6F73; stroke: #2E3133; stroke-width: 1; }
.tape-case { fill: #F2C230; stroke: #2E3133; stroke-width: 1.6; }
.tape-hub { fill: #2E3133; }
.tape-hub-pin { fill: #F2C230; }
.tape-point { fill: #F2C230; stroke: #2E3133; stroke-width: 1.5; }
.tape-point.is-snapped { fill: none; stroke: #C88A00; stroke-width: 2.5; }
.tape-label-bg { fill: #1C1C1C; opacity: 0.88; }
.tape-label-main { fill: #F5C518; font: 700 14px var(--font-head); text-anchor: middle; dominant-baseline: middle; }
.tape-label-sub { fill: #E6E6E1; font: 500 11px var(--font-ui, sans-serif); text-anchor: middle; dominant-baseline: middle; }
.view3d {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #DCE3E0;
}
.view3d[hidden] { display: none; }
.view3d-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}
.view3d-bar .spacer { flex: 1; }
.view3d-title { margin: 0; font: 700 19px/1 var(--font-head); }
.view3d-fade { margin-top: 0; }
.view3d-fade[hidden] { display: none; }
.view3d-stage { position: relative; min-height: 0; overflow: hidden; }
.view3d-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.view3d-stage canvas:active { cursor: grabbing; }
.view3d-stage canvas[data-mode="walk"] { cursor: default; }
.view3d-stage canvas[data-mode="walk"].is-looking { cursor: grabbing; }
.view3d-loading {
  position: absolute; inset: 0; display: grid; place-items: center; margin: 0;
  font: 600 16px var(--font-head); color: var(--ink-soft);
}
.view3d-loading[hidden] { display: none; }
.view3d-hint {
  margin: 0;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 13px;
}

.field-label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.room-item-stairs .stairs-landing { fill: #CFC8B8; }

.view3d-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(300px, calc(100% - 24px));
  padding: 14px 16px 12px;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(10, 30, 22, 0.25);
}
.view3d-panel[hidden] { display: none; }
.view3d-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.view3d-panel-head h3 { margin: 0; font: 700 17px/1.2 var(--font-head); }
.view3d-turn { margin-bottom: 4px; }
.view3d-pad {
  position: absolute; right: 14px; bottom: 14px;
  display: grid; grid-template-columns: 38px 38px 38px; grid-template-rows: 38px 38px 38px; gap: 4px;
  padding: 6px; border-radius: 12px; background: rgba(20, 42, 34, 0.82);
}
.view3d-pad[hidden] { display: none; }
.view3d-pad button {
  border: 0; border-radius: 8px; background: rgba(255, 255, 255, 0.08); color: #EEF1EE;
  font-size: 15px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
}
.view3d-pad button:hover { background: rgba(255, 255, 255, 0.18); }
.view3d-pad button:active, .view3d-pad button.is-held { background: var(--signal); color: var(--ink); }
.view3d-pad [data-pan="arrowup"] { grid-column: 2; grid-row: 1; }
.view3d-pad [data-pan="arrowleft"] { grid-column: 1; grid-row: 2; }
.view3d-pad [data-pan="zoomin"] { grid-column: 2; grid-row: 2; font-size: 20px; }
.view3d-pad [data-pan="arrowright"] { grid-column: 3; grid-row: 2; }
.view3d-pad [data-pan="arrowdown"] { grid-column: 2; grid-row: 3; }
.view3d-pad [data-pan="zoomout"] { grid-column: 3; grid-row: 3; font-size: 20px; }
.view3d-walkpad { grid-template-rows: 38px 38px; }
.view3d-walkpad [data-pan] { grid-column: auto; grid-row: auto; }
.view3d-walkpad [data-pan="arrowleft"], .view3d-walkpad [data-pan="arrowright"] { font-size: 19px; }
.view3d-train { right: auto; left: 12px; max-height: calc(100% - 24px); overflow-y: auto; }
/* Docked in the inspector for the plan's Run mode. */
.view3d-train.is-docked { position: static; width: auto; max-height: none; box-shadow: none; border-radius: 0; padding: 14px 16px 12px; overflow: visible; }
.view3d-train [hidden] { display: none !important; }
.view3d-train.is-docked .view3d-panel-head h3 { font: 700 18px/1.2 var(--font-head); }
.train-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 4px; }
.train-modes { display: flex; gap: 6px; margin: 0 0 10px; }
.train-modes .btn { flex: 1; justify-content: center; padding-inline: 8px; white-space: nowrap; }
.btn-command, .command-word { color: #C7372F; font-weight: 700; font-style: italic; }
.train-head-right { display: flex; align-items: center; gap: 6px; }
.train-sounds { margin-top: 6px; }
.train-sound-btn.is-on { background: var(--signal); border-color: var(--signal); color: #1C1C1C; }
/* Master volume: a speaker button with a vertical slider that pops out under it. */
.vol { position: relative; display: inline-flex; }
.vol-btn { width: 30px; height: 30px; padding: 4px; }
.vol-btn[data-level="mute"] .vol-low, .vol-btn[data-level="mute"] .vol-high, .vol-btn[data-level="low"] .vol-high { opacity: 0.25; }
.vol-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: flex; justify-content: center; width: 34px; padding: 10px 0; border-radius: 8px; background: var(--panel); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); border: 1px solid var(--rule); }
.vol-pop[hidden] { display: none; }
.vol-pop input { writing-mode: vertical-lr; direction: rtl; width: 22px; height: 110px; margin: 0; accent-color: var(--primary); }
body.is-command .vol-pop { background: #22302B; border-color: #3B4A43; }
.btn-command { border-color: #C7372F; }
.btn-command:hover { background: rgba(199, 55, 47, 0.08); }

/* ---- Command Mode ----------------------------------------------------------- */
body.is-command { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.is-command .site-footer { display: none; }
body.is-command .topbar { flex-shrink: 0; }
.command-title { font: 600 16px/1.2 var(--font-head); }
.command-actions .check { font-size: 13px; margin-right: 6px; }
.command { flex: 1; min-height: 0; display: grid; grid-template-columns: 150px minmax(0, 1.3fr) minmax(360px, 1fr); gap: 10px; padding: 10px; background: #1A2A24; }
.command-switches { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: #22302B; color: #E9ECE8; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.command-switches h3 { margin: 0 0 2px; font: 700 15px/1.2 var(--font-head); letter-spacing: 0.02em; }
.command-switches .panel-note { color: #A9B5AF; }
.command-switch-list { display: flex; flex-direction: column; gap: 8px; }
.switch-lever { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 8px 8px 8px; border: 1px solid #3B4A43; border-radius: 8px; background: #1B2621; color: inherit; text-align: left; cursor: pointer; }
.switch-lever:hover { border-color: #5C6E65; }
.switch-lever-head { display: flex; flex-direction: column; min-width: 0; }
.switch-lever-head strong { font: 700 13px/1.2 var(--font-head); }
.switch-lever-head small { font-size: 11px; color: #A9B5AF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The lever itself: a slot with a knob that sits left for Through, right for Diverging. */
.switch-lever-track { position: relative; display: block; height: 22px; border-radius: 11px; background: #0F1714; border: 1px solid #3B4A43; }
.switch-lever-track i { position: absolute; top: 2px; left: 2px; width: 40%; height: 16px; border-radius: 8px; background: #3DBE63; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); transition: left 0.15s ease, background 0.15s ease; }
.switch-lever.is-thrown .switch-lever-track i { left: calc(60% - 2px); background: var(--signal); }
.switch-lever-state { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #3DBE63; }
.switch-lever.is-thrown .switch-lever-state { color: var(--signal); }
.command-overview { position: relative; min-height: 0; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; background: var(--panel); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.command-plan { flex: 1; min-height: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.command-overview-foot { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; font-size: 12px; color: var(--ink-soft); border-top: 1px solid var(--rule); background: var(--panel); }
.command-cabs { container-type: inline-size; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 10px; align-content: start; padding-right: 2px; }
.command-stage { position: fixed; left: -4000px; top: 0; pointer-events: none; }
.command-count { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.22); font-size: 12px; font-variant-numeric: tabular-nums; }
.command-picker { position: fixed; right: 12px; top: 54px; z-index: 20; width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 70px); max-height: calc(100dvh - 70px); overflow-y: auto; padding: 12px 14px 14px; border-radius: 12px; background: var(--panel); color: var(--ink); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); }
.command-picker-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.command-picker-head h3 { margin: 0; font: 700 17px/1.2 var(--font-head); }
.command-picker .train-box { margin: 8px 0 0; }
/* Three or four trains: a 2 × 2 wall of cabs, and the cabs get a bigger share of the screen. */
.command:has(.command-cabs[data-count="3"]), .command:has(.command-cabs[data-count="4"]) { grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.35fr); }
@media (min-width: 1200px) {
  .command-cabs[data-count="3"], .command-cabs[data-count="4"] { grid-template-columns: 1fr 1fr; }
}
.command-cabs[data-count="3"] .cab-stand, .command-cabs[data-count="4"] .cab-stand { gap: 8px 12px; padding: 8px 12px 10px; }
.command-cabs[data-count="3"] .cab-lever, .command-cabs[data-count="4"] .cab-lever { height: 70px; }
.command-cabs[data-count="3"] .cab-speed, .command-cabs[data-count="4"] .cab-speed { font-size: 24px; }
.command-cabs[data-count="3"] .cab-gauge, .command-cabs[data-count="4"] .cab-gauge { min-width: 64px; padding: 4px 6px; }
.command-cabs[data-count="3"] .cab-estop, .command-cabs[data-count="4"] .cab-estop { width: 52px; height: 52px; font-size: 9px; letter-spacing: 0; border-width: 3px; }
.command-cabs[data-count="3"] .reverser button, .command-cabs[data-count="4"] .reverser button { padding: 4px 8px; }
.command-cabs[data-count="3"] .cab-head, .command-cabs[data-count="4"] .cab-head { padding: 6px 10px; }
.command-empty { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 420px; padding: 22px 26px; border-radius: 12px; background: var(--panel); color: var(--ink); text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4); }
.command-empty h2 { margin: 0 0 8px; font: 700 20px/1.2 var(--font-head); }
.command-empty p { margin: 0; color: var(--ink-soft); font-size: 14px; }

.cab { display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto auto; border-radius: 10px; overflow: hidden; background: #22302B; color: #E9ECE8; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); outline: 0; }
.cab:focus-within { box-shadow: 0 0 0 2px var(--signal); }
.cab-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: #1B2621; }
.cab-name { display: flex; flex-direction: column; min-width: 0; }
.cab-name strong { font: 700 15px/1.2 var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab-name small { font-size: 12px; color: #A9B5AF; }
.cab-views { background: #0F1714; border-color: #3B4A43; }
.cab-views button { color: #D7DDD9; }
.cab-views button[aria-checked="true"] { background: var(--primary); color: #fff; }
.cab-tile { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; background: #0B1210; cursor: grab; }
.cab-tile.is-dragging { cursor: grabbing; }
.cab-stand { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 18px; padding: 12px 14px 14px; background: linear-gradient(180deg, #2A3934, #202C27); }
.cab-reverser { min-width: 96px; }
.cab-buttons { flex-direction: row; align-items: center; gap: 14px; }
.cab-sounds { flex-direction: column; }
.command-zoom { position: absolute; right: 10px; top: 10px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 8px; background: rgba(28, 28, 28, 0.82); color: #F2F2EE; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.command-zoom button { min-width: 30px; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: 600 15px/1 var(--font-body, sans-serif); cursor: pointer; }
.command-zoom button:hover { background: rgba(255, 255, 255, 0.14); }
.command-zoom span { min-width: 44px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.cab-label { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #A9B5AF; margin-bottom: 4px; }
.cab-gauge { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 74px; padding: 6px 8px; border-radius: 8px; background: #0F1714; border: 1px solid #3B4A43; }
.cab-speed { font: 700 30px/1 var(--font-head); color: #F5B700; font-variant-numeric: tabular-nums; }
.cab-gauge small { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #A9B5AF; margin-top: 4px; }
.cab-throttle { display: flex; flex-direction: column; align-items: center; }
.cab-lever { writing-mode: vertical-lr; direction: rtl; width: 28px; height: 96px; margin: 2px 0; accent-color: var(--signal); cursor: ns-resize; }
.cab-throttle-pct { font-size: 12px; color: #D7DDD9; font-variant-numeric: tabular-nums; }
.cab-reverser { display: flex; flex-direction: column; }
.reverser { display: grid; gap: 4px; }
.reverser button { padding: 6px 10px; border: 1px solid #3B4A43; border-radius: 6px; background: #0F1714; color: #D7DDD9; font: 600 12px var(--font-body, sans-serif); cursor: pointer; text-align: left; }
.reverser button[aria-checked="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.reverser button[data-cab-dir="neutral"][aria-checked="true"] { background: #55605B; border-color: #55605B; }
.cab-buttons { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 8px; }
.cab-estop { width: 58px; height: 58px; border-radius: 50%; border: 4px solid #F5D37A; background: radial-gradient(circle at 35% 30%, #E8534A, #A5211A 70%); color: #fff; font: 800 11px/1.1 var(--font-head); letter-spacing: 0.02em; cursor: pointer; box-shadow: 0 4px 0 #5F1510, 0 6px 10px rgba(0, 0, 0, 0.4); }
.cab-estop:active, .cab.is-estop .cab-estop { transform: translateY(3px); box-shadow: 0 1px 0 #5F1510, 0 2px 4px rgba(0, 0, 0, 0.4); }
.cab-sounds { display: flex; gap: 6px; }
.cab-sound { padding: 6px 10px; border: 1px solid #3B4A43; border-radius: 6px; background: #0F1714; color: #D7DDD9; font: 600 12px var(--font-body, sans-serif); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.cab-sound.is-held { background: var(--signal); border-color: var(--signal); color: #1C1C1C; }
@media (max-width: 1100px) {
  .command { grid-template-columns: 1fr; grid-template-rows: auto minmax(240px, 40%) 1fr; }
  .command-switches { flex-direction: row; align-items: center; max-height: 120px; }
  .command-switch-list { flex-direction: row; flex-wrap: wrap; }
  .switch-lever { min-width: 130px; }
}
@media (min-width: 1700px) {
  .command { grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1.1fr); }
}
/* Phones: one scrolling column instead of a fixed screen-high grid. The cabs (the controls) come first,
   then the switches as a strip you swipe sideways, then the overview. */
@media (max-width: 760px) {
  body.is-command { display: block; height: auto; min-height: 100dvh; overflow: visible; background: #1A2A24; }
  .command-actions { flex-wrap: wrap; justify-content: flex-end; }
  .command { display: flex; flex-direction: column; gap: 10px; padding: 8px; }
  .command-cabs { order: 1; overflow: visible; grid-template-columns: 1fr !important; padding-right: 0; }
  .command-switches { order: 2; flex-direction: column; align-items: stretch; max-height: none; padding: 8px 10px; overflow: visible; }
  .command-switch-list { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-color: #3B4A43 transparent; }
  .switch-lever { flex: 0 0 150px; min-width: 0; scroll-snap-align: start; }
  .command-overview { order: 3; flex: none; height: 62vh; height: 62svh; }
  /* Swiping up and down over the picture scrolls the page; sideways still swings the camera round. */
  .cab-tile { touch-action: pan-y !important; }
  .cab-stand { justify-content: space-around; gap: 12px 14px; padding: 12px 10px 14px; }
  .reverser button { padding: 9px 10px; }
  .cab-sound { padding: 9px 12px; font-size: 13px; }
  .cab-lever { height: 110px; width: 36px; }
  .command-overview-foot { flex-direction: column; gap: 2px; }
  .command-picker { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 78dvh; }
}
.train-icons { display: flex; align-items: center; gap: 4px; }
.icon-btn { position: relative; width: 32px; height: 32px; padding: 5px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--primary); cursor: pointer; }
.icon-btn svg { width: 100%; height: 100%; display: block; }
.icon-btn .stop-sign { fill: #C7372F; }
.icon-btn:hover:not(:disabled) { background: var(--panel-soft, rgba(0, 0, 0, 0.05)); border-color: var(--rule); }
.icon-btn:disabled { color: var(--ink-soft); opacity: 0.4; cursor: default; }
.icon-btn:disabled .stop-sign { fill: var(--ink-soft); }
/* Hover tooltip, from data-tip. */
.icon-btn[data-tip]:hover:not(:disabled)::after, .icon-btn[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 5; width: max-content; max-width: 200px; white-space: normal;
  padding: 5px 8px; border-radius: 6px; background: #1C1C1C; color: #F2F2EE; font: 500 12px/1.2 var(--font-body, sans-serif); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); pointer-events: none;
}
.train-sound-check { margin: 0; font-size: 13px; }
.btn-3d { display: inline-flex; align-items: center; gap: 6px; }
.btn-3d::before { content: ''; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 2px; box-shadow: 3px -3px 0 -0.5px var(--panel, #fff), 3px -3px 0 1px currentColor; margin-right: 3px; }

/* Trains on the plan. */
.layer-trains .veh { cursor: pointer; }
.layer-trains .veh-lamp { pointer-events: none; }
.layer-trains .veh-label { fill: #FFFFFF; font-family: var(--font-head); font-weight: 600; paint-order: stroke; stroke: rgba(20, 20, 20, 0.75); stroke-width: 1px; pointer-events: none; }
.layer-trains .veh-selected { stroke: var(--signal); stroke-dasharray: 4 3; }
.layer-trains .switch-lamp { cursor: pointer; }
.layer-trains .switch-lamp-zone { fill: transparent; }
.layer-trains .switch-lamp-head { fill: #3DBE63; stroke: #1E5C33; stroke-width: 1.5; }
.layer-trains .switch-lamp.is-thrown .switch-lamp-head { fill: var(--signal); stroke: #7A5600; }
.layer-trains .crash-ball { pointer-events: none; }
.plan[data-mode="run"] { cursor: default; }

/* The roster: lists in the Run panel, and the builders. */
/* The quick train and the roster each sit in their own outlined box. */
.train-box { margin: 8px 0 10px; padding: 10px 12px 12px; border: 1px solid var(--rule); border-radius: 8px; }
.train-box-title { margin: 0 0 8px; font: 700 15px/1.2 var(--font-head); }
.train-box .field-pair { margin-top: 0; }
.train-box .panel-actions { margin-top: 8px; }
.train-box-green { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.train-box-green .panel-note { margin-top: 0; }
.train-box-green .train-add-hint { display: block; margin: 4px 0 0; }
.train-roster { margin: 6px 0 10px; }
/* The way into the train management console: a big dark button that looks like it goes somewhere. */
.console-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; padding: 11px 14px;
  border: 0; border-radius: 10px; cursor: pointer; color: #F2F2EE; font: 700 14px/1.2 var(--font-head); letter-spacing: 0.01em;
  background: linear-gradient(135deg, #1E3D32 0%, #2E5A48 60%, #3A6E58 100%);
  box-shadow: 0 6px 16px rgba(10, 30, 22, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.console-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(10, 30, 22, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.16); }
.console-btn:active { transform: translateY(0); box-shadow: 0 3px 8px rgba(10, 30, 22, 0.3); }
.console-btn i { font-style: normal; font-size: 22px; line-height: 1; opacity: 0.8; }
.train-roster .roster-head:first-child { margin-top: 0; }
.roster-head .train-box-title { margin: 0; }
.roster-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.roster-head .btn-link { font-size: 13px; }
.roster-list, .roster-consist { margin: 4px 0 0; padding: 0; list-style: none; }
.roster-row, .roster-consist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--rule); }
.roster-row:first-child { border-top: 0; }
.roster-chips { display: flex; gap: 2px; align-items: center; flex-shrink: 0; min-width: 22px; max-width: 64px; flex-wrap: wrap; }
.roster-chip { display: inline-block; width: 18px; height: 10px; border-radius: 2px; background: linear-gradient(to bottom, var(--roof) 0 30%, var(--body) 30% 100%); border: 1px solid rgba(0, 0, 0, 0.35); }
.roster-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.roster-text strong { font: 600 14px var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster-text small { color: var(--ink-soft); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster-btns { display: flex; gap: 4px; flex-shrink: 0; }
.roster-preview { margin: 0 0 12px; padding: 8px; border-radius: 8px; background: #DCE3E0; display: flex; flex-direction: column; align-items: center; gap: 4px; overflow: hidden; }
.roster-preview svg { max-width: 100%; height: auto; }
.roster-preview-train { flex-direction: row; justify-content: flex-start; gap: 0; overflow-x: auto; align-items: flex-end; }
/* The close-up: a magnifier on the builder's preview, and the viewer it opens (js/vehicle-zoom.js). */
#vehicle-preview { position: relative; cursor: zoom-in; }
.roster-zoom { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; padding: 5px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); color: var(--ink); cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.roster-zoom:hover { border-color: var(--primary); color: var(--primary); }
.roster-zoom svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.vz-dialog { width: min(1200px, calc(100vw - 24px)); height: min(780px, calc(100dvh - 24px)); max-height: none; padding: 12px; }
.vz-dialog[open] { display: flex; flex-direction: column; gap: 10px; }
.vz-head { padding-left: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.vz-title { font: 700 16px/1.2 var(--font-head); }
.vz-spacer { flex: 1; }
.vz-zoom { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--rule); border-radius: 8px; }
.vz-zoom button { min-width: 34px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: 600 15px/1 var(--font-ui, sans-serif); cursor: pointer; }
.vz-zoom button:hover { background: var(--field); }
.vz-stage { position: relative; flex: 1; min-height: 240px; border-radius: 10px; overflow: hidden; background: #DCE3E0; }
.vz-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.vz-canvas:active { cursor: grabbing; }
.vz-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink-soft); }
.vz-pan { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.vz-pan:active { cursor: grabbing; }
.vz-pan-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.vz-hint { margin: 0; font-size: 12px; color: var(--ink-soft); }
@media (max-width: 640px) {
  .vz-dialog { width: 100vw; height: 100dvh; max-width: none; border-radius: 0; padding: 8px; }
  .vz-hint { display: none; }
}
.roster-colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 10px; }
.roster-color .roster-swatch { display: flex; flex-direction: column; gap: 4px; }
.roster-color input[type="color"] { width: 100%; height: 32px; padding: 2px; border: 1px solid var(--rule); border-radius: 6px; background: var(--field); cursor: pointer; }
.swatch-row { display: flex; align-items: center; gap: 4px; }
.swatch-grip { flex-shrink: 0; width: 16px; height: 32px; border-radius: 4px; border: 1px solid var(--rule); background: var(--c, #888) repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.45) 0 2px, transparent 2px 5px) center / 6px 14px no-repeat; cursor: grab; }
.swatch-grip:active { cursor: grabbing; }
.roster-color.is-over input[type="color"] { outline: 2px solid var(--signal); outline-offset: 1px; }
.is-color-drag .roster-color { border-radius: 6px; }
.roster-color input[type="color"]:disabled { opacity: 0.35; }
.roster-color .check { font-size: 12px; margin: 0; }
.roster-logo { display: flex; align-items: center; gap: 10px; }
.roster-logo-img { height: 36px; max-width: 120px; object-fit: contain; background: #fff; border: 1px solid var(--rule); border-radius: 4px; padding: 2px; }
.roster-logo-none { color: var(--ink-soft); font-size: 13px; }
.roster-add { align-items: flex-end; }
.btn-icon { border: 1px solid var(--rule); background: var(--panel); border-radius: 6px; width: 28px; height: 28px; cursor: pointer; color: var(--ink); font-size: 12px; }
.btn-icon:disabled { opacity: 0.35; cursor: default; }
.btn-icon.is-on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.dialog-vehicle { width: min(600px, calc(100vw - 32px)); }
/* The train management console: trains on the left, locomotives and cars on the right. */
.dialog-console { width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
/* The header stays put while the console scrolls, so Close is always within reach. */
.dialog-console > .dialog-x { position: sticky; float: left; top: -12px; left: 0; z-index: 3; margin: -2px 0 0 -14px; }
.dialog-console .dialog-head { position: sticky; top: -22px; z-index: 2; margin: -22px -24px 12px; padding: 16px 24px 8px; background: var(--panel); }
@media (max-width: 640px) {
  .dialog-console { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 16px 14px 16px; border-radius: 10px; }
  .dialog-console .dialog-head { top: -16px; margin: -16px -14px 10px; padding: 12px 14px 8px; }
  .dialog-console .dialog-head h2 { font-size: 19px; }
  .dialog-console .dialog-head .btn-link { flex-shrink: 0; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; text-decoration: none; font-weight: 600; }
  .roster-row-console { flex-wrap: wrap; }
  .roster-row-console .roster-thumb { width: 110px; height: 32px; }
  .roster-row-console .roster-thumb svg { width: 110px; height: 32px; }
  .roster-row-console .roster-btns, .console-col .roster-row .roster-btns { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
  .console-col .roster-row { flex-wrap: wrap; }
}
.console-body { display: grid; grid-template-columns: 1fr 1.25fr; gap: 24px; align-items: start; }
.console-col .roster-text strong, .console-col .roster-text small { white-space: normal; }
.console-col h3 { margin: 0; font: 700 16px/1.2 var(--font-head); }
.console-col .roster-head { margin-top: 14px; }
.console-col .roster-head:first-child { margin-top: 0; }
.roster-row-console { gap: 10px; }
.roster-thumb { flex-shrink: 0; width: 150px; height: 44px; background: #DCE3E0; border-radius: 6px; overflow: hidden; }
.roster-thumb svg { display: block; }
@media (max-width: 760px) { .console-body { grid-template-columns: 1fr; } }
.veh-top .veh-label { display: none; }
.roster-btns .is-pending { outline: 2px solid var(--signal); outline-offset: 1px; }
.view3d-train .field { margin-bottom: 8px; }
.train-loco { padding: 8px 0 6px; border-top: 1px solid var(--rule); }
.train-loco:first-child { border-top: 0; }
.train-loco-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.train-loco-head button { font: 600 14px var(--font-head); padding: 2px 0; border: 0; background: none; color: var(--ink); cursor: pointer; text-align: left; }
.train-loco.is-selected .train-loco-head button { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.train-loco-head small { color: var(--ink-soft); font-size: 12px; }
.train-loco .train-throttle { margin: 4px 0 2px; }
.train-loco .train-actions { margin: 2px 0 0; }
.train-add-hint { color: var(--signal); font-weight: 600; margin-left: 6px; }
.train-throttle input[type="range"] { width: 100%; accent-color: var(--primary); }
.train-throttle em { font-style: normal; font-weight: 600; color: var(--ink); margin-left: 6px; }
.train-actions { margin: 4px 0 10px; }
.train-views button { flex: 1; }
#train-camera { margin: 0 0 10px; }
.train-switches { margin: 6px 0 0; padding: 0; list-style: none; }
.train-switches li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.train-switches li small { display: block; color: var(--ink-soft); }
.train-switch-btn {
  flex-shrink: 0; min-width: 92px; padding: 3px 8px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--panel); font: 600 12px var(--font-ui); cursor: pointer;
}
.train-switch-btn::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #3DBE63; vertical-align: 0; }
.train-switch-btn.is-thrown::before { background: var(--signal); }
.btn-train[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
@media (max-width: 640px) {
  .view3d-panel { top: auto; bottom: 8px; right: 8px; left: 8px; width: auto; }
  .view3d-train { max-height: 55%; }
}

.room-item .closet-door-gap { stroke: #F2F4F1; stroke-width: 3; }
.room-item .closet-door-swing { fill: none; stroke: #2B3632; stroke-width: 1.2; stroke-dasharray: 4 3; }

/* ---- Scenery ------------------------------------------------------------- */

.mountain-topo { pointer-events: none; }
.mountain-outline { fill: transparent; stroke: #3E4A2E; stroke-width: 1.5; }
.mountain-outline.is-selected { stroke: var(--signal); stroke-width: 3; }
.plan[data-mode="scenery"][data-tool="select"] .mountain-outline { cursor: move; }
.mountain-peak { fill: #FFFFFF; stroke: #3E4A2E; stroke-width: 1.2; pointer-events: none; }
.mountain-top { fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 1.2; stroke-dasharray: 5 3; pointer-events: none; }
.mountain-top.is-selected { stroke: var(--signal); stroke-width: 2; }
.handle-top { fill: #FFFFFF; stroke: var(--signal); }
.mountain-label { fill: #FFFFFF; font: 600 12px var(--font-head); text-anchor: middle; paint-order: stroke; stroke: rgba(40, 50, 30, 0.85); stroke-width: 3px; pointer-events: none; }
.mountain-draft { fill: rgba(104, 138, 86, 0.25); stroke: var(--signal); stroke-width: 2; stroke-dasharray: 6 4; }
.mountain-draft-pt { fill: var(--signal); stroke: #FFFFFF; stroke-width: 1.5; }
.mountain-draft-pt.is-first { fill: #FFFFFF; stroke: var(--signal); stroke-width: 2.5; }
.tunnel-bore { fill: none; stroke: #FFFFFF; stroke-width: 2; stroke-dasharray: 7 5; stroke-opacity: 0.9; pointer-events: none; }
.tunnel-portal { fill: none; stroke: #1E2420; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.handle-peak { fill: #FFFFFF; stroke: var(--ink); stroke-width: 1.5; }
.handle-peak.is-extra { fill: #F4EFE6; }
.handle-peak.is-active { stroke: var(--signal); stroke-width: 2.5; }
.mountain-peak.is-extra { fill: #E8E3D5; }
.mountain-label.is-small { font-size: 10.5px; }
.peak-list { margin: 4px 0 10px; }
.peak-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.peak-row.is-active { background: var(--field); }
.peak-name { font-size: 13px; font-weight: 600; min-width: 64px; }
.peak-note { font-size: 12.5px; color: var(--ink-soft); }
.peak-height { margin: 0; flex: 1; }
.peak-height input { width: 70px; }
.handle.is-active { fill: var(--signal); }
.plan[data-mode="scenery"][data-tool="mountain"], .plan[data-mode="scenery"][data-tool="lake"], .plan[data-mode="scenery"][data-tool="river"], .plan[data-mode="scenery"][data-tool="tree"], .plan[data-mode="scenery"][data-tool="building"], .plan[data-mode="vehicles"][data-tool="building"] { cursor: crosshair; }
.mountain-draft.draft-lake { fill: rgba(70, 130, 180, 0.3); stroke: #2F6F9F; }
.mountain-draft.draft-river { stroke: #2F6F9F; stroke-opacity: 0.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: none; }
.mountain-draft.draft-ground { fill: rgba(110, 155, 87, 0.3); stroke: #4F7A3C; }
.mountain-draft.draft-road { stroke: #3F4144; stroke-opacity: 0.55; stroke-linecap: butt; stroke-linejoin: round; stroke-dasharray: none; }

/* Roads: paving under the track, painted lines, and planks where track crosses. The paving color is set per road in the markup. */
.road-paving { stroke-width: 1; stroke-linejoin: round; }
.road-stripe { fill: none; stroke-linecap: butt; stroke-linejoin: round; pointer-events: none; }
.road-stripe-yellow { stroke: #E8C547; }
.road-stripe-white { stroke: #F2F2EE; }
.road-label { fill: #FFFFFF; font: 600 12px var(--font-head); text-anchor: middle; paint-order: stroke; stroke: rgba(30, 30, 30, 0.85); stroke-width: 3px; pointer-events: none; }
.road-selected-edge { fill: none; stroke: var(--signal); stroke-width: 2.5; stroke-opacity: 0.9; stroke-linejoin: round; pointer-events: none; }
/* Ground cover: textured areas under everything else. Fill and edge are set per area in the markup. */
.ground-area { stroke-width: 1; stroke-linejoin: round; }
.ground-stripe { stroke: #F1F0E8; stroke-linecap: butt; pointer-events: none; }
.ground-label { fill: #FFFFFF; font: 600 12px var(--font-head); text-anchor: middle; paint-order: stroke; stroke: rgba(30, 40, 30, 0.75); stroke-width: 3px; pointer-events: none; }
.ground-selected-edge { fill: none; stroke: var(--signal); stroke-width: 2.5; stroke-opacity: 0.9; stroke-linejoin: round; pointer-events: none; }
.plan[data-mode="scenery"][data-tool="select"] .ground { cursor: move; }
.plan.on-template .ground { opacity: 0.35; }
.crossing-planks { fill: #7A5C3A; stroke: #4F3A22; stroke-width: 1; stroke-linejoin: round; pointer-events: none; }
.crossing-joints { fill: none; stroke: #4F3A22; stroke-width: 1; stroke-opacity: 0.7; pointer-events: none; }
.crossing-rail { fill: none; stroke: #B9BEC3; stroke-linecap: butt; pointer-events: none; }
.plan[data-mode="scenery"][data-tool="select"] .road { cursor: move; }
.plan.on-template .road { opacity: 0.35; }

/* Water */
/* Rivers set their stroke width per river in the markup, so no width is set on .water itself. */
.water { fill: #4A8DB5; fill-opacity: 0.9; stroke: #2B5F82; }
.water-depth { pointer-events: none; }
.water-join-cursor { fill: none; stroke: var(--signal); stroke-width: 2.5; pointer-events: none; }
.water-lake { stroke-width: 1.5; }
/* Square ends, so a river that stops at a table edge really stops there (a round cap would poke out by half the width). */
.water-river { fill: none; stroke: #4A8DB5; stroke-opacity: 0.9; stroke-linecap: butt; stroke-linejoin: round; }
.water-ripple { fill: none; stroke: rgba(255, 255, 255, 0.28); stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.water-lake.is-selected { stroke: var(--signal); stroke-width: 3; }
.water-selected-edge { fill: none; stroke: var(--signal); stroke-opacity: 0.9; stroke-linecap: butt; stroke-linejoin: round; pointer-events: none; }
.water-control { fill: none; stroke: var(--signal); stroke-width: 1; stroke-dasharray: 4 3; stroke-opacity: 0.8; pointer-events: none; }
.water-label { fill: #FFFFFF; font: 600 12px var(--font-head); text-anchor: middle; paint-order: stroke; stroke: rgba(20, 50, 80, 0.8); stroke-width: 3px; pointer-events: none; }
.plan[data-mode="scenery"][data-tool="select"] .water { cursor: move; }

/* Buildings */
.bld-walls { stroke: #2B2420; stroke-width: 1.2; fill-opacity: 0.95; }
.bld.finish-wood .bld-walls { stroke: #4A4438; }
.bld-platform { fill: #B5B2A8; stroke: #6E6A62; stroke-width: 1; }
.bld-ridge { fill: none; stroke: rgba(0, 0, 0, 0.35); stroke-width: 1.5; }
.bld-line { stroke: rgba(0, 0, 0, 0.3); stroke-width: 1; }
.bld-door { stroke: #2B2420; stroke-linecap: butt; }
.bld-track-line { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.bld-label { fill: #FFFFFF; font: 600 12px var(--font-head); text-anchor: middle; paint-order: stroke; stroke: rgba(30, 20, 15, 0.8); stroke-width: 3px; pointer-events: none; }
.bld.is-selected .bld-walls { stroke: var(--signal); stroke-width: 3; }
.bld-line-ring { fill: none; stroke: rgba(0, 0, 0, 0.35); stroke-width: 1.2; }
.bld-dot { fill: #2B2420; }
.bld-lamp { fill: #FFF2C2; stroke: #2B2420; stroke-width: 1; }
.bld-blade { stroke: rgba(255, 255, 255, 0.85); stroke-width: 2.5; stroke-linecap: round; }
.bld-infield-out { fill: none; stroke: rgba(255, 255, 255, 0.6); stroke-width: 1.2; }
.bld-infield { fill: #B98A5A; stroke: none; }
.bld-diamond { fill: #5E9A4A; stroke: rgba(255, 255, 255, 0.7); stroke-width: 1; }
.bld-line-box { fill: rgba(255, 255, 255, 0.25); stroke: rgba(0, 0, 0, 0.35); stroke-width: 1; }
.bld-line-dash { stroke: rgba(0, 0, 0, 0.35); stroke-width: 1; stroke-dasharray: 3 2; }
.bld-glass { stroke: #6FA6C9; stroke-linecap: butt; }
.bld-path { fill: #B9B4A8; stroke: none; }
.bld-dome { fill: rgba(255, 255, 255, 0.5); stroke: rgba(0, 0, 0, 0.4); stroke-width: 1.2; }
.bld-coal { fill: #2B2A28; stroke: none; }
.bld-dam { fill: rgba(255, 255, 255, 0.35); stroke: rgba(0, 0, 0, 0.5); stroke-width: 1.2; }
.bld-pipe { stroke: rgba(0, 0, 0, 0.45); stroke-width: 2.2; }
.bld-water { fill: #4F86A8; stroke: none; }
.bld-asphalt { fill: #3A3B3D; stroke: none; }
.bld-island { fill: #B9B6AE; stroke: none; }
.bld-stall { stroke: #F2E9B8; stroke-width: 1.2; }
.bld-charger { stroke: #2B2420; stroke-width: 0.8; }
.bld-charger-accent { stroke-width: 2; }
.bld.is-ghost { opacity: 0.55; pointer-events: none; }
/* Road vehicles on the plan, and the fleet list. */
.veh-glass { fill: #1E2A33; fill-opacity: 0.9; stroke: none; }
.veh-roof { stroke: rgba(0, 0, 0, 0.3); stroke-width: 0.8; }
.veh-bed { fill: rgba(0, 0, 0, 0.5); stroke: none; }
.veh-stripe { stroke-linecap: butt; }
.veh-lamp { stroke: #FFF2C2; stroke-linecap: round; }
.veh-tail { stroke: #B3161B; stroke-linecap: round; }
.fleet-row { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.fleet-row .layout-row-meta { grid-column: 2; }
.fleet-chip { grid-row: 1 / span 2; width: 22px; height: 14px; border-radius: 4px; border: 1px solid var(--rule); background: linear-gradient(90deg, var(--sw) 0 38%, var(--stripe) 38% 46%, var(--sw) 46% 54%, var(--stripe) 54% 62%, var(--sw) 62%); }
.swatch.swatch-none { background: linear-gradient(135deg, transparent 0 46%, #C7372F 46% 54%, transparent 54%), var(--panel); }
.garage-list .is-picked > .fleet-row { box-shadow: inset 3px 0 0 var(--signal); padding-left: 8px; }
.garage-list .is-picked .layout-row-name { font-weight: 700; }
.garage-park { font-weight: 600; color: var(--ink); }
.panel-subtitle { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; font: 600 13px/1.3 var(--font-ui); color: var(--ink); }
.plan[data-mode="scenery"][data-tool="select"] .bld, .plan[data-mode="vehicles"][data-tool="select"] .bld, .plan[data-mode="all"] .bld { cursor: move; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* Building and trestle swatches set --sw; the floor swatches above set --swatch. Either one shows. */
.swatch { width: 26px; height: 26px; padding: 0; border: 2px solid var(--rule); border-radius: 6px; background: var(--sw, var(--swatch)); cursor: pointer; }
.swatch.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--panel) inset; }
.swatch-custom { position: relative; background: conic-gradient(#f66, #ff6, #6f6, #6ff, #66f, #f6f, #f66); overflow: hidden; }
.swatch-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* Trees */
.tree .tree-ring { fill: none; stroke: var(--signal); stroke-width: 0.14; opacity: 0; }
.tree.is-selected .tree-ring { opacity: 1; }
.tree .hedge-ring { fill: none; stroke: var(--signal); stroke-width: 2.5; stroke-linejoin: round; opacity: 0; }
.tree.is-selected .hedge-ring { opacity: 1; }
.tree.is-ghost { opacity: 0.55; pointer-events: none; }
.plan[data-mode="scenery"][data-tool="select"] .tree, .plan[data-mode="all"] .tree { cursor: move; }
.scenery-tools { flex-wrap: wrap; }
.back-link { white-space: nowrap; }
.scn-inuse { margin-top: 4px; }
.scn-inuse > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font: 600 13px/1.3 var(--font-ui); color: var(--ink); padding: 6px 0; user-select: none; }
.scn-inuse > summary::-webkit-details-marker { display: none; }
.scn-inuse > summary::before { content: ''; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; transition: transform .15s; flex: none; }
.scn-inuse[open] > summary::before { transform: rotate(180deg); }
.scn-count { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--ink-soft); }
.scn-inuse > .lib-list { margin-top: 4px; }
.scn-li { display: flex; align-items: center; gap: 4px; }
.scn-li > .scenery-row { flex: 1 1 auto; min-width: 0; }
.scn-lock { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer; opacity: 0.55; }
.scn-lock:hover, .scn-lock:focus-visible { opacity: 1; background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.scn-lock.is-locked { opacity: 1; color: var(--ink); }
.scn-eye { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer; opacity: 0.55; }
.scn-eye:hover, .scn-eye:focus-visible { opacity: 1; background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.scn-eye.is-on { opacity: 1; color: var(--primary); background: rgba(0, 0, 0, 0.06); }
.isolate-banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 999px; background: var(--ink); color: #fff; font: 500 13px/1.3 var(--font-ui); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); z-index: 5; }
.isolate-banner[hidden] { display: none; }
.isolate-banner .btn { padding: 3px 10px; color: var(--ink); background: #fff; border-color: #fff; }
.scn-li.is-locked .layout-row-name::after { content: ' (locked)'; color: var(--ink-soft); font-weight: 400; }
.scn-trees { align-items: flex-start; }
.scn-trees > .scn-lock { margin-top: 6px; }
.scn-tree-list { flex: 1 1 auto; min-width: 0; }
.scn-tree-list > summary { list-style: none; cursor: pointer; display: block; }
.scn-tree-list > summary::-webkit-details-marker { display: none; }
.scn-tree-list > summary .layout-row-name::before { content: '▸ '; color: var(--ink-soft); }
.scn-tree-list[open] > summary .layout-row-name::before { content: '▾ '; }
.scn-tree-list > .lib-list { margin: 0 0 4px 12px; border-left: 2px solid rgba(0, 0, 0, 0.08); padding-left: 6px; }
.scn-tree-list .scn-li .scenery-row { padding: 5px 2px; }
.panel-title-lock { display: flex; align-items: center; gap: 6px; }
.panel-title-lock .scn-lock { margin-left: auto; }
.scn-locked-note { margin-top: -4px; }
.scenery-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 10px; }
.scenery-cat { display: flex; align-items: center; justify-content: flex-start; gap: 7px; text-align: left; padding: 6px 8px; font-size: 12px; min-width: 0; }
.scenery-cat span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scenery-cat svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tree-species { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 10px; }
.tree-chip {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--panel);
  font: 500 13px var(--font-ui); color: var(--ink); cursor: pointer; text-align: left;
}
.tree-chip i { width: 16px; height: 16px; border-radius: 50%; background: var(--tree); border: 2px solid var(--tree-edge); flex-shrink: 0; }
.tree-chip[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--field); }
.plan[data-mode="track"] .layer-scenery { opacity: 0.45; pointer-events: none; }
.plan[data-mode="track"] .layer-trestles { opacity: 0.6; pointer-events: none; }
.plan[data-mode="benchwork"] .layer-trestles, .plan[data-mode="room"] .layer-trestles { opacity: 0.75; pointer-events: none; }
.plan[data-mode="all"] .layer-trestles { opacity: 1; pointer-events: auto; }
.plan[data-mode="all"] .trestle, .plan[data-mode="bridges"][data-tool="select"] .trestle { cursor: move; }
.plan[data-mode="bridges"][data-tool="trestle"] { cursor: crosshair; }
.plan[data-mode="scenery"] .layer-trestles { opacity: 0.7; pointer-events: none; }
.plan[data-mode="bridges"] .layer-scenery { opacity: 0.6; pointer-events: none; }
.plan[data-mode="bridges"] .layer-track { opacity: 0.8; pointer-events: none; }
.plan[data-mode="bridges"] .layer-room, .plan[data-mode="bridges"] .layer-roomTop { opacity: 0.9; }
/* Trestles: the deck as a band under the track, bents as ticks across it. */
.trestle-deck { fill-opacity: 0.85; stroke: rgba(0, 0, 0, 0.45); stroke-width: 1; }
.trestle-wall { stroke: #5F5C55; stroke-width: 3; stroke-linecap: round; pointer-events: none; }
.trestle-bank { fill-opacity: 0.6; stroke: rgba(0, 0, 0, 0.35); stroke-width: 1; stroke-dasharray: 4 3; }
.trestle-bents { fill: none; stroke: rgba(0, 0, 0, 0.5); stroke-width: 1.2; }
.trestle-steel .trestle-bents { stroke: rgba(255, 255, 255, 0.45); }
.trestle-ramp { fill: none; stroke: #F5B700; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.trestle-selected-edge { fill: none; stroke: var(--signal); stroke-width: 2.5; stroke-dasharray: 6 4; pointer-events: none; }
.trestle-label { fill: #FFFFFF; font: 600 12px var(--font-head); text-anchor: middle; paint-order: stroke; stroke: rgba(30, 20, 15, 0.8); stroke-width: 3px; pointer-events: none; }
.trestle.is-ghost { opacity: 0.45; pointer-events: none; }
.mountain-draft.draft-trestle { stroke: #6B4A2F; stroke-opacity: 0.7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: none; }
:is(.plan.on-paper, :root[data-theme="print"] .plan) .trestle-label { fill: #3A4541; stroke: #FFFFFF; }
.plan[data-mode="benchwork"] .layer-scenery, .plan[data-mode="room"] .layer-scenery { opacity: 0.75; pointer-events: none; }
.scenery-list { margin-top: 12px; }
.scenery-row { padding: 8px 2px; }

/* ---- All mode ------------------------------------------------------------ */
.plan[data-mode="all"] .table, .plan[data-mode="all"] .track-piece, .plan[data-mode="all"] .room-item, .plan[data-mode="all"] .mountain-outline { cursor: move; }
.plan[data-mode="all"] .layer-track, .plan[data-mode="all"] .layer-scenery, .plan[data-mode="all"] .layer-room, .plan[data-mode="all"] .layer-roomTop { opacity: 1; pointer-events: auto; }

/* Sign-in dialog note + the /sso.php error page */
.dialog-note a { color: var(--primary); font-weight: 600; }
.dialog-actions a.btn-link { text-decoration: underline; }
.dialog-note { margin: 4px 0 16px; line-height: 1.45; padding: 8px 10px; border-left: 3px solid var(--primary); background: var(--panel-soft, #f3f5f4); color: var(--ink-soft); font-size: 13px; border-radius: 0 6px 6px 0; }
.sso-page { display: grid; place-items: center; min-height: 100vh; margin: 0; background: var(--bg, #1f3a30); }
.sso-card { max-width: 420px; margin: 24px; padding: 28px 28px 24px; background: var(--panel, #fff); color: var(--ink, #1a1a1a); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); text-align: center; }
.sso-logo { width: 180px; height: auto; margin-bottom: 12px; }
.sso-card h1 { font-size: 20px; margin: 0 0 8px; }
.sso-card p { color: var(--ink-soft, #555); font-size: 14px; line-height: 1.5; }
.sso-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---- Export & share ------------------------------------------------------ */

.dialog-export { width: min(640px, calc(100vw - 32px)); }
.export-list { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.export-card { display: flex; align-items: center; gap: 12px 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.export-text { flex: 1; min-width: 0; }
.export-card h3 { margin: 0 0 2px; font: 700 16px/1.2 var(--font-head); }
.export-card p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.export-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex-shrink: 0; max-width: 46%; }
.export-paper { margin-top: 8px; }
.export-paper > span { display: inline; }
.export-check { margin-top: 8px; font-size: 13px; }
.share-row { display: flex; gap: 6px; margin-top: 8px; }
.share-row input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 6px; background: var(--field); color: var(--ink); font: 13px var(--font-ui); }
.share-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 560px) {
  .export-card { flex-direction: column; align-items: stretch; }
  .export-actions { max-width: none; justify-content: flex-start; }
}

/* Plan drawn for paper (printed plan and full-size templates): dark lines on white. */
:is(.plan.on-paper, :root[data-theme="print"] .plan) .room { fill: none; stroke: #3A4541; }
:is(.plan.on-paper, :root[data-theme="print"] .plan) .room-label { fill: #3A4541; }
:is(.plan.on-paper, :root[data-theme="print"] .plan) .grid-origin { stroke: rgba(0, 0, 0, 0.35); }
:is(.plan.on-paper, :root[data-theme="print"] .plan) .door-leaf, :is(.plan.on-paper, :root[data-theme="print"] .plan) .door-arc, :is(.plan.on-paper, :root[data-theme="print"] .plan) .slider-arrow { stroke: #3A4541; }
:is(.plan.on-paper, :root[data-theme="print"] .plan) .slider-walk { stroke: #3A4541; }
:is(.plan.on-paper, :root[data-theme="print"] .plan) .tunnel-bore { stroke: #3A4541; }
:is(.plan.on-paper, :root[data-theme="print"] .plan) .water-ripple { stroke: rgba(255, 255, 255, 0.5); }
:is(.plan.on-paper, :root[data-theme="print"] .plan) .track-bed-top { stroke: rgba(0, 0, 0, 0.08); }

/* ---- Shared layout page -------------------------------------------------- */

body.share-page { grid-template-rows: auto 1fr var(--footer-h); }
.share-actions-top { margin-left: auto; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
a.btn:not(.btn-primary) { color: var(--ink); }
.share-main { display: flex; flex-direction: column; min-height: 0; padding: 14px 16px 10px; gap: 10px; }
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.share-title h1 { margin: 0; font: 700 24px/1.15 var(--font-head); }
.share-meta { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }
.share-plan { position: relative; flex: 1; min-height: 260px; border-radius: 10px; overflow: hidden; background: var(--mat); }
.share-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.share-svg.is-panning { cursor: grabbing; }
.share-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #EEF1EE; font: 600 16px var(--font-head); }
.share-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 4px; padding: 5px; border-radius: 10px; background: rgba(20, 42, 34, 0.82); }
.share-zoom button { min-width: 36px; height: 34px; border: 0; border-radius: 7px; background: rgba(255, 255, 255, 0.08); color: #EEF1EE; font: 600 15px var(--font-ui); cursor: pointer; }
.share-zoom button:hover { background: rgba(255, 255, 255, 0.18); }
.share-cta { margin: 0; font-size: 14px; color: var(--ink-soft); }
.share-missing { max-width: 520px; margin: 10vh auto; text-align: center; }
.share-missing h1 { font: 700 26px/1.2 var(--font-head); }
@media (max-width: 640px) {
  .share-actions-top { width: auto; margin-left: 0; }
  .share-title h1 { font-size: 20px; }
}
/* Full-size templates: outlines and rails, very little ink. */
.plan.on-template .table-top { fill: none; stroke: #3A4541; stroke-width: 1.5; }
.plan.on-template .table-joists { stroke: rgba(58, 69, 65, 0.25); }
.plan.on-template .track-bed { stroke-opacity: 0.16; }
.plan.on-template .track-bed-top { stroke: none; }
.plan.on-template .track-ties { stroke-opacity: 0.45; }
.plan.on-template .track-rail { stroke: #17241F; stroke-width: 1; }
.plan.on-template .track-rail-centre { stroke: #4F5E58; stroke-width: 0.8; }
.plan.on-template .track-centreline { stroke: #C7372F; stroke-width: 0.8; stroke-dasharray: 8 5; }
.plan.on-template .tree, .plan.on-template .bld, .plan.on-template .mountain-outline, .plan.on-template .water { opacity: 0.35; }

/* ---- Build Demo ---------------------------------------------------------- */
.btn-demo { background: linear-gradient(135deg, #2F7A50, #1E5B3A); color: #fff; border-color: transparent; }
.btn-demo:hover { filter: brightness(1.1); }
.demo-overlay { position: fixed; inset: 0; z-index: 60; cursor: default; }
.is-demo .empty-state, .is-demo #toast { display: none !important; }
.demo-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70;
  width: min(720px, calc(100vw - 32px)); padding: 12px 16px 12px; border-radius: 14px;
  background: rgba(20, 24, 22, 0.92); color: #F2F2EE; box-shadow: 0 12px 40px rgba(0,0,0,0.35); backdrop-filter: blur(6px);
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'dots dots' 'caption actions'; gap: 8px 16px; align-items: center;
  font-family: inherit;
}
.demo-dots { grid-area: dots; display: flex; gap: 6px; }
.demo-dot { width: 22px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.18); transition: background 0.3s; }
.demo-dot.is-on { background: #7FD39A; }
.demo-caption { grid-area: caption; margin: 0; font-size: 15px; line-height: 1.35; }
.demo-actions { grid-area: actions; display: flex; gap: 6px; }
.demo-bar .btn { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.2); }
.demo-bar .btn.btn-primary { background: #2F7A50; border-color: #2F7A50; }
.is-3d .demo-bar { z-index: 1200; }
@media (max-width: 640px) {
  .demo-bar { grid-template-areas: 'dots dots' 'caption caption' 'actions actions'; }
  .demo-actions { justify-content: flex-end; }
}
.is-demo-playing #view3d-train, .is-demo-playing .view3d-fade, .is-demo-playing #view3d-pad { display: none !important; }

/* ---- Templates ------------------------------------------------------------- */
.dialog-templates { width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.dialog-head-actions { display: flex; gap: 8px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-top: 6px; }
.template-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); }
.template-card h3 { margin: 4px 0 0; font: 700 16px/1.25 var(--font-head); }
.template-thumb svg { display: block; width: 100%; height: auto; }
.template-meta { margin: 0; font-size: 12px; color: var(--ink-soft); }
.template-blurb { margin: 0 0 6px; font-size: 13px; line-height: 1.4; flex: 1; }
.empty-state .btn + .btn { margin-left: 8px; }
/* Settings: tabs, and two columns inside a pane where there's enough to fill them. */
.settings-tabs { margin: 0 0 14px; }
.settings-tabs [role="tab"][aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); }
.settings-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; align-items: start; }
.settings-pane[hidden] { display: none; }   /* the grid display above would otherwise beat the hidden attribute */
.settings-pane .lib-group:first-child { margin-top: 0; }
.settings-pane .check .help-link { margin-left: 4px; font-weight: 600; text-decoration: none; }
@media (max-width: 560px) { .settings-cols { grid-template-columns: 1fr; } }
.settings-row { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; flex-wrap: wrap; }
.settings-row .panel-note { margin: 0; flex: 1; min-width: 160px; }
.settings-grid-style { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.settings-color input[type="color"] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--rule); border-radius: 6px; background: var(--field); cursor: pointer; }
.settings-field input[type="range"] { width: 100%; margin: 8px 0 0; accent-color: var(--primary); }
.settings-field output { margin-left: 6px; font-weight: 400; }
.check small { margin: 0; font-size: 12px; }
#settings-dialog .check + .field { margin-top: 12px; }

/* ---- Help menu and contact form ------------------------------------------- */
.help-wrap { position: relative; }
.help-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; min-width: 250px; padding: 6px; border-radius: 10px; background: var(--panel); color: var(--ink); box-shadow: 0 12px 36px rgba(10, 30, 22, 0.28); border: 1px solid var(--rule); }
.help-menu[hidden] { display: none; }
.help-menu a, .help-menu button { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 9px 12px; border: 0; border-radius: 7px; background: none; color: inherit; font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.help-menu a:hover, .help-menu button:hover, .help-menu a:focus-visible, .help-menu button:focus-visible { background: var(--bg-soft, rgba(46, 94, 78, 0.1)); outline: none; }
.help-menu small { font-size: 12px; color: var(--ink-soft); }
.help-menu a + button { margin-top: 4px; border-top: 1px solid var(--rule); border-radius: 0 0 7px 7px; padding-top: 11px; }
#contact-dialog textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; font: inherit; resize: vertical; }
#contact-dialog select { width: 100%; }
.contact-website { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.field.is-invalid input, .field.is-invalid textarea, .field.is-invalid select { border-color: var(--stop); }
.field-error { margin: 3px 0 0; font-size: 12px; color: var(--stop); }
/* ---- Help page --------------------------------------------------------------- */
.help-page { display: flex; flex-direction: column; min-height: 100vh; }
.help-main { flex: 1; padding: 28px 16px 48px; background: var(--bg, #F3F5F2); overflow: auto; }
.help-doc { max-width: 760px; margin: 0 auto; font-size: 16px; line-height: 1.55; }
.help-doc h1 { margin: 0 0 10px; font: 700 34px/1.15 var(--font-head); }
.help-lede { font-size: 18px; color: var(--ink-soft); margin: 0 0 22px; }
.help-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 12px 16px; margin-bottom: 26px; border-radius: 10px; background: var(--panel); border: 1px solid var(--rule); font-size: 14px; }
.help-toc a { color: var(--ink); text-decoration: none; }
.help-toc a:hover { text-decoration: underline; }
.help-doc section { margin-bottom: 30px; scroll-margin-top: 20px; }
.help-doc h2 { margin: 0 0 8px; font: 700 23px/1.2 var(--font-head); }
.help-doc ul { padding-left: 22px; }
.help-doc li { margin-bottom: 6px; }
.help-keys { border-collapse: collapse; width: 100%; font-size: 15px; }
.help-keys td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.help-keys th { text-align: left; padding: 16px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); border-bottom: 1px solid var(--rule); }
.help-keys td:first-child { white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; width: 190px; }
.contact-profile { margin: -4px 0 12px; font-size: 13px; color: var(--ink-soft); }

/* ---- My Profile ------------------------------------------------------------- */
.dialog-profile { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.profile-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.profile-form .form-span { grid-column: 1 / -1; }
.profile-form .lib-group { margin-top: 14px; }
.profile-form .lib-group small { font-weight: 400; color: var(--ink-soft); }
.profile-form input[readonly] { color: var(--ink-soft); background: var(--bg, #F3F5F2); }
#password-form { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 4px; }
@media (max-width: 520px) { .profile-form .form-grid { grid-template-columns: 1fr; } }

/* ---- Account dialog (profile + layouts) --------------------------------------- */
.dialog-account .account-section + .account-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.dialog-account .dialog-head { margin-bottom: 6px; }
.account-facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 8px 0 12px; font-size: 14px; }
.account-facts dt { color: var(--ink-soft); }
.account-facts dd { margin: 0; }
.account-facts:empty { display: none; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2px; }
#account-backup-note { margin: 8px 0 0; }
.dialog-account .layout-list { margin-bottom: 4px; }
/* Four buttons here: let the row wrap instead of pushing the dialog wider than its box. */
.dialog-account .dialog-actions { flex-wrap: wrap; row-gap: 8px; }
.dialog-account .dialog-actions .spacer { flex: 1 0 auto; }
.demo-close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,0.12); color: #fff; cursor: pointer; display: grid; place-items: center; }
.demo-close:hover { background: rgba(255,255,255,0.25); }
.demo-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.demo-bar { padding-right: 44px; }

/* Fences and walls on the plan. */
.fence-line { fill: none; stroke-linecap: butt; stroke-linejoin: round; }
.fence-line-edge { fill: none; stroke: rgba(0, 0, 0, 0.35); stroke-linejoin: round; stroke-linecap: butt; }
.fence-fence .fence-line-edge { stroke-dasharray: 6 3; }
.fence-wall-body { fill: none; stroke-linejoin: miter; stroke-linecap: butt; }
.fence-wall-edge { fill: none; stroke: rgba(0, 0, 0, 0.5); stroke-dasharray: 4 2; stroke-linejoin: miter; stroke-linecap: butt; }
.fence-post { stroke: rgba(0, 0, 0, 0.45); stroke-width: 0.6; }
.fence-selected { fill: none; stroke: var(--signal); opacity: 0.5; pointer-events: none; stroke-linejoin: round; stroke-linecap: round; }
.fence.is-ghost { opacity: 0.6; }
.fence-label { font: 600 11px var(--font-ui); fill: #17241F; text-anchor: middle; paint-order: stroke; stroke: rgba(255, 255, 255, 0.85); stroke-width: 3px; pointer-events: none; }

/* A lake's dam on the plan. */
.dam-band { stroke: rgba(0, 0, 0, 0.55); stroke-width: 1.2; stroke-linejoin: miter; }
.dam-crest { stroke: rgba(0, 0, 0, 0.4); stroke-width: 1; stroke-dasharray: 3 2; }
.dam-pier { stroke: rgba(0, 0, 0, 0.6); stroke-width: 1.6; }
.dam.is-selected .dam-band { stroke: var(--signal); stroke-width: 2; }

/* Learn: lessons in a sandbox. */
.learn-group { margin: 14px 0 6px; font: 700 12px/1.2 var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.learn-list { margin-bottom: 4px; }
.learn-record { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 8px; }
.learn-record > summary { cursor: pointer; font: 600 13px/1.3 var(--font-ui); color: var(--ink-soft); }
.learn-steps { width: 100%; margin-top: 8px; font: 11px/1.4 ui-monospace, Menlo, monospace; border: 1px solid var(--rule); border-radius: 6px; padding: 6px; resize: vertical; }
.learn-title { font: 700 12px/1.2 var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: #B9CBBF; }
.learn-cursor { position: fixed; left: 0; top: 0; z-index: 1300; width: 26px; height: 26px; pointer-events: none; transform: translate(-100px, -100px); filter: drop-shadow(0 2px 3px rgba(0,0,0,0.45)); transition: scale .12s; }
.learn-cursor svg { width: 100%; height: 100%; fill: #FFFFFF; stroke: #17241F; stroke-width: 1.4; stroke-linejoin: round; }
.learn-cursor.is-down { scale: 0.82; }
.learn-cursor[hidden] { display: none; }
.learn-ring { position: fixed; z-index: 1290; pointer-events: none; border: 3px solid var(--signal); border-radius: 10px; box-shadow: 0 0 0 4px rgba(242, 182, 28, 0.25); animation: learn-pulse 1s ease-in-out infinite; }
.learn-ring[hidden] { display: none; }
@keyframes learn-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(242, 182, 28, 0.2); } 50% { box-shadow: 0 0 0 8px rgba(242, 182, 28, 0.35); } }
.is-learn [data-mode-tab="learn"]::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--signal); vertical-align: middle; }

/* Flex track row at the top of the track library. */
.lib-flex { align-items: center; gap: 10px; }
.lib-flex .btn { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.lib-flex-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.lib-flex-note { font-size: 12px; color: var(--ink-soft); line-height: 1.3; }

/* Mini 3D preview in the inspector. */
.mini3d { height: 200px; margin: 0 0 12px; border-radius: 10px; overflow: hidden; background: #DCE3E0; border: 1px solid var(--rule); cursor: grab; }
.mini3d:active { cursor: grabbing; }
.mini3d-canvas { display: block; width: 100% !important; height: 100% !important; }

/* Build me a layout */
.dialog-builder { width: min(600px, calc(100vw - 32px)); }
.builder-steps { display: flex; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.builder-steps li { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--rule); font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.builder-steps li.is-current { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.builder-steps li.is-done { background: var(--field); cursor: pointer; }
.builder-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.builder-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.builder-card:hover { border-color: var(--primary); background: var(--field); }
.builder-card[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.builder-card strong { font-size: 15px; }
.builder-card span { font-size: 12.5px; line-height: 1.35; color: var(--ink-soft); }
.builder-space { margin-bottom: 12px; }
.builder-preview svg { display: block; width: 100%; height: auto; border-radius: 8px; }
.builder-name { margin: 12px 0 2px; font: 700 18px/1.25 var(--font-head); }
.builder-summary { margin: 0 0 8px; font-size: 14px; }
.builder-notes { margin: 0 0 10px; padding-left: 18px; font-size: 13px; color: var(--ink-soft); }
.builder-error { padding: 12px 14px; border-radius: 8px; background: var(--field); color: var(--stop); font-size: 14px; }

/* Shortcuts popup: the common keys in one column, the per-tab keys in the other. */
.dialog-shortcuts { width: min(1240px, calc(100vw - 32px)); max-height: calc(100dvh - 24px); overflow: auto; }
.dialog-shortcuts .lede { margin: -6px 0 10px; font-size: 13px; color: var(--ink-soft); }
.shortcuts-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 26px; align-items: start; }
.shortcuts-cols .help-keys { font-size: 14px; }
.shortcuts-cols .help-keys td { padding: 4px 8px 4px 0; }
.shortcuts-cols .help-keys td:first-child { width: 150px; font-size: 13px; }
.shortcuts-cols .help-keys th { padding-top: 10px; }
.shortcuts-cols .help-keys tr:first-child th { padding-top: 0; }
@media (max-width: 1000px) { .shortcuts-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .shortcuts-cols { grid-template-columns: 1fr; } .shortcuts-cols .help-keys td:first-child { width: 130px; } }

/* ---- the showroom: every road vehicle on a turntable, to choose one for the garage ---- */
.dialog-showroom { width: min(1040px, calc(100vw - 32px)); }
.showroom { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 18px; align-items: start; }
.showroom[data-step="customize"] { grid-template-columns: minmax(0, 1fr) 320px; }
.showroom[data-step="customize"] .showroom-brands { display: none; }
.showroom-brands { display: flex; flex-direction: column; gap: 3px; }
.showroom-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-weight: 600; color: var(--ink-soft); text-align: left; cursor: pointer; }
.showroom-brand span { font-size: 12px; font-weight: 500; opacity: 0.75; }
.showroom-brand:hover { background: var(--field); color: var(--ink); }
.showroom-brand[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
.showroom-brand:focus-visible, .showroom-arrow:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }
.showroom-stage { position: relative; }
.showroom-turntable { height: 380px; margin: 0; background: #14171B; border-color: #14171B; }
.showroom-arrow { position: absolute; top: 50%; display: grid; place-items: center; width: 44px; height: 44px; padding: 0 0 4px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; transform: translateY(-50%); }
.showroom-arrow:hover { background: rgba(255, 255, 255, 0.3); }
.showroom-prev { left: 12px; }
.showroom-next { right: 12px; }
.showroom-plate { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 12px 0 12px; }
.showroom-plate h3 { margin: 0; font: 700 22px/1.2 var(--font-head); }
.showroom-plate p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.showroom-lineup { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.showroom-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.showroom-options h3 { margin: 0 0 10px; font: 700 18px/1.2 var(--font-head); }
/* The Roundhouse (locomotives and cars) is the same room with a longer list of options and the builder's side and
   top drawings under the turntable. */
.roundhouse[data-step="customize"] { grid-template-columns: minmax(0, 1fr) 340px; }
.roundhouse .showroom-turntable { height: 360px; background: #F1EEE6; border-color: #D9D4C7; }
.roundhouse .showroom-arrow { background: rgba(20, 23, 27, 0.5); }
.roundhouse .showroom-arrow:hover { background: rgba(20, 23, 27, 0.72); }
.roundhouse .roster-preview { position: relative; margin: 0; cursor: zoom-in; }
.roundhouse .showroom-lineup .tree-chip { padding: 6px 10px; }
.roundhouse .showroom-options .roster-colors { margin-bottom: 10px; }
/* The tender toggle under the name plate, for engines that can be had with more than one kind. */
.rh-tender { display: flex; align-items: center; gap: 10px; margin: -2px 0 12px; font-size: 13px; color: var(--ink-soft); }
.rh-tender > span { font-weight: 600; }
.roundhouse .field-inline em { position: absolute; right: 10px; bottom: 9px; font-style: normal; font-size: 13px; color: var(--ink-soft); pointer-events: none; }
.roundhouse .showroom-options .field { margin-bottom: 10px; }
@media (max-width: 760px) {
  .roundhouse, .roundhouse[data-step="customize"] { grid-template-columns: 1fr; }
  .roundhouse .showroom-brands { flex-direction: row; flex-wrap: wrap; }
  .roundhouse .showroom-turntable { height: 240px; }
}
.garage-showroom { margin-top: 12px; }
@media (max-width: 760px) {
  .showroom, .showroom[data-step="customize"] { grid-template-columns: minmax(0, 1fr); }
  .showroom-brands { flex-direction: row; flex-wrap: wrap; }
  .showroom-turntable { height: 250px; }
}


/* ---- Theme: Frutiger Aero ------------------------------------------------
   The mid-2000s look: sky blue and fresh green, glass panels, glossy gel buttons with a highlight across the top,
   soft glows and floating bubbles. The plan's mat becomes clear blue water. Everything here is scoped to
   data-theme="aero", and sits last in the file so it wins over the base styles. */
:root[data-theme="aero"] {
  --mat: #1E8FD3;
  --mat-deep: #0B5FA3;
  --mat-line: rgba(255, 255, 255, 0.1);
  --mat-major: rgba(255, 255, 255, 0.42);
  --ink: #0A3554;
  --ink-soft: #3C6C8A;
  --paper: #CFEBFA;
  --panel: #F3FAFE;
  --rule: #A8D4EC;
  --field: #FFFFFF;
  --primary: #1787D1;
  --primary-ink: #FFFFFF;
  --focus: #7ACC12;
  --font-ui: 'Frutiger', 'Frutiger Linotype', 'Segoe UI', 'Myriad Pro', 'Helvetica Neue', 'Barlow', system-ui, sans-serif;
  --font-head: 'Frutiger', 'Frutiger Linotype', 'Segoe UI', 'Myriad Pro', 'Helvetica Neue', 'Barlow Semi Condensed', system-ui, sans-serif;
  --aero-gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.5) 48%, rgba(255, 255, 255, 0.12) 52%, rgba(255, 255, 255, 0.3) 100%);
  --aero-glass: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(232, 246, 254, 0.9) 45%, rgba(205, 233, 250, 0.92) 100%);
  --aero-blue: linear-gradient(180deg, #8EDBFF 0%, #3FB2F0 46%, #1486D2 52%, #2FA4E8 100%);
  --aero-green: linear-gradient(180deg, #D2F78C 0%, #8FDA36 46%, #5DB80F 52%, #86D62B 100%);
  color-scheme: light;
}
:root[data-theme="aero"] body {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.7) 0 22px, rgba(255, 255, 255, 0) 60px),
    radial-gradient(circle at 86% 30%, rgba(255, 255, 255, 0.5) 0 30px, rgba(255, 255, 255, 0) 90px),
    linear-gradient(180deg, #7CCBF5 0%, #CFEBFA 45%, #DDF5C4 100%);
}
/* Bars: frosted glass with a bright top edge. */
:root[data-theme="aero"] .topbar {
  background: var(--aero-glass);
  border-bottom: 1px solid #8CC6E8;
  box-shadow: inset 0 1px 0 #FFFFFF, 0 2px 10px rgba(20, 110, 180, 0.25);
  position: relative;
  z-index: 2;
}
:root[data-theme="aero"] .statusbar { background: var(--aero-glass); border-top: 1px solid #8CC6E8; box-shadow: inset 0 1px 0 #FFFFFF; }
:root[data-theme="aero"] .site-footer { background: linear-gradient(180deg, #2FA4E8, #0B5FA3); }
:root[data-theme="aero"] .wordmark-name { color: #0B5FA3; text-shadow: 0 1px 0 #FFFFFF; }
/* The side panel: glass over the sky, with a faint bubble or two. */
:root[data-theme="aero"] .inspector {
  background:
    radial-gradient(circle at 88% 6%, rgba(255, 255, 255, 0.9) 0 10px, rgba(160, 220, 255, 0.35) 11px 38px, rgba(255, 255, 255, 0) 39px),
    radial-gradient(circle at 14% 62%, rgba(255, 255, 255, 0.7) 0 6px, rgba(170, 230, 160, 0.25) 7px 26px, rgba(255, 255, 255, 0) 27px),
    linear-gradient(180deg, #FAFDFF 0%, #E6F5FD 55%, #E9F8DC 100%);
  background-attachment: local;
  border-left: 1px solid #8CC6E8;
  box-shadow: inset 1px 0 0 #FFFFFF;
}
:root[data-theme="aero"] .panel { border-bottom: 1px solid rgba(120, 190, 230, 0.55); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9); }
:root[data-theme="aero"] .panel-title, :root[data-theme="aero"] .dialog h2 { color: #0B5FA3; text-shadow: 0 1px 0 #FFFFFF; }
/* Buttons: gel pills with a gloss across the top half. */
:root[data-theme="aero"] .btn {
  border: 1px solid #86BFE2;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFFFFF 0%, #EAF6FD 48%, #CFE9F9 52%, #E4F4FD 100%);
  box-shadow: inset 0 1px 0 #FFFFFF, 0 1px 3px rgba(20, 110, 180, 0.25);
  color: #0A3554;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}
:root[data-theme="aero"] .btn:hover:not(:disabled) { border-color: #3FA7E6; box-shadow: inset 0 1px 0 #FFFFFF, 0 0 0 3px rgba(90, 190, 255, 0.35), 0 1px 3px rgba(20, 110, 180, 0.3); }
:root[data-theme="aero"] .btn:active:not(:disabled) { background: linear-gradient(180deg, #CFE9F9 0%, #E4F4FD 100%); box-shadow: inset 0 2px 4px rgba(20, 90, 150, 0.3); }
:root[data-theme="aero"] .btn-primary,
:root[data-theme="aero"] .mode-tabs button[aria-selected="true"],
:root[data-theme="aero"] .btn-icon.is-on,
:root[data-theme="aero"] .btn-train[aria-pressed="true"] {
  background: var(--aero-blue);
  border-color: #0B6DB8;
  color: #FFFFFF;
  text-shadow: 0 -1px 0 rgba(0, 60, 110, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 1px 4px rgba(10, 90, 160, 0.45);
}
:root[data-theme="aero"] .btn-primary:hover:not(:disabled) { background: var(--aero-blue); border-color: #0B6DB8; filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 3px rgba(90, 190, 255, 0.4), 0 1px 4px rgba(10, 90, 160, 0.45); }
:root[data-theme="aero"] .btn-demo { background: var(--aero-green); border-color: #4E9E0C; color: #173B00; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 4px rgba(60, 130, 10, 0.45); }
:root[data-theme="aero"] .btn-danger, :root[data-theme="aero"] .btn-danger-outline { color: #B3261E; }
:root[data-theme="aero"] .btn-link { text-shadow: none; }
/* The tool rail and its mode tabs. */
:root[data-theme="aero"] .mode-tabs { border: 1px solid #8CC6E8; border-radius: 12px; background: linear-gradient(180deg, #FFFFFF, #DCF0FB); box-shadow: inset 0 1px 0 #FFFFFF, 0 1px 3px rgba(20, 110, 180, 0.2); }
:root[data-theme="aero"] .mode-tabs button { border-radius: 9px; }
:root[data-theme="aero"] .tool { border-radius: 12px; }
:root[data-theme="aero"] .tool:hover:not(:disabled) { background: linear-gradient(180deg, #FFFFFF, #DCF0FB); box-shadow: inset 0 1px 0 #FFFFFF, 0 0 0 1px #A8D4EC; }
:root[data-theme="aero"] .tool[aria-pressed="true"] { background: linear-gradient(180deg, #F2FBFF 0%, #BFE6FB 100%); box-shadow: inset 0 1px 0 #FFFFFF, inset 0 0 0 1.5px #3FA7E6, 0 0 8px rgba(90, 190, 255, 0.6); }
:root[data-theme="aero"] .segmented button[aria-checked="true"] { background: var(--aero-blue); color: #FFFFFF; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7); }
/* Fields: white wells with a soft inner shadow and a glowing focus ring. */
:root[data-theme="aero"] .field input, :root[data-theme="aero"] .field select, :root[data-theme="aero"] select, :root[data-theme="aero"] input[type="text"], :root[data-theme="aero"] input[type="number"] {
  border-color: #8CC6E8;
  border-radius: 8px;
  box-shadow: inset 0 2px 3px rgba(20, 90, 150, 0.14);
}
:root[data-theme="aero"] .field input:focus, :root[data-theme="aero"] select:focus { border-color: #3FA7E6; box-shadow: inset 0 2px 3px rgba(20, 90, 150, 0.12), 0 0 0 3px rgba(90, 190, 255, 0.45); }
:root[data-theme="aero"] .swatch { border-radius: 50%; box-shadow: inset 0 6px 6px -3px rgba(255, 255, 255, 0.65), 0 1px 2px rgba(20, 90, 150, 0.35); }
:root[data-theme="aero"] .tree-chip { border-radius: 999px; background: linear-gradient(180deg, #FFFFFF, #E4F4FD); box-shadow: inset 0 1px 0 #FFFFFF; }
/* The plan: clear blue water, lighter towards the top, with light playing across it. */
:root[data-theme="aero"] .canvas-wrap {
  background:
    radial-gradient(ellipse at 22% -8%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 82% 16%, rgba(190, 255, 170, 0.22) 0%, rgba(190, 255, 170, 0) 30%),
    linear-gradient(180deg, #45B5EE 0%, #1E8FD3 45%, #0E6DB4 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5), inset 0 8px 24px rgba(255, 255, 255, 0.18);
}
:root[data-theme="aero"] .zoom-controls { border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.12) 50%, rgba(10, 70, 130, 0.45) 51%, rgba(10, 70, 130, 0.35)); box-shadow: 0 2px 10px rgba(5, 50, 100, 0.4); backdrop-filter: blur(6px); }
/* Dialogs: a pane of glass with a glow round it. */
:root[data-theme="aero"] .dialog {
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.95) 0 12px, rgba(150, 215, 255, 0.35) 13px 46px, rgba(255, 255, 255, 0) 47px),
    linear-gradient(180deg, #FFFFFF 0%, #EAF6FD 60%, #E3F6D6 100%);
  box-shadow: 0 0 0 1px #6DB7E4, 0 0 40px rgba(110, 200, 255, 0.55), 0 24px 60px rgba(5, 60, 110, 0.45);
}
:root[data-theme="aero"] .dialog::backdrop { background: radial-gradient(circle at 50% 30%, rgba(120, 205, 255, 0.35), rgba(5, 50, 100, 0.55)); backdrop-filter: blur(3px); }
:root[data-theme="aero"] .dialog-console .dialog-head { background: linear-gradient(180deg, #FFFFFF, #F1F9FE); }
:root[data-theme="aero"] .toast { border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 999px; background: var(--aero-blue); color: #FFFFFF; text-shadow: 0 -1px 0 rgba(0, 60, 110, 0.5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 6px 20px rgba(5, 60, 110, 0.4); }
:root[data-theme="aero"] .toast[data-kind="error"] { background: linear-gradient(180deg, #FF9A8F 0%, #E2463A 48%, #C3281D 52%, #DA4034 100%); }
:root[data-theme="aero"] .inspector::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #BFE3F8, #7FC4EE); border: 2px solid #EAF6FD; }

/* Choosing Frutiger Aero in Settings: the Transform button beside the theme list, then the wipe it sets off.
   The page as it was stays put underneath while the new look is uncovered from the left, a band of light on its edge. */
/* The button hangs off the right of the list without taking any room, so nothing else in Settings moves when it appears. */
.field > .theme-row { position: relative; display: block; margin-bottom: 0; font-size: inherit; font-weight: inherit; color: inherit; }
.btn-transform {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  margin-top: -17px;
  height: 34px;
  padding-block: 0;
  border: 1px solid #0B6DB8;
  border-radius: 999px;
  background: linear-gradient(180deg, #8EDBFF 0%, #3FB2F0 46%, #1486D2 52%, #2FA4E8 100%);
  color: #FFFFFF;
  font-weight: 600;
  text-shadow: 0 -1px 0 rgba(0, 60, 110, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 0 0 0 rgba(90, 190, 255, 0.7);
  animation: aero-beckon 1.6s ease-in-out infinite;
}
.btn-transform:hover { border-color: #0B6DB8; filter: brightness(1.08); }
.btn-transform[hidden] { display: none; }
@keyframes aero-beckon { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 0 0 0 rgba(90, 190, 255, 0.7); } 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 0 0 6px rgba(90, 190, 255, 0); } }
html.aero-wipe::view-transition-old(root) { animation: none; }
html.aero-wipe::view-transition-new(root) { animation: aero-wipe 2.8s cubic-bezier(0.45, 0, 0.3, 1) both; }
@keyframes aero-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.aero-band {
  position: fixed;
  z-index: 9999;
  top: 0;
  bottom: 0;
  left: 0;
  width: 180px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(170, 230, 255, 0.35) 55%, rgba(255, 255, 255, 0.95) 97%, #FFFFFF 100%);
  animation: aero-band 2.8s cubic-bezier(0.45, 0, 0.3, 1) both;
}
@keyframes aero-band { 0% { transform: translateX(-180px); opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(calc(100vw - 180px)); opacity: 0; } }
/* And back out again: Aero itself is drawn away from right to left, uncovering the theme chosen underneath. */
html.aero-unwipe::view-transition-new(root) { animation: none; z-index: 1; mix-blend-mode: normal; }
html.aero-unwipe::view-transition-old(root) { animation: aero-unwipe 2.8s cubic-bezier(0.45, 0, 0.3, 1) both; z-index: 2; mix-blend-mode: normal; }
@keyframes aero-unwipe { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 100% 0 0); } }
.aero-band-back {
  background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, rgba(170, 230, 255, 0.35) 55%, rgba(255, 255, 255, 0.95) 97%, #FFFFFF 100%);
  animation-name: aero-band-back;
}
@keyframes aero-band-back { 0% { transform: translateX(100vw); opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(0); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .btn-transform { animation: none; } }
/* On a phone the list fills the dialog's width, so the button goes under it instead. */
@media (max-width: 560px) { .btn-transform { position: static; display: inline-block; margin-top: 8px; } .btn-transform[hidden] { display: none; } }

/* The Frutiger Aero logo: the track in a glass bubble, in place of the green tile, while that theme is on. */
.wordmark .wordmark-mark-aero { display: none; }
:root[data-theme="aero"] .wordmark .wordmark-mark:not(.wordmark-mark-aero) { display: none; }
:root[data-theme="steampunk"] .wordmark .wordmark-mark-aero { display: none; }
:root[data-theme="aero"] .wordmark .wordmark-mark-aero { display: block; filter: drop-shadow(0 1px 2px rgba(5, 60, 110, 0.35)); }


/* ---- Theme: Steampunk ------------------------------------------------------
   Victorian engineering: brass plates and copper pipe, riveted corners, parchment for paper, engraved serif lettering,
   and gears, one of them turning slowly behind the plan. The plan's mat becomes a dark leather desk top ruled in brass.
   Like Frutiger Aero it's put on and taken off with the Transform button (see transformTheme in app.js). */
:root[data-theme="steampunk"] {
  --mat: #3A2A1C;
  --mat-deep: #1E150D;
  --mat-line: rgba(214, 170, 90, 0.1);
  --mat-major: rgba(214, 170, 90, 0.42);
  --ink: #2A1A0E;
  --ink-soft: #6A4B2D;
  --paper: #B79A68;
  --panel: #E9D8B0;
  --rule: #9C7A45;
  --field: #F4E8C8;
  --primary: #9A4E1C;
  --primary-ink: #FBEFD0;
  --focus: #E0A12B;
  --font-ui: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif;
  --font-head: 'Playfair Display', 'Didot', 'Bodoni MT', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --brass: linear-gradient(180deg, #F1DC9A 0%, #D4B062 22%, #B08D57 55%, #8A6A35 100%);
  --copper: linear-gradient(180deg, #F0B58A 0%, #CF7F4A 30%, #A9561F 62%, #733A12 100%);
  --pipe: linear-gradient(180deg, #5A2C0C 0%, #B5651D 22%, #F2BE95 40%, #D9895A 52%, #8E4A1A 78%, #4A2409 100%);
  --rivets: radial-gradient(circle at 7px 50%, #FBEFC6 0 1.2px, #7A5A2A 1.6px 3px, rgba(0, 0, 0, 0) 3.4px), radial-gradient(circle at calc(100% - 7px) 50%, #FBEFC6 0 1.2px, #7A5A2A 1.6px 3px, rgba(0, 0, 0, 0) 3.4px);
  color-scheme: light;
}
:root[data-theme="steampunk"] body { background: #B79A68; }
/* The top bar: a brass plate, a copper pipe run along its foot. */
:root[data-theme="steampunk"] .topbar {
  background: var(--brass);
  border-bottom: 5px solid #8E4A1A;
  border-image: var(--pipe) 1;
  box-shadow: inset 0 1px 0 rgba(255, 246, 210, 0.8), 0 3px 8px rgba(40, 20, 5, 0.5);
  position: relative;
  z-index: 2;
}
:root[data-theme="steampunk"] .wordmark-name { color: #3B2208; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.7); letter-spacing: 0.03em; }
:root[data-theme="steampunk"] .statusbar { background: var(--pipe); border-top: 1px solid #3A1D07; color: #FBEFD0; text-shadow: 0 1px 1px rgba(40, 15, 0, 0.8); }
:root[data-theme="steampunk"] #cursor-pos { color: #FFF6DC; }
:root[data-theme="steampunk"] .site-footer { background: linear-gradient(180deg, #3B3531, #1F1B18); color: #D8C39A; }
/* The side panel: parchment, foxed at the edges, a gear let into its corner. */
:root[data-theme="steampunk"] .inspector {
  isolation: isolate;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(120, 80, 30, 0.16), rgba(120, 80, 30, 0) 55%),
    radial-gradient(ellipse at 100% 100%, rgba(110, 70, 25, 0.22), rgba(110, 70, 25, 0) 50%),
    linear-gradient(180deg, #EFE0BA 0%, #E6D3A6 60%, #DCC592 100%);
  background-attachment: local;
  border-left: 4px solid #8A6A35;
  border-image: linear-gradient(90deg, #6E5326, #E6C877 45%, #8A6A35) 1;
}
/* The gear in the panel's top corner: faint, so the words over it stay easy to read, turning slowly, and staying put in
   the corner while the panel scrolls. It takes up no room (the negative margin gives back its height). */
:root[data-theme="steampunk"] .inspector::before {
  content: '';
  position: sticky;
  z-index: -1;
  top: -46px;
  display: block;
  width: 150px;
  height: 150px;
  margin: 0 -46px -150px auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath fill-rule='evenodd' fill='%23B5651D' d='M179.25 77.71L196.68 83.95L196.68 116.05L179.25 122.29L178.72 124.09L190.01 138.77L172.65 165.77L154.62 161.59L153.19 162.83L154.76 181.27L125.56 194.61L112.65 181.34L110.78 181.61L102.13 197.98L70.36 193.41L66.66 175.27L64.95 174.49L48.82 183.57L24.56 162.55L31.26 145.29L30.24 143.71L11.76 142.64L2.72 111.84L17.69 100.94L17.69 99.06L2.72 88.16L11.76 57.36L30.24 56.29L31.26 54.71L24.56 37.45L48.82 16.43L64.95 25.51L66.66 24.73L70.36 6.59L102.13 2.02L110.78 18.39L112.65 18.66L125.56 5.39L154.76 18.73L153.19 37.17L154.62 38.41L172.65 34.23L190.01 61.23L178.72 75.91ZM115.68 100.00A15.68 15.68 0 1 0 84.32 100.00A15.68 15.68 0 1 0 115.68 100.00ZM163.70 100.00A16.66 16.66 0 1 0 130.38 100.00A16.66 16.66 0 1 0 163.70 100.00ZM116.66 147.04A16.66 16.66 0 1 0 83.34 147.04A16.66 16.66 0 1 0 116.66 147.04ZM69.62 100.00A16.66 16.66 0 1 0 36.30 100.00A16.66 16.66 0 1 0 69.62 100.00ZM116.66 52.96A16.66 16.66 0 1 0 83.34 52.96A16.66 16.66 0 1 0 116.66 52.96Z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.2;
  pointer-events: none;
  animation: steam-gear 28s linear infinite reverse;
}
@media (prefers-reduced-motion: reduce) { :root[data-theme="steampunk"] .inspector::before { animation: none; } }
:root[data-theme="steampunk"] .panel { border-bottom: 3px double #9C7A45; }
:root[data-theme="steampunk"] .panel-title, :root[data-theme="steampunk"] .dialog h2, :root[data-theme="steampunk"] .lib-group {
  color: #4A2A0C; font-variant: small-caps; letter-spacing: 0.06em; text-shadow: 0 1px 0 rgba(255, 244, 210, 0.8);
}
/* Buttons: brass plates held by a rivet at each end; the main ones in copper. */
:root[data-theme="steampunk"] .btn {
  border: 1px solid #5C4033;
  border-radius: 4px;
  background: var(--rivets), var(--brass);
  padding-inline: 18px;
  color: #2A1A0E;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 248, 215, 0.85), inset 0 -2px 3px rgba(70, 45, 10, 0.35), 0 1px 3px rgba(40, 20, 5, 0.5);
}
:root[data-theme="steampunk"] .btn-small { padding-inline: 16px; }
:root[data-theme="steampunk"] .btn:hover:not(:disabled) { border-color: #2A1A0E; filter: brightness(1.07); }
:root[data-theme="steampunk"] .btn:active:not(:disabled) { box-shadow: inset 0 2px 5px rgba(50, 30, 5, 0.6); filter: brightness(0.94); }
:root[data-theme="steampunk"] .btn-primary,
:root[data-theme="steampunk"] .btn-demo,
:root[data-theme="steampunk"] .mode-tabs button[aria-selected="true"],
:root[data-theme="steampunk"] .btn-icon.is-on,
:root[data-theme="steampunk"] .btn-train[aria-pressed="true"] {
  background: var(--rivets), var(--copper);
  border-color: #4A2409;
  color: #FFF3D6;
  text-shadow: 0 -1px 0 rgba(60, 25, 0, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 225, 190, 0.7), inset 0 -2px 3px rgba(60, 25, 0, 0.4), 0 1px 3px rgba(40, 20, 5, 0.55);
}
:root[data-theme="steampunk"] .btn-primary:hover:not(:disabled) { background: var(--rivets), var(--copper); border-color: #2A1205; }
:root[data-theme="steampunk"] .btn-danger, :root[data-theme="steampunk"] .btn-danger-outline { color: #7A1410; }
:root[data-theme="steampunk"] .btn-link { font-family: var(--font-ui); text-shadow: none; }
:root[data-theme="steampunk"] .btn-settings, :root[data-theme="steampunk"] .btn-icon { padding-inline: 9px; background: var(--brass); }
/* The tool rail. */
:root[data-theme="steampunk"] .mode-tabs { border: 1px solid #5C4033; border-radius: 4px; background: linear-gradient(180deg, #D9C08A, #C4A86C); box-shadow: inset 0 1px 3px rgba(60, 35, 5, 0.4); }
:root[data-theme="steampunk"] .mode-tabs button { border-radius: 3px; color: #4A3215; }
:root[data-theme="steampunk"] .mode-tabs button[aria-selected="true"] { background: var(--copper); }
:root[data-theme="steampunk"] .tool { border-radius: 4px; }
:root[data-theme="steampunk"] .tool:hover:not(:disabled) { background: linear-gradient(180deg, #F1DC9A, #C9A85E); box-shadow: inset 0 1px 0 rgba(255, 248, 215, 0.8), 0 0 0 1px #8A6A35; }
:root[data-theme="steampunk"] .tool[aria-pressed="true"] { background: linear-gradient(180deg, #B08D57, #D4B062); box-shadow: inset 0 2px 5px rgba(50, 30, 5, 0.55), inset 0 0 0 1.5px #5C4033; }
:root[data-theme="steampunk"] .segmented button[aria-checked="true"] { background: var(--copper); color: #FFF3D6; box-shadow: inset 0 1px 0 rgba(255, 225, 190, 0.6); }
/* Fields: cream paper let into the plate. */
:root[data-theme="steampunk"] .field input, :root[data-theme="steampunk"] .field select, :root[data-theme="steampunk"] select, :root[data-theme="steampunk"] input[type="text"], :root[data-theme="steampunk"] input[type="number"] {
  border: 1px solid #7A5A2A;
  border-radius: 3px;
  background-color: #F7ECCD;
  box-shadow: inset 0 2px 4px rgba(70, 45, 10, 0.28);
}
:root[data-theme="steampunk"] .field input:focus, :root[data-theme="steampunk"] select:focus { border-color: #9A4E1C; box-shadow: inset 0 2px 4px rgba(70, 45, 10, 0.25), 0 0 0 3px rgba(224, 161, 43, 0.5); }
:root[data-theme="steampunk"] .swatch { border-radius: 50%; border-color: #7A5A2A; box-shadow: inset 0 4px 5px -2px rgba(255, 255, 255, 0.5), 0 0 0 2px #C9A85E, 0 0 0 3px #5C4033; }
:root[data-theme="steampunk"] .tree-chip { border-radius: 4px; border-color: #7A5A2A; background: linear-gradient(180deg, #F4E8C8, #E2CE9C); }
/* The plan: a dark leather desk top, lamplit in the middle, with the works showing in one corner and turning. */
:root[data-theme="steampunk"] .canvas-wrap {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 190, 110, 0.16) 0%, rgba(255, 190, 110, 0) 55%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.5) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath fill-rule='evenodd' fill='%235C4033' d='M180.11 81.07L197.05 86.40L197.05 113.60L180.11 118.93L179.73 120.47L192.25 133.06L179.62 157.14L162.14 153.99L161.09 155.18L166.32 172.15L143.94 187.60L129.93 176.68L128.45 177.25L125.20 194.71L98.20 197.98L90.87 181.81L89.29 181.62L78.30 195.57L52.87 185.92L53.89 168.20L52.58 167.29L36.37 174.54L18.34 154.18L27.48 138.96L26.74 137.55L9.02 136.43L2.51 110.02L17.68 100.80L17.68 99.20L2.51 89.98L9.02 63.57L26.74 62.45L27.48 61.04L18.34 45.82L36.37 25.46L52.58 32.71L53.89 31.80L52.87 14.08L78.30 4.43L89.29 18.38L90.87 18.19L98.20 2.02L125.20 5.29L128.45 22.75L129.93 23.32L143.94 12.40L166.32 27.85L161.09 44.82L162.14 46.01L179.62 42.86L192.25 66.94L179.73 79.53ZM115.68 100.00A15.68 15.68 0 1 0 84.32 100.00A15.68 15.68 0 1 0 115.68 100.00ZM163.70 100.00A16.66 16.66 0 1 0 130.38 100.00A16.66 16.66 0 1 0 163.70 100.00ZM131.20 144.74A16.66 16.66 0 1 0 97.88 144.74A16.66 16.66 0 1 0 131.20 144.74ZM78.60 127.65A16.66 16.66 0 1 0 45.28 127.65A16.66 16.66 0 1 0 78.60 127.65ZM78.60 72.35A16.66 16.66 0 1 0 45.28 72.35A16.66 16.66 0 1 0 78.60 72.35ZM131.20 55.26A16.66 16.66 0 1 0 97.88 55.26A16.66 16.66 0 1 0 131.20 55.26Z'/%3E%3C/svg%3E") no-repeat left 96px bottom -70px / 210px 210px,
    linear-gradient(180deg, #46331F 0%, #3A2A1C 50%, #2A1D12 100%);
  box-shadow: inset 0 0 0 3px #8A6A35, inset 0 0 0 4px #2A1A0E, inset 0 6px 18px rgba(0, 0, 0, 0.5);
}
:root[data-theme="steampunk"] .canvas-wrap::before {
  content: '';
  position: absolute;
  left: -110px;
  bottom: -110px;
  width: 300px;
  height: 300px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath fill-rule='evenodd' fill='%23C79A4B' d='M180.86 84.57L197.37 88.94L197.37 111.06L180.86 115.43L180.61 116.69L194.19 127.05L185.73 147.48L168.80 145.20L168.09 146.27L176.67 161.03L161.03 176.67L146.27 168.09L145.20 168.80L147.48 185.73L127.05 194.19L116.69 180.61L115.43 180.86L111.06 197.37L88.94 197.37L84.57 180.86L83.31 180.61L72.95 194.19L52.52 185.73L54.80 168.80L53.73 168.09L38.97 176.67L23.33 161.03L31.91 146.27L31.20 145.20L14.27 147.48L5.81 127.05L19.39 116.69L19.14 115.43L2.63 111.06L2.63 88.94L19.14 84.57L19.39 83.31L5.81 72.95L14.27 52.52L31.20 54.80L31.91 53.73L23.33 38.97L38.97 23.33L53.73 31.91L54.80 31.20L52.52 14.27L72.95 5.81L83.31 19.39L84.57 19.14L88.94 2.63L111.06 2.63L115.43 19.14L116.69 19.39L127.05 5.81L147.48 14.27L145.20 31.20L146.27 31.91L161.03 23.33L176.67 38.97L168.09 53.73L168.80 54.80L185.73 52.52L194.19 72.95L180.61 83.31ZM115.68 100.00A15.68 15.68 0 1 0 84.32 100.00A15.68 15.68 0 1 0 115.68 100.00ZM163.70 100.00A16.66 16.66 0 1 0 130.38 100.00A16.66 16.66 0 1 0 163.70 100.00ZM131.20 144.74A16.66 16.66 0 1 0 97.88 144.74A16.66 16.66 0 1 0 131.20 144.74ZM78.60 127.65A16.66 16.66 0 1 0 45.28 127.65A16.66 16.66 0 1 0 78.60 127.65ZM78.60 72.35A16.66 16.66 0 1 0 45.28 72.35A16.66 16.66 0 1 0 78.60 72.35ZM131.20 55.26A16.66 16.66 0 1 0 97.88 55.26A16.66 16.66 0 1 0 131.20 55.26Z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.5;
  pointer-events: none;
  animation: steam-gear 40s linear infinite;
}
@keyframes steam-gear { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { :root[data-theme="steampunk"] .canvas-wrap::before { animation: none; } }
:root[data-theme="steampunk"] .zoom-controls { border: 1px solid #2A1A0E; border-radius: 4px; background: var(--brass); color: #2A1A0E; box-shadow: inset 0 1px 0 rgba(255, 248, 215, 0.8), 0 2px 8px rgba(0, 0, 0, 0.6); }
:root[data-theme="steampunk"] .zoom-controls button, :root[data-theme="steampunk"] .zoom-controls output { color: #2A1A0E; }
:root[data-theme="steampunk"] .zoom-controls .grid-info { color: #3B2A12; border-left-color: rgba(60, 40, 10, 0.4); }
/* Dialogs: a sheet of parchment in a brass frame, riveted at the corners. */
:root[data-theme="steampunk"] .dialog {
  border: 6px solid #8A6A35;
  border-image: linear-gradient(135deg, #F1DC9A, #8A6A35 30%, #D4B062 55%, #6E5326 80%, #E6C877) 1;
  border-radius: 0;
  background:
    radial-gradient(circle at 9px 9px, #FBEFC6 0 1.5px, #6E5326 2px 4px, rgba(0, 0, 0, 0) 4.5px),
    radial-gradient(circle at calc(100% - 9px) 9px, #FBEFC6 0 1.5px, #6E5326 2px 4px, rgba(0, 0, 0, 0) 4.5px),
    radial-gradient(circle at 9px calc(100% - 9px), #FBEFC6 0 1.5px, #6E5326 2px 4px, rgba(0, 0, 0, 0) 4.5px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #FBEFC6 0 1.5px, #6E5326 2px 4px, rgba(0, 0, 0, 0) 4.5px),
    radial-gradient(ellipse at 100% 100%, rgba(110, 70, 25, 0.25), rgba(110, 70, 25, 0) 55%),
    linear-gradient(180deg, #F1E3BE 0%, #E4D0A2 100%);
  box-shadow: 0 0 0 2px #2A1A0E, 0 24px 60px rgba(15, 8, 0, 0.7);
}
:root[data-theme="steampunk"] .dialog::backdrop { background: radial-gradient(circle at 50% 35%, rgba(90, 55, 20, 0.45), rgba(15, 8, 0, 0.8)); }
:root[data-theme="steampunk"] .dialog-console .dialog-head { background: #F1E3BE; }
:root[data-theme="steampunk"] .toast { border: 1px solid #2A1A0E; border-radius: 4px; background: var(--rivets), var(--brass); color: #2A1A0E; padding-inline: 22px; font-family: var(--font-head); box-shadow: inset 0 1px 0 rgba(255, 248, 215, 0.85), 0 6px 18px rgba(15, 8, 0, 0.6); }
:root[data-theme="steampunk"] .toast[data-kind="error"] { background: var(--rivets), linear-gradient(180deg, #D46A55, #8E2018); color: #FFF3D6; }
:root[data-theme="steampunk"] .inspector::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #D4B062, #8A6A35); border: 2px solid #E6D3A6; }
/* Its Transform button, and its wipe: a bank of steam rolls across in place of the band of light. */
.btn-transform[data-to="steampunk"] { border-color: #4A2409; border-radius: 4px; background: linear-gradient(180deg, #F0B58A 0%, #CF7F4A 30%, #A9561F 62%, #733A12 100%); color: #FFF3D6; font-family: Georgia, 'Times New Roman', serif; text-shadow: 0 -1px 0 rgba(60, 25, 0, 0.7); box-shadow: inset 0 1px 0 rgba(255, 225, 190, 0.7), 0 0 0 0 rgba(224, 161, 43, 0.75); animation-name: steam-beckon; }
@keyframes steam-beckon { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 225, 190, 0.7), 0 0 0 0 rgba(224, 161, 43, 0.75); } 50% { box-shadow: inset 0 1px 0 rgba(255, 225, 190, 0.7), 0 0 0 6px rgba(224, 161, 43, 0); } }
.aero-band.is-steampunk { width: 300px; background: radial-gradient(ellipse 60% 22% at 80% 20%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%), radial-gradient(ellipse 70% 26% at 70% 52%, rgba(255, 252, 244, 0.95), rgba(255, 255, 255, 0) 70%), radial-gradient(ellipse 60% 24% at 82% 82%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%), linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(245, 240, 230, 0.7) 70%, rgba(255, 255, 255, 0.95) 100%); filter: blur(6px); animation-name: steam-band; }
@keyframes steam-band { 0% { transform: translateX(-300px); opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(calc(100vw - 300px)); opacity: 0; } }
.aero-band.aero-band-back.is-steampunk { transform-origin: center; background: radial-gradient(ellipse 60% 22% at 20% 20%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%), radial-gradient(ellipse 70% 26% at 30% 52%, rgba(255, 252, 244, 0.95), rgba(255, 255, 255, 0) 70%), radial-gradient(ellipse 60% 24% at 18% 82%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%), linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, rgba(245, 240, 230, 0.7) 70%, rgba(255, 255, 255, 0.95) 100%); animation-name: aero-band-back; }
/* And its logo: the track on a brass gear. */
.wordmark .wordmark-mark-steam { display: none; }
:root[data-theme="steampunk"] .wordmark .wordmark-mark:not(.wordmark-mark-steam) { display: none; }
:root[data-theme="steampunk"] .wordmark .wordmark-mark-steam { display: block; filter: drop-shadow(0 1px 2px rgba(30, 15, 0, 0.6)); }


/* ---- Theme: Retro Terminal (data-theme="unix") --------------------------------
   An old terminal: green phosphor on a black tube. Everything in a fixed-width face with a faint glow, square corners
   and one-pixel rules; the chosen thing shown in reverse video; the status bar a reverse-video status line; scan lines
   and a darkened rim over the whole screen. The plan is drawn in green on black too. Put on and taken off with the
   Transform button, like the other transformative themes. */
:root[data-theme="unix"] {
  --mat: #010A03;
  --mat-deep: #000000;
  --mat-line: rgba(51, 255, 102, 0.1);
  --mat-major: rgba(51, 255, 102, 0.4);
  --ink: #33FF66;
  --ink-soft: #1FB548;
  --paper: #000000;
  --panel: #020B04;
  --rule: #178A38;
  --field: #000000;
  --primary: #33FF66;
  --primary-ink: #001A07;
  --focus: #C8FFD6;
  --stop: #FFB000;
  --font-ui: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Courier New', monospace;
  --font-head: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Courier New', monospace;
  --glow: 0 0 6px rgba(51, 255, 102, 0.55);
  color-scheme: dark;
}
:root[data-theme="unix"] body { background: #000; font-size: 13px; letter-spacing: 0; text-shadow: var(--glow); }
:root[data-theme="unix"] ::selection { background: #33FF66; color: #001A07; text-shadow: none; }
/* Scan lines and the tube's dark rim, over everything on the page. */
:root[data-theme="unix"] body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0 1px, rgba(0, 0, 0, 0) 1px 3px),
    radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.55) 100%);
}
:root[data-theme="unix"] .topbar { background: #000; border-bottom: 1px solid #33FF66; box-shadow: 0 0 12px rgba(51, 255, 102, 0.35); position: relative; z-index: 2; }
:root[data-theme="unix"] .wordmark { font-size: 16px; }
:root[data-theme="unix"] .wordmark-name::after { content: '\2588'; margin-left: 2px; animation: unix-blink 1.1s steps(1) infinite; }
@keyframes unix-blink { 50% { opacity: 0; } }
/* The status line: reverse video, as an editor's is. */
:root[data-theme="unix"] .statusbar { background: #33FF66; border-top: 0; color: #001A07; text-shadow: none; font-weight: 600; }
:root[data-theme="unix"] #cursor-pos { color: #001A07; }
:root[data-theme="unix"] .site-footer { background: #000; color: #1FB548; }
:root[data-theme="unix"] .inspector { background: #020B04; border-left: 1px solid #33FF66; }
:root[data-theme="unix"] .panel { border-bottom: 1px dashed #178A38; }
:root[data-theme="unix"] .panel-title, :root[data-theme="unix"] .dialog h2 { text-transform: uppercase; letter-spacing: 0.04em; font-size: 15px; }
:root[data-theme="unix"] .lib-group::before, :root[data-theme="unix"] .dialog h2::before { content: '$ '; }
:root[data-theme="unix"] .help-link, :root[data-theme="unix"] .btn-link { color: #9DFFB6; }
/* Buttons: a box of green rule; pointed at or switched on, reverse video. */
:root[data-theme="unix"] .btn {
  border: 1px solid #33FF66;
  border-radius: 0;
  background: #000;
  color: #33FF66;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 10px;
  text-shadow: var(--glow);
  box-shadow: none;
}
:root[data-theme="unix"] .btn-small { font-size: 12px; padding: 4px 8px; }
:root[data-theme="unix"] .btn:hover:not(:disabled),
:root[data-theme="unix"] .btn-primary,
:root[data-theme="unix"] .btn-demo,
:root[data-theme="unix"] .mode-tabs button[aria-selected="true"],
:root[data-theme="unix"] .segmented button[aria-checked="true"],
:root[data-theme="unix"] .btn-icon.is-on,
:root[data-theme="unix"] .btn-train[aria-pressed="true"],
:root[data-theme="unix"] .tool[aria-pressed="true"] {
  background: #33FF66;
  border-color: #33FF66;
  color: #001A07;
  text-shadow: none;
  box-shadow: 0 0 10px rgba(51, 255, 102, 0.55);
  filter: none;
}
:root[data-theme="unix"] .btn-primary:hover:not(:disabled) { background: #B6FFC8; border-color: #B6FFC8; }
:root[data-theme="unix"] .btn-danger, :root[data-theme="unix"] .btn-danger-outline { color: #FFB000; border-color: #FFB000; text-shadow: 0 0 6px rgba(255, 176, 0, 0.5); }
:root[data-theme="unix"] .btn-danger-outline:hover:not(:disabled) { background: #FFB000; border-color: #FFB000; color: #1A0F00; box-shadow: 0 0 10px rgba(255, 176, 0, 0.5); }
:root[data-theme="unix"] .btn-link { border: 0; background: none; box-shadow: none; }
:root[data-theme="unix"] .mode-tabs { border: 1px solid #33FF66; border-radius: 0; background: #000; }
:root[data-theme="unix"] .mode-tabs button { border-radius: 0; color: #33FF66; font-size: 12px; }
:root[data-theme="unix"] .segmented { border-radius: 0; background: #000; border-color: #33FF66; }
:root[data-theme="unix"] .segmented button { border-radius: 0; color: #33FF66; }
:root[data-theme="unix"] .tool { border-radius: 0; font-size: 12px; }
:root[data-theme="unix"] .tool:hover:not(:disabled) { background: #062A10; box-shadow: inset 0 0 0 1px #33FF66; }
:root[data-theme="unix"] .tool-sep { background: #178A38; }
/* Fields: black, ruled in green, a block of light for the caret. */
:root[data-theme="unix"] .field input, :root[data-theme="unix"] .field select, :root[data-theme="unix"] select, :root[data-theme="unix"] input[type="text"], :root[data-theme="unix"] input[type="number"] {
  border: 1px solid #178A38;
  border-radius: 0;
  background-color: #000;
  color: #33FF66;
  caret-color: #33FF66;
  text-shadow: var(--glow);
  box-shadow: none;
}
:root[data-theme="unix"] .field input:focus, :root[data-theme="unix"] select:focus { border-color: #33FF66; box-shadow: 0 0 0 1px #33FF66, 0 0 10px rgba(51, 255, 102, 0.5); }
:root[data-theme="unix"] input[type="checkbox"], :root[data-theme="unix"] input[type="radio"], :root[data-theme="unix"] input[type="range"] { accent-color: #33FF66; }
:root[data-theme="unix"] .swatch { border-radius: 0; border-color: #178A38; }
:root[data-theme="unix"] .swatch.is-active { border-color: #C8FFD6; box-shadow: 0 0 8px rgba(51, 255, 102, 0.8); }
:root[data-theme="unix"] .tree-chip { border-radius: 0; border-color: #178A38; background: #000; color: #33FF66; }
:root[data-theme="unix"] .tree-chip[aria-checked="true"] { border-color: #33FF66; box-shadow: 0 0 0 1px #33FF66; }
/* The plan: the same drawing, shown as the tube would show it, in shades of green on black. */
:root[data-theme="unix"] .canvas-wrap { background: #000; box-shadow: inset 0 0 60px rgba(51, 255, 102, 0.08); }
:root[data-theme="unix"] .canvas-wrap > .plan, :root[data-theme="unix"] canvas { filter: grayscale(1) sepia(1) hue-rotate(68deg) saturate(4.5) brightness(0.92) contrast(1.15); }   /* (and the 3D views and previews with it) */
:root[data-theme="unix"] .showroom-brands button, :root[data-theme="unix"] [data-show-brand] { border-radius: 0; }
/* The green filter makes the 3D canvas a layer of its own, which would otherwise paint over the pads and panels
   that sit on top of it. */
:root[data-theme="unix"] .view3d-pad, :root[data-theme="unix"] .view3d-panel { z-index: 2; }
:root[data-theme="unix"] .canvas-wrap::before {
  content: 'RoW/UX tty1\A $ plan --edit\A \2588';
  position: absolute;
  left: 110px;
  bottom: 14px;
  white-space: pre;
  font: 12px/1.5 var(--font-ui);
  color: #1FB548;
  opacity: 0.7;
  pointer-events: none;
}
:root[data-theme="unix"] .zoom-controls { border: 1px solid #33FF66; border-radius: 0; background: #000; color: #33FF66; box-shadow: 0 0 10px rgba(51, 255, 102, 0.35); }
:root[data-theme="unix"] .zoom-controls button, :root[data-theme="unix"] .zoom-controls output { color: #33FF66; }
:root[data-theme="unix"] .zoom-controls .grid-info { color: #1FB548; border-left-color: #178A38; }
/* Dialogs: a window on the tube, its own scan lines drawn in (it sits above the page's). */
:root[data-theme="unix"] .dialog {
  border: 1px solid #33FF66;
  border-radius: 0;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0 1px, rgba(0, 0, 0, 0) 1px 3px), #020B04;
  color: #33FF66;
  text-shadow: var(--glow);
  font-size: 13px;
  box-shadow: 0 0 0 1px #000, 0 0 30px rgba(51, 255, 102, 0.45);
}
:root[data-theme="unix"] .dialog::backdrop { background: rgba(0, 8, 2, 0.82); }
:root[data-theme="unix"] .dialog-console .dialog-head { background: #020B04; }
:root[data-theme="unix"] .dialog > .dialog-x { border-radius: 0; color: #33FF66; }
:root[data-theme="unix"] .dialog > .dialog-x:hover { background: #33FF66; color: #001A07; }
:root[data-theme="unix"] .toast { border: 1px solid #33FF66; border-radius: 0; background: #33FF66; color: #001A07; text-shadow: none; font-family: var(--font-ui); font-weight: 600; box-shadow: 0 0 18px rgba(51, 255, 102, 0.6); }
:root[data-theme="unix"] .toast[data-kind="error"] { background: #FFB000; border-color: #FFB000; color: #1A0F00; box-shadow: 0 0 18px rgba(255, 176, 0, 0.6); }
:root[data-theme="unix"] .inspector::-webkit-scrollbar-thumb { background: #178A38; border: 2px solid #020B04; border-radius: 0; }
:root[data-theme="unix"] .empty-state p { color: #1FB548; }
:root[data-theme="unix"] .empty-state .empty-title { color: #33FF66; }
/* Its Transform button, its wipe (the tube's beam sweeping across), and its logo (the track drawn on a small screen). */
.btn-transform[data-to="unix"] { border: 1px solid #33FF66; border-radius: 0; background: #000; color: #33FF66; font-family: ui-monospace, Menlo, Consolas, 'Courier New', monospace; font-weight: 600; text-shadow: 0 0 6px rgba(51, 255, 102, 0.7); box-shadow: 0 0 0 0 rgba(51, 255, 102, 0.8); animation-name: unix-beckon; }
@keyframes unix-beckon { 0%, 100% { box-shadow: 0 0 0 0 rgba(51, 255, 102, 0.8); } 50% { box-shadow: 0 0 0 6px rgba(51, 255, 102, 0); } }
.aero-band.is-unix { width: 90px; background: linear-gradient(90deg, rgba(51, 255, 102, 0) 0%, rgba(51, 255, 102, 0.25) 60%, rgba(160, 255, 190, 0.95) 94%, #FFFFFF 100%); box-shadow: 0 0 40px 10px rgba(51, 255, 102, 0.35); animation-name: unix-band; }
@keyframes unix-band { 0% { transform: translateX(-90px); opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(calc(100vw - 90px)); opacity: 0; } }
.aero-band.aero-band-back.is-unix { background: linear-gradient(270deg, rgba(51, 255, 102, 0) 0%, rgba(51, 255, 102, 0.25) 60%, rgba(160, 255, 190, 0.95) 94%, #FFFFFF 100%); animation-name: aero-band-back; }
.wordmark .wordmark-mark-unix { display: none; }
:root[data-theme="unix"] .wordmark .wordmark-mark:not(.wordmark-mark-unix) { display: none; }
:root[data-theme="unix"] .wordmark .wordmark-mark-unix { display: block; filter: drop-shadow(0 0 4px rgba(51, 255, 102, 0.7)); }
@media (prefers-reduced-motion: reduce) { :root[data-theme="unix"] .wordmark-name::after { animation: none; } }


/* ---- Theme: OK Computer (data-theme="okc") ---------------------------------------
   The late-1990s look now called Gen X Soft Club: bleached whites and cool, washed-out blues; a city skyline dissolving
   into haze; spare, wide-set capitals as on airport signs; thin rules and square
   corners; everything a little pale and far away. The plan's mat is bone white, drawn on in blue-black. The graphics are
   our own. Put on and taken off with the Transform button, like the other transformative themes. */
:root[data-theme="okc"] {
  --mat: #E2EAEF;
  --mat-deep: #1B2A3A;
  --mat-line: rgba(27, 42, 58, 0.07);
  --mat-major: rgba(27, 42, 58, 0.26);
  --ink: #1B2A3A;
  --ink-soft: #5F7689;
  --paper: #DCE5EB;
  --panel: #F3F6F7;
  --rule: #B9C8D3;
  --field: #FFFFFF;
  --primary: #2F4E6E;
  --primary-ink: #F3F6F8;
  --focus: #5C8DB8;
  --font-ui: 'Helvetica Neue', Helvetica, 'Univers', Arial, 'Barlow', system-ui, sans-serif;
  --font-head: 'Eurostile Extended', 'Eurostile', 'Microgramma', 'Bank Gothic', 'Helvetica Neue', Helvetica, Arial, 'Barlow', sans-serif;
  color-scheme: light;
}
:root[data-theme="okc"] body { background: #DCE5EB; }
:root[data-theme="okc"] .topbar {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 38%, rgba(190, 212, 228, 0.55) 62%, rgba(255, 255, 255, 0) 100%), #F3F6F7;
  border-bottom: 1px solid #1B2A3A;
  position: relative;
  z-index: 2;
}
:root[data-theme="okc"] .wordmark-name { text-transform: uppercase; letter-spacing: 0.14em; font-size: 15px; font-weight: 700; }
:root[data-theme="okc"] .statusbar { background: #1B2A3A; border-top: 0; color: #C9D8E4; letter-spacing: 0.04em; }
:root[data-theme="okc"] #cursor-pos { color: #F3F6F8; }
:root[data-theme="okc"] .site-footer { background: #101B27; color: #7F97AB; letter-spacing: 0.08em; }
:root[data-theme="okc"] .inspector { background: linear-gradient(180deg, #F6F8F9 0%, #EEF2F4 55%, #DDE7EE 100%); border-left: 1px solid #1B2A3A; }
:root[data-theme="okc"] .panel { border-bottom: 1px solid #B9C8D3; }
:root[data-theme="okc"] .panel-title, :root[data-theme="okc"] .dialog h2, :root[data-theme="okc"] .lib-group {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; font-weight: 700; color: #1B2A3A;
}
:root[data-theme="okc"] .lib-group::before { content: '\2192\00a0\00a0'; color: #5F7689; }
:root[data-theme="okc"] .panel-note { color: #5F7689; }
/* Buttons: signs. Flat, square, thinly ruled, in small wide capitals; the chosen one a solid block. */
:root[data-theme="okc"] .btn {
  border: 1px solid #1B2A3A;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.7);
  color: #1B2A3A;
  font-family: var(--font-head);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: none;
}
:root[data-theme="okc"] .btn-small { font-size: 10.5px; }
:root[data-theme="okc"] .btn:hover:not(:disabled) { background: #C9D8E4; border-color: #1B2A3A; }
:root[data-theme="okc"] .btn-primary,
:root[data-theme="okc"] .btn-demo,
:root[data-theme="okc"] .mode-tabs button[aria-selected="true"],
:root[data-theme="okc"] .segmented button[aria-checked="true"],
:root[data-theme="okc"] .btn-icon.is-on,
:root[data-theme="okc"] .btn-train[aria-pressed="true"] { background: #1B2A3A; border-color: #1B2A3A; color: #F3F6F8; box-shadow: none; filter: none; }
:root[data-theme="okc"] .btn-primary:hover:not(:disabled) { background: #2F4E6E; border-color: #2F4E6E; }
:root[data-theme="okc"] .btn-danger, :root[data-theme="okc"] .btn-danger-outline { color: #9A3B32; border-color: #9A3B32; }
:root[data-theme="okc"] .btn-link { border: 0; background: none; text-transform: none; letter-spacing: 0; font-family: var(--font-ui); font-size: inherit; font-weight: 500; }
:root[data-theme="okc"] .mode-tabs { border: 1px solid #1B2A3A; border-radius: 0; background: rgba(255, 255, 255, 0.6); padding: 0; gap: 0; }
:root[data-theme="okc"] .mode-tabs button { border-radius: 0; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10.5px; color: #1B2A3A; }
:root[data-theme="okc"] .segmented { border-radius: 0; }
:root[data-theme="okc"] .segmented button { border-radius: 0; }
:root[data-theme="okc"] .tool { border-radius: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; }
:root[data-theme="okc"] .tool:hover:not(:disabled) { background: #DCE5EB; }
:root[data-theme="okc"] .tool[aria-pressed="true"] { background: #C9D8E4; box-shadow: inset 0 0 0 1px #1B2A3A; }
:root[data-theme="okc"] .field input, :root[data-theme="okc"] .field select, :root[data-theme="okc"] select, :root[data-theme="okc"] input[type="text"], :root[data-theme="okc"] input[type="number"] {
  border: 0;
  border-bottom: 1px solid #1B2A3A;
  border-radius: 0;
  background-color: rgba(255, 255, 255, 0.75);
  box-shadow: none;
}
:root[data-theme="okc"] .field input:focus, :root[data-theme="okc"] select:focus { border-color: #2F4E6E; box-shadow: 0 2px 0 #5C8DB8; }
:root[data-theme="okc"] .field > span { text-transform: uppercase; letter-spacing: 0.1em; font-size: 10.5px; }
:root[data-theme="okc"] .swatch { border-radius: 0; border-color: #B9C8D3; }
:root[data-theme="okc"] .tree-chip { border-radius: 0; border-color: #B9C8D3; background: rgba(255, 255, 255, 0.7); }
/* The plan: bone white, with a skyline fading into haze along its foot. (Nothing moves over it: it's a work surface.) */
:root[data-theme="okc"] .canvas-wrap {
  background:
    linear-gradient(180deg, rgba(226, 234, 239, 0) 55%, rgba(226, 234, 239, 0.9) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 220' preserveAspectRatio='xMidYMax slice'%3E%3Crect x='0' y='152' width='37' height='68' fill='%23C3D3DF'/%3E%3Crect x='17' y='135' width='2' height='26' fill='%23C3D3DF'/%3E%3Crect x='43' y='104' width='43' height='116' fill='%23C3D3DF'/%3E%3Crect x='89' y='109' width='25' height='111' fill='%23C3D3DF'/%3E%3Crect x='118' y='156' width='32' height='64' fill='%23C3D3DF'/%3E%3Crect x='159' y='58' width='28' height='162' fill='%23C3D3DF'/%3E%3Crect x='190' y='118' width='42' height='102' fill='%23C3D3DF'/%3E%3Crect x='232' y='83' width='61' height='137' fill='%23C3D3DF'/%3E%3Crect x='296' y='134' width='50' height='86' fill='%23C3D3DF'/%3E%3Crect x='356' y='146' width='36' height='74' fill='%23C3D3DF'/%3E%3Crect x='397' y='84' width='28' height='136' fill='%23C3D3DF'/%3E%3Crect x='435' y='77' width='37' height='143' fill='%23C3D3DF'/%3E%3Crect x='475' y='59' width='30' height='161' fill='%23C3D3DF'/%3E%3Crect x='489' y='36' width='2' height='26' fill='%23C3D3DF'/%3E%3Crect x='505' y='160' width='38' height='60' fill='%23C3D3DF'/%3E%3Crect x='548' y='88' width='38' height='132' fill='%23C3D3DF'/%3E%3Crect x='586' y='112' width='49' height='108' fill='%23C3D3DF'/%3E%3Crect x='609' y='97' width='2' height='26' fill='%23C3D3DF'/%3E%3Crect x='638' y='117' width='55' height='103' fill='%23C3D3DF'/%3E%3Crect x='693' y='100' width='29' height='120' fill='%23C3D3DF'/%3E%3Crect x='726' y='96' width='31' height='124' fill='%23C3D3DF'/%3E%3Crect x='763' y='115' width='53' height='105' fill='%23C3D3DF'/%3E%3Crect x='817' y='101' width='39' height='119' fill='%23C3D3DF'/%3E%3Crect x='857' y='113' width='31' height='107' fill='%23C3D3DF'/%3E%3Crect x='896' y='82' width='62' height='138' fill='%23C3D3DF'/%3E%3Crect x='926' y='63' width='2' height='26' fill='%23C3D3DF'/%3E%3Crect x='966' y='143' width='33' height='77' fill='%23C3D3DF'/%3E%3Crect x='981' y='121' width='2' height='26' fill='%23C3D3DF'/%3E%3Crect x='1000' y='89' width='43' height='131' fill='%23C3D3DF'/%3E%3Crect x='1050' y='132' width='29' height='88' fill='%23C3D3DF'/%3E%3Crect x='1063' y='120' width='2' height='26' fill='%23C3D3DF'/%3E%3Crect x='1082' y='116' width='64' height='104' fill='%23C3D3DF'/%3E%3Crect x='1148' y='53' width='23' height='167' fill='%23C3D3DF'/%3E%3Crect x='1181' y='125' width='47' height='95' fill='%23C3D3DF'/%3E%3Crect x='0' y='185' width='34' height='35' fill='%23A9BFD0'/%3E%3Crect x='16' y='170' width='2' height='26' fill='%23A9BFD0'/%3E%3Crect x='37' y='185' width='62' height='35' fill='%23A9BFD0'/%3E%3Crect x='99' y='173' width='55' height='47' fill='%23A9BFD0'/%3E%3Crect x='125' y='154' width='2' height='26' fill='%23A9BFD0'/%3E%3Crect x='158' y='111' width='23' height='109' fill='%23A9BFD0'/%3E%3Crect x='168' y='100' width='2' height='26' fill='%23A9BFD0'/%3E%3Crect x='184' y='143' width='44' height='77' fill='%23A9BFD0'/%3E%3Crect x='233' y='114' width='57' height='106' fill='%23A9BFD0'/%3E%3Crect x='297' y='162' width='38' height='58' fill='%23A9BFD0'/%3E%3Crect x='344' y='124' width='49' height='96' fill='%23A9BFD0'/%3E%3Crect x='367' y='105' width='2' height='26' fill='%23A9BFD0'/%3E%3Crect x='393' y='188' width='59' height='32' fill='%23A9BFD0'/%3E%3Crect x='461' y='184' width='59' height='36' fill='%23A9BFD0'/%3E%3Crect x='489' y='169' width='2' height='26' fill='%23A9BFD0'/%3E%3Crect x='529' y='157' width='35' height='63' fill='%23A9BFD0'/%3E%3Crect x='545' y='144' width='2' height='26' fill='%23A9BFD0'/%3E%3Crect x='566' y='123' width='43' height='97' fill='%23A9BFD0'/%3E%3Crect x='618' y='148' width='26' height='72' fill='%23A9BFD0'/%3E%3Crect x='630' y='128' width='2' height='26' fill='%23A9BFD0'/%3E%3Crect x='645' y='176' width='48' height='44' fill='%23A9BFD0'/%3E%3Crect x='699' y='138' width='62' height='82' fill='%23A9BFD0'/%3E%3Crect x='769' y='129' width='24' height='91' fill='%23A9BFD0'/%3E%3Crect x='793' y='123' width='40' height='97' fill='%23A9BFD0'/%3E%3Crect x='843' y='172' width='47' height='48' fill='%23A9BFD0'/%3E%3Crect x='892' y='168' width='40' height='52' fill='%23A9BFD0'/%3E%3Crect x='932' y='143' width='47' height='77' fill='%23A9BFD0'/%3E%3Crect x='988' y='126' width='32' height='94' fill='%23A9BFD0'/%3E%3Crect x='1003' y='103' width='2' height='26' fill='%23A9BFD0'/%3E%3Crect x='1028' y='174' width='46' height='46' fill='%23A9BFD0'/%3E%3Crect x='1074' y='122' width='56' height='98' fill='%23A9BFD0'/%3E%3Crect x='1101' y='104' width='2' height='26' fill='%23A9BFD0'/%3E%3Crect x='1135' y='178' width='42' height='42' fill='%23A9BFD0'/%3E%3Crect x='1187' y='134' width='41' height='86' fill='%23A9BFD0'/%3E%3C/svg%3E") center bottom / auto 34% repeat-x,
    linear-gradient(180deg, #F2F6F8 0%, #E2EAEF 55%, #CBD9E3 100%);
}
:root[data-theme="okc"] .zoom-controls { border: 1px solid #1B2A3A; border-radius: 0; background: rgba(243, 246, 247, 0.92); color: #1B2A3A; box-shadow: none; }
:root[data-theme="okc"] .zoom-controls button, :root[data-theme="okc"] .zoom-controls output { color: #1B2A3A; }
:root[data-theme="okc"] .zoom-controls .grid-info { color: #5F7689; border-left-color: #B9C8D3; }
:root[data-theme="okc"] .dialog {
  border: 1px solid #1B2A3A;
  border-top: 5px solid #1B2A3A;
  border-radius: 0;
  background: linear-gradient(180deg, #FFFFFF 0%, #F0F4F6 70%, #DFE8EE 100%);
  box-shadow: 0 30px 80px rgba(27, 42, 58, 0.35);
}
:root[data-theme="okc"] .dialog::backdrop { background: rgba(203, 217, 227, 0.72); backdrop-filter: blur(5px); }
:root[data-theme="okc"] .dialog-console .dialog-head { background: #FFFFFF; }
:root[data-theme="okc"] .toast { border-radius: 0; background: #1B2A3A; color: #F3F6F8; font-family: var(--font-head); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
:root[data-theme="okc"] .inspector::-webkit-scrollbar-thumb { background: #9FB3C2; border: 2px solid #EEF2F4; border-radius: 0; }
:root[data-theme="okc"] .empty-state p { color: #5F7689; }
:root[data-theme="okc"] .empty-state .empty-title { color: #1B2A3A; }
/* Its Transform button, its wipe (a bank of white haze), and its logo. */
.btn-transform[data-to="okc"] { border: 1px solid #1B2A3A; border-radius: 0; background: #F3F6F7; color: #1B2A3A; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; text-shadow: none; box-shadow: 0 0 0 0 rgba(92, 141, 184, 0.8); animation-name: okc-beckon; }
@keyframes okc-beckon { 0%, 100% { box-shadow: 0 0 0 0 rgba(92, 141, 184, 0.8); } 50% { box-shadow: 0 0 0 6px rgba(92, 141, 184, 0); } }
.aero-band.is-okc { width: 360px; background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(226, 236, 243, 0.7) 50%, #FFFFFF 100%); filter: blur(10px); animation-name: okc-band; }
@keyframes okc-band { 0% { transform: translateX(-360px); opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(calc(100vw - 360px)); opacity: 0; } }
.aero-band.aero-band-back.is-okc { background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, rgba(226, 236, 243, 0.7) 50%, #FFFFFF 100%); animation-name: aero-band-back; }
.wordmark .wordmark-mark-okc { display: none; }
:root[data-theme="okc"] .wordmark .wordmark-mark:not(.wordmark-mark-okc) { display: none; }
:root[data-theme="okc"] .wordmark .wordmark-mark-okc { display: block; }


/* ---- The three 1970s themes ---------------------------------------------------------
   Rec Room (data-theme="recroom"), The 1970's ("seventies") and Vintage Hi-Fi ("hifi"). All put on and taken off with
   the Transform button, like the other transformative themes. They share a fat, friendly display face. */
:root[data-theme="recroom"], :root[data-theme="seventies"] {
  --font-ui: 'Avenir Next', 'Avenir', 'Century Gothic', 'Futura', 'Trebuchet MS', 'Barlow', system-ui, sans-serif;
  --font-head: 'Cooper Black', 'Cooper Std', 'Souvenir', 'Bookman Old Style', 'Rockwell Extra Bold', 'Georgia', serif;
}

/* ---- Rec Room: the basement den. Walnut panelling, carpet underfoot, a pair of pendant lamps over the plan, a plant in
   a knotted hanger; gold, avocado and burnt orange on cream. */
:root[data-theme="recroom"] {
  --mat: #6B4423; --mat-deep: #2E1A0B; --mat-line: rgba(255, 224, 170, 0.08); --mat-major: rgba(255, 224, 170, 0.38);
  --ink: #2B1A0E; --ink-soft: #6B4A2F; --paper: #C9A26B; --panel: #F1E3C6; --rule: #B08C5A; --field: #FBF3DE;
  --primary: #B5541C; --primary-ink: #FFF4DC; --focus: #E0A12B;
  --wood: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='320' viewBox='0 0 360 320'%3E%3Cdefs%3E%3Cfilter id='d0' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.10 0.006' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l0' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.06 0.004' numOctaves='3' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c0' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='12' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d1' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.12 0.006' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l1' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.07 0.004' numOctaves='3' seed='16' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c1' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='20' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d2' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.14 0.006' numOctaves='4' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l2' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.08 0.004' numOctaves='3' seed='28' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c2' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='32' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d3' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.10 0.006' numOctaves='4' seed='37' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l3' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.06 0.004' numOctaves='3' seed='42' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c3' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='46' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d4' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.12 0.006' numOctaves='4' seed='52' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l4' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.07 0.004' numOctaves='3' seed='57' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c4' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='61' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3C/defs%3E%3Crect x='0' width='74' height='320' fill='%238F5526'/%3E%3Crect x='0' width='74' height='320' filter='url(%23c0)'/%3E%3Crect x='0' width='74' height='320' filter='url(%23l0)'/%3E%3Crect x='0' width='74' height='320' filter='url(%23d0)'/%3E%3Crect x='0' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='2' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='74' width='58' height='320' fill='%237E4A20'/%3E%3Crect x='74' width='58' height='320' filter='url(%23c1)'/%3E%3Crect x='74' width='58' height='320' filter='url(%23l1)'/%3E%3Crect x='74' width='58' height='320' filter='url(%23d1)'/%3E%3Crect x='74' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='76' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='132' width='82' height='320' fill='%2396592A'/%3E%3Crect x='132' width='82' height='320' filter='url(%23c2)'/%3E%3Crect x='132' width='82' height='320' filter='url(%23l2)'/%3E%3Crect x='132' width='82' height='320' filter='url(%23d2)'/%3E%3Crect x='132' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='134' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='214' width='66' height='320' fill='%23844D22'/%3E%3Crect x='214' width='66' height='320' filter='url(%23c3)'/%3E%3Crect x='214' width='66' height='320' filter='url(%23l3)'/%3E%3Crect x='214' width='66' height='320' filter='url(%23d3)'/%3E%3Crect x='214' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='216' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='280' width='80' height='320' fill='%238B5225'/%3E%3Crect x='280' width='80' height='320' filter='url(%23c4)'/%3E%3Crect x='280' width='80' height='320' filter='url(%23l4)'/%3E%3Crect x='280' width='80' height='320' filter='url(%23d4)'/%3E%3Crect x='280' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='282' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3C/svg%3E") 0 0 / 360px 320px;   /* planks of figured wood, each its own tone and grain, a dark groove between */
  color-scheme: light;
}
:root[data-theme="recroom"] body { background: #C9A26B; }
:root[data-theme="recroom"] .topbar { background: var(--wood); border-bottom: 3px solid #2E1A0B; box-shadow: inset 0 1px 0 rgba(255, 220, 170, 0.25), 0 3px 8px rgba(30, 15, 5, 0.5); color: #F7E7C4; position: relative; z-index: 2; }
:root[data-theme="recroom"] .wordmark, :root[data-theme="recroom"] .wordmark-name { color: #FBEBC6; text-shadow: 0 2px 0 rgba(30, 15, 5, 0.6); }
:root[data-theme="recroom"] .wordmark-by, :root[data-theme="recroom"] .topbar label, :root[data-theme="recroom"] .topbar .wordmark small { color: #E3C894; }
:root[data-theme="recroom"] .topbar .wordmark-text, :root[data-theme="recroom"] .topbar .wordmark-text * { color: #F1DDB2; text-shadow: 0 1px 0 rgba(30, 15, 5, 0.7); }
:root[data-theme="recroom"] .topbar input, :root[data-theme="recroom"] .topbar select { color: #2B1A0E; }
:root[data-theme="recroom"] .statusbar { background: var(--wood); border-top: 2px solid #2E1A0B; color: #F1DDB2; text-shadow: 0 1px 0 rgba(30, 15, 5, 0.7); }
:root[data-theme="recroom"] #cursor-pos { color: #FFF1CF; }
:root[data-theme="recroom"] .site-footer { background: #2E1A0B; color: #C9A26B; }
:root[data-theme="recroom"] .inspector { isolation: isolate; background: linear-gradient(180deg, #F6EACF 0%, #EEDDB9 100%); border-left: 10px solid #5A3418; border-image: var(--wood) 1; border-image: linear-gradient(90deg, #3A1F0C, #7A4A24 50%, #3A1F0C) 1; }
:root[data-theme="recroom"] .inspector::before { content: ''; position: sticky; z-index: -1; top: 0; display: block; width: 84px; height: 140px; margin: 0 6px -140px auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 200'%3E%3Cg fill='none' stroke='%23C9A26B' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M60 0V46'/%3E%3Cpath d='M60 46L34 110'/%3E%3Cpath d='M60 46L86 110'/%3E%3Cpath d='M60 46V112'/%3E%3Cpath d='M34 110l8 40h36l8-40'/%3E%3Cpath d='M46 78l28 0M40 94l40 0'/%3E%3Cpath d='M44 150l6 40M60 152v46M76 150l-6 40'/%3E%3C/g%3E%3Ccircle cx='60' cy='46' r='4.5' fill='%23C9A26B'/%3E%3Cpath d='M36 112h48l-6 36H42z' fill='%23B5541C' stroke='%237A3511' stroke-width='2'/%3E%3Cg fill='%236B7A2A' stroke='%234A5619' stroke-width='1.2'%3E%3Cpath d='M60 112c-6-22-22-30-34-28 4 14 16 26 34 28z'/%3E%3Cpath d='M60 112c6-24 22-34 36-30-4 16-18 28-36 30z'/%3E%3Cpath d='M60 112c-2-22 4-40 14-48 6 16 0 36-14 48z'/%3E%3Cpath d='M60 112c-10-10-12-26-8-40 10 8 14 24 8 40z'/%3E%3C/g%3E%3C/svg%3E") center top / contain no-repeat; opacity: 0.32; pointer-events: none; }
:root[data-theme="recroom"] .panel { border-bottom: 2px solid #D9BE8C; }
:root[data-theme="recroom"] .panel-title, :root[data-theme="recroom"] .dialog h2, :root[data-theme="recroom"] .lib-group { color: #7A3511; letter-spacing: 0; }
:root[data-theme="recroom"] .btn { border: 2px solid #5A3418; border-radius: 10px; background: linear-gradient(180deg, #F2C85B, #D9A62E); color: #2B1A0E; font-weight: 700; box-shadow: 0 3px 0 #7A5A16; }
:root[data-theme="recroom"] .btn:hover:not(:disabled) { border-color: #2B1A0E; filter: brightness(1.06); }
:root[data-theme="recroom"] .btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #7A5A16; }
:root[data-theme="recroom"] .btn-primary, :root[data-theme="recroom"] .btn-demo { background: linear-gradient(180deg, #E0782E, #B5541C); border-color: #5A2C0C; color: #FFF4DC; box-shadow: 0 3px 0 #6E2F0C; }
:root[data-theme="recroom"] .btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #E0782E, #B5541C); border-color: #2B1205; }
:root[data-theme="recroom"] .mode-tabs button[aria-selected="true"], :root[data-theme="recroom"] .segmented button[aria-checked="true"], :root[data-theme="recroom"] .btn-icon.is-on, :root[data-theme="recroom"] .btn-train[aria-pressed="true"] { background: #6B7A2A; border-color: #3E4A14; color: #FBF3DE; }
:root[data-theme="recroom"] .btn-danger, :root[data-theme="recroom"] .btn-danger-outline { color: #8E1F14; }
:root[data-theme="recroom"] .btn-link { border: 0; background: none; box-shadow: none; }
:root[data-theme="recroom"] .btn-settings, :root[data-theme="recroom"] .btn-icon { box-shadow: 0 2px 0 #7A5A16; }
:root[data-theme="recroom"] .mode-tabs { border: 2px solid #5A3418; border-radius: 10px; background: #E6CF9E; }
:root[data-theme="recroom"] .mode-tabs button { border-radius: 7px; color: #4A2E12; }
:root[data-theme="recroom"] .tool { border-radius: 10px; }
:root[data-theme="recroom"] .tool:hover:not(:disabled) { background: #EBD49F; }
:root[data-theme="recroom"] .tool[aria-pressed="true"] { background: #F2C85B; box-shadow: inset 0 0 0 2px #5A3418; }
:root[data-theme="recroom"] .field input, :root[data-theme="recroom"] .field select, :root[data-theme="recroom"] select, :root[data-theme="recroom"] input[type="text"], :root[data-theme="recroom"] input[type="number"] { border: 2px solid #B08C5A; border-radius: 8px; background-color: #FBF3DE; }
:root[data-theme="recroom"] .field input:focus, :root[data-theme="recroom"] select:focus { border-color: #B5541C; box-shadow: 0 0 0 3px rgba(224, 161, 43, 0.5); }
:root[data-theme="recroom"] .swatch { border-radius: 8px; border-color: #7A5A2A; }
:root[data-theme="recroom"] .tree-chip { border-radius: 10px; border: 2px solid #B08C5A; background: #FBF3DE; }
/* A pendant lamp in each top corner, part of the floor's own background: everything on the plan is drawn over them. */
:root[data-theme="recroom"] .canvas-wrap { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 210'%3E%3Cdefs%3E%3CradialGradient id='glow' cx='0.5' cy='0.5' r='0.5'%3E%3Cstop offset='0' stop-color='%23FFE9A8' stop-opacity='0.75'/%3E%3Cstop offset='1' stop-color='%23FFE9A8' stop-opacity='0'/%3E%3C/radialGradient%3E%3ClinearGradient id='dome' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23F08A1D'/%3E%3Cstop offset='1' stop-color='%23B5541C'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='110' cy='128' r='78' fill='url(%23glow)'/%3E%3Cpath d='M110 0V78' stroke='%232B1A0E' stroke-width='2.5'/%3E%3Cpath d='M62 122c0-28 21-46 48-46s48 18 48 46z' fill='url(%23dome)' stroke='%235A2C0C' stroke-width='2'/%3E%3Cellipse cx='110' cy='122' rx='48' ry='7' fill='%23FFE9A8'/%3E%3C/svg%3E") no-repeat left 4px top / 170px auto, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 210'%3E%3Cdefs%3E%3CradialGradient id='glow' cx='0.5' cy='0.5' r='0.5'%3E%3Cstop offset='0' stop-color='%23FFE9A8' stop-opacity='0.75'/%3E%3Cstop offset='1' stop-color='%23FFE9A8' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='globe' cx='0.4' cy='0.35' r='0.7'%3E%3Cstop offset='0' stop-color='%23FFF6D6'/%3E%3Cstop offset='0.6' stop-color='%23F6D27A'/%3E%3Cstop offset='1' stop-color='%23D9A441'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='110' cy='96' r='70' fill='url(%23glow)'/%3E%3Cpath d='M110 0V58' stroke='%232B1A0E' stroke-width='2.5'/%3E%3Crect x='102' y='56' width='16' height='10' fill='%236E4A26'/%3E%3Ccircle cx='110' cy='98' r='34' fill='url(%23globe)' stroke='%23B5861F' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 4px top / 170px auto, radial-gradient(ellipse at 0% 0%, rgba(255, 222, 150, 0.3) 0%, rgba(255, 222, 150, 0) 42%), radial-gradient(ellipse at 100% 0%, rgba(255, 222, 150, 0.26) 0%, rgba(255, 222, 150, 0) 40%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 -0.08'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23p)'/%3E%3C/svg%3E"), #6B4423; box-shadow: inset 0 0 0 3px #2E1A0B, inset 0 10px 22px rgba(20, 10, 0, 0.45); }
:root[data-theme="recroom"] .zoom-controls { border: 2px solid #2E1A0B; border-radius: 10px; background: #F2C85B; color: #2B1A0E; }
:root[data-theme="recroom"] .zoom-controls button, :root[data-theme="recroom"] .zoom-controls output { color: #2B1A0E; }
:root[data-theme="recroom"] .zoom-controls .grid-info { color: #4A2E12; border-left-color: rgba(60, 35, 10, 0.4); }
:root[data-theme="recroom"] .dialog { border: 14px solid #5A3418; border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='320' viewBox='0 0 360 320'%3E%3Cdefs%3E%3Cfilter id='d0' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.10 0.006' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l0' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.06 0.004' numOctaves='3' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c0' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='12' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d1' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.12 0.006' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l1' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.07 0.004' numOctaves='3' seed='16' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c1' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='20' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d2' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.14 0.006' numOctaves='4' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l2' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.08 0.004' numOctaves='3' seed='28' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c2' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='32' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d3' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.10 0.006' numOctaves='4' seed='37' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l3' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.06 0.004' numOctaves='3' seed='42' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c3' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='46' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d4' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.12 0.006' numOctaves='4' seed='52' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l4' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.07 0.004' numOctaves='3' seed='57' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c4' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='61' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3C/defs%3E%3Crect x='0' width='74' height='320' fill='%238F5526'/%3E%3Crect x='0' width='74' height='320' filter='url(%23c0)'/%3E%3Crect x='0' width='74' height='320' filter='url(%23l0)'/%3E%3Crect x='0' width='74' height='320' filter='url(%23d0)'/%3E%3Crect x='0' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='2' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='74' width='58' height='320' fill='%237E4A20'/%3E%3Crect x='74' width='58' height='320' filter='url(%23c1)'/%3E%3Crect x='74' width='58' height='320' filter='url(%23l1)'/%3E%3Crect x='74' width='58' height='320' filter='url(%23d1)'/%3E%3Crect x='74' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='76' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='132' width='82' height='320' fill='%2396592A'/%3E%3Crect x='132' width='82' height='320' filter='url(%23c2)'/%3E%3Crect x='132' width='82' height='320' filter='url(%23l2)'/%3E%3Crect x='132' width='82' height='320' filter='url(%23d2)'/%3E%3Crect x='132' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='134' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='214' width='66' height='320' fill='%23844D22'/%3E%3Crect x='214' width='66' height='320' filter='url(%23c3)'/%3E%3Crect x='214' width='66' height='320' filter='url(%23l3)'/%3E%3Crect x='214' width='66' height='320' filter='url(%23d3)'/%3E%3Crect x='214' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='216' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='280' width='80' height='320' fill='%238B5225'/%3E%3Crect x='280' width='80' height='320' filter='url(%23c4)'/%3E%3Crect x='280' width='80' height='320' filter='url(%23l4)'/%3E%3Crect x='280' width='80' height='320' filter='url(%23d4)'/%3E%3Crect x='280' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='282' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3C/svg%3E") 14 round; border-radius: 0; background: linear-gradient(180deg, #F8EDD3, #EEDDB9); box-shadow: 0 0 0 2px #1E1006, 0 24px 60px rgba(20, 10, 0, 0.7); }
:root[data-theme="recroom"] .dialog::backdrop { background: rgba(46, 26, 11, 0.72); }
:root[data-theme="recroom"] .dialog-console .dialog-head { background: #F8EDD3; }
:root[data-theme="recroom"] .toast { border: 2px solid #2E1A0B; border-radius: 10px; background: #F2C85B; color: #2B1A0E; font-weight: 700; }
:root[data-theme="recroom"] .inspector::-webkit-scrollbar-thumb { background: #B08C5A; border: 2px solid #EEDDB9; }

/* ---- The 1970's: supergraphics. Cream walls and great bands of maroon, red, orange and gold curving across them;
   pill-shaped buttons; a chocolate-brown plan. */
:root[data-theme="seventies"] {
  --mat: #4A2A16; --mat-deep: #2A150A; --mat-line: rgba(247, 227, 176, 0.08); --mat-major: rgba(242, 178, 27, 0.42);
  --ink: #3B1F0E; --ink-soft: #7A5230; --paper: #EAD9B4; --panel: #FBF4E2; --rule: #DDBF8C; --field: #FFFFFF;
  --primary: #D9421C; --primary-ink: #FFF6E0; --focus: #F2B21B;
  --stripes: linear-gradient(180deg, #7A1E12 0 20%, #D9421C 20% 40%, #F08A1D 40% 60%, #F2B21B 60% 80%, #F7E3B0 80% 100%);
  color-scheme: light;
}
:root[data-theme="seventies"] body { background: #EAD9B4; }
:root[data-theme="seventies"] .topbar { background: linear-gradient(180deg, rgba(0, 0, 0, 0) calc(100% - 8px), #7A1E12 calc(100% - 8px) calc(100% - 6px), #D9421C calc(100% - 6px) calc(100% - 4px), #F08A1D calc(100% - 4px) calc(100% - 2px), #F2B21B calc(100% - 2px)), #FBF4E2; border-bottom: 0; position: relative; z-index: 2; }
:root[data-theme="seventies"] .wordmark-name { color: #D9421C; letter-spacing: -0.01em; font-size: 21px; }
:root[data-theme="seventies"] .statusbar { background: #7A1E12; border-top: 0; color: #F7E3B0; }
:root[data-theme="seventies"] #cursor-pos { color: #FFF6E0; }
:root[data-theme="seventies"] .site-footer { background: #3B1F0E; color: #F2B21B; }
:root[data-theme="seventies"] .inspector { background: radial-gradient(circle at 100% 0, rgba(0,0,0,0) 0 60px, #7A1E12 60px 82px, #D9421C 82px 104px, #F08A1D 104px 126px, #F2B21B 126px 148px, #F7E3B0 148px 170px, rgba(0,0,0,0) 170px) no-repeat, #FBF4E2; background-attachment: local; border-left: 0; }
:root[data-theme="seventies"] .panel { border-bottom: 2px solid #EAD9B4; background: rgba(251, 244, 226, 0.86); }
:root[data-theme="seventies"] .panel-title, :root[data-theme="seventies"] .dialog h2, :root[data-theme="seventies"] .lib-group { color: #7A1E12; letter-spacing: -0.01em; }
:root[data-theme="seventies"] .panel-title { font-size: 19px; }
:root[data-theme="seventies"] .btn { border: 2px solid #3B1F0E; border-radius: 999px; background: #FBF4E2; color: #3B1F0E; font-weight: 700; padding-inline: 16px; box-shadow: none; }
:root[data-theme="seventies"] .btn-small { padding-inline: 12px; }
:root[data-theme="seventies"] .btn:hover:not(:disabled) { background: #F2B21B; border-color: #3B1F0E; }
:root[data-theme="seventies"] .btn-primary, :root[data-theme="seventies"] .btn-demo { background: #D9421C; border-color: #7A1E12; color: #FFF6E0; }
:root[data-theme="seventies"] .btn-primary:hover:not(:disabled) { background: #F08A1D; border-color: #7A1E12; }
:root[data-theme="seventies"] .mode-tabs button[aria-selected="true"], :root[data-theme="seventies"] .segmented button[aria-checked="true"], :root[data-theme="seventies"] .btn-icon.is-on, :root[data-theme="seventies"] .btn-train[aria-pressed="true"] { background: #F08A1D; border-color: #7A1E12; color: #3B1F0E; }
:root[data-theme="seventies"] .btn-danger, :root[data-theme="seventies"] .btn-danger-outline { color: #7A1E12; }
:root[data-theme="seventies"] .btn-link { border: 0; background: none; padding-inline: 0; }
:root[data-theme="seventies"] .btn-settings, :root[data-theme="seventies"] .btn-icon { padding-inline: 9px; }
:root[data-theme="seventies"] .mode-tabs { border: 2px solid #3B1F0E; border-radius: 16px; background: #FBF4E2; }
:root[data-theme="seventies"] .mode-tabs button { border-radius: 12px; color: #3B1F0E; }
:root[data-theme="seventies"] .tool { border-radius: 16px; }
:root[data-theme="seventies"] .tool:hover:not(:disabled) { background: #F7E3B0; }
:root[data-theme="seventies"] .tool[aria-pressed="true"] { background: #F2B21B; box-shadow: inset 0 0 0 2px #3B1F0E; }
:root[data-theme="seventies"] .field input, :root[data-theme="seventies"] .field select, :root[data-theme="seventies"] select, :root[data-theme="seventies"] input[type="text"], :root[data-theme="seventies"] input[type="number"] { border: 2px solid #3B1F0E; border-radius: 14px; background-color: #FFFFFF; }
:root[data-theme="seventies"] .field input:focus, :root[data-theme="seventies"] select:focus { border-color: #D9421C; box-shadow: 0 0 0 3px rgba(242, 178, 27, 0.6); }
:root[data-theme="seventies"] .swatch { border-radius: 50%; border-color: #3B1F0E; }
:root[data-theme="seventies"] .tree-chip { border-radius: 999px; border: 2px solid #DDBF8C; background: #FFFFFF; }
:root[data-theme="seventies"] .canvas-wrap { background: radial-gradient(circle at 0 100%, rgba(0,0,0,0) 0 150px, #7A1E12 150px 194px, #D9421C 194px 238px, #F08A1D 238px 282px, #F2B21B 282px 326px, #F7E3B0 326px 370px, rgba(0,0,0,0) 370px) no-repeat, #4A2A16; }
:root[data-theme="seventies"] .zoom-controls { border: 2px solid #F7E3B0; border-radius: 999px; background: #7A1E12; }
:root[data-theme="seventies"] .dialog { border: 0; border-radius: 26px; background: linear-gradient(180deg, #7A1E12 0 7px, #D9421C 7px 14px, #F08A1D 14px 21px, #F2B21B 21px 28px, #FBF4E2 28px); padding-top: 46px; box-shadow: 0 0 0 3px #3B1F0E, 0 24px 60px rgba(40, 15, 0, 0.6); }
:root[data-theme="seventies"] .dialog > .dialog-x { top: 34px; }
:root[data-theme="seventies"] .dialog::backdrop { background: rgba(74, 42, 22, 0.7); }
:root[data-theme="seventies"] .dialog-console .dialog-head { background: #FBF4E2; }
:root[data-theme="seventies"] .toast { border-radius: 999px; background: #D9421C; color: #FFF6E0; font-weight: 700; }
:root[data-theme="seventies"] .inspector::-webkit-scrollbar-thumb { background: #F08A1D; border: 2px solid #FBF4E2; }

/* ---- Vintage Hi-Fi: a stereo receiver. Brushed aluminium faces in a walnut cabinet, small engraved labels, a black
   dial window lit in amber along the bottom with a twitching level meter, and the plan on dark speaker cloth. */
:root[data-theme="hifi"] {
  --mat: #1D1E20; --mat-deep: #0B0906; --mat-line: rgba(255, 181, 46, 0.08); --mat-major: rgba(255, 181, 46, 0.4);
  --ink: #17191B; --ink-soft: #53585D; --paper: #3A1F0C; --panel: #D7DADC; --rule: #9AA0A5; --field: #F3F4F4;
  --primary: #C9861A; --primary-ink: #1A1205; --focus: #FFB52E;
  --font-ui: 'Helvetica Neue', Helvetica, Arial, 'Barlow', system-ui, sans-serif;
  --font-head: 'Eurostile', 'Microgramma', 'Bank Gothic', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --alu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='60'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 1.1' numOctaves='2' seed='11'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.5 -0.1'/%3E%3C/filter%3E%3Crect width='400' height='60' filter='url(%23b)'/%3E%3C/svg%3E"), linear-gradient(180deg, #F2F3F4 0%, #D3D6D9 45%, #BFC3C7 100%);
  --walnut: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9 0.012' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.06  0 0 0 0 0.02  0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)'/%3E%3C/svg%3E"), linear-gradient(180deg, #7A4A24, #4A2A12);
  color-scheme: light;
}
:root[data-theme="hifi"] body { background: #3A1F0C; }
:root[data-theme="hifi"] { --status-h: 40px; }   /* a deeper dial window, to take the meters */
:root[data-theme="hifi"] .topbar { background: var(--alu); border-bottom: 7px solid #4A2A12; border-image: linear-gradient(180deg, #7A4A24, #3A1F0C) 1; box-shadow: inset 0 1px 0 #FFFFFF, 0 3px 8px rgba(0, 0, 0, 0.5); position: relative; z-index: 2; }
:root[data-theme="hifi"] .wordmark-name { text-transform: uppercase; letter-spacing: 0.12em; font-size: 15px; color: #17191B; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); }
/* The dial window: amber on black glass, the scale's ticks along its top, the level meter at its end. */
:root[data-theme="hifi"] .statusbar { background: repeating-linear-gradient(90deg, rgba(255, 181, 46, 0.55) 0 1px, rgba(0, 0, 0, 0) 1px 14px) top / 100% 4px no-repeat, linear-gradient(180deg, #17120A, #0B0906); border-top: 2px solid #5A5F64; color: #FFB52E; text-shadow: 0 0 8px rgba(255, 181, 46, 0.7); letter-spacing: 0.04em; position: relative; padding-right: 160px; }
:root[data-theme="hifi"] #cursor-pos { color: #FFD27A; }
/* Two level meters at the end of the dial window, left channel and right: lit cream faces, their needles
   swinging together. (The needle's angle is a registered property, so it can be animated; where that isn't supported the
   needles simply rest.) */
@property --vu { syntax: '<angle>'; inherits: false; initial-value: -32deg; }
:root[data-theme="hifi"] .statusbar::before, :root[data-theme="hifi"] .statusbar::after {
  position: absolute;
  top: 50%;
  width: 62px;
  height: 30px;
  margin-top: -15px;
  box-sizing: border-box;
  padding: 17px 0 0 4px;
  border: 1px solid #8C9196;
  border-radius: 2px;
  color: #3A2A10;
  font: 700 8px/1 var(--font-head);
  text-shadow: none;
  letter-spacing: 0;
  background:
    conic-gradient(from calc(var(--vu) - 1.3deg) at 50% 135%, #1A1205 0 2.6deg, rgba(0, 0, 0, 0) 2.6deg),
    linear-gradient(#C8281E, #C8281E) 88% 5px / 15px 2px no-repeat,
    linear-gradient(#3A2A10, #3A2A10) 30% 5px / 30px 1px no-repeat,
    repeating-linear-gradient(90deg, #3A2A10 0 1px, rgba(0, 0, 0, 0) 1px 6px) 50% 7px / 48px 3px no-repeat,
    radial-gradient(ellipse at 50% 120%, #FFF6D6 0%, #F7DC8C 55%, #E0B04A 100%);
  box-shadow: inset 0 1px 4px rgba(60, 35, 0, 0.55), 0 0 8px rgba(255, 200, 90, 0.45);
}
:root[data-theme="hifi"] .statusbar::before { content: 'L'; right: 82px; animation: hifi-vu-l 3.1s ease-in-out infinite; }
:root[data-theme="hifi"] .statusbar::after { content: 'R'; right: 14px; animation: hifi-vu-l 3.1s ease-in-out infinite; }   /* (the same swing as the left, so the two move together) */
@keyframes hifi-vu-l { 0% { --vu: -30deg; } 9% { --vu: 4deg; } 17% { --vu: -12deg; } 26% { --vu: 16deg; } 34% { --vu: -4deg; } 45% { --vu: 26deg; } 53% { --vu: 2deg; } 64% { --vu: 12deg; } 73% { --vu: -18deg; } 84% { --vu: 8deg; } 100% { --vu: -30deg; } }
@media (prefers-reduced-motion: reduce) { :root[data-theme="hifi"] .statusbar::before, :root[data-theme="hifi"] .statusbar::after { animation: none; --vu: -8deg; } }
:root[data-theme="hifi"] .site-footer { background: var(--walnut); color: #E3C894; }
:root[data-theme="hifi"] .inspector { background: var(--alu); border-left: 12px solid #4A2A12; border-image: linear-gradient(90deg, #3A1F0C, #7A4A24 50%, #3A1F0C) 1; }
:root[data-theme="hifi"] .panel { border-bottom: 1px solid #8C9196; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); }
:root[data-theme="hifi"] .panel-title, :root[data-theme="hifi"] .dialog h2, :root[data-theme="hifi"] .lib-group { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12.5px; font-weight: 700; color: #17191B; }
:root[data-theme="hifi"] .help-link, :root[data-theme="hifi"] .btn-link { color: #7A4A08; }
:root[data-theme="hifi"] .field > span { text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; color: #3E4347; }
:root[data-theme="hifi"] .btn { border: 1px solid #5A5F64; border-radius: 3px; background: linear-gradient(180deg, #FDFDFD 0%, #D9DCDF 55%, #BEC2C6 100%); color: #17191B; font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); box-shadow: inset 0 1px 0 #FFFFFF, 0 1px 2px rgba(0, 0, 0, 0.45); }
:root[data-theme="hifi"] .btn-small { font-size: 10px; }
:root[data-theme="hifi"] .btn:hover:not(:disabled) { border-color: #17191B; filter: brightness(1.04); }
:root[data-theme="hifi"] .btn:active:not(:disabled) { background: linear-gradient(180deg, #BEC2C6, #D9DCDF); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.4); }
/* Switched on: lit from behind in amber. */
:root[data-theme="hifi"] .btn-primary, :root[data-theme="hifi"] .btn-demo, :root[data-theme="hifi"] .mode-tabs button[aria-selected="true"], :root[data-theme="hifi"] .segmented button[aria-checked="true"], :root[data-theme="hifi"] .btn-icon.is-on, :root[data-theme="hifi"] .btn-train[aria-pressed="true"] { background: linear-gradient(180deg, #FFD98A 0%, #FFB52E 50%, #D98A12 100%); border-color: #7A4A08; color: #2A1803; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.7); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 10px rgba(255, 181, 46, 0.75); }
:root[data-theme="hifi"] .btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #FFD98A 0%, #FFB52E 50%, #D98A12 100%); border-color: #4A2A04; }
:root[data-theme="hifi"] .btn-danger, :root[data-theme="hifi"] .btn-danger-outline { color: #A1241A; }
:root[data-theme="hifi"] .btn-link { border: 0; background: none; box-shadow: none; text-transform: none; letter-spacing: 0; font-family: var(--font-ui); font-size: inherit; font-weight: 500; }
:root[data-theme="hifi"] .mode-tabs { border: 1px solid #5A5F64; border-radius: 3px; background: #2A2C2E; gap: 1px; padding: 1px; }
:root[data-theme="hifi"] .mode-tabs button { border-radius: 2px; background: linear-gradient(180deg, #FDFDFD, #C9CDD1); color: #17191B; text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; }
:root[data-theme="hifi"] .tool { border-radius: 3px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 9.5px; }
:root[data-theme="hifi"] .tool:hover:not(:disabled) { background: linear-gradient(180deg, #FFFFFF, #D3D6D9); box-shadow: 0 0 0 1px #8C9196; }
:root[data-theme="hifi"] .tool[aria-pressed="true"] { background: linear-gradient(180deg, #BEC2C6, #E3E5E7); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 -2px 0 #FFB52E; }
:root[data-theme="hifi"] .field input, :root[data-theme="hifi"] .field select, :root[data-theme="hifi"] select, :root[data-theme="hifi"] input[type="text"], :root[data-theme="hifi"] input[type="number"] { border: 1px solid #5A5F64; border-radius: 2px; background-color: #F3F4F4; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.22); }
:root[data-theme="hifi"] .field input:focus, :root[data-theme="hifi"] select:focus { border-color: #C9861A; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(255, 181, 46, 0.7); }
:root[data-theme="hifi"] input[type="range"], :root[data-theme="hifi"] input[type="checkbox"] { accent-color: #C9861A; }
/* Colour swatches as knobs: round, with a bright metal rim. */
:root[data-theme="hifi"] .swatch { border-radius: 50%; border: 0; box-shadow: inset 0 5px 6px -3px rgba(255, 255, 255, 0.6), 0 0 0 2px #EDEFF0, 0 0 0 3px #5A5F64, 0 2px 3px 3px rgba(0, 0, 0, 0.3); }
:root[data-theme="hifi"] .swatch.is-active { box-shadow: inset 0 5px 6px -3px rgba(255, 255, 255, 0.6), 0 0 0 2px #FFB52E, 0 0 0 3px #7A4A08, 0 0 8px 3px rgba(255, 181, 46, 0.7); }
:root[data-theme="hifi"] .tree-chip { border-radius: 3px; border-color: #8C9196; background: linear-gradient(180deg, #FDFDFD, #D9DCDF); }
:root[data-theme="hifi"] .canvas-wrap { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 -0.08'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23p)'/%3E%3C/svg%3E"), linear-gradient(180deg, #232426, #17181A); box-shadow: inset 0 0 0 2px #5A5F64, inset 0 0 0 3px #0B0906, inset 0 8px 20px rgba(0, 0, 0, 0.6); }
:root[data-theme="hifi"] .zoom-controls { border: 1px solid #5A5F64; border-radius: 3px; background: linear-gradient(180deg, #17120A, #0B0906); color: #FFB52E; }
:root[data-theme="hifi"] .zoom-controls button, :root[data-theme="hifi"] .zoom-controls output { color: #FFB52E; text-shadow: 0 0 6px rgba(255, 181, 46, 0.6); }
:root[data-theme="hifi"] .zoom-controls .grid-info { color: #C9861A; border-left-color: #5A4A2A; }
/* Dialogs: a faceplate between the cabinet's walnut cheeks, a screw in each corner. */
:root[data-theme="hifi"] .dialog { border: 0; border-left: 16px solid #4A2A12; border-right: 16px solid #4A2A12; border-image: linear-gradient(180deg, #7A4A24, #3A1F0C 50%, #6A3F1D) 1; border-radius: 0; background: radial-gradient(circle at 11px 11px, #6E7378 0 1px, #F5F6F6 1.5px 4px, #6E7378 4.5px 5px, rgba(0, 0, 0, 0) 5.5px), radial-gradient(circle at calc(100% - 11px) 11px, #6E7378 0 1px, #F5F6F6 1.5px 4px, #6E7378 4.5px 5px, rgba(0, 0, 0, 0) 5.5px), radial-gradient(circle at 11px calc(100% - 11px), #6E7378 0 1px, #F5F6F6 1.5px 4px, #6E7378 4.5px 5px, rgba(0, 0, 0, 0) 5.5px), radial-gradient(circle at calc(100% - 11px) calc(100% - 11px), #6E7378 0 1px, #F5F6F6 1.5px 4px, #6E7378 4.5px 5px, rgba(0, 0, 0, 0) 5.5px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='60'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 1.1' numOctaves='2' seed='11'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.5 -0.1'/%3E%3C/filter%3E%3Crect width='400' height='60' filter='url(%23b)'/%3E%3C/svg%3E"), linear-gradient(180deg, #F2F3F4, #C9CDD1); box-shadow: 0 0 0 2px #0B0906, 0 24px 60px rgba(0, 0, 0, 0.75); }
:root[data-theme="hifi"] .dialog::backdrop { background: rgba(11, 9, 6, 0.78); }
:root[data-theme="hifi"] .dialog-console .dialog-head { background: #EEF0F1; }
:root[data-theme="hifi"] .toast { border: 1px solid #5A5F64; border-radius: 3px; background: linear-gradient(180deg, #17120A, #0B0906); color: #FFB52E; text-shadow: 0 0 8px rgba(255, 181, 46, 0.7); font-family: var(--font-head); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
:root[data-theme="hifi"] .inspector::-webkit-scrollbar-thumb { background: #8C9196; border: 2px solid #D3D6D9; }

/* The receiver's controls. Three kinds, as on the real thing:
     push buttons   every ordinary button: a small round spun-aluminium button, its label printed on the faceplate beside it;
     knobs          the tools down the left and the round icon buttons: a spun face inside a knurled edge;
     switches       check boxes and the mode list: a lever in a slot, with an amber lamp when it's on. */
:root[data-theme="hifi"] {
  --spun: conic-gradient(from 20deg, #FFFFFF, #A9AEB3 9%, #F4F5F6 18%, #8C9298 30%, #EDEFF0 41%, #A9AEB3 50%, #FFFFFF 59%, #8C9298 70%, #F4F5F6 82%, #9AA0A5 91%, #FFFFFF);
  --knurl: repeating-conic-gradient(#5E6368 0 3deg, #F1F2F3 3deg 6deg);
}
:root[data-theme="hifi"] .btn { border: 0; border-radius: 3px; background: none; box-shadow: none; padding: 6px 8px 6px 6px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85); filter: none; }
:root[data-theme="hifi"] .btn::before { content: ''; display: inline-block; width: 15px; height: 15px; margin-right: 7px; vertical-align: -3px; border: 1px solid #4E5358; border-radius: 50%; background: var(--spun); box-shadow: 0 0 0 2px #C4C8CC, 0 0 0 3px #6E7378, 0 2px 3px 2px rgba(0, 0, 0, 0.35); transition: transform 0.06s; }
:root[data-theme="hifi"] .btn-small::before { width: 12px; height: 12px; margin-right: 6px; vertical-align: -2px; }
:root[data-theme="hifi"] .btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.45); filter: none; }
:root[data-theme="hifi"] .btn:active:not(:disabled) { background: none; box-shadow: none; }
:root[data-theme="hifi"] .btn:active:not(:disabled)::before { transform: scale(0.86); box-shadow: 0 0 0 2px #A9AEB3, 0 0 0 3px #4E5358, inset 0 1px 3px rgba(0, 0, 0, 0.5); }
/* The main buttons carry a lit amber lamp instead. */
:root[data-theme="hifi"] .btn-primary, :root[data-theme="hifi"] .btn-demo, :root[data-theme="hifi"] .btn-train[aria-pressed="true"] { background: none; border: 0; color: #17191B; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85); box-shadow: none; }
:root[data-theme="hifi"] .btn-primary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.45); }
:root[data-theme="hifi"] .btn-primary::before, :root[data-theme="hifi"] .btn-demo::before, :root[data-theme="hifi"] .btn-train[aria-pressed="true"]::before { background: radial-gradient(circle at 40% 35%, #FFF3C9 0%, #FFB52E 45%, #C9790A 100%); border-color: #7A4A08; box-shadow: 0 0 0 2px #C4C8CC, 0 0 0 3px #6E7378, 0 0 9px 3px rgba(255, 181, 46, 0.8); }
:root[data-theme="hifi"] .btn-danger-outline::before, :root[data-theme="hifi"] .btn-danger::before { background: radial-gradient(circle at 40% 35%, #FFD0C8 0%, #D9483A 50%, #8E1F14 100%); border-color: #5A120B; }
:root[data-theme="hifi"] .btn-link::before, :root[data-theme="hifi"] .btn-account.is-avatar::before { content: none; }
/* Round icon buttons, and the zoom buttons: small knobs. */
:root[data-theme="hifi"] .btn-settings, :root[data-theme="hifi"] .btn-icon { width: 34px; height: 34px; padding: 0; border: 3px solid transparent; border-radius: 50%; background: var(--spun) padding-box, var(--knurl) border-box; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
:root[data-theme="hifi"] .btn-settings::before, :root[data-theme="hifi"] .btn-icon::before { content: none; }
:root[data-theme="hifi"] .btn-settings:hover:not(:disabled), :root[data-theme="hifi"] .btn-icon:hover:not(:disabled) { background: var(--spun) padding-box, var(--knurl) border-box; filter: brightness(1.07); }
:root[data-theme="hifi"] .btn-settings:active:not(:disabled), :root[data-theme="hifi"] .btn-icon:active:not(:disabled) { background: var(--spun) padding-box, var(--knurl) border-box; transform: rotate(25deg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
:root[data-theme="hifi"] .btn-icon.is-on { background: var(--spun) padding-box, var(--knurl) border-box; box-shadow: 0 0 0 2px #FFB52E, 0 0 9px 3px rgba(255, 181, 46, 0.75); }
:root[data-theme="hifi"] .zoom-controls { padding: 3px 4px; gap: 2px; }
:root[data-theme="hifi"] .zoom-controls button { width: 26px; height: 26px; border: 2px solid transparent; border-radius: 50%; background: var(--spun) padding-box, var(--knurl) border-box; color: #17191B; text-shadow: none; font-size: 16px; line-height: 1; }
/* The tools: big knobs, the label engraved under each. The one in use is ringed in amber and turned a little. */
:root[data-theme="hifi"] .tool { gap: 5px; padding: 6px 2px 6px; background: none; box-shadow: none; }
:root[data-theme="hifi"] .tool svg { box-sizing: content-box; width: 22px; height: 22px; padding: 8px; border: 4px solid transparent; border-radius: 50%; background: var(--spun) padding-box, var(--knurl) border-box; box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5); stroke: #17191B; transition: transform 0.15s; }
:root[data-theme="hifi"] .tool:hover:not(:disabled) { background: none; box-shadow: none; }
:root[data-theme="hifi"] .tool:hover:not(:disabled) svg { filter: brightness(1.07); }
:root[data-theme="hifi"] .tool:active:not(:disabled) svg { transform: rotate(20deg); }
:root[data-theme="hifi"] .tool[aria-pressed="true"] { background: none; box-shadow: none; }
:root[data-theme="hifi"] .tool[aria-pressed="true"] svg { box-shadow: 0 0 0 2px #FFB52E, 0 0 10px 4px rgba(255, 181, 46, 0.7), 0 3px 5px rgba(0, 0, 0, 0.5); }
:root[data-theme="hifi"] .tool-sep { background: #8C9196; }
/* The mode list: a row of lever switches. Down is off; up, with its lamp lit, is the one chosen. */
:root[data-theme="hifi"] .mode-tabs { border: 0; background: none; padding: 0; gap: 0; }
:root[data-theme="hifi"] .mode-tabs button { position: relative; min-height: 24px; padding: 4px 2px 4px 17px; border-radius: 0; background: none; border-bottom: 1px solid rgba(0, 0, 0, 0.14); text-align: left; font-size: 9px; letter-spacing: 0.04em; line-height: 1.15; }
:root[data-theme="hifi"] .mode-tabs button::before { content: ''; position: absolute; left: 3px; top: 50%; width: 9px; height: 18px; margin-top: -9px; border-radius: 4px; background: radial-gradient(circle at 50% 74%, #FFFFFF 0 1.5px, #C9CDD1 2.5px, #5E6368 4px, rgba(0, 0, 0, 0) 4.5px), #17181A; box-shadow: inset 0 1px 2px #000, 0 1px 0 rgba(255, 255, 255, 0.8); }
:root[data-theme="hifi"] .mode-tabs button[aria-selected="true"] { background: none; border-color: rgba(0, 0, 0, 0.14); color: #17191B; box-shadow: none; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85); }
:root[data-theme="hifi"] .mode-tabs button[aria-selected="true"]::before { background: radial-gradient(circle at 50% 26%, #FFFFFF 0 1.5px, #C9CDD1 2.5px, #5E6368 4px, rgba(0, 0, 0, 0) 4.5px), linear-gradient(180deg, #17181A 50%, #FFB52E 50%); box-shadow: inset 0 1px 2px #000, 0 0 7px 2px rgba(255, 181, 46, 0.8); }
/* Check boxes: slide switches. */
:root[data-theme="hifi"] input[type="checkbox"] { -webkit-appearance: none; appearance: none; flex: none; width: 26px; height: 16px; margin: 0; border: 1px solid #4E5358; border-radius: 8px; background: radial-gradient(circle at 8px 50%, #FFFFFF 0 2px, #D3D6D9 4px, #6E7378 6px, rgba(0, 0, 0, 0) 6.5px), #17181A; box-shadow: inset 0 1px 3px #000, 0 1px 0 rgba(255, 255, 255, 0.8); cursor: pointer; vertical-align: middle; }
:root[data-theme="hifi"] .check { font-size: 13px; gap: 7px; }   /* (the switch is wider than a check box: this keeps the labels on their lines) */
:root[data-theme="hifi"] input[type="checkbox"]:checked { background: radial-gradient(circle at calc(100% - 8px) 50%, #FFFFFF 0 2px, #D3D6D9 4px, #6E7378 6px, rgba(0, 0, 0, 0) 6.5px), linear-gradient(90deg, #FFB52E, #C9790A); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 7px 1px rgba(255, 181, 46, 0.7); }
:root[data-theme="hifi"] input[type="checkbox"]:focus-visible { outline: 2px solid #C9861A; outline-offset: 2px; }
/* The picture on each knob glows dial blue, in a small window of dark glass let into the knob's face. */
:root[data-theme="hifi"] { --dial: #6FC8FF; --glass: radial-gradient(circle, #0E1B2A 0 52%, #05090E 58%, #4E5358 61%, rgba(0, 0, 0, 0) 64%); }
:root[data-theme="hifi"] .tool svg { background: var(--glass) padding-box, var(--spun) padding-box, var(--knurl) border-box; stroke: var(--dial); filter: drop-shadow(0 0 2.5px rgba(111, 200, 255, 0.9)); }
:root[data-theme="hifi"] .tool:hover:not(:disabled) svg { filter: drop-shadow(0 0 4px rgba(111, 200, 255, 1)) brightness(1.08); }
:root[data-theme="hifi"] .tool-tape svg * { fill: none; stroke: var(--dial); }
:root[data-theme="hifi"] .btn-settings, :root[data-theme="hifi"] .btn-icon, :root[data-theme="hifi"] .btn-settings:hover:not(:disabled), :root[data-theme="hifi"] .btn-icon:hover:not(:disabled), :root[data-theme="hifi"] .btn-settings:active:not(:disabled), :root[data-theme="hifi"] .btn-icon:active:not(:disabled), :root[data-theme="hifi"] .btn-icon.is-on { background: var(--glass) padding-box, var(--spun) padding-box, var(--knurl) border-box; color: var(--dial); text-shadow: 0 0 5px rgba(111, 200, 255, 0.9); }
:root[data-theme="hifi"] .btn-settings svg, :root[data-theme="hifi"] .btn-icon svg { width: 15px; height: 15px; stroke: var(--dial); filter: drop-shadow(0 0 2px rgba(111, 200, 255, 0.9)); }
:root[data-theme="hifi"] .zoom-controls button { background: var(--glass) padding-box, var(--spun) padding-box, var(--knurl) border-box; color: var(--dial); text-shadow: 0 0 5px rgba(111, 200, 255, 0.9); font-size: 14px; }
/* A button that already carries its own picture (the scenery categories) is a flat aluminium key instead, so its label keeps its room. */
:root[data-theme="hifi"] .btn:has(> svg):not(.btn-settings):not(.btn-icon) { border: 1px solid #5A5F64; background: linear-gradient(180deg, #FDFDFD 0%, #D9DCDF 55%, #BEC2C6 100%); box-shadow: inset 0 1px 0 #FFFFFF, 0 1px 2px rgba(0, 0, 0, 0.45); }
:root[data-theme="hifi"] .btn:has(> svg)::before { content: none; }
/* The ground-cover and species chips: flat aluminium keys, pressed in when chosen. */
:root[data-theme="hifi"] .tree-chip[aria-checked="true"] { background: linear-gradient(180deg, #BEC2C6, #E3E5E7); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 -2px 0 #FFB52E; }

/* Their Transform buttons, their wipes, and their logos. */
.btn-transform[data-to="recroom"] { border: 2px solid #5A2C0C; border-radius: 10px; background: linear-gradient(180deg, #E0782E, #B5541C); color: #FFF4DC; font-weight: 700; text-shadow: none; box-shadow: 0 0 0 0 rgba(224, 161, 43, 0.85); animation-name: seventies-beckon; }
.btn-transform[data-to="seventies"] { border: 2px solid #7A1E12; border-radius: 999px; background: #D9421C; color: #FFF6E0; font-weight: 700; text-shadow: none; box-shadow: 0 0 0 0 rgba(224, 161, 43, 0.85); animation-name: seventies-beckon; }
.btn-transform[data-to="hifi"] { border: 1px solid #7A4A08; border-radius: 3px; background: linear-gradient(180deg, #FFD98A 0%, #FFB52E 50%, #D98A12 100%); color: #2A1803; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; text-shadow: none; box-shadow: 0 0 0 0 rgba(224, 161, 43, 0.85); animation-name: seventies-beckon; }
@keyframes seventies-beckon { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 161, 43, 0.85); } 50% { box-shadow: 0 0 0 6px rgba(224, 161, 43, 0); } }
/* Rec Room: a panel of walnut slides across. The 1970's: the five stripes. Hi-Fi: the dial's pointer, glowing blue. */
.aero-band.is-recroom { width: 120px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='320' viewBox='0 0 360 320'%3E%3Cdefs%3E%3Cfilter id='d0' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.10 0.006' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l0' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.06 0.004' numOctaves='3' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c0' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='12' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d1' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.12 0.006' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l1' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.07 0.004' numOctaves='3' seed='16' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c1' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='20' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d2' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.14 0.006' numOctaves='4' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l2' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.08 0.004' numOctaves='3' seed='28' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c2' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='32' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d3' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.10 0.006' numOctaves='4' seed='37' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l3' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.06 0.004' numOctaves='3' seed='42' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c3' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='46' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3Cfilter id='d4' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.12 0.006' numOctaves='4' seed='52' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 0 0.03  2.6 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='l4' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.07 0.004' numOctaves='3' seed='57' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.80  0 0 0 0 0.52  0 0 0 0 0.24  1.5 0 0 0 -0.72'/%3E%3C/filter%3E%3Cfilter id='c4' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.03' numOctaves='2' seed='61' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.07  0 0 0 0 0.02  1.8 0 0 0 -0.8'/%3E%3C/filter%3E%3C/defs%3E%3Crect x='0' width='74' height='320' fill='%238F5526'/%3E%3Crect x='0' width='74' height='320' filter='url(%23c0)'/%3E%3Crect x='0' width='74' height='320' filter='url(%23l0)'/%3E%3Crect x='0' width='74' height='320' filter='url(%23d0)'/%3E%3Crect x='0' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='2' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='74' width='58' height='320' fill='%237E4A20'/%3E%3Crect x='74' width='58' height='320' filter='url(%23c1)'/%3E%3Crect x='74' width='58' height='320' filter='url(%23l1)'/%3E%3Crect x='74' width='58' height='320' filter='url(%23d1)'/%3E%3Crect x='74' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='76' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='132' width='82' height='320' fill='%2396592A'/%3E%3Crect x='132' width='82' height='320' filter='url(%23c2)'/%3E%3Crect x='132' width='82' height='320' filter='url(%23l2)'/%3E%3Crect x='132' width='82' height='320' filter='url(%23d2)'/%3E%3Crect x='132' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='134' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='214' width='66' height='320' fill='%23844D22'/%3E%3Crect x='214' width='66' height='320' filter='url(%23c3)'/%3E%3Crect x='214' width='66' height='320' filter='url(%23l3)'/%3E%3Crect x='214' width='66' height='320' filter='url(%23d3)'/%3E%3Crect x='214' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='216' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3Crect x='280' width='80' height='320' fill='%238B5225'/%3E%3Crect x='280' width='80' height='320' filter='url(%23c4)'/%3E%3Crect x='280' width='80' height='320' filter='url(%23l4)'/%3E%3Crect x='280' width='80' height='320' filter='url(%23d4)'/%3E%3Crect x='280' width='2' height='320' fill='%231C0E05'/%3E%3Crect x='282' width='1' height='320' fill='%23C98A4A' opacity='0.35'/%3E%3C/svg%3E") 0 0 / 360px 320px; box-shadow: 0 0 24px rgba(20, 10, 0, 0.6); animation-name: seventies-band; }
.aero-band.is-seventies { width: 120px; background: linear-gradient(90deg, #7A1E12 0 20%, #D9421C 20% 40%, #F08A1D 40% 60%, #F2B21B 60% 80%, #F7E3B0 80% 100%); animation-name: seventies-band; }
.aero-band.aero-band-back.is-seventies { background: linear-gradient(270deg, #7A1E12 0 20%, #D9421C 20% 40%, #F08A1D 40% 60%, #F2B21B 60% 80%, #F7E3B0 80% 100%); }
.aero-band.is-hifi { width: 14px; left: 0; background: linear-gradient(90deg, #6FC8FF, #E6F6FF 50%, #6FC8FF); box-shadow: 0 0 34px 14px rgba(111, 200, 255, 0.65); animation-name: hifi-band; }
@keyframes seventies-band { 0% { transform: translateX(-120px); opacity: 1; } 96% { opacity: 1; } 100% { transform: translateX(calc(100vw - 120px)); opacity: 0; } }
@keyframes hifi-band { 0% { transform: translateX(-14px); opacity: 1; } 96% { opacity: 1; } 100% { transform: translateX(calc(100vw - 14px)); opacity: 0; } }
.aero-band.aero-band-back.is-recroom, .aero-band.aero-band-back.is-seventies, .aero-band.aero-band-back.is-hifi { animation-name: aero-band-back; }
.wordmark .wordmark-mark-recroom, .wordmark .wordmark-mark-seventies, .wordmark .wordmark-mark-hifi { display: none; }
:root[data-theme="recroom"] .wordmark .wordmark-mark:not(.wordmark-mark-recroom), :root[data-theme="seventies"] .wordmark .wordmark-mark:not(.wordmark-mark-seventies), :root[data-theme="hifi"] .wordmark .wordmark-mark:not(.wordmark-mark-hifi) { display: none; }
:root[data-theme="recroom"] .wordmark .wordmark-mark-recroom, :root[data-theme="seventies"] .wordmark .wordmark-mark-seventies, :root[data-theme="hifi"] .wordmark .wordmark-mark-hifi { display: block; }


/* ---- Theme: K-Pop (data-theme="kpop") -----------------------------------------------
   Stage night: a deep violet plan scattered with sparkles, glossy white panels edged in a holographic pastel sheen
   (pink, lilac, sky, mint), hot-pink pill buttons with a glow, and round, bubbly lettering. The graphics and the
   jingle are our own. Put on and taken off with the Transform button, like the other transformative themes. */
:root[data-theme="kpop"] {
  --mat: #24103F; --mat-deep: #12062A; --mat-line: rgba(255, 184, 230, 0.08); --mat-major: rgba(255, 138, 216, 0.4);
  --ink: #2A1245; --ink-soft: #7B5C9C; --paper: #F3E4FF; --panel: #FFFFFF; --rule: #E7CFFA; --field: #FBF4FF;
  --primary: #FF3FA4; --primary-ink: #FFFFFF; --focus: #8AD8FF;
  --font-ui: 'Nunito', 'Quicksand', 'Poppins', 'Arial Rounded MT Bold', 'Avenir Next', 'Barlow', system-ui, sans-serif;
  --font-head: 'Poppins', 'Nunito', 'Arial Rounded MT Bold', 'Avenir Next', 'Barlow', system-ui, sans-serif;
  --holo: linear-gradient(115deg, #FF8AD8 0%, #C59BFF 28%, #8AD8FF 52%, #9BFFD9 74%, #FFE38A 100%);
  color-scheme: light;
}
:root[data-theme="kpop"] body { background: #F3E4FF; }
:root[data-theme="kpop"] .topbar { background: #FFFFFF; border-bottom: 4px solid #FF8AD8; border-image: var(--holo) 1; box-shadow: 0 4px 18px rgba(255, 63, 164, 0.25); position: relative; z-index: 2; }
:root[data-theme="kpop"] .wordmark-name { background: linear-gradient(90deg, #FF3FA4, #9B5CFF 55%, #3FB8FF); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; letter-spacing: -0.01em; }
:root[data-theme="kpop"] .wordmark-sub { color: #7B5C9C; -webkit-text-fill-color: #7B5C9C; font-weight: 600; }
:root[data-theme="kpop"] .statusbar { background: var(--holo); border-top: 0; color: #2A1245; font-weight: 600; }
:root[data-theme="kpop"] #cursor-pos { color: #2A1245; }
:root[data-theme="kpop"] .site-footer { background: #12062A; color: #FFB8E6; }
:root[data-theme="kpop"] .inspector { background: linear-gradient(rgba(255,255,255,0.78), rgba(255,255,255,0.78)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cpath d='M175 80Q176.54 85.46 182 87Q176.54 88.54 175 94Q173.46 88.54 168 87Q173.46 85.46 175 80Z' fill='%23FFFFFF' opacity='0.39'/%3E%3Cpath d='M284 53Q285.1 56.9 289 58Q285.1 59.1 284 63Q282.9 59.1 279 58Q282.9 56.9 284 53Z' fill='%23FFFFFF' opacity='0.85'/%3E%3Cpath d='M119 26Q119.66 28.34 122 29Q119.66 29.66 119 32Q118.34 29.66 116 29Q118.34 28.34 119 26Z' fill='%23E3C8FF' opacity='0.58'/%3E%3Cpath d='M133 47Q134.98 54.02 142 56Q134.98 57.98 133 65Q131.02 57.98 124 56Q131.02 54.02 133 47Z' fill='%23E3C8FF' opacity='0.38'/%3E%3Cpath d='M299 69Q299.88 72.12 303 73Q299.88 73.88 299 77Q298.12 73.88 295 73Q298.12 72.12 299 69Z' fill='%23FFFFFF' opacity='0.67'/%3E%3Cpath d='M213 31Q213.88 34.12 217 35Q213.88 35.88 213 39Q212.12 35.88 209 35Q212.12 34.12 213 31Z' fill='%23FFFFFF' opacity='0.66'/%3E%3Cpath d='M78 151Q79.54 156.46 85 158Q79.54 159.54 78 165Q76.46 159.54 71 158Q76.46 156.46 78 151Z' fill='%23FFB8E6' opacity='0.65'/%3E%3Cpath d='M302 158Q303.98 165.02 311 167Q303.98 168.98 302 176Q300.02 168.98 293 167Q300.02 165.02 302 158Z' fill='%23FFB8E6' opacity='0.41'/%3E%3Cpath d='M302 333Q302.88 336.12 306 337Q302.88 337.88 302 341Q301.12 337.88 298 337Q301.12 336.12 302 333Z' fill='%23B8F2FF' opacity='0.4'/%3E%3Cpath d='M374 33Q375.98 40.02 383 42Q375.98 43.98 374 51Q372.02 43.98 365 42Q372.02 40.02 374 33Z' fill='%23FFFFFF' opacity='0.69'/%3E%3Cpath d='M264 349Q265.98 356.02 273 358Q265.98 359.98 264 367Q262.02 359.98 255 358Q262.02 356.02 264 349Z' fill='%23E3C8FF' opacity='0.78'/%3E%3Cpath d='M248 302Q249.54 307.46 255 309Q249.54 310.54 248 316Q246.46 310.54 241 309Q246.46 307.46 248 302Z' fill='%23B8F2FF' opacity='0.51'/%3E%3Cpath d='M102 363Q102.88 366.12 106 367Q102.88 367.88 102 371Q101.12 367.88 98 367Q101.12 366.12 102 363Z' fill='%23FFFFFF' opacity='0.67'/%3E%3Cpath d='M278 258Q279.1 261.9 283 263Q279.1 264.1 278 268Q276.9 264.1 273 263Q276.9 261.9 278 258Z' fill='%23E3C8FF' opacity='0.51'/%3E%3Cpath d='M47 61Q48.98 68.02 56 70Q48.98 71.98 47 79Q45.02 71.98 38 70Q45.02 68.02 47 61Z' fill='%23E3C8FF' opacity='0.44'/%3E%3Cpath d='M185 80Q186.54 85.46 192 87Q186.54 88.54 185 94Q183.46 88.54 178 87Q183.46 85.46 185 80Z' fill='%23E3C8FF' opacity='0.37'/%3E%3Cpath d='M352 40Q353.98 47.02 361 49Q353.98 50.98 352 58Q350.02 50.98 343 49Q350.02 47.02 352 40Z' fill='%23B8F2FF' opacity='0.54'/%3E%3Cpath d='M189 307Q190.54 312.46 196 314Q190.54 315.54 189 321Q187.46 315.54 182 314Q187.46 312.46 189 307Z' fill='%23E3C8FF' opacity='0.39'/%3E%3Cpath d='M57 141Q58.54 146.46 64 148Q58.54 149.54 57 155Q55.46 149.54 50 148Q55.46 146.46 57 141Z' fill='%23FFFFFF' opacity='0.38'/%3E%3Cpath d='M369 159Q370.98 166.02 378 168Q370.98 169.98 369 177Q367.02 169.98 360 168Q367.02 166.02 369 159Z' fill='%23E3C8FF' opacity='0.51'/%3E%3Cpath d='M207 347Q208.1 350.9 212 352Q208.1 353.1 207 357Q205.9 353.1 202 352Q205.9 350.9 207 347Z' fill='%23FFFFFF' opacity='0.87'/%3E%3Cpath d='M191 87Q192.98 94.02 200 96Q192.98 97.98 191 105Q189.02 97.98 182 96Q189.02 94.02 191 87Z' fill='%23FFFFFF' opacity='0.62'/%3E%3Cpath d='M121 153Q121.88 156.12 125 157Q121.88 157.88 121 161Q120.12 157.88 117 157Q120.12 156.12 121 153Z' fill='%23FFB8E6' opacity='0.57'/%3E%3Cpath d='M264 47Q264.88 50.12 268 51Q264.88 51.88 264 55Q263.12 51.88 260 51Q263.12 50.12 264 47Z' fill='%23E3C8FF' opacity='0.57'/%3E%3Cpath d='M152 73Q153.54 78.46 159 80Q153.54 81.54 152 87Q150.46 81.54 145 80Q150.46 78.46 152 73Z' fill='%23B8F2FF' opacity='0.74'/%3E%3Cpath d='M193 352Q194.54 357.46 200 359Q194.54 360.54 193 366Q191.46 360.54 186 359Q191.46 357.46 193 352Z' fill='%23FFB8E6' opacity='0.43'/%3E%3C/svg%3E"), linear-gradient(180deg, #FFFFFF 0%, #FBF1FF 60%, #EFF8FF 100%); background-attachment: local; border-left: 4px solid #C59BFF; border-image: linear-gradient(180deg, #FF8AD8, #C59BFF, #8AD8FF, #9BFFD9) 1; }
:root[data-theme="kpop"] .panel { border-bottom: 2px dotted #E3C8FF; }
:root[data-theme="kpop"] .panel-title, :root[data-theme="kpop"] .dialog h2, :root[data-theme="kpop"] .lib-group { color: #C2188A; font-weight: 800; letter-spacing: -0.01em; }
:root[data-theme="kpop"] .panel-title::before, :root[data-theme="kpop"] .dialog h2::before { content: '\2726\00a0'; color: #9B5CFF; }
:root[data-theme="kpop"] .panel-title { justify-content: flex-start; }
:root[data-theme="kpop"] .panel-title > :last-child:not(:first-child) { margin-left: auto; }
:root[data-theme="kpop"] .btn { border: 2px solid #E3C8FF; border-radius: 999px; background: #FFFFFF; color: #5A2A8A; font-weight: 700; box-shadow: 0 2px 0 #E3C8FF; }
:root[data-theme="kpop"] .btn:hover:not(:disabled) { border-color: #FF8AD8; background: #FFF0FA; box-shadow: 0 2px 0 #FF8AD8, 0 0 14px rgba(255, 138, 216, 0.55); }
:root[data-theme="kpop"] .btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
:root[data-theme="kpop"] .btn-primary, :root[data-theme="kpop"] .btn-demo { border-color: #FFFFFF; background: linear-gradient(135deg, #FF3FA4, #B45CFF); color: #FFFFFF; text-shadow: 0 1px 0 rgba(120, 0, 80, 0.35); box-shadow: 0 0 0 2px #FF8AD8, 0 4px 14px rgba(255, 63, 164, 0.5); }
:root[data-theme="kpop"] .btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #FF5FB6, #C47CFF); border-color: #FFFFFF; box-shadow: 0 0 0 2px #FF8AD8, 0 0 20px rgba(255, 63, 164, 0.8); }
:root[data-theme="kpop"] .mode-tabs button[aria-selected="true"], :root[data-theme="kpop"] .segmented button[aria-checked="true"], :root[data-theme="kpop"] .btn-icon.is-on, :root[data-theme="kpop"] .btn-train[aria-pressed="true"] { background: linear-gradient(135deg, #FF3FA4, #B45CFF); color: #FFFFFF; box-shadow: 0 2px 10px rgba(255, 63, 164, 0.45); }
:root[data-theme="kpop"] .btn-danger, :root[data-theme="kpop"] .btn-danger-outline { color: #D1175F; }
:root[data-theme="kpop"] .btn-link { border: 0; background: none; box-shadow: none; color: #C2188A; }
:root[data-theme="kpop"] .help-link { color: #9B5CFF; }
:root[data-theme="kpop"] .mode-tabs { border: 2px solid #E3C8FF; border-radius: 16px; background: #FFFFFF; }
:root[data-theme="kpop"] .mode-tabs button { border-radius: 12px; color: #5A2A8A; font-weight: 700; }
:root[data-theme="kpop"] .tool { border-radius: 16px; color: #5A2A8A; font-weight: 600; }
:root[data-theme="kpop"] .tool:hover:not(:disabled) { background: #FFF0FA; }
:root[data-theme="kpop"] .tool[aria-pressed="true"] { background: var(--holo); box-shadow: inset 0 0 0 2px #FFFFFF, 0 0 12px rgba(197, 155, 255, 0.7); }
:root[data-theme="kpop"] .field input, :root[data-theme="kpop"] .field select, :root[data-theme="kpop"] select, :root[data-theme="kpop"] input[type="text"], :root[data-theme="kpop"] input[type="number"] { border: 2px solid #E3C8FF; border-radius: 14px; background-color: #FFFFFF; }
:root[data-theme="kpop"] .field input:focus, :root[data-theme="kpop"] select:focus { border-color: #FF8AD8; box-shadow: 0 0 0 3px rgba(138, 216, 255, 0.55); }
:root[data-theme="kpop"] input[type="checkbox"], :root[data-theme="kpop"] input[type="range"] { accent-color: #FF3FA4; }
:root[data-theme="kpop"] .swatch { border-radius: 50%; border-color: #FFFFFF; box-shadow: 0 0 0 2px #E3C8FF; }
:root[data-theme="kpop"] .tree-chip, :root[data-theme="kpop"] .chip { border-radius: 999px; border-color: #E3C8FF; }
:root[data-theme="kpop"] .canvas-wrap { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cpath d='M175 80Q176.54 85.46 182 87Q176.54 88.54 175 94Q173.46 88.54 168 87Q173.46 85.46 175 80Z' fill='%23FFFFFF' opacity='0.39'/%3E%3Cpath d='M284 53Q285.1 56.9 289 58Q285.1 59.1 284 63Q282.9 59.1 279 58Q282.9 56.9 284 53Z' fill='%23FFFFFF' opacity='0.85'/%3E%3Cpath d='M119 26Q119.66 28.34 122 29Q119.66 29.66 119 32Q118.34 29.66 116 29Q118.34 28.34 119 26Z' fill='%23E3C8FF' opacity='0.58'/%3E%3Cpath d='M133 47Q134.98 54.02 142 56Q134.98 57.98 133 65Q131.02 57.98 124 56Q131.02 54.02 133 47Z' fill='%23E3C8FF' opacity='0.38'/%3E%3Cpath d='M299 69Q299.88 72.12 303 73Q299.88 73.88 299 77Q298.12 73.88 295 73Q298.12 72.12 299 69Z' fill='%23FFFFFF' opacity='0.67'/%3E%3Cpath d='M213 31Q213.88 34.12 217 35Q213.88 35.88 213 39Q212.12 35.88 209 35Q212.12 34.12 213 31Z' fill='%23FFFFFF' opacity='0.66'/%3E%3Cpath d='M78 151Q79.54 156.46 85 158Q79.54 159.54 78 165Q76.46 159.54 71 158Q76.46 156.46 78 151Z' fill='%23FFB8E6' opacity='0.65'/%3E%3Cpath d='M302 158Q303.98 165.02 311 167Q303.98 168.98 302 176Q300.02 168.98 293 167Q300.02 165.02 302 158Z' fill='%23FFB8E6' opacity='0.41'/%3E%3Cpath d='M302 333Q302.88 336.12 306 337Q302.88 337.88 302 341Q301.12 337.88 298 337Q301.12 336.12 302 333Z' fill='%23B8F2FF' opacity='0.4'/%3E%3Cpath d='M374 33Q375.98 40.02 383 42Q375.98 43.98 374 51Q372.02 43.98 365 42Q372.02 40.02 374 33Z' fill='%23FFFFFF' opacity='0.69'/%3E%3Cpath d='M264 349Q265.98 356.02 273 358Q265.98 359.98 264 367Q262.02 359.98 255 358Q262.02 356.02 264 349Z' fill='%23E3C8FF' opacity='0.78'/%3E%3Cpath d='M248 302Q249.54 307.46 255 309Q249.54 310.54 248 316Q246.46 310.54 241 309Q246.46 307.46 248 302Z' fill='%23B8F2FF' opacity='0.51'/%3E%3Cpath d='M102 363Q102.88 366.12 106 367Q102.88 367.88 102 371Q101.12 367.88 98 367Q101.12 366.12 102 363Z' fill='%23FFFFFF' opacity='0.67'/%3E%3Cpath d='M278 258Q279.1 261.9 283 263Q279.1 264.1 278 268Q276.9 264.1 273 263Q276.9 261.9 278 258Z' fill='%23E3C8FF' opacity='0.51'/%3E%3Cpath d='M47 61Q48.98 68.02 56 70Q48.98 71.98 47 79Q45.02 71.98 38 70Q45.02 68.02 47 61Z' fill='%23E3C8FF' opacity='0.44'/%3E%3Cpath d='M185 80Q186.54 85.46 192 87Q186.54 88.54 185 94Q183.46 88.54 178 87Q183.46 85.46 185 80Z' fill='%23E3C8FF' opacity='0.37'/%3E%3Cpath d='M352 40Q353.98 47.02 361 49Q353.98 50.98 352 58Q350.02 50.98 343 49Q350.02 47.02 352 40Z' fill='%23B8F2FF' opacity='0.54'/%3E%3Cpath d='M189 307Q190.54 312.46 196 314Q190.54 315.54 189 321Q187.46 315.54 182 314Q187.46 312.46 189 307Z' fill='%23E3C8FF' opacity='0.39'/%3E%3Cpath d='M57 141Q58.54 146.46 64 148Q58.54 149.54 57 155Q55.46 149.54 50 148Q55.46 146.46 57 141Z' fill='%23FFFFFF' opacity='0.38'/%3E%3Cpath d='M369 159Q370.98 166.02 378 168Q370.98 169.98 369 177Q367.02 169.98 360 168Q367.02 166.02 369 159Z' fill='%23E3C8FF' opacity='0.51'/%3E%3Cpath d='M207 347Q208.1 350.9 212 352Q208.1 353.1 207 357Q205.9 353.1 202 352Q205.9 350.9 207 347Z' fill='%23FFFFFF' opacity='0.87'/%3E%3Cpath d='M191 87Q192.98 94.02 200 96Q192.98 97.98 191 105Q189.02 97.98 182 96Q189.02 94.02 191 87Z' fill='%23FFFFFF' opacity='0.62'/%3E%3Cpath d='M121 153Q121.88 156.12 125 157Q121.88 157.88 121 161Q120.12 157.88 117 157Q120.12 156.12 121 153Z' fill='%23FFB8E6' opacity='0.57'/%3E%3Cpath d='M264 47Q264.88 50.12 268 51Q264.88 51.88 264 55Q263.12 51.88 260 51Q263.12 50.12 264 47Z' fill='%23E3C8FF' opacity='0.57'/%3E%3Cpath d='M152 73Q153.54 78.46 159 80Q153.54 81.54 152 87Q150.46 81.54 145 80Q150.46 78.46 152 73Z' fill='%23B8F2FF' opacity='0.74'/%3E%3Cpath d='M193 352Q194.54 357.46 200 359Q194.54 360.54 193 366Q191.46 360.54 186 359Q191.46 357.46 193 352Z' fill='%23FFB8E6' opacity='0.43'/%3E%3C/svg%3E"), radial-gradient(ellipse at 20% 0%, rgba(255, 63, 164, 0.28) 0%, rgba(255, 63, 164, 0) 50%), radial-gradient(ellipse at 85% 0%, rgba(63, 184, 255, 0.24) 0%, rgba(63, 184, 255, 0) 48%), linear-gradient(180deg, #2E1452 0%, #24103F 55%, #160A2C 100%); }
:root[data-theme="kpop"] .zoom-controls { border: 2px solid #FFFFFF; border-radius: 999px; background: linear-gradient(135deg, #FF3FA4, #B45CFF); box-shadow: 0 4px 14px rgba(255, 63, 164, 0.5); }
:root[data-theme="kpop"] .dialog { border: 5px solid #FF8AD8; border-image: var(--holo) 1; border-radius: 0; background: linear-gradient(rgba(255,255,255,0.78), rgba(255,255,255,0.78)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cpath d='M175 80Q176.54 85.46 182 87Q176.54 88.54 175 94Q173.46 88.54 168 87Q173.46 85.46 175 80Z' fill='%23FFFFFF' opacity='0.39'/%3E%3Cpath d='M284 53Q285.1 56.9 289 58Q285.1 59.1 284 63Q282.9 59.1 279 58Q282.9 56.9 284 53Z' fill='%23FFFFFF' opacity='0.85'/%3E%3Cpath d='M119 26Q119.66 28.34 122 29Q119.66 29.66 119 32Q118.34 29.66 116 29Q118.34 28.34 119 26Z' fill='%23E3C8FF' opacity='0.58'/%3E%3Cpath d='M133 47Q134.98 54.02 142 56Q134.98 57.98 133 65Q131.02 57.98 124 56Q131.02 54.02 133 47Z' fill='%23E3C8FF' opacity='0.38'/%3E%3Cpath d='M299 69Q299.88 72.12 303 73Q299.88 73.88 299 77Q298.12 73.88 295 73Q298.12 72.12 299 69Z' fill='%23FFFFFF' opacity='0.67'/%3E%3Cpath d='M213 31Q213.88 34.12 217 35Q213.88 35.88 213 39Q212.12 35.88 209 35Q212.12 34.12 213 31Z' fill='%23FFFFFF' opacity='0.66'/%3E%3Cpath d='M78 151Q79.54 156.46 85 158Q79.54 159.54 78 165Q76.46 159.54 71 158Q76.46 156.46 78 151Z' fill='%23FFB8E6' opacity='0.65'/%3E%3Cpath d='M302 158Q303.98 165.02 311 167Q303.98 168.98 302 176Q300.02 168.98 293 167Q300.02 165.02 302 158Z' fill='%23FFB8E6' opacity='0.41'/%3E%3Cpath d='M302 333Q302.88 336.12 306 337Q302.88 337.88 302 341Q301.12 337.88 298 337Q301.12 336.12 302 333Z' fill='%23B8F2FF' opacity='0.4'/%3E%3Cpath d='M374 33Q375.98 40.02 383 42Q375.98 43.98 374 51Q372.02 43.98 365 42Q372.02 40.02 374 33Z' fill='%23FFFFFF' opacity='0.69'/%3E%3Cpath d='M264 349Q265.98 356.02 273 358Q265.98 359.98 264 367Q262.02 359.98 255 358Q262.02 356.02 264 349Z' fill='%23E3C8FF' opacity='0.78'/%3E%3Cpath d='M248 302Q249.54 307.46 255 309Q249.54 310.54 248 316Q246.46 310.54 241 309Q246.46 307.46 248 302Z' fill='%23B8F2FF' opacity='0.51'/%3E%3Cpath d='M102 363Q102.88 366.12 106 367Q102.88 367.88 102 371Q101.12 367.88 98 367Q101.12 366.12 102 363Z' fill='%23FFFFFF' opacity='0.67'/%3E%3Cpath d='M278 258Q279.1 261.9 283 263Q279.1 264.1 278 268Q276.9 264.1 273 263Q276.9 261.9 278 258Z' fill='%23E3C8FF' opacity='0.51'/%3E%3Cpath d='M47 61Q48.98 68.02 56 70Q48.98 71.98 47 79Q45.02 71.98 38 70Q45.02 68.02 47 61Z' fill='%23E3C8FF' opacity='0.44'/%3E%3Cpath d='M185 80Q186.54 85.46 192 87Q186.54 88.54 185 94Q183.46 88.54 178 87Q183.46 85.46 185 80Z' fill='%23E3C8FF' opacity='0.37'/%3E%3Cpath d='M352 40Q353.98 47.02 361 49Q353.98 50.98 352 58Q350.02 50.98 343 49Q350.02 47.02 352 40Z' fill='%23B8F2FF' opacity='0.54'/%3E%3Cpath d='M189 307Q190.54 312.46 196 314Q190.54 315.54 189 321Q187.46 315.54 182 314Q187.46 312.46 189 307Z' fill='%23E3C8FF' opacity='0.39'/%3E%3Cpath d='M57 141Q58.54 146.46 64 148Q58.54 149.54 57 155Q55.46 149.54 50 148Q55.46 146.46 57 141Z' fill='%23FFFFFF' opacity='0.38'/%3E%3Cpath d='M369 159Q370.98 166.02 378 168Q370.98 169.98 369 177Q367.02 169.98 360 168Q367.02 166.02 369 159Z' fill='%23E3C8FF' opacity='0.51'/%3E%3Cpath d='M207 347Q208.1 350.9 212 352Q208.1 353.1 207 357Q205.9 353.1 202 352Q205.9 350.9 207 347Z' fill='%23FFFFFF' opacity='0.87'/%3E%3Cpath d='M191 87Q192.98 94.02 200 96Q192.98 97.98 191 105Q189.02 97.98 182 96Q189.02 94.02 191 87Z' fill='%23FFFFFF' opacity='0.62'/%3E%3Cpath d='M121 153Q121.88 156.12 125 157Q121.88 157.88 121 161Q120.12 157.88 117 157Q120.12 156.12 121 153Z' fill='%23FFB8E6' opacity='0.57'/%3E%3Cpath d='M264 47Q264.88 50.12 268 51Q264.88 51.88 264 55Q263.12 51.88 260 51Q263.12 50.12 264 47Z' fill='%23E3C8FF' opacity='0.57'/%3E%3Cpath d='M152 73Q153.54 78.46 159 80Q153.54 81.54 152 87Q150.46 81.54 145 80Q150.46 78.46 152 73Z' fill='%23B8F2FF' opacity='0.74'/%3E%3Cpath d='M193 352Q194.54 357.46 200 359Q194.54 360.54 193 366Q191.46 360.54 186 359Q191.46 357.46 193 352Z' fill='%23FFB8E6' opacity='0.43'/%3E%3C/svg%3E"), linear-gradient(180deg, #FFFFFF 0%, #FBF1FF 70%, #EFF8FF 100%); box-shadow: 0 0 50px rgba(255, 63, 164, 0.55), 0 24px 60px rgba(30, 5, 60, 0.6); }
:root[data-theme="kpop"] .dialog::backdrop { background: radial-gradient(circle at 50% 30%, rgba(180, 92, 255, 0.5), rgba(18, 6, 42, 0.85)); }
:root[data-theme="kpop"] .dialog-console .dialog-head { background: #FFFFFF; }
:root[data-theme="kpop"] .toast { border-radius: 999px; background: linear-gradient(135deg, #FF3FA4, #B45CFF); color: #FFFFFF; font-weight: 700; box-shadow: 0 0 24px rgba(255, 63, 164, 0.7); }
:root[data-theme="kpop"] .inspector::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #FF8AD8, #C59BFF); border: 2px solid #FFFFFF; }
/* Its Transform button, its wipe (a holographic ribbon), and its logo (the track in a heart). */
.btn-transform[data-to="kpop"] { border: 2px solid #FFFFFF; border-radius: 999px; background: linear-gradient(135deg, #FF3FA4, #B45CFF); color: #FFFFFF; font-weight: 800; text-shadow: none; box-shadow: 0 0 0 0 rgba(255, 63, 164, 0.85); animation-name: kpop-beckon; }
@keyframes kpop-beckon { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 63, 164, 0.85); } 50% { box-shadow: 0 0 0 7px rgba(255, 63, 164, 0); } }
.aero-band.is-kpop { width: 140px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cpath d='M175 80Q176.54 85.46 182 87Q176.54 88.54 175 94Q173.46 88.54 168 87Q173.46 85.46 175 80Z' fill='%23FFFFFF' opacity='0.39'/%3E%3Cpath d='M284 53Q285.1 56.9 289 58Q285.1 59.1 284 63Q282.9 59.1 279 58Q282.9 56.9 284 53Z' fill='%23FFFFFF' opacity='0.85'/%3E%3Cpath d='M119 26Q119.66 28.34 122 29Q119.66 29.66 119 32Q118.34 29.66 116 29Q118.34 28.34 119 26Z' fill='%23E3C8FF' opacity='0.58'/%3E%3Cpath d='M133 47Q134.98 54.02 142 56Q134.98 57.98 133 65Q131.02 57.98 124 56Q131.02 54.02 133 47Z' fill='%23E3C8FF' opacity='0.38'/%3E%3Cpath d='M299 69Q299.88 72.12 303 73Q299.88 73.88 299 77Q298.12 73.88 295 73Q298.12 72.12 299 69Z' fill='%23FFFFFF' opacity='0.67'/%3E%3Cpath d='M213 31Q213.88 34.12 217 35Q213.88 35.88 213 39Q212.12 35.88 209 35Q212.12 34.12 213 31Z' fill='%23FFFFFF' opacity='0.66'/%3E%3Cpath d='M78 151Q79.54 156.46 85 158Q79.54 159.54 78 165Q76.46 159.54 71 158Q76.46 156.46 78 151Z' fill='%23FFB8E6' opacity='0.65'/%3E%3Cpath d='M302 158Q303.98 165.02 311 167Q303.98 168.98 302 176Q300.02 168.98 293 167Q300.02 165.02 302 158Z' fill='%23FFB8E6' opacity='0.41'/%3E%3Cpath d='M302 333Q302.88 336.12 306 337Q302.88 337.88 302 341Q301.12 337.88 298 337Q301.12 336.12 302 333Z' fill='%23B8F2FF' opacity='0.4'/%3E%3Cpath d='M374 33Q375.98 40.02 383 42Q375.98 43.98 374 51Q372.02 43.98 365 42Q372.02 40.02 374 33Z' fill='%23FFFFFF' opacity='0.69'/%3E%3Cpath d='M264 349Q265.98 356.02 273 358Q265.98 359.98 264 367Q262.02 359.98 255 358Q262.02 356.02 264 349Z' fill='%23E3C8FF' opacity='0.78'/%3E%3Cpath d='M248 302Q249.54 307.46 255 309Q249.54 310.54 248 316Q246.46 310.54 241 309Q246.46 307.46 248 302Z' fill='%23B8F2FF' opacity='0.51'/%3E%3Cpath d='M102 363Q102.88 366.12 106 367Q102.88 367.88 102 371Q101.12 367.88 98 367Q101.12 366.12 102 363Z' fill='%23FFFFFF' opacity='0.67'/%3E%3Cpath d='M278 258Q279.1 261.9 283 263Q279.1 264.1 278 268Q276.9 264.1 273 263Q276.9 261.9 278 258Z' fill='%23E3C8FF' opacity='0.51'/%3E%3Cpath d='M47 61Q48.98 68.02 56 70Q48.98 71.98 47 79Q45.02 71.98 38 70Q45.02 68.02 47 61Z' fill='%23E3C8FF' opacity='0.44'/%3E%3Cpath d='M185 80Q186.54 85.46 192 87Q186.54 88.54 185 94Q183.46 88.54 178 87Q183.46 85.46 185 80Z' fill='%23E3C8FF' opacity='0.37'/%3E%3Cpath d='M352 40Q353.98 47.02 361 49Q353.98 50.98 352 58Q350.02 50.98 343 49Q350.02 47.02 352 40Z' fill='%23B8F2FF' opacity='0.54'/%3E%3Cpath d='M189 307Q190.54 312.46 196 314Q190.54 315.54 189 321Q187.46 315.54 182 314Q187.46 312.46 189 307Z' fill='%23E3C8FF' opacity='0.39'/%3E%3Cpath d='M57 141Q58.54 146.46 64 148Q58.54 149.54 57 155Q55.46 149.54 50 148Q55.46 146.46 57 141Z' fill='%23FFFFFF' opacity='0.38'/%3E%3Cpath d='M369 159Q370.98 166.02 378 168Q370.98 169.98 369 177Q367.02 169.98 360 168Q367.02 166.02 369 159Z' fill='%23E3C8FF' opacity='0.51'/%3E%3Cpath d='M207 347Q208.1 350.9 212 352Q208.1 353.1 207 357Q205.9 353.1 202 352Q205.9 350.9 207 347Z' fill='%23FFFFFF' opacity='0.87'/%3E%3Cpath d='M191 87Q192.98 94.02 200 96Q192.98 97.98 191 105Q189.02 97.98 182 96Q189.02 94.02 191 87Z' fill='%23FFFFFF' opacity='0.62'/%3E%3Cpath d='M121 153Q121.88 156.12 125 157Q121.88 157.88 121 161Q120.12 157.88 117 157Q120.12 156.12 121 153Z' fill='%23FFB8E6' opacity='0.57'/%3E%3Cpath d='M264 47Q264.88 50.12 268 51Q264.88 51.88 264 55Q263.12 51.88 260 51Q263.12 50.12 264 47Z' fill='%23E3C8FF' opacity='0.57'/%3E%3Cpath d='M152 73Q153.54 78.46 159 80Q153.54 81.54 152 87Q150.46 81.54 145 80Q150.46 78.46 152 73Z' fill='%23B8F2FF' opacity='0.74'/%3E%3Cpath d='M193 352Q194.54 357.46 200 359Q194.54 360.54 193 366Q191.46 360.54 186 359Q191.46 357.46 193 352Z' fill='%23FFB8E6' opacity='0.43'/%3E%3C/svg%3E"), linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #FF8AD8 20%, #C59BFF 40%, #8AD8FF 60%, #9BFFD9 80%, #FFFFFF 100%); box-shadow: 0 0 40px 10px rgba(255, 138, 216, 0.6); animation-name: kpop-band; }
@keyframes kpop-band { 0% { transform: translateX(-140px); opacity: 1; } 94% { opacity: 1; } 100% { transform: translateX(calc(100vw - 140px)); opacity: 0; } }
.aero-band.aero-band-back.is-kpop { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cpath d='M175 80Q176.54 85.46 182 87Q176.54 88.54 175 94Q173.46 88.54 168 87Q173.46 85.46 175 80Z' fill='%23FFFFFF' opacity='0.39'/%3E%3Cpath d='M284 53Q285.1 56.9 289 58Q285.1 59.1 284 63Q282.9 59.1 279 58Q282.9 56.9 284 53Z' fill='%23FFFFFF' opacity='0.85'/%3E%3Cpath d='M119 26Q119.66 28.34 122 29Q119.66 29.66 119 32Q118.34 29.66 116 29Q118.34 28.34 119 26Z' fill='%23E3C8FF' opacity='0.58'/%3E%3Cpath d='M133 47Q134.98 54.02 142 56Q134.98 57.98 133 65Q131.02 57.98 124 56Q131.02 54.02 133 47Z' fill='%23E3C8FF' opacity='0.38'/%3E%3Cpath d='M299 69Q299.88 72.12 303 73Q299.88 73.88 299 77Q298.12 73.88 295 73Q298.12 72.12 299 69Z' fill='%23FFFFFF' opacity='0.67'/%3E%3Cpath d='M213 31Q213.88 34.12 217 35Q213.88 35.88 213 39Q212.12 35.88 209 35Q212.12 34.12 213 31Z' fill='%23FFFFFF' opacity='0.66'/%3E%3Cpath d='M78 151Q79.54 156.46 85 158Q79.54 159.54 78 165Q76.46 159.54 71 158Q76.46 156.46 78 151Z' fill='%23FFB8E6' opacity='0.65'/%3E%3Cpath d='M302 158Q303.98 165.02 311 167Q303.98 168.98 302 176Q300.02 168.98 293 167Q300.02 165.02 302 158Z' fill='%23FFB8E6' opacity='0.41'/%3E%3Cpath d='M302 333Q302.88 336.12 306 337Q302.88 337.88 302 341Q301.12 337.88 298 337Q301.12 336.12 302 333Z' fill='%23B8F2FF' opacity='0.4'/%3E%3Cpath d='M374 33Q375.98 40.02 383 42Q375.98 43.98 374 51Q372.02 43.98 365 42Q372.02 40.02 374 33Z' fill='%23FFFFFF' opacity='0.69'/%3E%3Cpath d='M264 349Q265.98 356.02 273 358Q265.98 359.98 264 367Q262.02 359.98 255 358Q262.02 356.02 264 349Z' fill='%23E3C8FF' opacity='0.78'/%3E%3Cpath d='M248 302Q249.54 307.46 255 309Q249.54 310.54 248 316Q246.46 310.54 241 309Q246.46 307.46 248 302Z' fill='%23B8F2FF' opacity='0.51'/%3E%3Cpath d='M102 363Q102.88 366.12 106 367Q102.88 367.88 102 371Q101.12 367.88 98 367Q101.12 366.12 102 363Z' fill='%23FFFFFF' opacity='0.67'/%3E%3Cpath d='M278 258Q279.1 261.9 283 263Q279.1 264.1 278 268Q276.9 264.1 273 263Q276.9 261.9 278 258Z' fill='%23E3C8FF' opacity='0.51'/%3E%3Cpath d='M47 61Q48.98 68.02 56 70Q48.98 71.98 47 79Q45.02 71.98 38 70Q45.02 68.02 47 61Z' fill='%23E3C8FF' opacity='0.44'/%3E%3Cpath d='M185 80Q186.54 85.46 192 87Q186.54 88.54 185 94Q183.46 88.54 178 87Q183.46 85.46 185 80Z' fill='%23E3C8FF' opacity='0.37'/%3E%3Cpath d='M352 40Q353.98 47.02 361 49Q353.98 50.98 352 58Q350.02 50.98 343 49Q350.02 47.02 352 40Z' fill='%23B8F2FF' opacity='0.54'/%3E%3Cpath d='M189 307Q190.54 312.46 196 314Q190.54 315.54 189 321Q187.46 315.54 182 314Q187.46 312.46 189 307Z' fill='%23E3C8FF' opacity='0.39'/%3E%3Cpath d='M57 141Q58.54 146.46 64 148Q58.54 149.54 57 155Q55.46 149.54 50 148Q55.46 146.46 57 141Z' fill='%23FFFFFF' opacity='0.38'/%3E%3Cpath d='M369 159Q370.98 166.02 378 168Q370.98 169.98 369 177Q367.02 169.98 360 168Q367.02 166.02 369 159Z' fill='%23E3C8FF' opacity='0.51'/%3E%3Cpath d='M207 347Q208.1 350.9 212 352Q208.1 353.1 207 357Q205.9 353.1 202 352Q205.9 350.9 207 347Z' fill='%23FFFFFF' opacity='0.87'/%3E%3Cpath d='M191 87Q192.98 94.02 200 96Q192.98 97.98 191 105Q189.02 97.98 182 96Q189.02 94.02 191 87Z' fill='%23FFFFFF' opacity='0.62'/%3E%3Cpath d='M121 153Q121.88 156.12 125 157Q121.88 157.88 121 161Q120.12 157.88 117 157Q120.12 156.12 121 153Z' fill='%23FFB8E6' opacity='0.57'/%3E%3Cpath d='M264 47Q264.88 50.12 268 51Q264.88 51.88 264 55Q263.12 51.88 260 51Q263.12 50.12 264 47Z' fill='%23E3C8FF' opacity='0.57'/%3E%3Cpath d='M152 73Q153.54 78.46 159 80Q153.54 81.54 152 87Q150.46 81.54 145 80Q150.46 78.46 152 73Z' fill='%23B8F2FF' opacity='0.74'/%3E%3Cpath d='M193 352Q194.54 357.46 200 359Q194.54 360.54 193 366Q191.46 360.54 186 359Q191.46 357.46 193 352Z' fill='%23FFB8E6' opacity='0.43'/%3E%3C/svg%3E"), linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, #FF8AD8 20%, #C59BFF 40%, #8AD8FF 60%, #9BFFD9 80%, #FFFFFF 100%); animation-name: aero-band-back; }
.wordmark .wordmark-mark-kpop { display: none; }
:root[data-theme="kpop"] .wordmark .wordmark-mark:not(.wordmark-mark-kpop) { display: none; }
:root[data-theme="kpop"] .wordmark .wordmark-mark-kpop { display: block; filter: drop-shadow(0 2px 5px rgba(255, 63, 164, 0.5)); }

/* ---- Theme: Winter Wonderland (data-theme="winter") ----------------------------------
   A clear winter night: the plan is a deep blue sky with snow falling quietly BEHIND the layout (never over it), the
   panels are fresh snow and ice, icicles hang under the top bar, snowy pines stand along the foot of the plan, and every
   button is an ice cube. The graphics and the tune are our own. Put on and taken off with
   the Transform button, like the other transformative themes. */
:root[data-theme="winter"] {
  --mat: #12304F; --mat-deep: #0A1E36; --mat-line: rgba(200, 230, 255, 0.08); --mat-major: rgba(170, 215, 255, 0.38);
  --ink: #17324D; --ink-soft: #55748F; --paper: #EAF4FB; --panel: #FFFFFF; --rule: #D3E4F1; --field: #F5FAFE;
  --primary: #C1272D; --primary-ink: #FFFFFF; --focus: #7CC4F0;
  --frost: linear-gradient(180deg, #FFFFFF 0%, #EAF4FB 100%);
  color-scheme: light;
}
:root[data-theme="winter"] body { background: #EAF4FB; }
:root[data-theme="winter"] .topbar { position: relative; z-index: 3; background: var(--frost); border-bottom: 0; }
:root[data-theme="winter"] .topbar::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='18'%3E%3Cpath d='M0 0H120V3Q117.8 3.5 115.5 9Q113.2 3.5 111.0 3Q109.2 3.5 107.5 5Q105.8 3.5 104.0 3Q101.2 3.5 98.5 15Q95.8 3.5 93.0 3Q91.0 3.5 89.0 7Q87.0 3.5 85.0 3Q82.5 3.5 80.0 11Q77.5 3.5 75.0 3Q73.2 3.5 71.5 4Q69.8 3.5 68.0 3Q65.0 3.5 62.0 17Q59.0 3.5 56.0 3Q53.8 3.5 51.5 8Q49.2 3.5 47.0 3Q45.0 3.5 43.0 12Q41.0 3.5 39.0 3Q36.5 3.5 34.0 6Q31.5 3.5 29.0 3Q26.8 3.5 24.5 13Q22.2 3.5 20.0 3Q15.0 3.5 10.0 5Q5.0 3.5 0.0 3Z' fill='%23FFFFFF'/%3E%3Cpath d='M0 0H120' stroke='%23D3E4F1' stroke-width='1'/%3E%3C/svg%3E") repeat-x; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(10, 30, 54, 0.35)); }
:root[data-theme="winter"] .wordmark-name { color: #12304F; }
:root[data-theme="winter"] .wordmark-sub { color: #55748F; }
:root[data-theme="winter"] .statusbar { background: linear-gradient(180deg, #1B4470 0%, #2C5F92 100%); border-top: 2px solid #FFFFFF; color: #FFFFFF; text-shadow: 0 1px 2px rgba(10, 30, 54, 0.8); }
:root[data-theme="winter"] #cursor-pos { color: #FFFFFF; }
:root[data-theme="winter"] .site-footer { background: #0A1E36; color: #CFE6F7; }
:root[data-theme="winter"] .inspector { background: linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.86)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cpath d='M27.9 39.0L52.1 53.0M40.0 32.0L40.0 60.0M52.1 39.0L27.9 53.0M47.3 50.2L51.5 48.7M47.3 50.2L48.1 54.6M40.0 54.4L43.4 57.3M40.0 54.4L36.6 57.3M32.7 50.2L31.9 54.6M32.7 50.2L28.5 48.7M32.7 41.8L28.5 43.3M32.7 41.8L31.9 37.4M40.0 37.6L36.6 34.7M40.0 37.6L43.4 34.7M47.3 41.8L48.1 37.4M47.3 41.8L51.5 43.3' stroke='%23B9D8EE' stroke-width='1.2' stroke-linecap='round' fill='none' opacity='1'/%3E%3Cpath d='M143.1 26.0L156.9 34.0M150.0 22.0L150.0 38.0M156.9 26.0L143.1 34.0M154.2 32.4L156.6 31.5M154.2 32.4L154.6 34.9M150.0 34.8L152.0 36.4M150.0 34.8L148.0 36.4M145.8 32.4L145.4 34.9M145.8 32.4L143.4 31.5M145.8 27.6L143.4 28.5M145.8 27.6L145.4 25.1M150.0 25.2L148.0 23.6M150.0 25.2L152.0 23.6M154.2 27.6L154.6 25.1M154.2 27.6L156.6 28.5' stroke='%23B9D8EE' stroke-width='1.2' stroke-linecap='round' fill='none' opacity='1'/%3E%3Cpath d='M161.3 131.5L190.7 148.5M176.0 123.0L176.0 157.0M190.7 131.5L161.3 148.5M184.8 145.1L189.9 143.2M184.8 145.1L185.8 150.5M176.0 150.2L180.2 153.7M176.0 150.2L171.8 153.7M167.2 145.1L166.2 150.5M167.2 145.1L162.1 143.2M167.2 134.9L162.1 136.8M167.2 134.9L166.2 129.5M176.0 129.8L171.8 126.3M176.0 129.8L180.2 126.3M184.8 134.9L185.8 129.5M184.8 134.9L189.9 136.8' stroke='%23B9D8EE' stroke-width='1.2' stroke-linecap='round' fill='none' opacity='1'/%3E%3Cpath d='M61.3 165.0L78.7 175.0M70.0 160.0L70.0 180.0M78.7 165.0L61.3 175.0M75.2 173.0L78.2 171.9M75.2 173.0L75.8 176.2M70.0 176.0L72.5 178.1M70.0 176.0L67.5 178.1M64.8 173.0L64.2 176.2M64.8 173.0L61.8 171.9M64.8 167.0L61.8 168.1M64.8 167.0L64.2 163.8M70.0 164.0L67.5 161.9M70.0 164.0L72.5 161.9M75.2 167.0L75.8 163.8M75.2 167.0L78.2 168.1' stroke='%23B9D8EE' stroke-width='1.2' stroke-linecap='round' fill='none' opacity='1'/%3E%3Cpath d='M112.8 97.0L123.2 103.0M118.0 94.0L118.0 106.0M123.2 97.0L112.8 103.0M121.1 101.8L122.9 101.1M121.1 101.8L121.5 103.7M118.0 103.6L119.5 104.8M118.0 103.6L116.5 104.8M114.9 101.8L114.5 103.7M114.9 101.8L113.1 101.1M114.9 98.2L113.1 98.9M114.9 98.2L114.5 96.3M118.0 96.4L116.5 95.2M118.0 96.4L119.5 95.2M121.1 98.2L121.5 96.3M121.1 98.2L122.9 98.9' stroke='%23B9D8EE' stroke-width='1.2' stroke-linecap='round' fill='none' opacity='1'/%3E%3C/svg%3E"), #F5FAFE; border-left: 3px solid #FFFFFF; box-shadow: -1px 0 0 #D3E4F1; scrollbar-color: #B9D8EE transparent; }
:root[data-theme="winter"] .panel { border-bottom: 1px solid #D3E4F1; }
:root[data-theme="winter"] .panel-title, :root[data-theme="winter"] .dialog h2, :root[data-theme="winter"] .lib-group { color: #1B4470; }
:root[data-theme="winter"] .panel-title::before, :root[data-theme="winter"] .dialog h2::before { content: '\2744\00a0'; color: #7CC4F0; font-weight: 400; }
:root[data-theme="winter"] .panel-title { justify-content: flex-start; }
:root[data-theme="winter"] .panel-title > :last-child:not(:first-child) { margin-left: auto; }
/* Every button is an ice cube: clear, pale blue ice with a bright bevel on the top-left edges, a deeper blue in the
   bottom-right ones, and a glint running across it. The main buttons are cut from deeper glacier ice; whatever is
   switched on is a cube lit from inside. */
:root[data-theme="winter"] {
  --ice: linear-gradient(115deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.85) 44%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0) 66%, rgba(255, 255, 255, 0.5) 69%, rgba(255, 255, 255, 0) 72%), linear-gradient(145deg, #FFFFFF 0%, #DDF0FB 28%, #A9D5F0 62%, #D6EDFA 100%);
  --ice-deep: linear-gradient(115deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.55) 44%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0) 66%, rgba(255, 255, 255, 0.3) 69%, rgba(255, 255, 255, 0) 72%), linear-gradient(145deg, #A9DBF7 0%, #4FA3DC 35%, #1F6FB3 70%, #57AEE4 100%);
  --ice-lit: linear-gradient(115deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.6) 44%, rgba(255, 255, 255, 0) 50%), radial-gradient(circle at 50% 55%, #E9FBFF 0%, #7FD3F2 45%, #2C8CC8 100%);
  --ice-edge: inset 0 0 0 1px rgba(110, 175, 220, 0.6), inset 2px 2px 3px rgba(255, 255, 255, 0.95), inset -2px -3px 4px rgba(60, 130, 190, 0.5), 0 2px 3px rgba(13, 37, 66, 0.3);
}
:root[data-theme="winter"] .btn, :root[data-theme="winter"] .chip, :root[data-theme="winter"] .tree-chip, :root[data-theme="winter"] .tool, :root[data-theme="winter"] .mode-tabs button, :root[data-theme="winter"] .segmented button, :root[data-theme="winter"] .zoom-controls button { border: 1px solid rgba(255, 255, 255, 0.95); border-radius: 7px; background: var(--ice); color: #12304F; font-weight: 600; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); box-shadow: var(--ice-edge); }
:root[data-theme="winter"] .btn:hover:not(:disabled), :root[data-theme="winter"] .chip:hover, :root[data-theme="winter"] .tree-chip:hover, :root[data-theme="winter"] .tool:hover:not(:disabled), :root[data-theme="winter"] .mode-tabs button:hover, :root[data-theme="winter"] .segmented button:hover, :root[data-theme="winter"] .zoom-controls button:hover { border-color: #FFFFFF; background: var(--ice); filter: brightness(1.05); box-shadow: var(--ice-edge), 0 0 10px rgba(150, 215, 250, 0.9); }
:root[data-theme="winter"] .btn:active:not(:disabled), :root[data-theme="winter"] .tool:active:not(:disabled) { transform: translateY(1px); }
:root[data-theme="winter"] .btn:disabled, :root[data-theme="winter"] .tool:disabled { opacity: 0.55; }
:root[data-theme="winter"] .btn-primary, :root[data-theme="winter"] .btn-demo, :root[data-theme="winter"] .btn-primary:hover:not(:disabled) { border-color: #D6EDFA; background: var(--ice-deep); color: #FFFFFF; text-shadow: 0 1px 2px rgba(10, 30, 54, 0.75); }
:root[data-theme="winter"] .mode-tabs button[aria-selected="true"], :root[data-theme="winter"] .segmented button[aria-checked="true"], :root[data-theme="winter"] .btn-icon[aria-pressed="true"], :root[data-theme="winter"] .chip[aria-checked="true"], :root[data-theme="winter"] .tree-chip[aria-checked="true"], :root[data-theme="winter"] .tool[aria-pressed="true"] { border-color: #FFFFFF; background: var(--ice-lit); color: #0A1E36; box-shadow: var(--ice-edge), 0 0 12px rgba(127, 211, 242, 0.95); }
:root[data-theme="winter"] .mode-tabs, :root[data-theme="winter"] .segmented { gap: 2px; border: 0; background: none; padding: 0; }
:root[data-theme="winter"] .mode-tabs button { padding-block: 4px; }
:root[data-theme="winter"] .tool { padding-block: 6px 5px; }
:root[data-theme="winter"] .zoom-controls { gap: 3px; border: 0; background: none; box-shadow: none; }
.btn-transform[data-to="winter"] { border: 1px solid #D6EDFA; border-radius: 7px; background: linear-gradient(115deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.55) 44%, rgba(255, 255, 255, 0) 50%), linear-gradient(145deg, #A9DBF7 0%, #4FA3DC 35%, #1F6FB3 70%, #57AEE4 100%); color: #FFFFFF; text-shadow: 0 1px 2px rgba(10, 30, 54, 0.75); box-shadow: inset 2px 2px 3px rgba(255, 255, 255, 0.9), 0 0 0 0 rgba(124, 196, 240, 0.9); animation-name: winter-beckon; }
@keyframes winter-beckon { 0%, 100% { box-shadow: inset 2px 2px 3px rgba(255, 255, 255, 0.9), 0 0 0 0 rgba(124, 196, 240, 0.9); } 50% { box-shadow: inset 2px 2px 3px rgba(255, 255, 255, 0.9), 0 0 0 7px rgba(124, 196, 240, 0); } }
:root[data-theme="winter"] .btn-danger, :root[data-theme="winter"] .btn-danger-outline { color: #B01F25; }
:root[data-theme="winter"] .btn-link { border: 0; background: none; box-shadow: none; color: #1B5E9A; }
:root[data-theme="winter"] .help-link { color: #1B5E9A; }
:root[data-theme="winter"] .field input, :root[data-theme="winter"] .field select, :root[data-theme="winter"] select, :root[data-theme="winter"] input[type="text"], :root[data-theme="winter"] input[type="number"], :root[data-theme="winter"] textarea { border-color: #B9D8EE; background-color: #F5FAFE; }
:root[data-theme="winter"] .field input:focus, :root[data-theme="winter"] select:focus { border-color: #7CC4F0; box-shadow: 0 0 0 3px rgba(124, 196, 240, 0.45); }
:root[data-theme="winter"] input[type="checkbox"], :root[data-theme="winter"] input[type="range"] { accent-color: #1F5A44; }
:root[data-theme="winter"] .canvas-wrap { isolation: isolate; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='30'%3E%3Cg transform='translate(22 27) scale(1)'%3E%3Cpath d='M0 -22L-7 -9H-3L-9 0H9L3 -9H7Z' fill='%231F5A44'/%3E%3Cpath d='M0 -22L-4 -14Q0 -12 4 -14Z' fill='%23FFFFFF'/%3E%3Crect x='-1.2' y='0' width='2.4' height='3' fill='%235B3B22'/%3E%3C/g%3E%3Cg transform='translate(48 27) scale(0.7)'%3E%3Cpath d='M0 -22L-7 -9H-3L-9 0H9L3 -9H7Z' fill='%231F5A44'/%3E%3Cpath d='M0 -22L-4 -14Q0 -12 4 -14Z' fill='%23FFFFFF'/%3E%3Crect x='-1.2' y='0' width='2.4' height='3' fill='%235B3B22'/%3E%3C/g%3E%3Cg transform='translate(118 27) scale(0.85)'%3E%3Cpath d='M0 -22L-7 -9H-3L-9 0H9L3 -9H7Z' fill='%231F5A44'/%3E%3Cpath d='M0 -22L-4 -14Q0 -12 4 -14Z' fill='%23FFFFFF'/%3E%3Crect x='-1.2' y='0' width='2.4' height='3' fill='%235B3B22'/%3E%3C/g%3E%3Cg transform='translate(190 27) scale(1.1)'%3E%3Cpath d='M0 -22L-7 -9H-3L-9 0H9L3 -9H7Z' fill='%231F5A44'/%3E%3Cpath d='M0 -22L-4 -14Q0 -12 4 -14Z' fill='%23FFFFFF'/%3E%3Crect x='-1.2' y='0' width='2.4' height='3' fill='%235B3B22'/%3E%3C/g%3E%3Cg transform='translate(214 27) scale(0.65)'%3E%3Cpath d='M0 -22L-7 -9H-3L-9 0H9L3 -9H7Z' fill='%231F5A44'/%3E%3Cpath d='M0 -22L-4 -14Q0 -12 4 -14Z' fill='%23FFFFFF'/%3E%3Crect x='-1.2' y='0' width='2.4' height='3' fill='%235B3B22'/%3E%3C/g%3E%3Cpath d='M0 30V24Q30 16 65 23T130 22T200 24T260 24V30Z' fill='%23FFFFFF'/%3E%3C/svg%3E") repeat-x left bottom, radial-gradient(ellipse at 82% 0%, rgba(214, 236, 255, 0.22) 0%, rgba(214, 236, 255, 0) 45%), linear-gradient(180deg, #0D2542 0%, #12304F 55%, #1B4470 100%); }
/* The snowfall: two layers a tile taller than the plan, sliding down by exactly one tile and starting over. They sit
   under everything drawn on the plan, so the layout is never snowed on. */
:root[data-theme="winter"] .canvas-wrap::before, :root[data-theme="winter"] .canvas-wrap::after { content: ''; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; pointer-events: none; }
:root[data-theme="winter"] .canvas-wrap::before { top: -400px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Ccircle cx='152' cy='132' r='2.5' fill='%23FFFFFF' opacity='0.60'/%3E%3Ccircle cx='134' cy='7' r='1.4' fill='%23FFFFFF' opacity='0.49'/%3E%3Ccircle cx='161' cy='126' r='2.1' fill='%23FFFFFF' opacity='0.54'/%3E%3Ccircle cx='236' cy='31' r='2.4' fill='%23FFFFFF' opacity='0.66'/%3E%3Ccircle cx='278' cy='315' r='2.1' fill='%23FFFFFF' opacity='0.62'/%3E%3Ccircle cx='307' cy='25' r='1.8' fill='%23FFFFFF' opacity='0.35'/%3E%3Ccircle cx='176' cy='146' r='2.5' fill='%23FFFFFF' opacity='0.74'/%3E%3Ccircle cx='162' cy='91' r='1.6' fill='%23FFFFFF' opacity='0.76'/%3E%3Ccircle cx='28' cy='229' r='1.6' fill='%23FFFFFF' opacity='0.43'/%3E%3Ccircle cx='155' cy='311' r='1.6' fill='%23FFFFFF' opacity='0.64'/%3E%3Ccircle cx='104' cy='356' r='1.7' fill='%23FFFFFF' opacity='0.65'/%3E%3Ccircle cx='69' cy='150' r='1.6' fill='%23FFFFFF' opacity='0.66'/%3E%3Ccircle cx='56' cy='359' r='2.2' fill='%23FFFFFF' opacity='0.79'/%3E%3Ccircle cx='358' cy='156' r='1.2' fill='%23FFFFFF' opacity='0.48'/%3E%3Ccircle cx='13' cy='244' r='1.8' fill='%23FFFFFF' opacity='0.57'/%3E%3Ccircle cx='303' cy='199' r='1.2' fill='%23FFFFFF' opacity='0.80'/%3E%3Ccircle cx='384' cy='260' r='2.6' fill='%23FFFFFF' opacity='0.51'/%3E%3Ccircle cx='34' cy='277' r='2.2' fill='%23FFFFFF' opacity='0.66'/%3E%3Ccircle cx='130' cy='154' r='1.8' fill='%23FFFFFF' opacity='0.58'/%3E%3Ccircle cx='131' cy='141' r='1.7' fill='%23FFFFFF' opacity='0.38'/%3E%3Ccircle cx='255' cy='342' r='1.8' fill='%23FFFFFF' opacity='0.39'/%3E%3Ccircle cx='192' cy='269' r='2.3' fill='%23FFFFFF' opacity='0.56'/%3E%3Ccircle cx='6' cy='296' r='1.5' fill='%23FFFFFF' opacity='0.65'/%3E%3Ccircle cx='299' cy='318' r='1.5' fill='%23FFFFFF' opacity='0.66'/%3E%3Ccircle cx='330' cy='202' r='1.2' fill='%23FFFFFF' opacity='0.61'/%3E%3Ccircle cx='21' cy='165' r='2.0' fill='%23FFFFFF' opacity='0.46'/%3E%3C/svg%3E"); animation: winter-snow-a 26s linear infinite; }
:root[data-theme="winter"] .canvas-wrap::after { top: -520px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520'%3E%3Cpath d='M29.2 452.4L48.2 463.4M38.7 446.9L38.7 468.9M48.2 452.4L29.2 463.4M44.4 461.2L47.7 460.0M44.4 461.2L45.0 464.7M38.7 464.5L41.4 466.8M38.7 464.5L36.0 466.8M33.0 461.2L32.4 464.7M33.0 461.2L29.7 460.0M33.0 454.6L29.7 455.8M33.0 454.6L32.4 451.1M38.7 451.3L36.0 449.0M38.7 451.3L41.4 449.0M44.4 454.6L45.0 451.1M44.4 454.6L47.7 455.8' stroke='%23FFFFFF' stroke-width='1.3' stroke-linecap='round' fill='none' opacity='0.33'/%3E%3Cpath d='M366.1 486.7L388.4 499.6M377.3 480.3L377.3 506.0M388.4 486.7L366.1 499.6M384.0 497.0L387.8 495.6M384.0 497.0L384.7 501.1M377.3 500.9L380.4 503.5M377.3 500.9L374.1 503.5M370.6 497.0L369.9 501.1M370.6 497.0L366.7 495.6M370.6 489.3L366.7 490.7M370.6 489.3L369.9 485.2M377.3 485.4L374.1 482.8M377.3 485.4L380.4 482.8M384.0 489.3L384.7 485.2M384.0 489.3L387.8 490.7' stroke='%23FFFFFF' stroke-width='1.3' stroke-linecap='round' fill='none' opacity='0.32'/%3E%3Cpath d='M180.8 65.1L203.0 77.8M191.9 58.7L191.9 84.2M203.0 65.1L180.8 77.8M198.6 75.3L202.4 73.9M198.6 75.3L199.3 79.3M191.9 79.1L195.1 81.8M191.9 79.1L188.8 81.8M185.3 75.3L184.6 79.3M185.3 75.3L181.4 73.9M185.3 67.6L181.4 69.0M185.3 67.6L184.6 63.6M191.9 63.8L188.8 61.1M191.9 63.8L195.1 61.1M198.6 67.6L199.3 63.6M198.6 67.6L202.4 69.0' stroke='%23FFFFFF' stroke-width='1.3' stroke-linecap='round' fill='none' opacity='0.48'/%3E%3Cpath d='M341.5 19.1L354.0 26.3M347.8 15.5L347.8 29.9M354.0 19.1L341.5 26.3M351.5 24.9L353.7 24.1M351.5 24.9L351.9 27.2M347.8 27.1L349.5 28.5M347.8 27.1L346.0 28.5M344.0 24.9L343.6 27.2M344.0 24.9L341.8 24.1M344.0 20.6L341.8 21.3M344.0 20.6L343.6 18.3M347.8 18.4L346.0 16.9M347.8 18.4L349.5 16.9M351.5 20.6L351.9 18.3M351.5 20.6L353.7 21.3' stroke='%23FFFFFF' stroke-width='1.3' stroke-linecap='round' fill='none' opacity='0.35'/%3E%3Cpath d='M43.6 153.4L56.7 161.0M50.2 149.6L50.2 164.8M56.7 153.4L43.6 161.0M54.1 159.5L56.4 158.6M54.1 159.5L54.5 161.9M50.2 161.7L52.0 163.3M50.2 161.7L48.3 163.3M46.2 159.5L45.8 161.9M46.2 159.5L43.9 158.6M46.2 154.9L43.9 155.7M46.2 154.9L45.8 152.5M50.2 152.6L48.3 151.1M50.2 152.6L52.0 151.1M54.1 154.9L54.5 152.5M54.1 154.9L56.4 155.7' stroke='%23FFFFFF' stroke-width='1.3' stroke-linecap='round' fill='none' opacity='0.47'/%3E%3Cpath d='M437.5 297.9L454.9 308.0M446.2 292.9L446.2 313.1M454.9 297.9L437.5 308.0M451.5 306.0L454.5 304.9M451.5 306.0L452.0 309.2M446.2 309.0L448.7 311.1M446.2 309.0L443.7 311.1M441.0 306.0L440.4 309.2M441.0 306.0L437.9 304.9M441.0 300.0L437.9 301.1M441.0 300.0L440.4 296.8M446.2 296.9L443.7 294.9M446.2 296.9L448.7 294.9M451.5 300.0L452.0 296.8M451.5 300.0L454.5 301.1' stroke='%23FFFFFF' stroke-width='1.3' stroke-linecap='round' fill='none' opacity='0.42'/%3E%3Cpath d='M122.8 404.5L135.6 411.9M129.2 400.8L129.2 415.6M135.6 404.5L122.8 411.9M133.1 410.4L135.3 409.6M133.1 410.4L133.5 412.7M129.2 412.6L131.0 414.1M129.2 412.6L127.4 414.1M125.4 410.4L125.0 412.7M125.4 410.4L123.1 409.6M125.4 405.9L123.1 406.8M125.4 405.9L125.0 403.6M129.2 403.7L127.4 402.2M129.2 403.7L131.0 402.2M133.1 405.9L133.5 403.6M133.1 405.9L135.3 406.8' stroke='%23FFFFFF' stroke-width='1.3' stroke-linecap='round' fill='none' opacity='0.37'/%3E%3C/svg%3E"); animation: winter-snow-b 44s linear infinite; }
@keyframes winter-snow-a { to { transform: translateY(400px); } }
@keyframes winter-snow-b { to { transform: translateY(520px); } }
@media (prefers-reduced-motion: reduce) { :root[data-theme="winter"] .canvas-wrap::before, :root[data-theme="winter"] .canvas-wrap::after { animation: none; } }
:root[data-theme="winter"] .dialog { border: 3px solid #FFFFFF; border-radius: 14px; background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cpath d='M27.9 39.0L52.1 53.0M40.0 32.0L40.0 60.0M52.1 39.0L27.9 53.0M47.3 50.2L51.5 48.7M47.3 50.2L48.1 54.6M40.0 54.4L43.4 57.3M40.0 54.4L36.6 57.3M32.7 50.2L31.9 54.6M32.7 50.2L28.5 48.7M32.7 41.8L28.5 43.3M32.7 41.8L31.9 37.4M40.0 37.6L36.6 34.7M40.0 37.6L43.4 34.7M47.3 41.8L48.1 37.4M47.3 41.8L51.5 43.3' stroke='%23B9D8EE' stroke-width='1.2' stroke-linecap='round' fill='none' opacity='1'/%3E%3Cpath d='M143.1 26.0L156.9 34.0M150.0 22.0L150.0 38.0M156.9 26.0L143.1 34.0M154.2 32.4L156.6 31.5M154.2 32.4L154.6 34.9M150.0 34.8L152.0 36.4M150.0 34.8L148.0 36.4M145.8 32.4L145.4 34.9M145.8 32.4L143.4 31.5M145.8 27.6L143.4 28.5M145.8 27.6L145.4 25.1M150.0 25.2L148.0 23.6M150.0 25.2L152.0 23.6M154.2 27.6L154.6 25.1M154.2 27.6L156.6 28.5' stroke='%23B9D8EE' stroke-width='1.2' stroke-linecap='round' fill='none' opacity='1'/%3E%3Cpath d='M161.3 131.5L190.7 148.5M176.0 123.0L176.0 157.0M190.7 131.5L161.3 148.5M184.8 145.1L189.9 143.2M184.8 145.1L185.8 150.5M176.0 150.2L180.2 153.7M176.0 150.2L171.8 153.7M167.2 145.1L166.2 150.5M167.2 145.1L162.1 143.2M167.2 134.9L162.1 136.8M167.2 134.9L166.2 129.5M176.0 129.8L171.8 126.3M176.0 129.8L180.2 126.3M184.8 134.9L185.8 129.5M184.8 134.9L189.9 136.8' stroke='%23B9D8EE' stroke-width='1.2' stroke-linecap='round' fill='none' opacity='1'/%3E%3Cpath d='M61.3 165.0L78.7 175.0M70.0 160.0L70.0 180.0M78.7 165.0L61.3 175.0M75.2 173.0L78.2 171.9M75.2 173.0L75.8 176.2M70.0 176.0L72.5 178.1M70.0 176.0L67.5 178.1M64.8 173.0L64.2 176.2M64.8 173.0L61.8 171.9M64.8 167.0L61.8 168.1M64.8 167.0L64.2 163.8M70.0 164.0L67.5 161.9M70.0 164.0L72.5 161.9M75.2 167.0L75.8 163.8M75.2 167.0L78.2 168.1' stroke='%23B9D8EE' stroke-width='1.2' stroke-linecap='round' fill='none' opacity='1'/%3E%3Cpath d='M112.8 97.0L123.2 103.0M118.0 94.0L118.0 106.0M123.2 97.0L112.8 103.0M121.1 101.8L122.9 101.1M121.1 101.8L121.5 103.7M118.0 103.6L119.5 104.8M118.0 103.6L116.5 104.8M114.9 101.8L114.5 103.7M114.9 101.8L113.1 101.1M114.9 98.2L113.1 98.9M114.9 98.2L114.5 96.3M118.0 96.4L116.5 95.2M118.0 96.4L119.5 95.2M121.1 98.2L121.5 96.3M121.1 98.2L122.9 98.9' stroke='%23B9D8EE' stroke-width='1.2' stroke-linecap='round' fill='none' opacity='1'/%3E%3C/svg%3E"), #F5FAFE; box-shadow: 0 0 0 1px #B9D8EE, 0 18px 50px rgba(10, 30, 54, 0.55); }
:root[data-theme="winter"] .dialog::backdrop { background: radial-gradient(circle at 50% 20%, rgba(124, 196, 240, 0.35), rgba(10, 30, 54, 0.82)); }
:root[data-theme="winter"] .toast { border: 1px solid #FFFFFF; background: #1F5A44; color: #FFFFFF; box-shadow: inset 0 3px 0 -1px #FFFFFF, 0 6px 18px rgba(10, 30, 54, 0.45); }
.aero-band.is-winter { width: 160px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cpath d='M180.1 239.9L194.0 247.9M187.0 235.9L187.0 251.9M194.0 239.9L180.1 247.9M191.2 246.3L193.6 245.4M191.2 246.3L191.6 248.8M187.0 248.7L189.0 250.3M187.0 248.7L185.1 250.3M182.9 246.3L182.4 248.8M182.9 246.3L180.5 245.4M182.9 241.5L180.5 242.4M182.9 241.5L182.4 239.0M187.0 239.1L185.1 237.5M187.0 239.1L189.0 237.5M191.2 241.5L191.6 239.0M191.2 241.5L193.6 242.4' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.949'/%3E%3Cpath d='M90.1 220.3L112.3 233.1M101.2 213.8L101.2 239.6M112.3 220.3L90.1 233.1M107.9 230.6L111.8 229.1M107.9 230.6L108.6 234.6M101.2 234.4L104.4 237.1M101.2 234.4L98.1 237.1M94.5 230.6L93.8 234.6M94.5 230.6L90.7 229.1M94.5 222.8L90.7 224.2M94.5 222.8L93.8 218.8M101.2 219.0L98.1 216.3M101.2 219.0L104.4 216.3M107.9 222.8L108.6 218.8M107.9 222.8L111.8 224.2' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.929'/%3E%3Cpath d='M231.7 229.1L247.6 238.3M239.7 224.6L239.7 242.9M247.6 229.1L231.7 238.3M244.4 236.5L247.2 235.5M244.4 236.5L244.9 239.3M239.7 239.2L241.9 241.1M239.7 239.2L237.4 241.1M234.9 236.5L234.4 239.3M234.9 236.5L232.2 235.5M234.9 231.0L232.2 232.0M234.9 231.0L234.4 228.1M239.7 228.2L237.4 226.3M239.7 228.2L241.9 226.3M244.4 231.0L244.9 228.1M244.4 231.0L247.2 232.0' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.941'/%3E%3Cpath d='M43.2 182.5L60.8 192.6M52.0 177.4L52.0 197.7M60.8 182.5L43.2 192.6M57.3 190.6L60.3 189.5M57.3 190.6L57.8 193.8M52.0 193.7L54.5 195.7M52.0 193.7L49.5 195.7M46.7 190.6L46.2 193.8M46.7 190.6L43.7 189.5M46.7 184.5L43.7 185.6M46.7 184.5L46.2 181.3M52.0 181.5L49.5 179.4M52.0 181.5L54.5 179.4M57.3 184.5L57.8 181.3M57.3 184.5L60.3 185.6' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.941'/%3E%3Cpath d='M43.9 86.1L59.0 94.8M51.5 81.7L51.5 99.1M59.0 86.1L43.9 94.8M56.0 93.0L58.6 92.1M56.0 93.0L56.5 95.8M51.5 95.6L53.6 97.4M51.5 95.6L49.4 97.4M47.0 93.0L46.5 95.8M47.0 93.0L44.3 92.1M47.0 87.8L44.3 88.8M47.0 87.8L46.5 85.1M51.5 85.2L49.4 83.4M51.5 85.2L53.6 83.4M56.0 87.8L56.5 85.1M56.0 87.8L58.6 88.8' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.95'/%3E%3Cpath d='M263.4 56.2L282.9 67.5M273.2 50.5L273.2 73.1M282.9 56.2L263.4 67.5M279.0 65.2L282.4 64.0M279.0 65.2L279.7 68.8M273.2 68.6L275.9 70.9M273.2 68.6L270.4 70.9M267.3 65.2L266.7 68.8M267.3 65.2L263.9 64.0M267.3 58.4L263.9 59.7M267.3 58.4L266.7 54.9M273.2 55.0L270.4 52.7M273.2 55.0L275.9 52.7M279.0 58.4L279.7 54.9M279.0 58.4L282.4 59.7' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.928'/%3E%3Cpath d='M28.9 153.4L50.0 165.6M39.5 147.4L39.5 171.7M50.0 153.4L28.9 165.6M45.8 163.2L49.4 161.8M45.8 163.2L46.5 167.0M39.5 166.8L42.4 169.3M39.5 166.8L36.5 169.3M33.1 163.2L32.5 167.0M33.1 163.2L29.5 161.8M33.1 155.9L29.5 157.2M33.1 155.9L32.5 152.0M39.5 152.2L36.5 149.7M39.5 152.2L42.4 149.7M45.8 155.9L46.5 152.0M45.8 155.9L49.4 157.2' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.931'/%3E%3Cpath d='M128.9 218.9L144.9 228.1M136.9 214.3L136.9 232.7M144.9 218.9L128.9 228.1M141.7 226.3L144.5 225.3M141.7 226.3L142.2 229.2M136.9 229.0L139.2 230.9M136.9 229.0L134.6 230.9M132.1 226.3L131.6 229.2M132.1 226.3L129.3 225.3M132.1 220.7L129.3 221.8M132.1 220.7L131.6 217.8M136.9 218.0L134.6 216.1M136.9 218.0L139.2 216.1M141.7 220.7L142.2 217.8M141.7 220.7L144.5 221.8' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.943'/%3E%3Cpath d='M43.5 256.8L62.0 267.5M52.8 251.5L52.8 272.8M62.0 256.8L43.5 267.5M58.3 265.3L61.5 264.2M58.3 265.3L58.9 268.7M52.8 268.6L55.4 270.7M52.8 268.6L50.2 270.7M47.2 265.3L46.6 268.7M47.2 265.3L44.0 264.2M47.2 258.9L44.0 260.1M47.2 258.9L46.6 255.6M52.8 255.7L50.2 253.5M52.8 255.7L55.4 253.5M58.3 258.9L58.9 255.6M58.3 258.9L61.5 260.1' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.929'/%3E%3C/svg%3E"), linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(214, 236, 255, 0.55) 55%, #FFFFFF 100%); box-shadow: 0 0 40px 10px rgba(214, 236, 255, 0.6); animation-name: winter-band; }
@keyframes winter-band { 0% { transform: translateX(-160px); opacity: 1; } 94% { opacity: 1; } 100% { transform: translateX(calc(100vw - 160px)); opacity: 0; } }
.aero-band.aero-band-back.is-winter { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cpath d='M180.1 239.9L194.0 247.9M187.0 235.9L187.0 251.9M194.0 239.9L180.1 247.9M191.2 246.3L193.6 245.4M191.2 246.3L191.6 248.8M187.0 248.7L189.0 250.3M187.0 248.7L185.1 250.3M182.9 246.3L182.4 248.8M182.9 246.3L180.5 245.4M182.9 241.5L180.5 242.4M182.9 241.5L182.4 239.0M187.0 239.1L185.1 237.5M187.0 239.1L189.0 237.5M191.2 241.5L191.6 239.0M191.2 241.5L193.6 242.4' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.949'/%3E%3Cpath d='M90.1 220.3L112.3 233.1M101.2 213.8L101.2 239.6M112.3 220.3L90.1 233.1M107.9 230.6L111.8 229.1M107.9 230.6L108.6 234.6M101.2 234.4L104.4 237.1M101.2 234.4L98.1 237.1M94.5 230.6L93.8 234.6M94.5 230.6L90.7 229.1M94.5 222.8L90.7 224.2M94.5 222.8L93.8 218.8M101.2 219.0L98.1 216.3M101.2 219.0L104.4 216.3M107.9 222.8L108.6 218.8M107.9 222.8L111.8 224.2' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.929'/%3E%3Cpath d='M231.7 229.1L247.6 238.3M239.7 224.6L239.7 242.9M247.6 229.1L231.7 238.3M244.4 236.5L247.2 235.5M244.4 236.5L244.9 239.3M239.7 239.2L241.9 241.1M239.7 239.2L237.4 241.1M234.9 236.5L234.4 239.3M234.9 236.5L232.2 235.5M234.9 231.0L232.2 232.0M234.9 231.0L234.4 228.1M239.7 228.2L237.4 226.3M239.7 228.2L241.9 226.3M244.4 231.0L244.9 228.1M244.4 231.0L247.2 232.0' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.941'/%3E%3Cpath d='M43.2 182.5L60.8 192.6M52.0 177.4L52.0 197.7M60.8 182.5L43.2 192.6M57.3 190.6L60.3 189.5M57.3 190.6L57.8 193.8M52.0 193.7L54.5 195.7M52.0 193.7L49.5 195.7M46.7 190.6L46.2 193.8M46.7 190.6L43.7 189.5M46.7 184.5L43.7 185.6M46.7 184.5L46.2 181.3M52.0 181.5L49.5 179.4M52.0 181.5L54.5 179.4M57.3 184.5L57.8 181.3M57.3 184.5L60.3 185.6' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.941'/%3E%3Cpath d='M43.9 86.1L59.0 94.8M51.5 81.7L51.5 99.1M59.0 86.1L43.9 94.8M56.0 93.0L58.6 92.1M56.0 93.0L56.5 95.8M51.5 95.6L53.6 97.4M51.5 95.6L49.4 97.4M47.0 93.0L46.5 95.8M47.0 93.0L44.3 92.1M47.0 87.8L44.3 88.8M47.0 87.8L46.5 85.1M51.5 85.2L49.4 83.4M51.5 85.2L53.6 83.4M56.0 87.8L56.5 85.1M56.0 87.8L58.6 88.8' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.95'/%3E%3Cpath d='M263.4 56.2L282.9 67.5M273.2 50.5L273.2 73.1M282.9 56.2L263.4 67.5M279.0 65.2L282.4 64.0M279.0 65.2L279.7 68.8M273.2 68.6L275.9 70.9M273.2 68.6L270.4 70.9M267.3 65.2L266.7 68.8M267.3 65.2L263.9 64.0M267.3 58.4L263.9 59.7M267.3 58.4L266.7 54.9M273.2 55.0L270.4 52.7M273.2 55.0L275.9 52.7M279.0 58.4L279.7 54.9M279.0 58.4L282.4 59.7' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.928'/%3E%3Cpath d='M28.9 153.4L50.0 165.6M39.5 147.4L39.5 171.7M50.0 153.4L28.9 165.6M45.8 163.2L49.4 161.8M45.8 163.2L46.5 167.0M39.5 166.8L42.4 169.3M39.5 166.8L36.5 169.3M33.1 163.2L32.5 167.0M33.1 163.2L29.5 161.8M33.1 155.9L29.5 157.2M33.1 155.9L32.5 152.0M39.5 152.2L36.5 149.7M39.5 152.2L42.4 149.7M45.8 155.9L46.5 152.0M45.8 155.9L49.4 157.2' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.931'/%3E%3Cpath d='M128.9 218.9L144.9 228.1M136.9 214.3L136.9 232.7M144.9 218.9L128.9 228.1M141.7 226.3L144.5 225.3M141.7 226.3L142.2 229.2M136.9 229.0L139.2 230.9M136.9 229.0L134.6 230.9M132.1 226.3L131.6 229.2M132.1 226.3L129.3 225.3M132.1 220.7L129.3 221.8M132.1 220.7L131.6 217.8M136.9 218.0L134.6 216.1M136.9 218.0L139.2 216.1M141.7 220.7L142.2 217.8M141.7 220.7L144.5 221.8' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.943'/%3E%3Cpath d='M43.5 256.8L62.0 267.5M52.8 251.5L52.8 272.8M62.0 256.8L43.5 267.5M58.3 265.3L61.5 264.2M58.3 265.3L58.9 268.7M52.8 268.6L55.4 270.7M52.8 268.6L50.2 270.7M47.2 265.3L46.6 268.7M47.2 265.3L44.0 264.2M47.2 258.9L44.0 260.1M47.2 258.9L46.6 255.6M52.8 255.7L50.2 253.5M52.8 255.7L55.4 253.5M58.3 258.9L58.9 255.6M58.3 258.9L61.5 260.1' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' fill='none' opacity='0.929'/%3E%3C/svg%3E"), linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, rgba(214, 236, 255, 0.55) 55%, #FFFFFF 100%); animation-name: aero-band-back; }
.wordmark .wordmark-mark-winter { display: none; }
:root[data-theme="winter"] .wordmark .wordmark-mark:not(.wordmark-mark-winter) { display: none; }
:root[data-theme="winter"] .wordmark .wordmark-mark-winter { display: block; filter: drop-shadow(0 1px 3px rgba(10, 30, 54, 0.4)); }

/* ---- Theme: Holiday Cheer (data-theme="holiday") --------------------------------------
   Christmas Eve: the plan is a deep evergreen night with snow falling behind the layout, a snowy scene along its
   foot (lit trees, a snowman, presents, candy canes), and every so often Santa's sleigh and reindeer cross the sky,
   all of it UNDER the layout, never over it. A string of Christmas lights hangs beneath the top bar: how they blink
   and what colours they are is set in Settings (data-lights / data-light-colors on <html>; absent means twinkling,
   multicolour). Candy-cane trim, Santa-suit main buttons with a fur cuff, gold stars. Our own drawings and tune.
   Put on and taken off with the Transform button, like the other transformative themes. */
:root[data-theme="holiday"] {
  --mat: #123A2B; --mat-deep: #0A241B; --mat-line: rgba(255, 244, 214, 0.07); --mat-major: rgba(255, 210, 63, 0.3);
  --ink: #1F2A24; --ink-soft: #5C6B62; --paper: #FBF6EA; --panel: #FFFDF6; --rule: #E6DCC3; --field: #FFFFFF;
  --primary: #C1272D; --primary-ink: #FFFFFF; --focus: #FFD23F;
  --cane: repeating-linear-gradient(135deg, #D8383E 0 7px, #FFFFFF 7px 14px);
  --suit: linear-gradient(180deg, #FFFFFF 0 5px, #E4E4E4 5px 6px, #D8383E 6px, #B01F25 100%);
  --l1: #FF3B30; --l2: #FFD23F; --l3: #34C759; --l4: #3A9BFF;
  color-scheme: light;
}
:root[data-light-colors="warm"] { --l1: #FFD9A0; --l2: #FFC46B; --l3: #FFD9A0; --l4: #FFC46B; }
:root[data-light-colors="redgreen"] { --l1: #FF3B30; --l2: #34C759; --l3: #FF3B30; --l4: #34C759; }
:root[data-light-colors="ice"] { --l1: #7CC4FF; --l2: #FFFFFF; --l3: #7CC4FF; --l4: #FFFFFF; }
.holiday-only { display: none; }
:root[data-theme="holiday"] .holiday-only { display: contents; }
:root[data-theme="holiday"] body { background: #FBF6EA; }
:root[data-theme="holiday"] .topbar { position: relative; z-index: 3; background: #FFFDF6; border-bottom: 5px solid transparent; border-image: var(--cane) 5; }
/* The lights: the wire and bulbs 1 and 3 on one layer, bulbs 2 and 4 on another, so the two can take turns. */
:root[data-theme="holiday"] .topbar::before, :root[data-theme="holiday"] .topbar::after { content: ''; position: absolute; left: 0; right: 0; top: calc(100% + 5px); height: 26px; pointer-events: none; }
:root[data-theme="holiday"] .topbar::before { background: radial-gradient(circle at 15px 12.5px, #FFFFFF 0 0.8px, var(--l1) 1.4px 4.4px, color-mix(in srgb, var(--l1) 38%, transparent) 5.4px, transparent 12px) 0 0 / 120px 26px repeat-x, radial-gradient(circle at 75px 12.5px, #FFFFFF 0 0.8px, var(--l3) 1.4px 4.4px, color-mix(in srgb, var(--l3) 38%, transparent) 5.4px, transparent 12px) 0 0 / 120px 26px repeat-x, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='26'%3E%3Cpath d='M0 2Q15 11 30 2' fill='none' stroke='%232E7D4F' stroke-width='1.4'/%3E%3Crect x='13' y='5' width='4' height='3.4' fill='%23C9A227'/%3E%3C/svg%3E") repeat-x; animation: holiday-twinkle 2.4s ease-in-out infinite; }
:root[data-theme="holiday"] .topbar::after { background: radial-gradient(circle at 45px 12.5px, #FFFFFF 0 0.8px, var(--l2) 1.4px 4.4px, color-mix(in srgb, var(--l2) 38%, transparent) 5.4px, transparent 12px) 0 0 / 120px 26px repeat-x, radial-gradient(circle at 105px 12.5px, #FFFFFF 0 0.8px, var(--l4) 1.4px 4.4px, color-mix(in srgb, var(--l4) 38%, transparent) 5.4px, transparent 12px) 0 0 / 120px 26px repeat-x; animation: holiday-twinkle 2.4s ease-in-out -1.2s infinite; }
@keyframes holiday-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
:root[data-theme="holiday"][data-lights="chase"] .topbar::before { animation: holiday-chase 0.9s steps(1) infinite; }
:root[data-theme="holiday"][data-lights="chase"] .topbar::after { animation: holiday-chase 0.9s steps(1) -0.45s infinite; }
@keyframes holiday-chase { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
:root[data-theme="holiday"][data-lights="steady"] .topbar::before, :root[data-theme="holiday"][data-lights="steady"] .topbar::after { animation: none; }
:root[data-theme="holiday"][data-lights="off"] .topbar::before, :root[data-theme="holiday"][data-lights="off"] .topbar::after { display: none; }
@media (prefers-reduced-motion: reduce) { :root[data-theme="holiday"] .topbar::before, :root[data-theme="holiday"] .topbar::after { animation: none !important; } }
:root[data-theme="holiday"] .wordmark-name { color: #B01F25; }
:root[data-theme="holiday"] .wordmark-sub { color: #1F7A4D; }
:root[data-theme="holiday"] .statusbar { background: #8E1A1F; border-top: 4px solid transparent; border-image: var(--cane) 4; color: #FFFFFF; }
:root[data-theme="holiday"] #cursor-pos { color: #FFE9A8; }
:root[data-theme="holiday"] .site-footer { background: #0A241B; color: #FFE9A8; }
:root[data-theme="holiday"] .inspector { background: linear-gradient(rgba(255, 253, 246, 0.9), rgba(255, 253, 246, 0.9)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cg opacity='0.5'%3E%3Cpath d='M40 50q10 -14 24 -6q-2 8 4 12q-10 2 -10 10q-10 -4 -16 4q-6 -12 -2 -20z' fill='%23BFE3CC'/%3E%3Ccircle cx='62' cy='68' r='4' fill='%23F4B6B6'/%3E%3Ccircle cx='70' cy='63' r='4' fill='%23F4B6B6'/%3E%3Cpath d='M140 130q10 -14 24 -6q-2 8 4 12q-10 2 -10 10q-10 -4 -16 4q-6 -12 -2 -20z' fill='%23BFE3CC' transform='rotate(40 150 140)'/%3E%3Ccircle cx='138' cy='150' r='3.6' fill='%23F4B6B6'/%3E%3C/g%3E%3C/svg%3E"), #FFFDF6; border-left: 5px solid transparent; border-image: var(--cane) 5; scrollbar-color: #D8B4B4 transparent; }
:root[data-theme="holiday"] .panel { border-bottom: 1px dashed #D9C9A3; }
:root[data-theme="holiday"] .panel-title, :root[data-theme="holiday"] .dialog h2, :root[data-theme="holiday"] .lib-group { color: #B01F25; }
:root[data-theme="holiday"] .panel-title::before, :root[data-theme="holiday"] .dialog h2::before { content: '\2605\00a0'; color: #E0A800; font-weight: 400; }
:root[data-theme="holiday"] .panel-title { justify-content: flex-start; }
:root[data-theme="holiday"] .panel-title > :last-child:not(:first-child) { margin-left: auto; }
:root[data-theme="holiday"] .btn { border: 1px solid #1F7A4D; border-radius: 8px; background: #FFFDF6; color: #17603C; font-weight: 600; box-shadow: 0 2px 0 #1F7A4D; }
:root[data-theme="holiday"] .btn:hover:not(:disabled) { border-color: #B01F25; background: #FFF3F0; color: #B01F25; box-shadow: 0 2px 0 #B01F25; }
:root[data-theme="holiday"] .btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
/* The main buttons wear the suit: red, with a white fur cuff along the top. */
:root[data-theme="holiday"] .btn-primary, :root[data-theme="holiday"] .btn-demo { border-color: #8E1A1F; background: var(--suit); color: #FFFFFF; text-shadow: 0 1px 1px rgba(60, 0, 0, 0.6); box-shadow: 0 2px 0 #6E1216; }
:root[data-theme="holiday"] .btn-primary:hover:not(:disabled) { border-color: #8E1A1F; background: var(--suit); color: #FFFFFF; filter: brightness(1.08); box-shadow: 0 2px 0 #6E1216, 0 0 12px rgba(255, 210, 63, 0.8); }
:root[data-theme="holiday"] .mode-tabs button[aria-selected="true"], :root[data-theme="holiday"] .segmented button[aria-checked="true"], :root[data-theme="holiday"] .btn-icon[aria-pressed="true"], :root[data-theme="holiday"] .chip[aria-checked="true"] { background: #1F7A4D; border-color: #17603C; color: #FFE9A8; box-shadow: inset 0 0 0 1px #FFD23F; }
:root[data-theme="holiday"] .btn-danger, :root[data-theme="holiday"] .btn-danger-outline { color: #B01F25; }
:root[data-theme="holiday"] .btn-link { border: 0; background: none; box-shadow: none; color: #17603C; }
:root[data-theme="holiday"] .help-link { color: #17603C; }
:root[data-theme="holiday"] .mode-tabs { border: 1px solid #1F7A4D; background: #FFFDF6; }
:root[data-theme="holiday"] .mode-tabs button { color: #17603C; font-weight: 600; }
:root[data-theme="holiday"] .tool { border-radius: 8px; color: #17603C; }
:root[data-theme="holiday"] .tool:hover:not(:disabled) { background: #FFF3F0; color: #B01F25; }
:root[data-theme="holiday"] .tool[aria-pressed="true"] { background: var(--suit); color: #FFFFFF; }
:root[data-theme="holiday"] .field input, :root[data-theme="holiday"] .field select, :root[data-theme="holiday"] select, :root[data-theme="holiday"] input[type="text"], :root[data-theme="holiday"] input[type="number"], :root[data-theme="holiday"] textarea { border-color: #C9B98F; }
:root[data-theme="holiday"] .field input:focus, :root[data-theme="holiday"] select:focus { border-color: #1F7A4D; box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.55); }
:root[data-theme="holiday"] input[type="checkbox"], :root[data-theme="holiday"] input[type="range"] { accent-color: #C1272D; }
:root[data-theme="holiday"] .chip, :root[data-theme="holiday"] .tree-chip { border-color: #C9B98F; }
:root[data-theme="holiday"] .canvas-wrap { isolation: isolate; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='760' height='96'%3E%3Cg transform='translate(70 84) scale(1.0)'%3E%3Crect x='-3' y='0' width='6' height='7' fill='%236B4423'/%3E%3Cpath d='M0 -58L-13 -38H-7L-19 -20H-11L-25 0H25L11 -20H19L7 -38H13Z' fill='%231F7A4D'/%3E%3Cpath d='M0 -58L-13 -38H-7L-19 -20H-11L-25 0H-8L-2 -20L-6 -38Z' fill='%2317603C'/%3E%3Ccircle cx='-6' cy='-30' r='2.3' fill='%23FFD23F'/%3E%3Ccircle cx='5' cy='-24' r='2.3' fill='%23FF4D4D'/%3E%3Ccircle cx='-10' cy='-12' r='2.3' fill='%234DB8FF'/%3E%3Ccircle cx='2' cy='-9' r='2.3' fill='%23FF8AD8'/%3E%3Ccircle cx='12' cy='-6' r='2.3' fill='%23FFFFFF'/%3E%3Ccircle cx='-2' cy='-42' r='2.3' fill='%23FFD23F'/%3E%3Ccircle cx='6' cy='-36' r='2.3' fill='%23FF4D4D'/%3E%3Cpath d='M0 -68l2.4 5.4 5.8 0.6-4.4 3.9 1.3 5.7L0 -55.4l-5.1 3 1.3-5.7-4.4-3.9 5.8-0.6z' fill='%23FFD23F'/%3E%3C/g%3E%3Cg transform='translate(108 86) scale(0.62)'%3E%3Crect x='-3' y='0' width='6' height='7' fill='%236B4423'/%3E%3Cpath d='M0 -58L-13 -38H-7L-19 -20H-11L-25 0H25L11 -20H19L7 -38H13Z' fill='%231F7A4D'/%3E%3Cpath d='M0 -58L-13 -38H-7L-19 -20H-11L-25 0H-8L-2 -20L-6 -38Z' fill='%2317603C'/%3E%3Ccircle cx='-5' cy='-28' r='2.3' fill='%23FFD23F'/%3E%3Ccircle cx='6' cy='-14' r='2.3' fill='%23FF4D4D'/%3E%3Ccircle cx='-9' cy='-8' r='2.3' fill='%234DB8FF'/%3E%3Ccircle cx='1' cy='-40' r='2.3' fill='%23FF8AD8'/%3E%3Cpath d='M0 -68l2.4 5.4 5.8 0.6-4.4 3.9 1.3 5.7L0 -55.4l-5.1 3 1.3-5.7-4.4-3.9 5.8-0.6z' fill='%23FFD23F'/%3E%3C/g%3E%3Cg transform='translate(160 88) rotate(8)' fill='none' stroke-linecap='round'%3E%3Cpath d='M0 0V-22q0 -8 7 -8t7 7' stroke='%23FFFFFF' stroke-width='5'/%3E%3Cpath d='M0 0V-22q0 -8 7 -8t7 7' stroke='%23D8383E' stroke-width='5' stroke-dasharray='4 5' stroke-linecap='butt'/%3E%3C/g%3E%3Cg transform='translate(190 88)'%3E%3Crect x='0' y='-15' width='20' height='15' fill='%23D8383E'/%3E%3Crect x='8.0' y='-15' width='4' height='15' fill='%23FFD23F'/%3E%3Crect x='0' y='-9.0' width='20' height='3' fill='%23FFD23F'/%3E%3Cpath d='M10.0 -15q-7 -9 -9 -2t9 2q7 -9 9 -2t-9 2' fill='%23FFD23F'/%3E%3C/g%3E%3Cg transform='translate(213 88)'%3E%3Crect x='0' y='-21' width='14' height='21' fill='%231F7A4D'/%3E%3Crect x='5.0' y='-21' width='4' height='21' fill='%23FFFFFF'/%3E%3Crect x='0' y='-12.0' width='14' height='3' fill='%23FFFFFF'/%3E%3Cpath d='M7.0 -21q-7 -9 -9 -2t9 2q7 -9 9 -2t-9 2' fill='%23FFFFFF'/%3E%3C/g%3E%3Cg transform='translate(229 88)'%3E%3Crect x='0' y='-11' width='17' height='11' fill='%233A7BD5'/%3E%3Crect x='6.5' y='-11' width='4' height='11' fill='%23FFD23F'/%3E%3Crect x='0' y='-7.0' width='17' height='3' fill='%23FFD23F'/%3E%3Cpath d='M8.5 -11q-7 -9 -9 -2t9 2q7 -9 9 -2t-9 2' fill='%23FFD23F'/%3E%3C/g%3E%3Cg transform='translate(330 86)'%3E%3Cpath d='M-13 -22l-11 -8M13 -22l11 -9' stroke='%236B4423' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='0' cy='-12' r='13' fill='%23FFFFFF' stroke='%23B9D8EE' stroke-width='1.2'/%3E%3Ccircle cx='0' cy='-30' r='9.5' fill='%23FFFFFF' stroke='%23B9D8EE' stroke-width='1.2'/%3E%3Ccircle cx='0' cy='-44' r='7' fill='%23FFFFFF' stroke='%23B9D8EE' stroke-width='1.2'/%3E%3Crect x='-8' y='-51.5' width='16' height='2.4' fill='%231C1C1C'/%3E%3Crect x='-5' y='-61' width='10' height='10' fill='%231C1C1C'/%3E%3Crect x='-5' y='-54.5' width='10' height='2.2' fill='%23D8383E'/%3E%3Cpath d='M-7 -38.5q7 3.5 14 0v3.2q-7 3.5 -14 0z' fill='%23D8383E'/%3E%3Cpath d='M4 -36l3 11h-4.5l-1.5 -10z' fill='%23D8383E'/%3E%3Ccircle cx='-2.6' cy='-45.5' r='1' fill='%231C1C1C'/%3E%3Ccircle cx='2.6' cy='-45.5' r='1' fill='%231C1C1C'/%3E%3Cpath d='M0 -43.5l8 1.6-8 1z' fill='%23FF8A1F'/%3E%3Ccircle cx='0' cy='-31' r='1.1' fill='%231C1C1C'/%3E%3Ccircle cx='0' cy='-26' r='1.1' fill='%231C1C1C'/%3E%3Ccircle cx='0' cy='-14' r='1.1' fill='%231C1C1C'/%3E%3C/g%3E%3Cg transform='translate(455 85) scale(0.8)'%3E%3Crect x='-3' y='0' width='6' height='7' fill='%236B4423'/%3E%3Cpath d='M0 -58L-13 -38H-7L-19 -20H-11L-25 0H25L11 -20H19L7 -38H13Z' fill='%231F7A4D'/%3E%3Cpath d='M0 -58L-13 -38H-7L-19 -20H-11L-25 0H-8L-2 -20L-6 -38Z' fill='%2317603C'/%3E%3Ccircle cx='-6' cy='-30' r='2.3' fill='%23FFD23F'/%3E%3Ccircle cx='5' cy='-24' r='2.3' fill='%23FF4D4D'/%3E%3Ccircle cx='-10' cy='-12' r='2.3' fill='%234DB8FF'/%3E%3Ccircle cx='2' cy='-9' r='2.3' fill='%23FF8AD8'/%3E%3Ccircle cx='12' cy='-6' r='2.3' fill='%23FFFFFF'/%3E%3Ccircle cx='-2' cy='-42' r='2.3' fill='%23FFD23F'/%3E%3Cpath d='M0 -68l2.4 5.4 5.8 0.6-4.4 3.9 1.3 5.7L0 -55.4l-5.1 3 1.3-5.7-4.4-3.9 5.8-0.6z' fill='%23FFD23F'/%3E%3C/g%3E%3Cg transform='translate(500 88)'%3E%3Crect x='0' y='-13' width='16' height='13' fill='%23FFD23F'/%3E%3Crect x='6.0' y='-13' width='4' height='13' fill='%23D8383E'/%3E%3Crect x='0' y='-8.0' width='16' height='3' fill='%23D8383E'/%3E%3Cpath d='M8.0 -13q-7 -9 -9 -2t9 2q7 -9 9 -2t-9 2' fill='%23D8383E'/%3E%3C/g%3E%3Cg transform='translate(532 88) rotate(8)' fill='none' stroke-linecap='round'%3E%3Cpath d='M0 0V-22q0 -8 7 -8t7 7' stroke='%23FFFFFF' stroke-width='5'/%3E%3Cpath d='M0 0V-22q0 -8 7 -8t7 7' stroke='%23D8383E' stroke-width='5' stroke-dasharray='4 5' stroke-linecap='butt'/%3E%3C/g%3E%3Cg transform='translate(548 89) rotate(8)' fill='none' stroke-linecap='round'%3E%3Cpath d='M0 0V-22q0 -8 7 -8t7 7' stroke='%23FFFFFF' stroke-width='5'/%3E%3Cpath d='M0 0V-22q0 -8 7 -8t7 7' stroke='%23D8383E' stroke-width='5' stroke-dasharray='4 5' stroke-linecap='butt'/%3E%3C/g%3E%3Cg transform='translate(640 84) scale(1.12)'%3E%3Crect x='-3' y='0' width='6' height='7' fill='%236B4423'/%3E%3Cpath d='M0 -58L-13 -38H-7L-19 -20H-11L-25 0H25L11 -20H19L7 -38H13Z' fill='%231F7A4D'/%3E%3Cpath d='M0 -58L-13 -38H-7L-19 -20H-11L-25 0H-8L-2 -20L-6 -38Z' fill='%2317603C'/%3E%3Ccircle cx='-6' cy='-30' r='2.3' fill='%23FFD23F'/%3E%3Ccircle cx='5' cy='-24' r='2.3' fill='%23FF4D4D'/%3E%3Ccircle cx='-10' cy='-12' r='2.3' fill='%234DB8FF'/%3E%3Ccircle cx='2' cy='-9' r='2.3' fill='%23FF8AD8'/%3E%3Ccircle cx='12' cy='-6' r='2.3' fill='%23FFFFFF'/%3E%3Ccircle cx='-2' cy='-42' r='2.3' fill='%23FFD23F'/%3E%3Ccircle cx='6' cy='-36' r='2.3' fill='%23FF4D4D'/%3E%3Ccircle cx='-14' cy='-4' r='2.3' fill='%234DB8FF'/%3E%3Cpath d='M0 -68l2.4 5.4 5.8 0.6-4.4 3.9 1.3 5.7L0 -55.4l-5.1 3 1.3-5.7-4.4-3.9 5.8-0.6z' fill='%23FFD23F'/%3E%3C/g%3E%3Cg transform='translate(676 88)'%3E%3Crect x='0' y='-14' width='18' height='14' fill='%23D8383E'/%3E%3Crect x='7.0' y='-14' width='4' height='14' fill='%23FFFFFF'/%3E%3Crect x='0' y='-8.5' width='18' height='3' fill='%23FFFFFF'/%3E%3Cpath d='M9.0 -14q-7 -9 -9 -2t9 2q7 -9 9 -2t-9 2' fill='%23FFFFFF'/%3E%3C/g%3E%3Cpath d='M0 96V86Q60 78 130 85T280 84T430 86T600 84T760 86V96Z' fill='%23FFFFFF'/%3E%3C/svg%3E") repeat-x left bottom, radial-gradient(ellipse at 50% 0%, rgba(255, 233, 168, 0.12) 0%, rgba(255, 233, 168, 0) 55%), linear-gradient(180deg, #0A241B 0%, #123A2B 60%, #17603C 100%); }
/* Snow, and Santa on his rounds: both under everything drawn on the plan. */
:root[data-theme="holiday"] .canvas-wrap::before, :root[data-theme="holiday"] .canvas-wrap::after { content: ''; position: absolute; z-index: -1; pointer-events: none; }
:root[data-theme="holiday"] .canvas-wrap::before { left: 0; right: 0; bottom: 0; top: -400px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Ccircle cx='46' cy='281' r='1.7' fill='%23FFFFFF' opacity='0.71'/%3E%3Ccircle cx='173' cy='280' r='1.2' fill='%23FFFFFF' opacity='0.66'/%3E%3Ccircle cx='20' cy='256' r='2.4' fill='%23FFFFFF' opacity='0.54'/%3E%3Ccircle cx='349' cy='256' r='1.8' fill='%23FFFFFF' opacity='0.70'/%3E%3Ccircle cx='255' cy='163' r='2.6' fill='%23FFFFFF' opacity='0.56'/%3E%3Ccircle cx='54' cy='19' r='1.7' fill='%23FFFFFF' opacity='0.38'/%3E%3Ccircle cx='277' cy='29' r='1.3' fill='%23FFFFFF' opacity='0.48'/%3E%3Ccircle cx='368' cy='238' r='1.9' fill='%23FFFFFF' opacity='0.59'/%3E%3Ccircle cx='113' cy='194' r='2.1' fill='%23FFFFFF' opacity='0.65'/%3E%3Ccircle cx='298' cy='319' r='1.8' fill='%23FFFFFF' opacity='0.52'/%3E%3Ccircle cx='70' cy='265' r='1.9' fill='%23FFFFFF' opacity='0.57'/%3E%3Ccircle cx='179' cy='25' r='1.5' fill='%23FFFFFF' opacity='0.53'/%3E%3Ccircle cx='347' cy='390' r='1.9' fill='%23FFFFFF' opacity='0.77'/%3E%3Ccircle cx='80' cy='365' r='1.6' fill='%23FFFFFF' opacity='0.71'/%3E%3Ccircle cx='166' cy='320' r='2.1' fill='%23FFFFFF' opacity='0.51'/%3E%3Ccircle cx='85' cy='206' r='1.4' fill='%23FFFFFF' opacity='0.54'/%3E%3Ccircle cx='35' cy='213' r='1.9' fill='%23FFFFFF' opacity='0.43'/%3E%3Ccircle cx='331' cy='62' r='1.3' fill='%23FFFFFF' opacity='0.41'/%3E%3Ccircle cx='194' cy='116' r='1.6' fill='%23FFFFFF' opacity='0.71'/%3E%3Ccircle cx='137' cy='236' r='2.0' fill='%23FFFFFF' opacity='0.74'/%3E%3Ccircle cx='365' cy='195' r='2.6' fill='%23FFFFFF' opacity='0.68'/%3E%3Ccircle cx='365' cy='318' r='2.5' fill='%23FFFFFF' opacity='0.60'/%3E%3Ccircle cx='307' cy='230' r='1.9' fill='%23FFFFFF' opacity='0.73'/%3E%3Ccircle cx='239' cy='363' r='2.4' fill='%23FFFFFF' opacity='0.50'/%3E%3C/svg%3E"); animation: holiday-snow 30s linear infinite; }
:root[data-theme="holiday"] .canvas-wrap::after { left: 0; top: 9%; width: 300px; height: 84px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='84' viewBox='0 0 300 84'%3E%3Cpath d='M84 40L250 22' stroke='%23F3D9A6' stroke-width='1' fill='none'/%3E%3Cg transform='translate(150 44)'%3E%3Cg stroke='%23D9A066' stroke-width='2.4' stroke-linecap='round' fill='none'%3E%3Cpath d='M9 3l8 7l6 -1'/%3E%3Cpath d='M6 4l5 9l5 1'/%3E%3Cpath d='M-9 3l-8 7l-5 3'/%3E%3Cpath d='M-6 4l-7 9l-5 0'/%3E%3Cpath d='M-13 -2l-5 -3'/%3E%3C/g%3E%3Cellipse cx='0' cy='0' rx='14' ry='5.6' fill='%23D9A066'/%3E%3Cpath d='M8 -3l8 -10l5 3l-6 10z' fill='%23D9A066'/%3E%3Cellipse cx='20' cy='-12' rx='5.6' ry='3.2' fill='%23D9A066' transform='rotate(-12 20 -12)'/%3E%3Cg stroke='%23F3D9A6' stroke-width='1.5' stroke-linecap='round' fill='none'%3E%3Cpath d='M17 -15l-3 -8l-4 -2M14 -23l2 -4M16 -19l-5 -1'/%3E%3C/g%3E%3Cpath d='M-2 -5.6q4 4 6 0' stroke='%23D8383E' stroke-width='2.2' fill='none'/%3E%3C/g%3E%3Cg transform='translate(197 38)'%3E%3Cg stroke='%23D9A066' stroke-width='2.4' stroke-linecap='round' fill='none'%3E%3Cpath d='M9 3l8 7l6 -1'/%3E%3Cpath d='M6 4l5 9l5 1'/%3E%3Cpath d='M-9 3l-8 7l-5 3'/%3E%3Cpath d='M-6 4l-7 9l-5 0'/%3E%3Cpath d='M-13 -2l-5 -3'/%3E%3C/g%3E%3Cellipse cx='0' cy='0' rx='14' ry='5.6' fill='%23D9A066'/%3E%3Cpath d='M8 -3l8 -10l5 3l-6 10z' fill='%23D9A066'/%3E%3Cellipse cx='20' cy='-12' rx='5.6' ry='3.2' fill='%23D9A066' transform='rotate(-12 20 -12)'/%3E%3Cg stroke='%23F3D9A6' stroke-width='1.5' stroke-linecap='round' fill='none'%3E%3Cpath d='M17 -15l-3 -8l-4 -2M14 -23l2 -4M16 -19l-5 -1'/%3E%3C/g%3E%3Cpath d='M-2 -5.6q4 4 6 0' stroke='%23D8383E' stroke-width='2.2' fill='none'/%3E%3C/g%3E%3Cg transform='translate(244 31)'%3E%3Cg stroke='%23D9A066' stroke-width='2.4' stroke-linecap='round' fill='none'%3E%3Cpath d='M9 3l8 7l6 -1'/%3E%3Cpath d='M6 4l5 9l5 1'/%3E%3Cpath d='M-9 3l-8 7l-5 3'/%3E%3Cpath d='M-6 4l-7 9l-5 0'/%3E%3Cpath d='M-13 -2l-5 -3'/%3E%3C/g%3E%3Cellipse cx='0' cy='0' rx='14' ry='5.6' fill='%23D9A066'/%3E%3Cpath d='M8 -3l8 -10l5 3l-6 10z' fill='%23D9A066'/%3E%3Cellipse cx='20' cy='-12' rx='5.6' ry='3.2' fill='%23D9A066' transform='rotate(-12 20 -12)'/%3E%3Cg stroke='%23F3D9A6' stroke-width='1.5' stroke-linecap='round' fill='none'%3E%3Cpath d='M17 -15l-3 -8l-4 -2M14 -23l2 -4M16 -19l-5 -1'/%3E%3C/g%3E%3Cpath d='M-2 -5.6q4 4 6 0' stroke='%23D8383E' stroke-width='2.2' fill='none'/%3E%3Ccircle cx='25.6' cy='-13.2' r='2.2' fill='%23FF3B30'/%3E%3C/g%3E%3Cpath d='M40 34q-6 -16 10 -18q12 -1 12 14z' fill='%237A5230'/%3E%3Cpath d='M66 22q0 -11 10 -11t10 11v14H66z' fill='%23D8383E'/%3E%3Crect x='66' y='31' width='20' height='3.4' fill='%231C1C1C'/%3E%3Crect x='74' y='30.4' width='4.6' height='4.6' fill='%23FFD23F'/%3E%3Ccircle cx='78' cy='9' r='5.4' fill='%23F6C9A8'/%3E%3Cpath d='M73.4 10.5q4.6 7 9.6 0q-1 8 -4.8 8t-4.8 -8z' fill='%23FFFFFF'/%3E%3Cpath d='M72.4 7.2q4 -11 12 -3.6l-2 2.4z' fill='%23D8383E'/%3E%3Crect x='72' y='5.6' width='11.6' height='2.6' rx='1.3' fill='%23FFFFFF'/%3E%3Ccircle cx='85.4' cy='4' r='2' fill='%23FFFFFF'/%3E%3Cpath d='M30 36q-2 20 16 20h46q12 0 12 -12v-8h-8q-6 -10 -14 0z' fill='%23B01F25'/%3E%3Cpath d='M30 36q-2 20 16 20h46q12 0 12 -12v-3q-2 9 -12 9H48q-13 0 -14 -14z' fill='%238E1A1F'/%3E%3Cpath d='M36 68H100q14 0 14 -12' stroke='%23FFD23F' stroke-width='2.6' fill='none' stroke-linecap='round'/%3E%3Cpath d='M50 56v12M88 56v12' stroke='%23FFD23F' stroke-width='2.2'/%3E%3C/svg%3E") no-repeat; transform: translate(-320px, 40px); animation: holiday-sleigh 48s linear 4s infinite; }
@keyframes holiday-snow { to { transform: translateY(400px); } }
@keyframes holiday-sleigh { 0% { transform: translate(-320px, 40px) rotate(-4deg); } 30% { transform: translate(100vw, -30px) rotate(-4deg); } 100% { transform: translate(100vw, -30px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { :root[data-theme="holiday"] .canvas-wrap::before { animation: none; } :root[data-theme="holiday"] .canvas-wrap::after { animation: none; transform: translate(60px, 0) rotate(-4deg); } }
:root[data-theme="holiday"] .zoom-controls { border: 1px solid #FFD23F; background: #8E1A1F; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45); }
:root[data-theme="holiday"] .dialog { border: 6px solid transparent; border-image: var(--cane) 6; border-radius: 0; background: linear-gradient(rgba(255, 253, 246, 0.92), rgba(255, 253, 246, 0.92)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cg opacity='0.5'%3E%3Cpath d='M40 50q10 -14 24 -6q-2 8 4 12q-10 2 -10 10q-10 -4 -16 4q-6 -12 -2 -20z' fill='%23BFE3CC'/%3E%3Ccircle cx='62' cy='68' r='4' fill='%23F4B6B6'/%3E%3Ccircle cx='70' cy='63' r='4' fill='%23F4B6B6'/%3E%3Cpath d='M140 130q10 -14 24 -6q-2 8 4 12q-10 2 -10 10q-10 -4 -16 4q-6 -12 -2 -20z' fill='%23BFE3CC' transform='rotate(40 150 140)'/%3E%3Ccircle cx='138' cy='150' r='3.6' fill='%23F4B6B6'/%3E%3C/g%3E%3C/svg%3E"), #FFFDF6; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
:root[data-theme="holiday"] .dialog::backdrop { background: radial-gradient(circle at 50% 20%, rgba(255, 210, 63, 0.25), rgba(10, 36, 27, 0.85)); }
:root[data-theme="holiday"] .toast { border: 1px solid #FFD23F; background: #1F7A4D; color: #FFFFFF; }
.btn-transform[data-to="holiday"] { border: 1px solid #8E1A1F; border-radius: 8px; background: linear-gradient(180deg, #FFFFFF 0 5px, #E4E4E4 5px 6px, #D8383E 6px, #B01F25 100%); color: #FFFFFF; text-shadow: 0 1px 1px rgba(60, 0, 0, 0.6); box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.9); animation-name: holiday-beckon; }
@keyframes holiday-beckon { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.9); } 50% { box-shadow: 0 0 0 7px rgba(255, 210, 63, 0); } }
.aero-band.is-holiday { width: 70px; background: repeating-linear-gradient(135deg, #D8383E 0 7px, #FFFFFF 7px 14px); border-left: 3px solid #FFD23F; border-right: 3px solid #FFD23F; box-shadow: 0 0 40px 10px rgba(255, 210, 63, 0.6); animation-name: holiday-band; }
@keyframes holiday-band { 0% { transform: translateX(-70px); opacity: 1; } 94% { opacity: 1; } 100% { transform: translateX(calc(100vw - 70px)); opacity: 0; } }
.aero-band.aero-band-back.is-holiday { animation-name: aero-band-back; }
.wordmark .wordmark-mark-holiday { display: none; }
:root[data-theme="holiday"] .wordmark .wordmark-mark:not(.wordmark-mark-holiday) { display: none; }
:root[data-theme="holiday"] .wordmark .wordmark-mark-holiday { display: block; filter: drop-shadow(0 1px 3px rgba(60, 0, 0, 0.4)); }

/* ---- Theme: Art Deco (data-theme="deco") ----------------------------------------------
   The 1920s: black lacquer and gold. The plan is black with a faint gold fan pattern and a sunburst rising from its
   foot, the panels are ivory ruled in doubled gold lines, lettering is tall, spaced capitals, buttons are lacquer
   plaques with a double gold frame (the main ones solid gold), and fanned gold corners sit in the plan's upper
   corners, under the layout. Our own ornaments and tune. Put on and taken off with the Transform button, like the
   other transformative themes. */
:root[data-theme="deco"] {
  --mat: #0E0E10; --mat-deep: #050506; --mat-line: rgba(201, 162, 39, 0.10); --mat-major: rgba(230, 197, 106, 0.42);
  --ink: #16140F; --ink-soft: #6B6047; --paper: #EFE4C8; --panel: #F7EFDC; --rule: #D9C48A; --field: #FFFBF0;
  --primary: #C9A227; --primary-ink: #0E0E10; --focus: #E6C56A;
  --gold: linear-gradient(180deg, #F3DC92 0%, #D4AF37 45%, #A8831F 55%, #E6C56A 100%);
  --font-ui: 'Josefin Sans', 'Futura', 'Century Gothic', 'Avenir Next', 'Gill Sans', 'Barlow', system-ui, sans-serif;
  --font-head: 'Poiret One', 'Josefin Sans', 'Futura', 'Century Gothic', 'Avenir Next', 'Gill Sans', 'Barlow', system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="deco"] body { background: #0E0E10; }
:root[data-theme="deco"] .topbar { background: linear-gradient(180deg, #1B1B1F 0%, #0E0E10 100%); border-bottom: 6px double #C9A227; color: #E6C56A; }
:root[data-theme="deco"] .topbar input[type="text"], :root[data-theme="deco"] .topbar input:not([type]) { border-color: #C9A227; background: #1B1B1F; color: #F3DC92; letter-spacing: 0.06em; }
:root[data-theme="deco"] .topbar .btn { padding-inline: 9px; letter-spacing: 0.02em; }
:root[data-theme="deco"] .topbar label, :root[data-theme="deco"] .topbar .field span { color: #E6C56A; }
:root[data-theme="deco"] .wordmark-name { color: #E6C56A; letter-spacing: 0.03em; text-transform: uppercase; font-size: 15px; }
:root[data-theme="deco"] .wordmark-sub, :root[data-theme="deco"] .wordmark-by { color: #BFA765; letter-spacing: 0.08em; }
:root[data-theme="deco"] .statusbar { background: #0E0E10; border-top: 6px double #C9A227; color: #E6C56A; letter-spacing: 0.03em; }
:root[data-theme="deco"] #cursor-pos { color: #F3DC92; }
:root[data-theme="deco"] .site-footer { background: #050506; color: #BFA765; letter-spacing: 0.12em; text-transform: uppercase; }
:root[data-theme="deco"] .inspector { background: linear-gradient(rgba(247, 239, 220, 0.9), rgba(247, 239, 220, 0.9)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40'%3E%3Cpath d='M0 40A40 40 0 0 1 80 40' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M9 40A31 31 0 0 1 71 40' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M18 40A22 22 0 0 1 62 40' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M27 40A13 13 0 0 1 53 40' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M-40 20A40 40 0 0 1 40 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M-31 20A31 31 0 0 1 31 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M-22 20A22 22 0 0 1 22 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M-13 20A13 13 0 0 1 13 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M40 20A40 40 0 0 1 120 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M49 20A31 31 0 0 1 111 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M58 20A22 22 0 0 1 102 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M67 20A13 13 0 0 1 93 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M0 0A40 40 0 0 1 80 0' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M9 0A31 31 0 0 1 71 0' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M18 0A22 22 0 0 1 62 0' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M27 0A13 13 0 0 1 53 0' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3C/svg%3E"), #F7EFDC; border-left: 6px double #C9A227; scrollbar-color: #C9A227 transparent; }
:root[data-theme="deco"] .panel { border-bottom: 3px double #D4B968; }
:root[data-theme="deco"] .panel-title, :root[data-theme="deco"] .dialog h2, :root[data-theme="deco"] .lib-group { color: #16140F; font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.14em; }
:root[data-theme="deco"] .panel-title::before, :root[data-theme="deco"] .dialog h2::before { content: '\25C6\00a0'; color: #C9A227; }
:root[data-theme="deco"] .panel-title { justify-content: flex-start; }
:root[data-theme="deco"] .panel-title > :last-child:not(:first-child) { margin-left: auto; }
/* Buttons: black lacquer plaques in a doubled gold frame. */
:root[data-theme="deco"] .btn { border: 3px double #C9A227; border-radius: 0; background: linear-gradient(180deg, #26262B 0%, #0E0E10 100%); color: #F3DC92; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.84em; box-shadow: 0 1px 0 #000; }
:root[data-theme="deco"] .btn:hover:not(:disabled) { border-color: #F3DC92; background: #1B1B1F; color: #FFFFFF; box-shadow: 0 0 10px rgba(230, 197, 106, 0.6); }
:root[data-theme="deco"] .btn-primary, :root[data-theme="deco"] .btn-demo { border: 3px double #0E0E10; background: var(--gold); color: #0E0E10; font-weight: 700; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); }
:root[data-theme="deco"] .btn-primary:hover:not(:disabled) { border-color: #0E0E10; background: var(--gold); color: #0E0E10; filter: brightness(1.08); box-shadow: 0 0 12px rgba(230, 197, 106, 0.85); }
:root[data-theme="deco"] .mode-tabs button[aria-selected="true"], :root[data-theme="deco"] .segmented button[aria-checked="true"], :root[data-theme="deco"] .btn-icon[aria-pressed="true"], :root[data-theme="deco"] .chip[aria-checked="true"], :root[data-theme="deco"] .tool[aria-pressed="true"] { border-color: #0E0E10; background: var(--gold); color: #0E0E10; }
:root[data-theme="deco"] .btn-danger, :root[data-theme="deco"] .btn-danger-outline { color: #FF9A8A; }
:root[data-theme="deco"] .btn-link { border: 0; background: none; box-shadow: none; color: #7A5E12; text-transform: none; letter-spacing: 0; font-size: 1em; }
:root[data-theme="deco"] .help-link { color: #7A5E12; }
:root[data-theme="deco"] .topbar .help-link, :root[data-theme="deco"] .topbar .btn-link { color: #E6C56A; }
:root[data-theme="deco"] .mode-tabs { border: 3px double #C9A227; border-radius: 0; background: #0E0E10; }
:root[data-theme="deco"] .mode-tabs button { border-radius: 0; color: #E6C56A; letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.74em; }
:root[data-theme="deco"] .segmented { border-color: #C9A227; border-radius: 0; }
:root[data-theme="deco"] .segmented button { border-radius: 0; }
:root[data-theme="deco"] .tool { border-radius: 0; color: #16140F; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.72em; }
:root[data-theme="deco"] .tool:hover:not(:disabled) { background: #EADBB0; }
:root[data-theme="deco"] .field input, :root[data-theme="deco"] .field select, :root[data-theme="deco"] select, :root[data-theme="deco"] input[type="text"], :root[data-theme="deco"] input[type="number"], :root[data-theme="deco"] textarea { border-color: #C9A227; border-radius: 0; }
:root[data-theme="deco"] .field input:focus, :root[data-theme="deco"] select:focus { border-color: #0E0E10; box-shadow: 0 0 0 3px rgba(230, 197, 106, 0.6); }
:root[data-theme="deco"] input[type="checkbox"], :root[data-theme="deco"] input[type="range"] { accent-color: #A8831F; }
:root[data-theme="deco"] .chip, :root[data-theme="deco"] .tree-chip { border-color: #C9A227; border-radius: 0; }
:root[data-theme="deco"] .swatch { border-radius: 0; }
/* The plan: fanned corners up top, a sunburst rising from the foot, and the fan pattern over black lacquer. */
:root[data-theme="deco"] .canvas-wrap { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='%23C9A227' stroke-width='1.6'%3E%3Cpath d='M0 0L112.0 0.0'/%3E%3Cpath d='M0 0L108.2 29.0'/%3E%3Cpath d='M0 0L97.0 56.0'/%3E%3Cpath d='M0 0L79.2 79.2'/%3E%3Cpath d='M0 0L56.0 97.0'/%3E%3Cpath d='M0 0L29.0 108.2'/%3E%3Cpath d='M0 0L0.0 112.0'/%3E%3Cpath d='M112 0A112 112 0 0 1 0 112'/%3E%3Cpath d='M84 0A84 84 0 0 1 0 84'/%3E%3Cpath d='M40 0A40 40 0 0 1 0 40' fill='%23C9A227'/%3E%3C/g%3E%3C/svg%3E") no-repeat left top, radial-gradient(ellipse 75% 85% at 50% 100%, rgba(14, 14, 16, 0) 0%, rgba(14, 14, 16, 0) 45%, #0E0E10 100%), repeating-conic-gradient(from -90deg at 50% 100%, rgba(201, 162, 39, 0.10) 0deg 3deg, rgba(201, 162, 39, 0) 3deg 9deg), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40'%3E%3Cpath d='M0 40A40 40 0 0 1 80 40' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M9 40A31 31 0 0 1 71 40' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M18 40A22 22 0 0 1 62 40' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M27 40A13 13 0 0 1 53 40' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M-40 20A40 40 0 0 1 40 20' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M-31 20A31 31 0 0 1 31 20' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M-22 20A22 22 0 0 1 22 20' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M-13 20A13 13 0 0 1 13 20' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M40 20A40 40 0 0 1 120 20' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M49 20A31 31 0 0 1 111 20' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M58 20A22 22 0 0 1 102 20' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M67 20A13 13 0 0 1 93 20' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M0 0A40 40 0 0 1 80 0' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M9 0A31 31 0 0 1 71 0' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M18 0A22 22 0 0 1 62 0' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3Cpath d='M27 0A13 13 0 0 1 53 0' fill='none' stroke='%23C9A227' stroke-width='1' opacity='0.22'/%3E%3C/svg%3E"), #0E0E10; }
:root[data-theme="deco"] .canvas-wrap::after { content: ''; position: absolute; z-index: 0; right: 0; top: 0; width: 120px; height: 120px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='%23C9A227' stroke-width='1.6'%3E%3Cpath d='M0 0L112.0 0.0'/%3E%3Cpath d='M0 0L108.2 29.0'/%3E%3Cpath d='M0 0L97.0 56.0'/%3E%3Cpath d='M0 0L79.2 79.2'/%3E%3Cpath d='M0 0L56.0 97.0'/%3E%3Cpath d='M0 0L29.0 108.2'/%3E%3Cpath d='M0 0L0.0 112.0'/%3E%3Cpath d='M112 0A112 112 0 0 1 0 112'/%3E%3Cpath d='M84 0A84 84 0 0 1 0 84'/%3E%3Cpath d='M40 0A40 40 0 0 1 0 40' fill='%23C9A227'/%3E%3C/g%3E%3C/svg%3E") no-repeat; transform: scaleX(-1); pointer-events: none; }
:root[data-theme="deco"] .canvas-wrap { isolation: isolate; }
:root[data-theme="deco"] .canvas-wrap::after { z-index: -1; }
:root[data-theme="deco"] .zoom-controls { border: 3px double #C9A227; border-radius: 0; background: #0E0E10; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.6); }
:root[data-theme="deco"] .dialog { border: 6px double #C9A227; border-radius: 0; outline: 2px solid #0E0E10; background: linear-gradient(rgba(247, 239, 220, 0.92), rgba(247, 239, 220, 0.92)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40'%3E%3Cpath d='M0 40A40 40 0 0 1 80 40' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M9 40A31 31 0 0 1 71 40' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M18 40A22 22 0 0 1 62 40' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M27 40A13 13 0 0 1 53 40' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M-40 20A40 40 0 0 1 40 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M-31 20A31 31 0 0 1 31 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M-22 20A22 22 0 0 1 22 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M-13 20A13 13 0 0 1 13 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M40 20A40 40 0 0 1 120 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M49 20A31 31 0 0 1 111 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M58 20A22 22 0 0 1 102 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M67 20A13 13 0 0 1 93 20' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M0 0A40 40 0 0 1 80 0' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M9 0A31 31 0 0 1 71 0' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M18 0A22 22 0 0 1 62 0' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3Cpath d='M27 0A13 13 0 0 1 53 0' fill='none' stroke='%23B8962A' stroke-width='1' opacity='0.16'/%3E%3C/svg%3E"), #F7EFDC; box-shadow: 0 0 0 8px #0E0E10, 0 0 0 10px #C9A227, 0 24px 60px rgba(0, 0, 0, 0.7); }
:root[data-theme="deco"] .dialog::backdrop { background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(201, 162, 39, 0.10) 0deg 4deg, rgba(0, 0, 0, 0) 4deg 12deg), rgba(5, 5, 6, 0.86); }
:root[data-theme="deco"] .toast { border: 3px double #C9A227; border-radius: 0; background: #0E0E10; color: #F3DC92; letter-spacing: 0.06em; }
.btn-transform[data-to="deco"] { border: 3px double #0E0E10; border-radius: 0; background: linear-gradient(180deg, #F3DC92 0%, #D4AF37 45%, #A8831F 55%, #E6C56A 100%); color: #0E0E10; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-shadow: none; box-shadow: 0 0 0 0 rgba(230, 197, 106, 0.9); animation-name: deco-beckon; }
@keyframes deco-beckon { 0%, 100% { box-shadow: 0 0 0 0 rgba(230, 197, 106, 0.9); } 50% { box-shadow: 0 0 0 7px rgba(230, 197, 106, 0); } }
.aero-band.is-deco { width: 90px; background: repeating-linear-gradient(90deg, #0E0E10 0 6px, #D4AF37 6px 10px, #0E0E10 10px 14px, #F3DC92 14px 22px); box-shadow: 0 0 40px 10px rgba(230, 197, 106, 0.55); animation-name: deco-band; }
@keyframes deco-band { 0% { transform: translateX(-90px); opacity: 1; } 94% { opacity: 1; } 100% { transform: translateX(calc(100vw - 90px)); opacity: 0; } }
.aero-band.aero-band-back.is-deco { animation-name: aero-band-back; }
.wordmark .wordmark-mark-deco { display: none; }
:root[data-theme="deco"] .wordmark .wordmark-mark:not(.wordmark-mark-deco) { display: none; }
:root[data-theme="deco"] .wordmark .wordmark-mark-deco { display: block; }

/* ---- Theme: Postwar Catalog (data-theme="catalog") -------------------------------------
   The look of a late-1940s toy train catalogue page, painted and printed: the plan is an illustrated sky (blue wash,
   cream cloud puffs, little four-point stars) over rolling green hills and a strip of ballast, the panels are warm
   catalogue paper with a touch of grain, headlines are heavy red and black block capitals, the main buttons are red
   call-out boxes with white capitals, and the status bar is the golden band along the foot of the page. Everything
   in the plan's picture sits UNDER the layout. No maker's name or trademark is used, and the drawings and the sound
   are our own. Put on and taken off with the Transform button, like the other transformative themes. */
:root[data-theme="catalog"] {
  --mat: #4F8FB3; --mat-deep: #2C5F80; --mat-line: rgba(255, 246, 224, 0.10); --mat-major: rgba(255, 243, 196, 0.5);
  --ink: #1E1A14; --ink-soft: #5E5240; --paper: #EBDDB4; --panel: #F6EBC9; --rule: #CDB983; --field: #FFF9E6;
  --primary: #D4261C; --primary-ink: #FFFFFF; --focus: #1E6FB0;
  --font-head: 'Arial Black', 'Franklin Gothic Heavy', 'Helvetica Neue', 'Impact', 'Barlow', system-ui, sans-serif;
  --press: 2px 2px 0 rgba(60, 35, 10, 0.35);
  color-scheme: light;
}
:root[data-theme="catalog"] body { background: #EBDDB4; }
:root[data-theme="catalog"] .topbar { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0 0.1  0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"), linear-gradient(180deg, #FBF1D2 0%, #F3E4B8 100%); border-bottom: 4px solid #D4261C; box-shadow: 0 1px 0 #1E1A14; }
:root[data-theme="catalog"] .wordmark-name { color: #D4261C; font-family: var(--font-head); font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em; font-size: 16px; text-shadow: 1px 1px 0 rgba(60, 35, 10, 0.25); }
:root[data-theme="catalog"] .wordmark-sub { color: #1E1A14; -webkit-text-fill-color: #1E1A14; }
:root[data-theme="catalog"] .wordmark-by { color: #1E1A14; font-style: italic; font-weight: 700; }
:root[data-theme="catalog"] .statusbar { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0 0.1  0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"), linear-gradient(180deg, #E9B44C 0%, #DDA23A 100%); border-top: 2px solid #1E1A14; color: #2A1D0A; font-weight: 600; }
:root[data-theme="catalog"] #cursor-pos { color: #2A1D0A; }
:root[data-theme="catalog"] .site-footer { background: #1E1A14; color: #F3E4B8; }
:root[data-theme="catalog"] .inspector { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0 0.1  0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"), #F6EBC9; border-left: 2px solid #1E1A14; scrollbar-color: #C9A45C transparent; }
:root[data-theme="catalog"] .panel { border-bottom: 1px solid #CDB983; }
:root[data-theme="catalog"] .panel-title, :root[data-theme="catalog"] .dialog h2 { color: #1E1A14; font-family: var(--font-head); font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em; }
:root[data-theme="catalog"] .dialog h2 { font-style: italic; }
:root[data-theme="catalog"] .lib-group { color: #D4261C; font-family: var(--font-head); font-weight: 900; text-transform: uppercase; }
:root[data-theme="catalog"] .panel-title::before, :root[data-theme="catalog"] .dialog h2::before { content: '\2605\00a0'; color: #D4261C; font-style: normal; }
:root[data-theme="catalog"] .panel-title { justify-content: flex-start; }
:root[data-theme="catalog"] .panel-title > :last-child:not(:first-child) { margin-left: auto; }
:root[data-theme="catalog"] .panel-note { color: #3A3122; }
/* Buttons are printed boxes with a hard ink shadow; the main ones are the red call-outs with white capitals. */
:root[data-theme="catalog"] .btn { border: 2px solid #1E1A14; border-radius: 3px; background: #FFF9E6; color: #1E1A14; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.82em; box-shadow: var(--press); }
:root[data-theme="catalog"] .btn:hover:not(:disabled) { background: #FFE9A0; border-color: #1E1A14; }
:root[data-theme="catalog"] .btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
:root[data-theme="catalog"] .btn:has(> svg) { text-transform: none; letter-spacing: 0; font-size: 0.9em; font-weight: 700; }
:root[data-theme="catalog"] .btn-primary, :root[data-theme="catalog"] .btn-demo { border-color: #1E1A14; background: #D4261C; color: #FFFFFF; }
:root[data-theme="catalog"] .btn-primary:hover:not(:disabled) { background: #E8382D; border-color: #1E1A14; color: #FFFFFF; }
:root[data-theme="catalog"] .mode-tabs button[aria-selected="true"], :root[data-theme="catalog"] .segmented button[aria-checked="true"], :root[data-theme="catalog"] .btn-icon[aria-pressed="true"], :root[data-theme="catalog"] .chip[aria-checked="true"], :root[data-theme="catalog"] .tool[aria-pressed="true"] { background: #D4261C; border-color: #1E1A14; color: #FFFFFF; }
:root[data-theme="catalog"] .btn-danger, :root[data-theme="catalog"] .btn-danger-outline { color: #A3160E; }
:root[data-theme="catalog"] .btn-link { border: 0; background: none; box-shadow: none; color: #1E5E96; text-transform: none; letter-spacing: 0; font-size: 1em; font-weight: 600; }
:root[data-theme="catalog"] .help-link { color: #1E5E96; }
:root[data-theme="catalog"] .mode-tabs { border: 2px solid #1E1A14; border-radius: 3px; background: #FFF9E6; box-shadow: var(--press); }
:root[data-theme="catalog"] .mode-tabs button { border-radius: 0; color: #1E1A14; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; font-size: 0.74em; }
:root[data-theme="catalog"] .segmented { border-color: #1E1A14; border-radius: 3px; }
:root[data-theme="catalog"] .tool { border-radius: 3px; color: #1E1A14; font-weight: 700; }
:root[data-theme="catalog"] .tool:hover:not(:disabled) { background: #FFE9A0; }
:root[data-theme="catalog"] .field input, :root[data-theme="catalog"] .field select, :root[data-theme="catalog"] select, :root[data-theme="catalog"] input[type="text"], :root[data-theme="catalog"] input[type="number"], :root[data-theme="catalog"] textarea { border-color: #1E1A14; border-radius: 2px; }
:root[data-theme="catalog"] .field input:focus, :root[data-theme="catalog"] select:focus { border-color: #D4261C; box-shadow: 0 0 0 3px rgba(233, 180, 76, 0.7); }
:root[data-theme="catalog"] input[type="checkbox"], :root[data-theme="catalog"] input[type="range"] { accent-color: #D4261C; }
:root[data-theme="catalog"] .chip, :root[data-theme="catalog"] .tree-chip { border: 1.5px solid #1E1A14; border-radius: 3px; background: #FFF9E6; font-weight: 600; }
/* The plan's picture: hills and ballast along the foot, clouds and stars in a washed sky, warm light low down. */
:root[data-theme="catalog"] .canvas-wrap { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='110'%3E%3Cpath d='M0 110V58Q90 26 190 50T400 44T610 56T800 34T900 52V110Z' fill='%235E8F6B'/%3E%3Cpath d='M0 110V76Q120 50 260 70T520 66T760 74T900 64V110Z' fill='%237FA857'/%3E%3Cpath d='M0 110V92Q150 78 300 88T600 86T900 90V110Z' fill='%23C9A45C'/%3E%3Cg fill='%233F6B4A'%3E%3Cpath d='M120 62l7 -22l7 22z'/%3E%3Cpath d='M134 64l5 -16l5 16z'/%3E%3Cpath d='M560 58l8 -26l8 26z'/%3E%3Cpath d='M578 60l5 -17l5 17z'/%3E%3Cpath d='M760 50l7 -22l7 22z'/%3E%3C/g%3E%3Cg stroke='%236B4A2A' stroke-width='1.2' opacity='0.5'%3E%3Cpath d='M10 98l6 8'/%3E%3Cpath d='M36 98l6 8'/%3E%3Cpath d='M62 98l6 8'/%3E%3Cpath d='M88 98l6 8'/%3E%3Cpath d='M114 98l6 8'/%3E%3Cpath d='M140 98l6 8'/%3E%3Cpath d='M166 98l6 8'/%3E%3Cpath d='M192 98l6 8'/%3E%3Cpath d='M218 98l6 8'/%3E%3Cpath d='M244 98l6 8'/%3E%3Cpath d='M270 98l6 8'/%3E%3Cpath d='M296 98l6 8'/%3E%3Cpath d='M322 98l6 8'/%3E%3Cpath d='M348 98l6 8'/%3E%3Cpath d='M374 98l6 8'/%3E%3Cpath d='M400 98l6 8'/%3E%3Cpath d='M426 98l6 8'/%3E%3Cpath d='M452 98l6 8'/%3E%3Cpath d='M478 98l6 8'/%3E%3Cpath d='M504 98l6 8'/%3E%3Cpath d='M530 98l6 8'/%3E%3Cpath d='M556 98l6 8'/%3E%3Cpath d='M582 98l6 8'/%3E%3Cpath d='M608 98l6 8'/%3E%3Cpath d='M634 98l6 8'/%3E%3Cpath d='M660 98l6 8'/%3E%3Cpath d='M686 98l6 8'/%3E%3Cpath d='M712 98l6 8'/%3E%3Cpath d='M738 98l6 8'/%3E%3Cpath d='M764 98l6 8'/%3E%3Cpath d='M790 98l6 8'/%3E%3Cpath d='M816 98l6 8'/%3E%3Cpath d='M842 98l6 8'/%3E%3Cpath d='M868 98l6 8'/%3E%3Cpath d='M894 98l6 8'/%3E%3C/g%3E%3C/svg%3E") repeat-x left bottom, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='620'%3E%3Cg transform='translate(90 70) scale(1.5)' opacity='0.78'%3E%3Cpath d='M0 30q-22 2 -22 -12q0 -14 16 -13q4 -16 24 -14q14 -14 32 -2q20 -6 26 10q18 0 17 15q0 15 -20 16z' fill='%23FFF6E0'/%3E%3Cpath d='M-20 24q24 8 60 2t52 2q-4 6 -19 6H0q-14 0 -20 -6z' fill='%23F4B9A0' opacity='0.55'/%3E%3C/g%3E%3Cg transform='translate(520 150) scale(2.1)' opacity='0.7'%3E%3Cpath d='M0 30q-22 2 -22 -12q0 -14 16 -13q4 -16 24 -14q14 -14 32 -2q20 -6 26 10q18 0 17 15q0 15 -20 16z' fill='%23FFF6E0'/%3E%3Cpath d='M-20 24q24 8 60 2t52 2q-4 6 -19 6H0q-14 0 -20 -6z' fill='%23F4B9A0' opacity='0.55'/%3E%3C/g%3E%3Cg transform='translate(300 380) scale(1.2)' opacity='0.62'%3E%3Cpath d='M0 30q-22 2 -22 -12q0 -14 16 -13q4 -16 24 -14q14 -14 32 -2q20 -6 26 10q18 0 17 15q0 15 -20 16z' fill='%23FFF6E0'/%3E%3Cpath d='M-20 24q24 8 60 2t52 2q-4 6 -19 6H0q-14 0 -20 -6z' fill='%23F4B9A0' opacity='0.55'/%3E%3C/g%3E%3Cg transform='translate(730 470) scale(1.6)' opacity='0.66'%3E%3Cpath d='M0 30q-22 2 -22 -12q0 -14 16 -13q4 -16 24 -14q14 -14 32 -2q20 -6 26 10q18 0 17 15q0 15 -20 16z' fill='%23FFF6E0'/%3E%3Cpath d='M-20 24q24 8 60 2t52 2q-4 6 -19 6H0q-14 0 -20 -6z' fill='%23F4B9A0' opacity='0.55'/%3E%3C/g%3E%3Cg transform='translate(40 520) scale(1.0)' opacity='0.55'%3E%3Cpath d='M0 30q-22 2 -22 -12q0 -14 16 -13q4 -16 24 -14q14 -14 32 -2q20 -6 26 10q18 0 17 15q0 15 -20 16z' fill='%23FFF6E0'/%3E%3Cpath d='M-20 24q24 8 60 2t52 2q-4 6 -19 6H0q-14 0 -20 -6z' fill='%23F4B9A0' opacity='0.55'/%3E%3C/g%3E%3Cpath d='M378.33272384073064 217.22723060269874Q379.3328791637105 221.7834937407182 383.88914230173 222.78364906369808Q379.3328791637105 223.78380438667796 378.33272384073064 228.34006752469742Q377.33256851775076 223.78380438667796 372.7763053797313 222.78364906369808Q377.33256851775076 221.7834937407182 378.33272384073064 217.22723060269874Z' fill='%23FFF3C4' opacity='0.46'/%3E%3Cpath d='M792.1598532416352 413.28112406505386Q792.8737530722341 416.5333344044487 796.1259634116288 417.24723423504753Q792.8737530722341 417.9611340656464 792.1598532416352 421.2133444050412Q791.4459534110364 417.9611340656464 788.1937430716416 417.24723423504753Q791.4459534110364 416.5333344044487 792.1598532416352 413.28112406505386Z' fill='%23FFF3C4' opacity='0.39'/%3E%3Cpath d='M738.9870802340572 384.41067734613864Q740.0238184229835 389.13359576235814 744.746736839203 390.17033395128436Q740.0238184229835 391.2070721402106 738.9870802340572 395.9299905564301Q737.9503420451309 391.2070721402106 733.2274236289114 390.17033395128436Q737.9503420451309 389.13359576235814 738.9870802340572 384.41067734613864Z' fill='%23FFF3C4' opacity='0.4'/%3E%3Cpath d='M265.62602325684423 435.7923787243402Q266.25030412070873 438.6363248819451 269.0942502783136 439.2606057458096Q266.25030412070873 439.8848866096741 265.62602325684423 442.72883276727896Q265.00174239297974 439.8848866096741 262.15779623537486 439.2606057458096Q265.00174239297974 438.6363248819451 265.62602325684423 435.7923787243402Z' fill='%23FFF3C4' opacity='0.45'/%3E%3Cpath d='M578.0225083167145 377.8486297870242Q579.1038304789041 382.77465297033274 584.0298536622128 383.8559751325224Q579.1038304789041 384.9372972947121 578.0225083167145 389.8633204780206Q576.9411861545249 384.9372972947121 572.0151629712162 383.8559751325224Q576.9411861545249 382.77465297033274 578.0225083167145 377.8486297870242Z' fill='%23FFF3C4' opacity='0.36'/%3E%3Cpath d='M67.98631454024735 310.50647349335856Q69.1303551990259 315.71821427223864 74.34209597790598 316.8622549310172Q69.1303551990259 318.0062955897958 67.98631454024735 323.2180363686759Q66.8422738814688 318.0062955897958 61.630533102588714 316.8622549310172Q66.8422738814688 315.71821427223864 67.98631454024735 310.50647349335856Z' fill='%23FFF3C4' opacity='0.51'/%3E%3Cpath d='M402.3154053580311 519.4100762928925Q402.9293279683616 522.2068348510646 405.72608652653366 522.820757461395Q402.9293279683616 523.4346800717254 402.3154053580311 526.2314386298975Q401.70148274770065 523.4346800717254 398.90472418952857 522.820757461395Q401.70148274770065 522.2068348510646 402.3154053580311 519.4100762928925Z' fill='%23FFF3C4' opacity='0.67'/%3E%3Cpath d='M373.80438872789694 551.499714662149Q374.83876587410424 556.2118772170934 379.5509284290486 557.2462543633006Q374.83876587410424 558.2806315095079 373.80438872789694 562.9927940644523Q372.77001158168963 558.2806315095079 368.05784902674526 557.2462543633006Q372.77001158168963 556.2118772170934 373.80438872789694 551.499714662149Z' fill='%23FFF3C4' opacity='0.61'/%3E%3Cpath d='M725.0696814901406 131.74712193804416Q726.1739992353226 136.7779027772069 731.2047800744854 137.88222052238893Q726.1739992353226 138.98653826757098 725.0696814901406 144.0173191067337Q723.9653637449586 138.98653826757098 718.9345829057959 137.88222052238893Q723.9653637449586 136.7779027772069 725.0696814901406 131.74712193804416Z' fill='%23FFF3C4' opacity='0.57'/%3E%3Cpath d='M630.4702555691563 49.04218434419092Q631.1842224492253 52.29470013117219 634.4367382362066 53.00866701124125Q631.1842224492253 53.72263389131031 630.4702555691563 56.97514967829158Q629.7562886890872 53.72263389131031 626.503772902106 53.00866701124125Q629.7562886890872 52.29470013117219 630.4702555691563 49.04218434419092Z' fill='%23FFF3C4' opacity='0.66'/%3E%3Cpath d='M709.9563157707934 283.4768280510332Q710.8170274060589 287.3978477227982 714.7380470778238 288.2585593580637Q710.8170274060589 289.11927099332917 709.9563157707934 293.0402906650942Q709.0956041355279 289.11927099332917 705.1745844637629 288.2585593580637Q709.0956041355279 287.3978477227982 709.9563157707934 283.4768280510332Z' fill='%23FFF3C4' opacity='0.44'/%3E%3Cpath d='M469.27170868012394 535.5331896976132Q470.0435417580295 539.0493181636275 473.55967022404377 539.821151241533Q470.0435417580295 540.5929843194385 469.27170868012394 544.1091127854528Q468.49987560221837 540.5929843194385 464.9837471362041 539.821151241533Q468.49987560221837 539.0493181636275 469.27170868012394 535.5331896976132Z' fill='%23FFF3C4' opacity='0.64'/%3E%3Cpath d='M496.22847949531933 91.57911877136752Q497.29228845491633 96.42535958730929 502.13852927085804 97.48916854690626Q497.29228845491633 98.55297750650323 496.22847949531933 103.399218322445Q495.16467053572234 98.55297750650323 490.3184297197806 97.48916854690626Q495.16467053572234 96.42535958730929 496.22847949531933 91.57911877136752Z' fill='%23FFF3C4' opacity='0.35'/%3E%3Cpath d='M94.17601203258445 444.1546448717453Q95.23518338883228 448.97975882798545 100.06029734507241 450.03893018423327Q95.23518338883228 451.0981015404811 94.17601203258445 455.92321549672124Q93.11684067633662 451.0981015404811 88.29172672009649 450.03893018423327Q93.11684067633662 448.97975882798545 94.17601203258445 444.1546448717453Z' fill='%23FFF3C4' opacity='0.67'/%3E%3Cpath d='M108.1008292598522 63.096604344222Q108.83420275871042 66.43752806124274 112.17512647573116 67.17090156010096Q108.83420275871042 67.90427505895917 108.1008292598522 71.24519877597992Q107.36745576099399 67.90427505895917 104.02653204397325 67.17090156010096Q107.36745576099399 66.43752806124274 108.1008292598522 63.096604344222Z' fill='%23FFF3C4' opacity='0.69'/%3E%3Cpath d='M92.12243140336882 479.1702713983665Q92.93074502077879 482.85258898878965 96.61306261120195 483.6609026061996Q92.93074502077879 484.4692162236096 92.12243140336882 488.15153381403275Q91.31411778595886 484.4692162236096 87.63180019553569 483.6609026061996Q91.31411778595886 482.85258898878965 92.12243140336882 479.1702713983665Z' fill='%23FFF3C4' opacity='0.53'/%3E%3C/svg%3E"), radial-gradient(ellipse 90% 45% at 50% 100%, rgba(255, 196, 120, 0.55) 0%, rgba(255, 196, 120, 0) 70%), linear-gradient(180deg, #2F6A91 0%, #4F8FB3 45%, #86B6C8 100%); }
:root[data-theme="catalog"] .zoom-controls { border: 2px solid #1E1A14; border-radius: 3px; background: #D4261C; box-shadow: var(--press); }
:root[data-theme="catalog"] .dialog { border: 2px solid #1E1A14; border-top: 14px solid #D4261C; border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0 0.1  0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"), #F6EBC9; box-shadow: 8px 8px 0 rgba(30, 26, 20, 0.45); }
:root[data-theme="catalog"] .dialog::backdrop { background: rgba(44, 95, 128, 0.72); }
/* The toast is a red call-out with its pointer. */
:root[data-theme="catalog"] .toast { border: 2px solid #1E1A14; border-radius: 0; background: #D4261C; color: #FFFFFF; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; box-shadow: var(--press); overflow: visible; }
:root[data-theme="catalog"] .toast::after { content: ''; position: absolute; left: 22px; top: 100%; border: 9px solid transparent; border-top-color: #D4261C; border-left-color: #D4261C; }
.btn-transform[data-to="catalog"] { border: 2px solid #1E1A14; border-radius: 3px; background: #D4261C; color: #FFFFFF; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; text-shadow: none; box-shadow: 2px 2px 0 rgba(60, 35, 10, 0.35), 0 0 0 0 rgba(233, 180, 76, 0.95); animation-name: catalog-beckon; }
@keyframes catalog-beckon { 0%, 100% { box-shadow: 2px 2px 0 rgba(60, 35, 10, 0.35), 0 0 0 0 rgba(233, 180, 76, 0.95); } 50% { box-shadow: 2px 2px 0 rgba(60, 35, 10, 0.35), 0 0 0 7px rgba(233, 180, 76, 0); } }
.aero-band.is-catalog { width: 80px; background: linear-gradient(90deg, #E9B44C 0 10px, #1E1A14 10px 13px, #D4261C 13px 67px, #1E1A14 67px 70px, #FFF3C4 70px 80px); box-shadow: 0 0 30px 6px rgba(255, 196, 120, 0.6); animation-name: catalog-band; }
@keyframes catalog-band { 0% { transform: translateX(-80px); opacity: 1; } 94% { opacity: 1; } 100% { transform: translateX(calc(100vw - 80px)); opacity: 0; } }
.aero-band.aero-band-back.is-catalog { animation-name: aero-band-back; }
.wordmark .wordmark-mark-catalog { display: none; }
:root[data-theme="catalog"] .wordmark .wordmark-mark:not(.wordmark-mark-catalog) { display: none; }
:root[data-theme="catalog"] .wordmark .wordmark-mark-catalog { display: block; filter: drop-shadow(2px 2px 0 rgba(60, 35, 10, 0.3)); }


/* ---- Phones: more room for the plan --------------------------------------
   On a phone the header, tool row, options panel, status line and footer used to leave the plan about a third of
   the screen. Here (the editor page only): the header is one row (name, Save, account, and a "more" button that
   opens the rest); the mode tabs get a slim row to themselves; the tools float down the left edge of the plan
   (app.js moves .tool-strip into .canvas-wrap); the options panel is a sheet behind a handle bar; the status
   line and footer are not shown; and the zoom box gains a Fit button. Wider screens are untouched. */
.tool-strip { display: contents; }
.btn-more, .topbar-credit, .sheet-handle, .zoom-controls .zoom-fit { display: none; }
@media (max-width: 640px) {
  body.editor { --status-h: 0px; --footer-h: 0px; grid-template-rows: auto 1fr; }
  body.editor .statusbar, body.editor .site-footer { display: none; }

  body.editor .topbar { flex-wrap: wrap; align-items: center; gap: 6px 6px; padding: 6px 10px; }
  body.editor .wordmark-text { display: none; }
  body.editor .wordmark .wordmark-mark { width: 32px; height: 32px; }
  body.editor .doc-title { flex: 1 1 0; min-width: 0; padding-left: 2px; }
  body.editor .layout-name { width: 100%; min-width: 0; }
  body.editor .topbar-actions { display: contents; }
  body.editor .topbar-actions > * { display: none; order: 3; flex: 0 0 auto; margin: 0; }
  body.editor .topbar-actions > #save-btn:not([hidden]),
  body.editor .topbar-actions > #account-btn:not([hidden]),
  body.editor .topbar-actions > #more-btn { display: inline-flex; order: 1; }
  body.editor.menu-open .topbar-actions > *:not([hidden]) { display: inline-flex; }
  body.editor.menu-open .topbar-actions::before { content: ''; flex: 0 0 100%; height: 0; order: 2; }
  body.editor.menu-open .topbar-actions > .topbar-credit { display: block; flex: 0 0 100%; order: 4; font-size: 12px; color: var(--ink-soft); }
  body.editor.menu-open #more-btn { box-shadow: inset 0 0 0 1.5px var(--primary); }

  body.editor .workspace { grid-template-rows: auto 1fr auto auto; }
  body.editor .toolrail { padding: 4px 6px; }
  body.editor .mode-tabs { margin: 0; }

  body.editor .canvas-wrap > .tool-strip {
    position: absolute; left: 6px; top: 6px; z-index: 4;
    display: flex; flex-direction: column; gap: 1px;
    width: 44px; max-height: calc(100% - 12px); padding: 3px;
    overflow-y: auto; scrollbar-width: none;
    border: 1px solid var(--rule); border-radius: 10px;
    background: var(--panel); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  }
  body.editor .canvas-wrap > .tool-strip::-webkit-scrollbar { display: none; }
  body.editor .canvas-wrap > .tool-strip .tool { flex: 0 0 auto; width: 100%; padding: 7px 0; }
  body.editor .canvas-wrap > .tool-strip .tool > span { display: none; }
  body.editor .canvas-wrap > .tool-strip .tool svg { width: 22px; height: 22px; }
  body.editor .canvas-wrap > .tool-strip .tool-sep { width: auto; height: 1px; margin: 3px 6px; flex: 0 0 auto; }

  body.editor .zoom-controls .zoom-fit { display: inline-block; width: auto; padding: 0 10px; font-size: 13px; font-weight: 600; }

  body.editor .sheet-handle {
    display: flex; align-items: center; gap: 8px;
    width: 100%; min-height: 38px; padding: 0 14px;
    border: 0; border-top: 1px solid var(--rule);
    background: var(--panel); color: var(--ink);
    font: 600 14px/1.2 var(--font-head); text-align: left; cursor: pointer;
  }
  body.editor .sheet-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.editor .sheet-handle svg { flex: 0 0 auto; transition: transform 0.15s; }
  body.editor .sheet-handle[aria-expanded="true"] svg { transform: rotate(180deg); }
  body.editor .inspector { max-height: 46vh; max-height: 46dvh; border-top: 0; }
  body.editor.sheet-closed .inspector { display: none; }
}
