/* ------------------------------------------------------------------ */
/* design tokens                                                        */
/* ------------------------------------------------------------------ */
:root {
    /* Sugar Paper: near white rather than cream, warmth kept only in the
     * fills, and the cool blue reserved for the 3D stage so the workspace
     * separates from the controls. */
    --bg: #fffdf6;            /* page, near white with just enough warmth */
    --panel: #ffffff;         /* cards and the controls column */
    --panel-2: #fff7de;       /* pale lemon for sunken fields and drop targets */
    --panel-3: #fceab7;       /* biscuit yellow for pressed and selected */
    --line: #dcd7cb;          /* neutral, so borders recede instead of muddying */
    --line-soft: #ece8e0;
    --text: #24211d;
    --muted: #5c564d;
    --muted-soft: #6c6459;
    --accent: #d52d4b;        /* raspberry: baking, not confectionery pink */
    --accent-hover: #b91f3d;
    --accent-soft: #fff0f3;
    --accent-ink: #ffffff;
    --accent-2: #f6b622;      /* honey, always with dark text on it */
    --accent-2-soft: #fff6d4;
    --accent-2-ink: #24211d;
    --sky: #2b769e;
    --sky-soft: #eaf7ff;
    --violet: #6e55aa;
    --violet-soft: #f2eeff;
    --warn: #8a5a12;
    --ok: #24784d;
    --ok-soft: #eaf8ef;
    --bad: #b3124a;
    --ring: #9e1735;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 22px;

  --sidebar: clamp(320px, 30%, 384px);
  --control-h: 34px;        /* baseline hit target for inputs and buttons */

  --shadow-1: 0 1px 2px rgba(36, 33, 29, .07);
  --shadow-2: 0 3px 12px rgba(36, 33, 29, .09);
}

/* The wordmark face is one of the 65 faces the tool itself offers, subset
 * to the chrome's own characters by tools/make_ui_assets.py. */
@font-face {
  font-family: "Chrome Display";
  src: url("chrome.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ------------------------------------------------------------------ */
/* header                                                              */
/* ------------------------------------------------------------------ */
header {
  flex: 0 0 auto;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, var(--bg));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}
header .brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
header h1 {
  margin: 0;
  font-family: "Chrome Display", "Segoe UI", system-ui, sans-serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .1px;
}
header h1 .mark { color: var(--accent); }
header .sub { margin: 0; color: var(--muted); font-size: 13px; }

/* The one thing a cloud tool structurally cannot say. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips li {
  font-size: 11.5px;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--accent-2-soft);
  border: 1px solid var(--line-soft);
  white-space: nowrap;
}
.chips li:first-child {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}
.siteNav { display: flex; align-items: center; gap: 2px; }
.siteNav a {
  padding: 6px 10px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.siteNav a:hover { background: var(--panel-2); color: var(--text); }
.siteNav a[aria-current="page"] {
  color: var(--text);
  background: transparent;
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 0;
}

/* ------------------------------------------------------------------ */
/* app shell                                                           */
/* ------------------------------------------------------------------ */
main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

#controls {
  min-height: 0;
  overflow-y: auto;
  padding: var(--s-4);
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

#stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* ------------------------------------------------------------------ */
/* 3D viewer and empty state                                           */
/* ------------------------------------------------------------------ */
#viewer {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, #f7fcff 0%, #e8f4fb 72%);
}
#viewer canvas { display: block; }

.viewerHint {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  pointer-events: none;
  color: var(--muted);
}
#viewer.empty .viewerHint { display: flex; }
.viewerHint h2 {
  margin: 0 0 6px;
  font-family: "Chrome Display", "Segoe UI", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

/* Seven library outlines sitting on the bench like real cutters. Each one
 * builds its shape, so the empty state does work rather than decorate. */
.shapeShelf {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 4px;
  pointer-events: auto;
}
.shapeShelf button {
  width: 62px;
  height: 62px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 2px 0 rgba(36, 33, 29, .06);
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.shapeShelf button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(36, 33, 29, .12);
  border-color: var(--accent);
  background: var(--panel);
}
.shapeShelf svg { width: 100%; height: 100%; display: block; }
.viewerHint .assure {
  margin-top: 18px;
  max-width: 46ch;
  font-size: 12px;
  color: var(--muted-soft);
}
.viewerHint p { margin: 0; font-size: 13px; max-width: 44ch; line-height: 1.55; }
.viewerHint .steps {
  margin-top: 18px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  font-size: 12.5px;
  counter-reset: step;
}
.viewerHint .steps span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.viewerHint .steps span::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* status bar                                                          */
/* ------------------------------------------------------------------ */
#viewerBar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  background: var(--panel);
}
#status { flex: 1; min-width: 0; }
#status.err { color: var(--bad); }
#status.busy { color: var(--accent-2); }
#status.busy::before {
  content: "";
  display: inline-block;
  width: 9px; height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  vertical-align: -1px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #status.busy::before { animation: none; } }

/* ------------------------------------------------------------------ */
/* flat preview                                                        */
/* ------------------------------------------------------------------ */
#flatPreview {
  flex: 0 0 auto;
  padding: var(--s-3) var(--s-4);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
#flatPreview svg { max-height: 240px; max-width: 100%; background: #fffdf9; border-radius: var(--r-sm); }
#flatPreview .caption { margin: 0 0 var(--s-2); color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------------ */
/* report: downloads, warnings, sizes                                  */
/* ------------------------------------------------------------------ */
#report {
  flex: 0 0 auto;
  padding: var(--s-4) var(--s-4) 20px;
  background: var(--panel);
  max-height: 40vh;
  overflow-y: auto;
}
#report:empty { display: none; }

.resultHead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--ok);
}
.resultHead svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* download buttons: this is the payoff, so make it look like one */
.dl { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dl a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  min-height: 46px;
  border-radius: var(--r-md);
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-1);
  transition: transform .1s ease, box-shadow .15s ease, filter .15s ease;
}
.dl a .ic { flex: 0 0 auto; width: 22px; height: 22px; }
.dl a .lbl { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.dl a .name { font-weight: 600; font-size: 13.5px; }
.dl a .meta { font-size: 11.5px; color: var(--muted); }
.dl a.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.dl a.primary .meta { color: rgba(255, 255, 255, .78); }
.dl a:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); filter: brightness(1.03); }

/* alerts and notes */
.alert {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  margin: 0 0 12px;
  border: 1px solid var(--warn);
  border-left-width: 4px;
  border-radius: var(--r-md);
  background: var(--accent-2-soft);
}
.alert svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; color: var(--warn); }
.alert .title { font-weight: 650; font-size: 13px; margin: 0 0 2px; color: #8a5a12; }
/* Measured fixes offered inside the warning, so the answer is one click
 * away rather than somewhere in the panels below. */
.fixes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fixes button {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  min-height: 30px;
  border-color: #d9b775;
  background: var(--panel);
}
.fixes button:hover { border-color: var(--accent); background: var(--accent-soft); }
.alert p { margin: 0; font-size: 12.5px; color: var(--text); line-height: 1.5; }

.notes { list-style: none; margin: 0 0 12px; padding: 0; }
.notes li {
  position: relative;
  padding: 4px 0 4px 18px;
  font-size: 12.5px;
  color: var(--muted);
}
.notes li::before {
  content: "";
  position: absolute;
  left: 3px; top: 11px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warn);
  opacity: .8;
}

.sizesTitle {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted-soft);
}
table.info { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.info th, table.info td {
  text-align: left;
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--line-soft);
}
table.info th { color: var(--muted); font-weight: 500; }
table.info tr:last-child td { border-bottom: none; }

/* ------------------------------------------------------------------ */
/* upload                                                              */
/* ------------------------------------------------------------------ */
.drop {
  position: relative;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--panel-2);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--panel-3); }
.drop.over { border-style: solid; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { display: none; max-height: 140px; max-width: 100%; border-radius: var(--r-sm); background: #fff; }
.drop.has img { display: inline-block; }
.drop.has #dropText { display: none; }
#dropText strong { display: block; font-size: 14px; }
#dropText span { color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------------ */
/* starter presets                                                     */
/* ------------------------------------------------------------------ */
.presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: stretch;
  gap: var(--s-2);
}
.presets span {
  grid-column: 1 / -1;
  color: var(--muted-soft);
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.presets button {
  flex: 1 1 auto;
  padding: 7px 10px 7px 26px;
  font-size: 12.5px;
  position: relative;
  background: var(--panel);
}
/* An unselected preset shows an empty ring, the selected one fills with
 * honey and ticks. Without this nobody can tell which is active. */
.presets button::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
}
.presets button:hover::before { border-color: var(--accent-2); }
.presets button.on {
  background: var(--panel-3);
  border-color: var(--accent);
  color: var(--text);
  font-weight: 650;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.presets button.on::before {
  border-color: var(--accent);
  background: var(--accent);
}
.presets button.on::after {
  content: "";
  position: absolute;
  left: 12.5px;
  top: 50%;
  width: 3px;
  height: 6px;
  margin-top: -4px;
  border: solid #fff;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}

/* ------------------------------------------------------------------ */
/* source tabs, drawn as folder tabs so the chosen one is obvious      */
/* ------------------------------------------------------------------ */
.sourceTabs {
  display: flex;
  gap: 3px;
  padding: 5px 5px 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-md) var(--r-md) 0 0;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}
.sourceTabs button {
  flex: 1;
  padding: 9px 6px;
  font-family: "Chrome Display", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: transparent;
  color: var(--muted);
  min-height: 36px;
}
.sourceTabs button:hover { color: var(--text); border-color: transparent; background: rgba(0, 0, 0, .04); }
.sourceTabs button.on {
  background: var(--panel);
  border-color: var(--line);
  color: var(--accent);
  box-shadow: none;
}
/* The panel the active tab joins, so the tab reads as attached to it. */
.tabPanel {
  border: 1px solid var(--line);
  border-radius: 0 var(--r-md) var(--r-md) var(--r-md);
  background: var(--panel);
  padding: var(--s-3);
}

/* A quiet aside inside the tab panel. */
.panelNote {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.shapePicker .panelNote { margin-top: var(--s-2); }

/* Font pairings for the occasions that drive orders. */
.typeSets span {
  display: block;
  color: var(--muted-soft);
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.typeSetRow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.typeSetRow button { padding: 8px 10px; font-size: 12.5px; background: var(--panel); }
.typeSetRow button:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ------------------------------------------------------------------ */
/* pre-made shape picker                                               */
/* ------------------------------------------------------------------ */
.shapePicker {
  padding: 0;
}
.shapeBar {
  display: flex;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.shapeBar input { flex: 1 1 auto; min-width: 0; }
.shapeBar select { flex: 0 1 40%; }
.shapeGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}
.shapeGrid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px 4px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  color: #3f3a34;
}
.shapeGrid button:hover { color: var(--accent); border-color: var(--accent); }
.shapeGrid button.on {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.shapeGrid svg { width: 42px; height: 42px; display: block; }
.shapeGrid span {
  font-size: 10.5px;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}
.shapeEmpty { color: var(--muted); font-size: 12.5px; margin: var(--s-2) 0 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Until the engine reports its defaults nothing knows which controls apply,
 * so the presets and panels would flash up unfiltered and unselected. Hide
 * them rather than show a form that cannot work yet. */
.booting .presets,
.booting #panels,
.booting .row.actions { display: none; }
.bootNote {
  margin: var(--s-3) 0 0;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: 13px;
}
#controls:not(.booting) .bootNote { display: none; }

/* ------------------------------------------------------------------ */
/* panels                                                              */
/* ------------------------------------------------------------------ */
details {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  overflow: hidden;
}
details + details { margin-top: 0; }
details[open] { padding-bottom: var(--s-2); }
details.primary { border-color: var(--line); background: var(--panel); box-shadow: var(--shadow-1); }
details.primary > summary { color: var(--text); }
details.primary > summary::after { color: var(--accent); }

summary {
  position: relative;
  cursor: pointer;
  padding: 11px 12px;
  font-family: "Chrome Display", "Segoe UI", system-ui, sans-serif;
  font-weight: 650;
  font-size: 12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "";
  margin-left: auto;
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .15s ease;
  opacity: .8;
}
details[open] > summary::after { transform: rotate(-135deg); }
summary:hover { color: var(--text); }

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(116px, 140px);
  align-items: center;
  gap: var(--s-2);
  padding: 6px 12px;
}
.field label { font-size: 13px; }
.field .unit { color: var(--muted); font-size: 11px; }
.field.check { grid-template-columns: 1fr auto; }
.field.wide { grid-template-columns: 1fr; gap: 6px; }
.field.hidden { display: none; }

/* the two or three fields that actually matter every time */
.field.key { padding-top: 8px; padding-bottom: 8px; }
.field.key > label { font-weight: 600; }
.field.key #f_size { font-weight: 600; }

/* ------------------------------------------------------------------ */
/* inputs and buttons                                                  */
/* ------------------------------------------------------------------ */
input[type=number], select, textarea, .fontFilter {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #ffffff;
  color: var(--text);
  font: inherit;
}
input[type=number], select {
  min-height: var(--control-h);
  padding: 5px 8px;
  font-size: 13px;
}
select {
  appearance: none;
  padding-right: 22px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 9px center, right 4px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
textarea {
  padding: 8px 9px;
  font-size: 14px;
  resize: vertical;
  min-height: 62px;
  line-height: 1.4;
}
.fontFilter { padding: 6px 9px; margin-bottom: 6px; font-size: 12.5px; min-height: 32px; }

input[type=checkbox] {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

button {
  min-height: var(--control-h);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel-3);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color .12s, background .12s, filter .12s;
}
button:hover { border-color: var(--accent-2); background: var(--panel-3); }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}
button.primary:hover { filter: brightness(1.06); background: var(--accent); }
button:disabled { opacity: .5; cursor: default; filter: none; }

/* the generate row */
.row.actions { display: flex; align-items: center; gap: var(--s-3); }
#generate { flex: 0 0 auto; padding-left: 22px; padding-right: 22px; }
.inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}
.divider { height: 1px; background: var(--line-soft); margin: 2px 0; }

/* ------------------------------------------------------------------ */
/* font lines                                                          */
/* ------------------------------------------------------------------ */
.fontLines { display: flex; flex-direction: column; gap: 6px; }
.fontLine {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  gap: 6px;
}
.fontLine .lineTag {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fontLine select, .fontLine input { font-size: 12.5px; min-height: 32px; padding: 4px 6px; }
.fontLine select { padding-right: 22px; }

/* ------------------------------------------------------------------ */
/* hints and boot error                                                */
/* ------------------------------------------------------------------ */
.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 2px 12px 8px;
  padding-left: 20px;
  position: relative;
}
.hint::before {
  content: "i";
  position: absolute;
  left: 0; top: 1px;
  width: 14px; height: 14px;
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  opacity: .8;
}

.bootError {
  border: 1px solid var(--bad);
  border-radius: var(--r-md);
  background: var(--accent-soft);
  padding: 12px 14px;
}
.bootError strong { display: block; margin-bottom: 4px; font-size: 13.5px; }
.bootError p { margin: 0 0 10px; color: var(--muted); font-size: 12px; word-break: break-word; }
#controls.dead #panels, #controls.dead .presets, #controls.dead .drop {
  opacity: .35;
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* focus states: visible, consistent, high contrast                   */
/* ------------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, .fontFilter:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  border-color: var(--ring);
}
summary:focus-visible { outline-offset: -2px; border-radius: var(--r-md); }
/* keep a fallback for browsers without :focus-visible */
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); }

/* ------------------------------------------------------------------ */
/* scrollbars (dark)                                                   */
/* ------------------------------------------------------------------ */
#controls, #report { scrollbar-width: thin; scrollbar-color: #cfc9bd transparent; }
#controls::-webkit-scrollbar, #report::-webkit-scrollbar { width: 10px; }
#controls::-webkit-scrollbar-thumb, #report::-webkit-scrollbar-thumb {
  background: #cfc9bd;
  border-radius: 6px;
  border: 2px solid var(--panel);
}
#controls::-webkit-scrollbar-thumb:hover, #report::-webkit-scrollbar-thumb:hover { background: #b8b1a3; }

/* ------------------------------------------------------------------ */
/* responsive: stack below 900px so it works on iPad and phones        */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) {
  html, body { height: auto; }
  body { overflow: visible; }

  header { position: sticky; top: 0; z-index: 5; }

  main {
    display: block;
    min-height: 0;
  }

  #controls {
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  #stage { min-height: 0; }

  #viewer {
    height: 56vh;
    min-height: 320px;
    flex: 0 0 auto;
  }
  #report { max-height: none; overflow: visible; }

  /* bigger touch targets on tablets and phones */
  :root { --control-h: 40px; }
  .sourceTabs button { padding: 11px 8px; }
  .presets button { padding: 10px 12px; }
  button { min-height: 40px; }
  #viewerBar { padding: 11px 16px; }
}

@media (max-width: 480px) {
  header { padding: 10px 14px; }
  header h1 { font-size: 16px; }
  header .sub { font-size: 12px; }
  #controls { padding: var(--s-3); }
  #viewer { height: 50vh; min-height: 280px; }
  .dl a { flex: 1 1 100%; }
  .siteNav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -14px;
    padding: 0 14px 2px;
  }
  .siteNav::-webkit-scrollbar { display: none; }
}
