/* Guard Up web player builder. Tokens copied from the site (src/styles.css); fonts are self-hosted copies. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/Archivo-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/Archivo-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("fonts/Archivo-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Big Shoulders Display";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("fonts/BigShouldersDisplay-Black.ttf") format("truetype");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/IBMPlexMono-SemiBold.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  --radius: 4px;
  --panel: #14171c;
  --line: #262b34;
  --scrim: oklch(0.16 0.01 260 / 0.7);
  --background: #0e1013;
  --foreground: #f4f1ea;
  --card: #1b1f27;
  --popover: #1b1f27;
  --primary: #f26b1d;
  --primary-foreground: #0e1013;
  --muted-foreground: #9a968e;
  --subtle: #c9c5bc;
  --accent: #232833;
  --hardwood: #e8b36a;
  --destructive: #ff7a6b;
  --border: #3a3f49;
  --ring: #e8b36a;
  --primary-text: #f26b1d;
  --shadow: 0 16px 48px oklch(0.05 0 0 / 0.28);
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-sans: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --background: oklch(0.985 0 0);
  --foreground: oklch(0.19 0.01 260);
  --card: oklch(0.95 0.005 260);
  --panel: oklch(0.965 0.005 260);
  --popover: oklch(0.985 0 0);
  --muted-foreground: oklch(0.46 0.012 260);
  --subtle: oklch(0.36 0.012 260);
  --accent: oklch(0.92 0.01 260);
  --border: oklch(0.78 0.01 260);
  --line: oklch(0.85 0.005 260);
  --ring: oklch(0.55 0.17 45);
  --hardwood: oklch(0.45 0.1 60);
  --destructive: oklch(0.5 0.2 25);
  --primary-text: oklch(0.49 0.16 45);
  --shadow: 0 16px 48px oklch(0.2 0 0 / 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}
h2 {
  font-size: 1.35rem;
}
h3 {
  font-size: 1.05rem;
}
p {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
.mono {
  font-family: var(--font-mono);
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.wrap {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 24px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 12px 16px;
  font-weight: 700;
  border-radius: var(--radius);
}
.skip:focus {
  top: 12px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-text);
}
.display {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: 0;
}
.note {
  color: var(--muted-foreground);
  font-size: 0.9rem;
}
.note:empty,
.why:empty,
.verdict:empty {
  display: none;
}
.hint {
  color: var(--muted-foreground);
  font-size: 0.82rem;
}
.warn {
  color: var(--hardwood);
}
.bad {
  color: var(--destructive);
}

/* top bar */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--background);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}
.brand {
  color: var(--foreground);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
#theme-toggle {
  margin-left: auto;
}
.theme-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

/* buttons and inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    transform 0.1s;
}
.btn:hover:not(:disabled) {
  border-color: var(--foreground);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}
.btn.primary:hover:not(:disabled) {
  background: var(--hardwood);
  border-color: var(--hardwood);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.small {
  padding: 0 12px;
  font-size: 0.85rem;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.text-input,
.select {
  min-height: 44px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
}
.select {
  width: auto;
  max-width: 100%;
}
.field {
  display: grid;
  gap: 6px;
}
.field-label {
  font-weight: 600;
  font-size: 0.92rem;
}
.label-row {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  min-width: 0;
}
.row-name {
  font-weight: 600;
}

/* toggletips */
.tip {
  position: relative;
  display: inline-flex;
}
.tip-btn {
  width: 44px;
  height: 44px;
  margin: -10px -6px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.tip-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--muted-foreground);
  color: var(--muted-foreground);
  font: 700 12px/17px var(--font-mono);
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
}
.tip-btn:hover .tip-dot,
.tip-btn[aria-expanded="true"] .tip-dot {
  border-color: var(--primary-text);
  color: var(--primary-text);
}
.tip-bubble {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: -8px;
  z-index: 40;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  background: var(--popover);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font: 400 0.88rem/1.45 var(--font-sans);
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
}
.tip.open .tip-bubble {
  display: block;
}

/* intro, toolbar, tabs */
.intro-block {
  padding-block: 32px 20px;
  display: grid;
  gap: 10px;
}
.intro-block h1 {
  font-size: clamp(56px, 9vw, 112px);
}
.lede {
  max-width: 640px;
  color: var(--subtle);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--background);
  padding-block: 8px;
  border-bottom: 1px solid var(--line);
}
.tabs {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tabs [role="tab"] {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  font-weight: 700;
  cursor: pointer;
}
.tabs [role="tab"][aria-selected="true"] {
  background: var(--primary);
  color: var(--primary-foreground);
}
.history {
  display: flex;
  gap: 8px;
}

/* layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}
.work:focus {
  outline: none;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}
.panel > h2 {
  margin-bottom: 8px;
}
.intro {
  color: var(--subtle);
  margin-bottom: 16px;
  max-width: 70ch;
}
/* summary */
.summary {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 92px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 12px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#summary-body {
  display: grid;
  gap: 12px;
}
#summary-body h3 {
  font-size: 0.95rem;
}
.sum-id {
  font-weight: 700;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}
.budget {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}
.budget > div {
  background: var(--card);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.budget dt {
  font-size: 0.82rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
}
.budget dd {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}
.legal {
  font-weight: 600;
}
.legal:not(.bad)::before {
  content: "\2713  ";
  color: var(--primary-text);
}
.radar,
.body-fig {
  margin: 0;
}
.radar svg,
.body-fig svg {
  width: 100%;
  height: auto;
  display: block;
}
.body-fig svg {
  max-height: 300px;
}
.ring {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}
.spoke {
  stroke: var(--line);
  stroke-width: 1;
}
.you {
  fill: color-mix(in oklab, var(--primary) 28%, transparent);
  stroke: var(--primary);
  stroke-width: 2.5;
}
.cmp {
  fill: none;
  stroke: var(--hardwood);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}
.dot {
  fill: var(--primary);
}
.lbl {
  fill: var(--subtle);
  font: 600 13px var(--font-sans);
}
.lbl .val {
  fill: var(--foreground);
  font: 600 12px var(--font-mono);
}
.fig {
  fill: var(--primary);
  stroke: var(--primary);
}
.fig .limb {
  stroke-linecap: round;
}
.fig.cmp {
  fill: none;
  stroke: var(--hardwood);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}
.fig.cmp .limb {
  stroke-width: 2;
}
.floor {
  stroke: var(--border);
  stroke-width: 2;
}
.rim {
  stroke: var(--destructive);
  stroke-width: 2;
  stroke-dasharray: 8 5;
}
.tick {
  stroke: var(--muted-foreground);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.jump {
  fill: var(--hardwood);
  opacity: 0.8;
}
.body-fig .lbl {
  font-size: 19px;
}
.readouts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.readout {
  background: var(--card);
  border-radius: var(--radius);
  padding: 6px 10px;
  min-width: 0;
}
.readout dt {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.readout dd {
  margin: 0;
  font-weight: 700;
  font-family: var(--font-mono);
}
.sum-badges {
  font-size: 0.9rem;
  color: var(--subtle);
}

/* code */
.code-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}
.code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  word-break: break-all;
  padding: 10px;
  background: var(--card);
  border-radius: var(--radius);
  user-select: all;
}
.code.not-legal {
  opacity: 0.6;
  text-decoration: line-through;
  text-decoration-color: var(--destructive);
}
.preview-flag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hardwood);
  border: 1px dashed var(--hardwood);
  border-radius: var(--radius);
  padding: 6px 8px;
}
.verdict {
  font-weight: 600;
  font-size: 0.92rem;
}

/* steppers */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}
.step {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}
.step:hover {
  background: var(--accent);
}
.step-value {
  min-width: 3.2ch;
  padding: 0 6px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
}
.why {
  color: var(--destructive);
  font-size: 0.85rem;
  font-weight: 600;
}

/* wizard */
.wiz-steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.wiz-step {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
}
.wiz-step .num {
  font-family: var(--font-mono);
  font-weight: 700;
}
.wiz-step[aria-current="step"] {
  border-color: var(--primary);
  color: var(--foreground);
  background: var(--card);
}
.wiz-step[aria-current="step"] .num {
  color: var(--primary-text);
}
.step-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.step-title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 2.4rem;
  line-height: 1;
  margin: 4px 0 8px;
}
.step-title:focus {
  outline: none;
}
.step-title:focus-visible {
  outline: 3px solid var(--ring);
}
.wiz-stage {
  min-height: 300px;
}
.wiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  min-height: 44px;
}
.card input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.card:has(input:checked) {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.card:has(input:focus-visible) {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.card input:focus-visible {
  outline: none;
}
.card-body {
  display: grid;
  gap: 4px;
}
.card-text {
  color: var(--subtle);
  font-size: 0.92rem;
}
.card-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.wiz-stage .legal {
  margin-top: 12px;
}
.focus-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.focus {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 10px;
  row-gap: 6px;
  align-items: center;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
}
.focus input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
}
.focus:has(input:checked) {
  border-color: var(--primary);
}
.focus:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}
.focus:has(input:focus-visible) {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.focus .meter {
  grid-column: 1 / -1;
}
.focus-name {
  font-weight: 600;
}
.avg {
  font-size: 0.78rem;
  color: var(--muted-foreground);
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.facts > div {
  background: var(--card);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.facts dt {
  font-size: 0.78rem;
  color: var(--muted-foreground);
}
.facts dd {
  margin: 0;
  font-weight: 600;
}

/* body controls */
.body-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
  gap: 20px;
  align-items: start;
}
.body-controls:not(:has(.body-fig)) {
  grid-template-columns: minmax(0, 1fr);
}
.body-rows {
  display: grid;
  gap: 14px;
}
.body-row {
  display: grid;
  gap: 6px;
}
.body-row .stepper {
  justify-self: start;
}
.body-row .step-value {
  min-width: 15ch;
}
.badges {
  display: grid;
  gap: 12px;
}
.badge-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
}
.badge-row .why {
  grid-column: 1 / -1;
}
.badge-row .step-value {
  min-width: 11ch;
}
.badge-points {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
/* editor */
.ed-section {
  display: grid;
  gap: 12px;
  padding-block: 16px;
  border-top: 1px solid var(--line);
}
.ed-section h3 {
  display: flex;
  align-items: center;
  gap: 2px;
}
.seg {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.seg legend {
  font-weight: 600;
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}
.seg-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
}
.seg-opt input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.seg-opt:has(input:checked) {
  border-color: var(--primary);
}
.seg-opt:has(input:focus-visible) {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.reset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 12px;
}
.group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.group-head .avg {
  margin-left: auto;
}
.group-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
}
.rating {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
}
.rating .meter,
.rating .why {
  grid-column: 1 / -1;
}
.cost {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-foreground);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 5px;
  margin-left: 6px;
  white-space: nowrap;
}
.cost.off {
  border-style: dashed;
}
.meter {
  position: relative;
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--background);
  overflow: hidden;
}
.meter .band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--accent);
}
.meter .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.15s;
}

/* library */
.library {
  margin-top: 24px;
}
.lib-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 12px;
}
.lib-col {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}
.import-row {
  display: flex;
  gap: 8px;
}
.import-row .text-input {
  flex: 1;
  min-width: 0;
}
.saved-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.saved {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--card);
  border-radius: var(--radius);
}
.saved-id {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
#compare-table {
  overflow-x: auto;
}
table.cmp {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.cmp caption {
  text-align: left;
  color: var(--muted-foreground);
  padding-bottom: 6px;
}
table.cmp th,
table.cmp td {
  padding: 6px 4px;
  border-top: 1px solid var(--line);
  text-align: right;
}
table.cmp th[scope="row"] {
  text-align: left;
  font-weight: 500;
}
table.cmp td {
  font-family: var(--font-mono);
}
table.cmp .up {
  color: var(--primary-text);
}
table.cmp .down {
  color: var(--destructive);
}
.feedback-slot {
  margin-top: 24px;
}
.fb-form {
  display: grid;
  gap: 14px;
  max-width: 820px;
  margin-top: 8px;
}
.fb-grid {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.fb-grid .select {
  width: 100%;
}
.fb-text {
  min-height: 132px;
  resize: vertical;
  line-height: 1.45;
}
.fb-count {
  justify-self: end;
}
.fb-attach {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  min-width: 0;
}
.fb-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}
.fb-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
}
.fb-code {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}
.fb-status.good {
  color: var(--foreground);
}
.fb-pointer {
  margin-top: 16px;
}
.fb-link {
  color: var(--primary-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-block;
  padding-block: 10px;
}
.ed-foot {
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
@media (max-width: 600px) {
  .fb-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.foot {
  padding-block: 32px 48px;
}

/* toast, phone bar, sheet */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  background: var(--popover);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 10px 16px;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.phone-only {
  display: none;
}
.scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 45;
}
.scrim[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .lib-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .wiz-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 959px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .phone-only {
    display: inline-flex;
  }
  .phone-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: 1px solid var(--border);
  }
  #bar-status {
    font-size: 0.85rem;
  }
  body {
    padding-bottom: 72px;
  }
  .summary {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 50;
    max-height: 85vh;
    border-radius: 12px 12px 0 0;
    border-bottom: 0;
    transform: translateY(105%);
    visibility: hidden;
    transition:
      transform 0.25s ease,
      visibility 0s linear 0.25s;
    box-shadow: var(--shadow);
  }
  .summary.open {
    transform: none;
    visibility: visible;
    transition:
      transform 0.25s ease,
      visibility 0s;
  }
  .sheet-head {
    position: sticky;
    top: -16px;
    margin: -16px -16px 0;
    padding: 12px 16px;
    background: var(--panel);
    z-index: 2;
    border-bottom: 1px solid var(--line);
  }
  body.sheet-open {
    overflow: hidden;
  }
  .toast {
    bottom: 84px;
  }
  .body-controls {
    grid-template-columns: minmax(0, 1fr);
  }
  .body-fig {
    max-width: 320px;
  }
}
@media (max-width: 600px) {
  .wrap {
    padding-inline: 12px;
  }
  .panel {
    padding: 14px;
  }
  .intro-block {
    padding-block: 20px 14px;
  }
  .topbar-title {
    display: none;
  }
  .wiz-steps {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }
  .wiz-step {
    justify-content: center;
    padding: 4px;
  }
  .wiz-step .lbl {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .step-title {
    font-size: 2rem;
  }
  .seg {
    grid-template-columns: minmax(0, 1fr);
  }
  .wiz-nav .btn {
    flex: 1;
  }
  .toolbar .tabs {
    flex: 1;
  }
  .toolbar .tabs [role="tab"] {
    flex: 1;
    padding: 0 10px;
  }
  .readouts {
    grid-template-columns: minmax(0, 1fr);
  }
  .group {
    padding: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* site menu (matches the website's header) */
.brand img { height: 32px; width: auto; display: block; }
.brand .brand-on-light { display: none; }
:root[data-theme="light"] .brand .brand-on-dark { display: none; }
:root[data-theme="light"] .brand .brand-on-light { display: block; }
.topbar { position: relative; z-index: 120; }
.site-nav { display: flex; align-items: center; gap: 22px; margin-left: 24px; }
.site-nav a:not(.btn) {
  color: var(--muted-foreground);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { color: var(--primary-text); }
.play-link { text-decoration: none; display: inline-flex; align-items: center; }
.menu-toggle { display: none; }
.menu-bars, .menu-bars::before, .menu-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; position: relative; content: "";
}
.menu-bars::before { position: absolute; top: -6px; }
.menu-bars::after { position: absolute; top: 6px; }
@media (max-width: 1099px) {
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--background); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { min-height: 48px; font-size: 0.9rem; border-bottom: 1px solid var(--line); }
  .site-nav .play-link { margin-top: 12px; justify-content: center; min-height: 48px; }
}