/* Thread Order's own parts, on top of the kit's stage layout. */
.site-header .brand { font-family: var(--font-display); font-size: var(--step-1); letter-spacing: 0.01em; }
.site-header .brand img { width: 2rem; height: 2rem; }
.hero-title { font-weight: 400; letter-spacing: 0.005em; line-height: 1.05; max-width: 18ch; margin-inline: auto; }
.promise { max-width: 36rem; }

.stage { background-image: radial-gradient(color-mix(in oklab, var(--brand-ink) 18%, transparent) 1px, transparent 1.4px); background-size: 14px 14px; }
html[data-layout="stage"] .stage-sheet.bench { transition: max-width 0.25s; }
html[data-layout="stage"] .stage-sheet.bench.open { max-width: 66rem; }

.dropzone { min-height: 13rem; }
.sample-line { text-align: center; margin: var(--s4) 0 0; }
.sample-line .btn { font-size: var(--step-0); border: 1px solid var(--line-strong); }
.hint { margin: 0 0 var(--s2); color: var(--ink-2); font-size: var(--step--1); }

.work-head { display: flex; justify-content: space-between; align-items: start; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.file-name { margin: 0; font-family: var(--font-mono); font-size: var(--step--1); color: var(--ink-2); overflow-wrap: anywhere; }
.tally { margin: 0; font-size: var(--step-1); }
.tally strong { font-family: var(--font-display); font-weight: 400; font-size: var(--step-2); color: var(--brand-text); }

.work-grid { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .work-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; } }
.preview { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.preview canvas { display: block; color-scheme: light; width: 100%; height: auto; aspect-ratio: 1; background: #fbf8f1; border: 1px solid var(--line); border-radius: var(--radius); }
.preview figcaption { margin-top: var(--s2); text-align: center; }

.actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.actions.save { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.btn-big { font-size: var(--step-1); padding: 0.85rem 1.4rem; }
.btn-small { padding: 0.4rem 0.8rem; font-size: var(--step--1); }
.note { min-height: 1.4em; margin: var(--s3) 0; color: var(--ink-2); }

.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); max-height: 26rem; overflow: auto; }
.stop { display: grid; grid-template-columns: 1.6rem 2.25rem minmax(0, 1fr) auto; gap: var(--s2); align-items: center; padding: var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); }
.stop.on { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.stop .pos { font-family: var(--font-mono); color: var(--ink-2); text-align: right; }
.stop input[type="color"] { width: 2.25rem; height: 2.25rem; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.stop input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.stop input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.stop input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.stop .what { text-align: left; background: none; border: 0; padding: 0.2rem 0; color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.stop .what b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stop .what small { display: block; color: var(--ink-2); font-size: var(--step--1); }
.stop .moves { display: flex; gap: 0.25rem; }
.stop .moves button { min-width: 2.25rem; min-height: 2.25rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg); color: var(--ink); font: 700 0.95rem var(--font-body); cursor: pointer; }
.stop .moves .join-up { padding-inline: 0.5rem; font-size: var(--step--1); }
.stop .moves button:disabled { opacity: 0.35; cursor: default; }
@media (max-width: 480px) {
  .stops { max-height: none; overflow: visible; }
  .stop { grid-template-columns: 1.4rem 2.25rem minmax(0, 1fr); }
  .stop .moves { grid-column: 2 / -1; }
  .stop .moves button { min-width: 2.75rem; min-height: 2.75rem; }
}

.needles { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin-top: var(--s4); }
.needles label { font-weight: 700; }
.needles select { padding: 0.45rem 0.6rem; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); font: inherit; }

.error { margin: var(--s4) 0 0; padding: var(--s3); border-radius: var(--radius-s); background: color-mix(in oklab, #d1495b 16%, var(--surface)); color: var(--ink); }

.table-wrap { overflow-x: auto; margin-top: var(--s4); }
.runsheet table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.runsheet th, .runsheet td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.runsheet td:nth-child(2) { font-family: var(--font-mono); }
.chip { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 50%; vertical-align: -0.1rem; border: 1px solid var(--line-strong); }

.steps { margin-top: var(--s5); }
.fine { margin-top: var(--s7); color: var(--ink-2); }
.fine h3 { font-family: var(--font-body); font-size: var(--step-0); color: var(--ink); margin: var(--s5) 0 var(--s1); }
.fine p { margin: 0; }

@media print {
  .site-header, .hero, .stage, #how, .guide, footer, .skip-link { display: none !important; }
  .runsheet { display: block !important; padding: 0; }
  body { background: #fff; color: #000; }
}

.guide h2 { margin-top: var(--s6); }
.guide h2:first-child { margin-top: 0; }
.guide-links { padding-left: 1.2rem; display: grid; gap: var(--s2); }
.guide-links a { color: var(--brand-text); }
