/* Tesselform user guide. Offline: no web fonts, no CDN - the guide ships
   beside the program and opens from disk (F12 in the app). Colours follow the
   website's night palette; a light theme is offered for printing and daylight. */

:root {
  --bg: #0b1014;
  --bg-deep: #07090c;
  --raised: #121a1f;
  --high: #182127;
  --fg: #e9eef2;
  --muted: #9aa7b1;
  --line: rgba(200, 222, 238, .10);
  --line-strong: rgba(200, 222, 238, .22);
  --accent: #ff8300;
  --accent-soft: rgba(255, 131, 0, .14);
  --accent-ink: #ffb266;
  --steel: #6f9bbe;
  --ok: #45c486;
  --danger: #ff7b6b;
  --tip-bg: rgba(111, 155, 190, .10);
  --warn-bg: rgba(255, 123, 107, .10);
  --kbd-bg: #1d2830;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, Menlo, monospace;
  --radius: 6px;
  --side: 260px;
  --top: 60px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f7f9;
  --bg-deep: #e9eef2;
  --raised: #ffffff;
  --high: #eef2f5;
  --fg: #111a20;
  --muted: #53616c;
  --line: rgba(17, 26, 32, .10);
  --line-strong: rgba(17, 26, 32, .22);
  --accent: #d65300;
  --accent-soft: rgba(214, 83, 0, .10);
  --accent-ink: #a84000;
  --tip-bg: rgba(111, 155, 190, .14);
  --warn-bg: rgba(180, 35, 24, .08);
  --kbd-bg: #ffffff;
  --shadow: 0 14px 40px rgba(17, 26, 32, .14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 .45em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--kbd-bg);
  font: 600 .82em/1.55 var(--mono);
  text-align: center;
  white-space: nowrap;
}
.ui {
  /* A control's name as it reads in the app. */
  font-weight: 650;
  color: var(--fg);
  white-space: nowrap;
}
.ui::before { content: "\201C"; color: var(--muted); font-weight: 400; }
.ui::after { content: "\201D"; color: var(--muted); font-weight: 400; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg-deep) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.brand span { color: var(--muted); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .hint { color: var(--muted); font-size: 13.5px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: transparent; color: var(--fg); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.menu-btn { display: none; }
.lang-select {
  height: 36px; max-width: 150px; padding: 0 8px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--bg-deep); color: var(--fg); font: inherit; font-size: 13.5px; cursor: pointer;
}
.lang-select:hover, .lang-select:focus { border-color: var(--accent); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.sidebar {
  position: sticky; top: var(--top);
  height: calc(100vh - var(--top));
  overflow-y: auto;
  padding: 22px 16px 40px;
  border-right: 1px solid var(--line);
  background: var(--bg-deep);
}
/* Each group opens and closes; the chevron turns when it is open. */
.sidebar .nav-group {
  display: flex; align-items: center; gap: 6px; width: 100%;
  margin: 10px 0 2px; padding: 6px 10px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--muted); cursor: pointer; text-align: left;
  font: inherit; font-size: 11.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase;
}
.sidebar .nav-group:first-child { margin-top: 0; }
.sidebar .nav-group:hover { background: var(--high); color: var(--fg); }
.sidebar .chev { flex: none; transition: transform .15s ease; }
.sidebar [aria-expanded="true"] > .chev { transform: rotate(90deg); }
.sidebar .nav-items { padding-bottom: 4px; }
.sidebar .nav-parent { display: flex; align-items: center; }
.sidebar .nav-parent > a { flex: 1; min-width: 0; }
.sidebar .nav-subtoggle {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--muted); cursor: pointer;
}
.sidebar .nav-subtoggle:hover { background: var(--high); color: var(--fg); }
.sidebar button:focus-visible, .nav-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* The search box and its results, which take the list's place while you type. */
.nav-search {
  position: sticky; top: -22px; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  margin: -22px -16px 12px; padding: 16px 16px 12px;
  background: var(--bg-deep); color: var(--muted);
}
.nav-search svg { position: absolute; left: 27px; pointer-events: none; }
.nav-search input {
  flex: 1; min-width: 0; height: 34px; padding: 0 30px 0 32px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--raised); color: var(--fg); font: inherit; font-size: 14px;
}
.nav-search input::placeholder { color: var(--muted); }
.nav-search input:focus { border-color: var(--accent); }
.nav-search kbd { position: absolute; right: 24px; pointer-events: none; }
.nav-search input:focus ~ kbd, .nav-search input:not(:placeholder-shown) ~ kbd { display: none; }
.nav-results .nav-note { margin: 2px 10px 8px; color: var(--muted); font-size: 13px; }
.sidebar .nav-results a { display: block; padding: 7px 10px; }
.nav-results a b { display: block; font-weight: 600; font-size: 14px; }
.nav-results a small { display: block; color: var(--muted); font-size: 12px; }
.nav-results a .nav-x { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.sidebar .nav-results a.chosen { background: var(--high); box-shadow: inset 2px 0 0 var(--accent); }
.nav-results mark { background: var(--accent-soft); color: var(--accent-ink); border-radius: 2px; }
.sidebar a, .sidebar .soon {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: var(--radius);
  color: var(--fg); text-decoration: none; font-size: 14.5px;
}
.sidebar a img, .sidebar .soon img { width: 22px; height: 22px; }
.sidebar a:hover { background: var(--high); color: var(--fg); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.sidebar .soon { color: var(--muted); opacity: .6; }
.sidebar .soon::after { content: "soon"; margin-left: auto; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

main { padding: 36px clamp(16px, 4vw, 56px) 96px; max-width: 1320px; }
.crumbs { color: var(--muted); font-size: 14px; }
.crumbs a { color: var(--muted); }
h1 { display: flex; align-items: center; gap: 16px; margin: 10px 0 6px; font-size: clamp(30px, 4vw, 42px); line-height: 1.15; letter-spacing: -.01em; }
h1 img { width: 52px; height: 52px; padding: 6px; border-radius: 10px; background: var(--high); border: 1px solid var(--line); }
.lead { max-width: 64ch; margin: 8px 0 0; color: var(--muted); font-size: 18.5px; }
h2 { margin: 64px 0 12px; font-size: 26px; letter-spacing: -.005em; }
h2 .num { color: var(--accent); margin-right: 8px; }
h3 { margin: 28px 0 8px; font-size: 19px; }
p, li { max-width: 72ch; }
.section-intro { color: var(--muted); margin-top: 0; }

/* ---------- where to find it: the ribbon ---------- */
.find-it { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 26px; }
.ribbon {
  display: inline-flex; align-items: stretch; gap: 2px;
  flex-wrap: wrap;
  max-width: 100%;
  padding: 10px 12px 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #182127;
}
.ribbon .tabs { display: flex; gap: 18px; margin: -2px 0 8px; font-size: 13px; color: #9aa7b1; }
.ribbon .tabs b { color: #ff8300; font-weight: 650; border-bottom: 2px solid #ff8300; }
.ribbon-wrap { display: inline-flex; flex-direction: column; max-width: 100%; }
.rb {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 50px; padding: 6px 5px 4px; border-radius: 4px;
  color: #dee7ee; font-size: 12px; white-space: nowrap;
}
.rb img { width: 32px; height: 32px; }
.rb.here { background: rgba(255, 131, 0, .18); outline: 1.5px solid #ff8300; position: relative; }
.rb.here::after {
  content: ""; position: absolute; inset: -6px; border-radius: 8px;
  border: 2px solid #ff8300; opacity: 0;
  animation: pulse 2.4s var(--ease, ease-out) infinite;
}
@keyframes pulse { 0% { opacity: .9; transform: scale(.92); } 70%, 100% { opacity: 0; transform: scale(1.12); } }
.find-it .caption { color: var(--muted); font-size: 14px; }

/* ---------- facts strip ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 28px 0 0; }
.fact { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
.fact b { display: block; margin-bottom: 2px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- the walkthrough: steps + sticky demo ---------- */
.walk { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.45fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.walk .steps { counter-reset: step; padding-bottom: 30vh; }
.step {
  position: relative;
  margin: 0 0 18px; padding: 18px 20px 16px 62px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--raised);
  cursor: pointer;
  transition: border-color .25s, background .25s, opacity .25s;
  opacity: .62;
}
.step:hover { opacity: .9; }
.step.active { opacity: 1; border-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent 70%), var(--raised); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 18px; top: 17px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--high); border: 1px solid var(--line-strong);
  font-weight: 700; font-size: 14px;
}
.step.active::before { background: var(--accent); border-color: var(--accent); color: #111; }
.step h3 { margin: 0 0 6px; font-size: 17.5px; }
.step p { margin: 0 0 8px; }
.step p:last-child { margin-bottom: 0; }
.step .optional { margin-left: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.demo-sticky { position: sticky; top: calc(var(--top) + 18px); }

/* ---------- a demo: viewport + tool panel + status bar ---------- */
.demo {
  position: relative;
  border: 1px solid var(--line-strong); border-radius: 8px;
  overflow: hidden;
  background: #0d1216;
  box-shadow: var(--shadow);
  user-select: none;
}
.demo .stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 188px; }
.demo .viewport { display: flex; align-items: center; }
.demo.viewport-only .stage { grid-template-columns: minmax(0, 1fr); }
.demo .viewport { position: relative; background: radial-gradient(120% 90% at 50% 30%, #2b3a45 0%, #141c22 62%, #0c1115 100%); }
.demo svg.scene { display: block; width: 100%; height: auto; }
.demo .status {
  display: flex; align-items: center; gap: 10px;
  min-height: 30px; padding: 5px 12px;
  border-top: 1px solid rgba(200, 222, 238, .12);
  background: #0a0e11; color: #b9c5ce; font-size: 12.5px;
}
.demo .status .dot { width: 7px; height: 7px; border-radius: 50%; background: #45c486; flex: none; }
.demo .caption {
  position: absolute; left: 12px; top: 12px; right: 12px;
  display: flex; justify-content: flex-start; pointer-events: none;
}
.demo .caption span {
  padding: 5px 11px; border-radius: 999px;
  background: rgba(7, 9, 12, .78); color: #e9eef2;
  font-size: 12.5px; font-weight: 600;
  border: 1px solid rgba(200, 222, 238, .16);
  opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s;
}
.demo .caption span.show { opacity: 1; transform: none; }
:is(.demo, .brush) .controls {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-top: 1px solid rgba(200, 222, 238, .12); background: #0f1519;
}
:is(.demo, .brush) .controls button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  border: 1px solid rgba(200, 222, 238, .22); border-radius: 5px;
  background: transparent; color: #e9eef2; font: 600 12.5px var(--sans); cursor: pointer;
}
:is(.demo, .brush) .controls button:hover { border-color: #ff8300; color: #ffb266; }
:is(.demo, .brush) .controls .dots { display: flex; gap: 6px; margin-left: auto; }
:is(.demo, .brush) .controls .dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(200, 222, 238, .25); cursor: pointer;
}
:is(.demo, .brush) .controls .dots i.on { background: #ff8300; }

/* The pointer and its click ring, drawn over viewport and panel alike. */
.demo .pointer {
  position: absolute; left: 0; top: 0; z-index: 5;
  width: 22px; height: 22px; pointer-events: none;
  transform: translate(-100px, -100px);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6));
}
.demo .ripple {
  position: absolute; z-index: 4; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; border: 2px solid #ffd91a; pointer-events: none;
  animation: ripple .55s ease-out forwards;
}
.demo .ripple.right { border-color: #6f9bbe; }
@keyframes ripple { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }

/* The Trim panel, drawn as the app draws it. */
.tpanel {
  display: flex; flex-direction: column; gap: 9px;
  padding: 0 0 10px;
  border-left: 1px solid rgba(200, 222, 238, .14);
  background: #1b2329; color: #dee7ee; font-size: 11.5px;
}
.tpanel .t-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; background: #222c33; border-bottom: 1px solid rgba(200, 222, 238, .1);
  font-weight: 650; font-size: 12px;
}
.tpanel .t-head span { color: #9aa7b1; }
.tpanel .t-body { display: flex; flex-direction: column; gap: 9px; padding: 0 10px; }
.tpanel .t-explain { margin: 0; color: #a9b5be; line-height: 1.45; font-size: 10.5px; }
.tpanel .t-row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tpanel .t-btn, .tpanel .t-combo {
  flex: 1 1 auto;
  padding: 4px 6px; border-radius: 3px;
  border: 1px solid rgba(200, 222, 238, .2);
  background: #283239; color: #e5ecf1; text-align: center; white-space: nowrap;
  transition: background .2s, border-color .2s, opacity .2s, box-shadow .2s;
}
.tpanel .t-btn.checked { background: #3b4a55; border-color: #7f98ab; }
.tpanel .t-btn.disabled { opacity: .38; }
.tpanel .t-btn.hidden { display: none; }
.tpanel .t-combo { text-align: left; display: flex; justify-content: space-between; }
.tpanel .t-combo::after { content: "\25BE"; color: #9aa7b1; margin-left: 6px; }
.tpanel .t-label { color: #a9b5be; margin-right: 4px; }
.tpanel .t-btn.primary { background: #3a2a18; border-color: #ff8300; color: #ffd2a3; }
.tpanel .t-spin {
  flex: 1 1 60px; padding: 3px 6px; border-radius: 3px; text-align: right;
  border: 1px solid rgba(200, 222, 238, .2); background: #10161a; color: #e5ecf1; font-family: var(--mono); font-size: 10.5px;
}
.tpanel .t-check { display: inline-flex; align-items: center; gap: 6px; color: #dee7ee; }
.tpanel .t-check i { width: 11px; height: 11px; border-radius: 2px; border: 1px solid rgba(200, 222, 238, .45); background: #10161a; }
.tpanel .t-check.on i { background: #ff8300; border-color: #ff8300; box-shadow: inset 0 0 0 2px #10161a; }
.tpanel .t-section { width: 100%; margin-top: 2px; padding-top: 6px; border-top: 1px solid rgba(200, 222, 238, .12); color: #9aa7b1; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.tpanel .t-summary { margin: 2px 0 0; color: #c9d4dc; line-height: 1.45; min-height: 3em; }
.tpanel .hl { box-shadow: 0 0 0 2px #ff8300, 0 0 14px rgba(255, 131, 0, .55); border-color: #ff8300; }
.tpanel.closed .t-body, .tpanel.closed .t-head { opacity: 0; }
.tpanel .t-body, .tpanel .t-head { transition: opacity .35s; }

/* ---------- small demos in a row ---------- */
.trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 18px; }
.trio figure { margin: 0; }
.trio figcaption { margin-top: 10px; }
.trio figcaption b { display: block; font-size: 16px; margin-bottom: 2px; }
.trio figcaption span { color: var(--muted); font-size: 14.5px; }

/* ---------- reference table ---------- */
.ref { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
.ref th, .ref td { text-align: left; vertical-align: top; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.ref th { color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 650; }
.ref td:first-child { white-space: nowrap; font-weight: 650; }
.ref td .when { display: block; margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.table-wrap { overflow-x: auto; }

/* ---------- callouts ---------- */
.callout { margin: 16px 0; padding: 14px 16px 14px 18px; border-radius: var(--radius); border-left: 3px solid var(--steel); background: var(--tip-bg); }
.callout.warn { border-left-color: var(--danger); background: var(--warn-bg); }
.callout b:first-child { display: block; margin-bottom: 2px; }
.callout p { margin: 0; }

.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; padding: 10px 0; font-weight: 650; list-style: none; display: flex; gap: 10px; }
.faq summary::before { content: "+"; width: 1em; color: var(--accent); font-weight: 700; }
.faq details[open] summary::before { content: "\2212"; }
.faq details > *:not(summary) { margin: 0 0 12px 1.6em; }

.keys { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; align-items: baseline; margin-top: 10px; }

.home-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.home-cards a {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--raised); color: var(--fg); text-decoration: none;
}
.home-cards a:hover { border-color: var(--accent); }
.home-cards img { width: 40px; height: 40px; flex: none; padding: 4px; border-radius: 8px; background: #182127; }
.home-cards b { display: block; }
.home-cards span { color: var(--muted); font-size: 14.5px; }

footer.page-foot { margin-top: 80px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }

/* ---------- narrow screens ---------- */
@media (max-width: 1020px) {
  .walk { grid-template-columns: minmax(0, 1fr); }
  .demo-sticky { position: sticky; top: calc(var(--top) + 6px); z-index: 3; order: -1; }
  .walk .steps { padding-bottom: 0; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 30; top: var(--top); left: 0; width: min(84vw, 300px);
    transform: translateX(-102%); transition: transform .25s;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar .hint { display: none; }
  .demo .stage { grid-template-columns: minmax(0, 1fr) 150px; }
  .tpanel .t-explain { display: none; }
  .tpanel { font-size: 10.5px; }
}
@media (max-width: 520px) {
  .demo .stage { grid-template-columns: minmax(0, 1fr); }
  .demo .tpanel { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rb.here::after { animation: none; }
}
@media print {
  .topbar, .sidebar, :is(.demo, .brush) .controls { display: none; }
  .shell { display: block; }
  .demo-sticky { position: static; }
  .step { opacity: 1; break-inside: avoid; }
}

/* A colour key over a demo view (deviation, curvature). */
.demo .legend {
  position: absolute; right: 10px; bottom: 10px;
  display: flex; flex-direction: column; gap: 3px;
  padding: 6px 8px; border-radius: 5px;
  background: rgba(7, 9, 12, .78); border: 1px solid rgba(200, 222, 238, .16);
  color: #dee7ee; font-size: 10.5px;
}
.demo .legend span { display: flex; align-items: center; gap: 6px; }
.demo .legend i { width: 14px; height: 9px; border-radius: 2px; }

/* Route chooser on the Surface overview. */
.ribbon .rb-divider { width: 1px; margin: 4px 6px; background: rgba(200, 222, 238, .18); }
.ribbon .rb.finish { color: #b9c5ce; }
.route-table td:first-child img { width: 26px; height: 26px; vertical-align: middle; margin-right: 8px; padding: 2px; border-radius: 5px; background: #182127; }

/* The panel never sets the demo's height: the view does, and a long panel scrolls. */
.demo .stage > .tpanel { contain: size; overflow-y: auto; scrollbar-width: thin; }
.demo .viewport { min-height: 0; }

/* Sub-pages in the sidebar (the Panels pages). */
.sidebar a.sub { padding: 4px 10px 4px 44px; font-size: 13.5px; color: var(--muted); }
.sidebar a.sub[aria-current="page"] { color: var(--accent-ink); }

/* A control's reference card: name, what it does, how to use it. */
.controls-ref { display: grid; gap: 12px; margin-top: 14px; }
.ctl { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
.ctl h4 { margin: 0 0 4px; font-size: 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.ctl h4 .kind { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ctl h4 .def { margin-left: auto; font: 500 12.5px var(--mono); color: var(--muted); }
.ctl p { margin: 4px 0; }
.ctl .how { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.ctl .how b:first-child { color: var(--accent-ink); }
.ctl ul, .ctl ol { margin: 4px 0; padding-left: 20px; }
.ctl .opts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 6px 0; font-size: 14.5px; }
.ctl .opts dt { font-weight: 650; }
.ctl .opts dd { margin: 0; color: var(--fg); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; }
.pager a { flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--fg); background: var(--raised); }
.pager a:hover { border-color: var(--accent); }
.pager a span { display: block; color: var(--muted); font-size: 12.5px; }
.pager a.next { text-align: right; }
.toc-inline { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; }
.toc-inline a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; text-decoration: none; color: var(--fg); }
.toc-inline a:hover { border-color: var(--accent); }

/* The Panels page buttons (1 Create ... 7 Finish), as the panel lays them out: four, then three. */
.pagestrip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-width: 460px; margin-top: 20px; padding: 8px; border-radius: var(--radius); background: #1b2329; border: 1px solid var(--line); }
.pagestrip a { padding: 5px 6px; border-radius: 3px; border: 1px solid rgba(200, 222, 238, .2); background: #283239; color: #e5ecf1; text-align: center; font-size: 12.5px; text-decoration: none; }
.pagestrip a:hover { border-color: #ff8300; color: #fff; }
.pagestrip a.on { background: #3a2a18; border-color: #ff8300; color: #ffd2a3; font-weight: 650; }

/* Real screenshots with numbered markers (shots-view.js). */
figure.shot { margin: 20px 0; }
figure.shot figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.shot-frame { position: relative; display: inline-block; max-width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; overflow: visible; box-shadow: var(--shadow); background: #0d1216; }
.shot-frame img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
.shot-mark {
  position: absolute; z-index: 2; transform: translate(-65%, -50%);
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  display: grid; place-items: center;
  background: #ff8300; color: #111; font: 700 11.5px/1 var(--sans); text-decoration: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.shot-mark:hover { background: #ffb266; color: #111; }
.shot-box { position: absolute; border: 2px solid #ff8300; border-radius: 3px; opacity: 0; pointer-events: none; transition: opacity .15s; box-shadow: 0 0 12px rgba(255, 131, 0, .7); }
.shot-box.on { opacity: 1; }
.ctl-num { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #ff8300; color: #111; font: 700 11.5px/1 var(--sans); }
.shot-pair { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 24px; align-items: start; }
.shot-pair .controls-ref { margin-top: 20px; }
.shot-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; margin: 12px 0; }
.shot-row figure.shot { margin: 0; }
@media (max-width: 1020px) { .shot-pair { grid-template-columns: minmax(0, 1fr); } }
.shot-legend { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 7px; font-size: 14.5px; }
.shot-legend li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: baseline; }
.shot-legend li:not(:has(.ctl-num)) { display: none; }
.shot-legend li .ctl-num { justify-self: start; }
.shot-legend li a { font-weight: 650; }
.shot-legend li span.what { color: var(--muted); }
figure.shot-window { margin: 26px 0 0; }
figure.shot-window img { display: block; width: 100%; height: auto; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); }
figure.shot-window figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }

/* A short task loop beside the step it shows (panels-tasks.js). */
figure.task { margin: 18px 0 22px; max-width: 560px; }
figure.task figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }

/* Sculpt brush cards: a looping picture of one stroke, then what the brush does. */
.brush-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin: 14px 0 8px; }
.brush { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); overflow: hidden; }
.brush-view { position: relative; background: linear-gradient(#1a2127, #3b4349); }
.brush-view canvas { display: block; width: 100%; aspect-ratio: 600 / 330; }
.brush-state {
  position: absolute; left: 10px; top: 8px; padding: 2px 8px; border-radius: 999px;
  background: rgba(7, 9, 12, .6); color: #e9eef2; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
}
.brush figcaption { padding: 10px 14px 12px; }
.brush figcaption h4 { margin: 0 0 4px; font-size: 15px; }
.brush figcaption h4 .def { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.brush figcaption p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Numbered instructions without a side-by-side animated demonstration. */
.walk:not([data-walk]) { grid-template-columns: minmax(0, 1fr); }
.walk:not([data-walk]) .steps { padding-bottom: 0; }
.walk:not([data-walk]) .step { opacity: 1; cursor: auto; }
code { font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; }
pre { max-width: 100%; overflow: auto; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raised); line-height: 1.5; }
pre code { overflow-wrap: normal; }
.mcp-reference summary h2 { font: inherit; margin: 0; }
.mcp-reference pre { margin-top: 12px; }

/* Copyable natural-language briefs wrap on narrow screens. */
pre.prompt code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Getting started, task choices and expected-result checkpoints. */
.type-cards, .choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 22px 0; }
.type-cards figure { margin: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--raised); }
.type-cards figure > img { display: block; width: 100%; }
.type-cards figcaption { padding: 16px 20px; }
.type-cards h3, .choice-card h3 { margin: 0 0 8px; }
.type-cards p, .choice-card p { margin: 8px 0; }
.choice-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raised); }
.choice-card > img { width: 40px; height: 40px; }
.decision-line { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.decision-line > span { padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--raised); }
.checkpoint { padding: 12px 16px; margin: 18px 0; border-left: 3px solid var(--ok); border-radius: 0 var(--radius) var(--radius) 0; background: var(--tip-bg); font-size: 14.5px; }
.checkpoint b { display: block; color: var(--fg); }
.checkpoint p { margin: 4px 0 0; }
.checkpoint-pictures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.checkpoint-pictures figure { margin: 0; }
.checkpoint-pictures img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line-strong); }
.checkpoint-pictures figcaption { font-size: 14px; color: var(--muted); padding-top: 6px; }
.panel-map .shot-frame { max-width: 380px; }
.panel-map .shot-legend { max-width: 62ch; }
.panel-map-note { font-size: 14px; color: var(--muted); }
.shot-mark:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }
@media (max-width: 720px) {
  .type-cards, .choice-grid, .decision-line, .checkpoint-pictures { grid-template-columns: minmax(0, 1fr); }
  .choice-card { padding: 16px; }
}

/* Reading, copying and consistent demonstration controls. */
.page-contents { margin: 24px 0 32px; padding: 14px 18px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.page-contents summary { cursor: pointer; font-weight: 650; }
.page-contents ul { columns: 2; padding-left: 20px; margin-bottom: 0; }
.page-contents li { break-inside: avoid; padding: 3px 0; }
.section-link { margin-left: .55em; color: var(--muted); font-size: .72em; text-decoration: none; opacity: .6; }
.section-link:hover, .section-link:focus-visible { opacity: 1; color: var(--accent-ink); }
.reading-next { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 48px 0 24px; padding: 20px 0; border-top: 1px solid var(--line-strong); }
.reading-next > span { flex-basis: 100%; font-weight: 650; }
.guide-button { border: 1px solid var(--line-strong); border-radius: 5px; background: var(--raised); color: var(--fg); padding: 7px 12px; font: 600 14px var(--sans); cursor: pointer; }
.guide-button:hover { border-color: var(--accent); }
.copy-bar { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.copy-bar + pre { margin-top: 8px; }
.copy-status { font-size: 13px; color: var(--muted); }
.clipboard-fallback { position: fixed; top: 0; left: -9999px; }
.prompt-editor { background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px 20px; margin-top: 24px; }
.prompt-editor summary { font-weight: 650; cursor: pointer; }
.prompt-note { font-size: 14px; color: var(--muted); }
.prompt-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.prompt-fields label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; min-width: 0; }
.prompt-fields input, .prompt-fields select, .prompt-fields textarea { width: 100%; padding: 9px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg); color: var(--fg); font: 14px var(--sans); }
.prompt-fields textarea { min-height: 105px; resize: vertical; }
.prompt-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; grid-column: 1 / -1; }
:is(.demo, .brush) .controls { flex-wrap: wrap; color-scheme: dark; }
:is(.demo, .brush) .controls button:disabled { opacity: .4; cursor: default; }
.playback-speed { display: flex; align-items: center; gap: 6px; color: #e9eef2; font-size: 12px; }
.playback-speed select { background: #182127; color: #e9eef2; border: 1px solid #53616c; border-radius: 4px; padding: 3px; }
.step-timeline { display: flex; align-items: center; flex: 1 1 160px; gap: 8px; font-size: 12px; color: #e9eef2; white-space: nowrap; }
.step-timeline input { min-width: 50px; width: 100%; accent-color: #ff8300; }
@media (max-width: 620px) { .page-contents ul { columns: 1; } .prompt-fields { grid-template-columns: 1fr; } .step-timeline { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .demo *, .brush * { transition: none !important; animation: none !important; } }
@media print { .page-contents, .section-link, .reading-next, .copy-bar, .prompt-editor, .brush .controls { display: none; } }

/* Illustrated references use the same blue geometry as the animated tool views. */
.learning-figure { margin: 22px 0; }
.learning-figure img { display: block; width: 100%; border-radius: var(--radius); }
.learning-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; }
.learning-pair, .learning-compare, .glossary-grid, .controls-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.learning-pair .learning-figure { margin-top: 0; }
.learning-compare { margin: 20px 0 36px; }
.learning-compare > div { padding: 16px 20px; border-left: 3px solid var(--accent); background: var(--raised); }
.learning-compare p { margin: 6px 0 0; }
.glossary-card { min-width: 0; padding: 22px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.glossary-card h3 { margin: 0 0 14px; }
.glossary-card p { margin-bottom: 0; }
.glossary-card > img { display: block; width: 100%; height: 210px; object-fit: contain; background: #182127; border-radius: 5px; }
.glossary-term { text-decoration-style: dotted; text-decoration-color: var(--muted); }
.glossary-term:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.print-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0; }
.print-actions a { text-decoration: none; }
.controls-scope { border-left: 3px solid var(--accent); padding: 12px 18px; background: var(--raised); }
.control-card { min-width: 0; padding: 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raised); }
.control-card h2 { margin: 0 0 12px; padding: 0; font-size: 19px; }
.control-card dl { margin: 0; font-size: 14px; }
.control-card dl > div { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.control-card dt { font-weight: 650; }
.control-card dd { margin: 0; }
.controls-footnote { font-size: 13px; color: var(--muted); margin-top: 20px; }
@media (max-width: 760px) {
  .learning-pair, .learning-compare, .glossary-grid, .controls-grid { grid-template-columns: minmax(0, 1fr); }
  .glossary-card { padding: 18px; }
}
