/* SoundDelay.com
   Layout: header bar, short hero, a "how do you find the beat" chooser (two big tabs),
   then a two-column tool (controls and tables on the left, answer and sticky field map on the right)
   that stacks on phones. One-way uses the orange accent, round trip uses teal, so the color
   itself tells you which delay you are looking at. */

:root {
  --bg: #f1f5f0;
  --surface: #ffffff;
  --surface-2: #e7eee6;
  --ink: #13211a;
  --ink-2: #485a4f;
  --line: #cdd9cd;
  --focus: #1b6fd1;
  --turf: #2f6b3f;
  --turf-end: #265a34;
  --chalk: #ffffff;
  --map-label: #485a4f;
  --halo: #1d4a29;

  --c-one: #cf4a0e;
  --c-one-ink: #ffffff;
  --c-one-soft: #fbe6da;
  --c-round: #0e7490;
  --c-round-ink: #ffffff;
  --c-round-soft: #d6eef3;

  --c-dm: #f2b705;
  --c-dm-ink: #241a00;
  --c-dm-soft: #fdf0bd;
  --c-dm-text: #805b00;

  --accent: var(--c-one);
  --accent-ink: var(--c-one-ink);
  --accent-soft: var(--c-one-soft);
  --accent-text: var(--c-one);

  --font-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1612;
    --surface: #16221b;
    --surface-2: #1f2e25;
    --ink: #e9f1ea;
    --ink-2: #a2b5a8;
    --line: #2d4033;
    --focus: #6fb0ff;
    --turf: #25583a;
    --turf-end: #1d4a2f;
    --map-label: #a2b5a8;
    --halo: #0f2a19;
    --c-one: #ff8f55;
    --c-one-ink: #1a0d05;
    --c-one-soft: #3a2415;
    --c-round: #5ec8e0;
    --c-round-ink: #06222a;
    --c-round-soft: #123740;
    --c-dm: #ffd23f;
    --c-dm-ink: #241a00;
    --c-dm-soft: #3a3110;
    --c-dm-text: #ffd23f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1612;
  --surface: #16221b;
  --surface-2: #1f2e25;
  --ink: #e9f1ea;
  --ink-2: #a2b5a8;
  --line: #2d4033;
  --focus: #6fb0ff;
  --turf: #25583a;
  --turf-end: #1d4a2f;
  --map-label: #a2b5a8;
  --halo: #0f2a19;
  --c-one: #ff8f55;
  --c-one-ink: #1a0d05;
  --c-one-soft: #3a2415;
  --c-round: #5ec8e0;
  --c-round-ink: #06222a;
  --c-round-soft: #123740;
  --c-dm: #ffd23f;
  --c-dm-ink: #241a00;
  --c-dm-soft: #3a3110;
  --c-dm-text: #ffd23f;
  color-scheme: dark;
}

/* The page accent follows the chosen mode: orange one-way, teal round trip, yellow Drum Major Mode.
   --accent-text is the version safe to use for text on the page background. */
:root[data-trip="round"] {
  --accent: var(--c-round);
  --accent-ink: var(--c-round-ink);
  --accent-soft: var(--c-round-soft);
  --accent-text: var(--c-round);
}
:root[data-trip="dm"] {
  --accent: var(--c-dm);
  --accent-ink: var(--c-dm-ink);
  --accent-soft: var(--c-dm-soft);
  --accent-text: var(--c-dm-text);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Make the hidden attribute win over any display rule below */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  text-wrap: balance;
  margin: 0;
}

/* Header and logo */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { display: block; flex: none; }
.brand-mark .logo-bg { fill: var(--turf); }
.brand-mark .logo-waves { fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; }
.brand-mark .logo-dot { fill: #ffffff; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.01em; }
.brand-dot { color: var(--ink-2); font-weight: 500; }
.header-link { font-size: 0.9rem; color: var(--ink-2); }

/* Hero */
.hero { padding-block: 44px 28px; }
.hero h1 { font-weight: 700; font-size: clamp(2.1rem, 5.5vw, 3.4rem); letter-spacing: 0.005em; }
.hero-lede { max-width: 58ch; margin: 16px 0 0; color: var(--ink-2); font-size: 1.05rem; }

/* Chooser tabs */
.tool { padding-bottom: 40px; }
.chooser-title { font-weight: 700; font-size: 1.6rem; margin-bottom: 16px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tab {
  appearance: none; cursor: pointer; text-align: left;
  background: var(--surface-2); color: var(--ink);
  border: 2px solid transparent; border-radius: var(--radius);
  padding: 18px 20px; font: inherit;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.tab:hover { border-color: var(--line); }
.tab-title { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.1; }
.tab-sub { font-size: 0.88rem; color: var(--ink-2); }
.tab-badge, .pill {
  display: inline-block; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 99px; padding: 2px 10px;
}
.tab-one .tab-badge, .pill-one { background: var(--c-one-soft); color: var(--c-one); }
.tab-round .tab-badge, .pill-round { background: var(--c-round-soft); color: var(--c-round); }
.tab-one[aria-selected="true"] { background: var(--surface); border-color: var(--c-one); }
.tab-round[aria-selected="true"] { background: var(--surface); border-color: var(--c-round); }
.tab-one[aria-selected="true"] .tab-badge { background: var(--c-one); color: var(--c-one-ink); }
.tab-round[aria-selected="true"] .tab-badge { background: var(--c-round); color: var(--c-round-ink); }
.tabs.is-locked .tab-round { opacity: 0.6; }
.tabs.is-locked .tab-round:hover { opacity: 1; }
.chooser-help { margin: 14px 0 28px; }
.linklike {
  appearance: none; background: none; border: 0; padding: 0; font: inherit; font-size: 0.95rem;
  color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.linklike:hover { color: var(--accent-text); }

/* Banner and direction switch */
.banner {
  background: var(--accent-soft); border-left: 5px solid var(--accent);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; font-size: 0.95rem;
}
.banner strong { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.direction { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-bottom: 28px; }
.direction .label-like { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.dir-seg { flex: 1 1 480px; max-width: 760px; }
#dirDm + label { background: var(--c-dm-soft); font-weight: 600; }
.segmented #dirDm:checked + label { background: var(--c-dm); color: var(--c-dm-ink); box-shadow: 0 0 0 1.5px var(--c-dm-text) inset; }

/* Grid */
.tool-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: start; }
.col-controls { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.col-map { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (min-width: 861px) and (min-height: 880px) { .col-map { position: sticky; top: 16px; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  margin: 0;
  box-shadow: 0 1px 2px rgba(19, 33, 26, 0.04), 0 6px 18px rgba(19, 33, 26, 0.04);
  min-width: 0;
}
.card-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.4rem;
  padding: 0; margin: 0 0 18px;
}
.card.details > div > .card-title { margin-bottom: 8px; }
.step-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-size: 0.95rem; font-weight: 700; flex: none;
}
.optional { font-family: var(--font-body); font-size: 0.75rem; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }

details.temp { padding: 0; }
details.temp summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 14px 18px; cursor: pointer; list-style: none; min-height: 48px; }
details.temp summary::-webkit-details-marker { display: none; }
details.temp summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
details.temp[open] summary::before { transform: rotate(45deg); }
.temp-title { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.temp-now { margin-left: auto; font-size: 0.85rem; color: var(--ink-2); }
.temp-body { padding: 14px 18px 16px; border-top: 1px solid var(--line); }

/* Form controls */
.field-group { display: flex; flex-direction: column; gap: 14px; padding-block: 20px; border-top: 1px solid var(--line); }
.field-group:first-of-type { border-top: 0; padding-top: 0; }
.group-label { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label, .label-like { font-size: 0.88rem; font-weight: 500; }

input[type="number"], select {
  width: 100%; min-height: 44px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px;
}
select { appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
input[type="number"]:hover, select:hover { border-color: var(--ink-2); }

.segmented { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: grid; place-items: center; min-height: 38px; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 0.92rem; text-align: center; }
.segmented input:checked + label { background: var(--surface); box-shadow: 0 0 0 1.5px var(--accent) inset; font-weight: 600; }
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 1px; }
.segmented.wide { margin-bottom: 10px; }
.temp-row { margin-bottom: 8px; }

.help { margin: 0; font-size: 0.85rem; color: var(--ink-2); max-width: 60ch; }
.tip { margin: 12px 0 0; font-size: 0.9rem; background: var(--accent-soft); border-radius: var(--radius-sm); padding: 8px 12px; }

/* Results */
.result-label { font-size: 0.9rem; color: var(--ink-2); margin-bottom: 4px; }
.headline { display: flex; align-items: baseline; gap: 10px; }
.headline .num { font-family: var(--font-display); font-weight: 700; font-size: clamp(3.4rem, 9vw, 5rem); line-height: 0.95; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.headline .unit { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.lede { margin: 12px 0 18px; max-width: 60ch; font-size: 0.95rem; color: var(--ink-2); }
.use { margin: 0 0 20px; max-width: 60ch; padding: 10px 12px; background: var(--accent-soft); border-left: 5px solid var(--accent); border-radius: var(--radius-sm); font-size: 0.98rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 0; }
.facts > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.facts dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.sub-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); margin: 16px 0 8px; }

table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); font-weight: 600; }
table.data td.num-col { text-align: right; white-space: nowrap; }
table.data th.num-col { text-align: right; white-space: nowrap; }
#revTable td:first-child, #revTable th:first-child { white-space: nowrap; }
table.data tr.primary td { background: var(--accent-soft); font-weight: 600; }
table.data caption { text-align: left; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; padding: 0 0 6px; color: var(--ink-2); }
.table-scroll { overflow-x: auto; max-width: 100%; }
.check { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.check-out { margin: 10px 0 0; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 0.95rem; }
.warn { color: var(--accent-text); font-weight: 600; }

/* Map */
.map-card { padding: 20px; }
.map-title { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; margin-bottom: 14px; }
.map-wrap { border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
#fieldMap { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
#fieldMap .turf { fill: var(--turf); }
#fieldMap .endzone { fill: var(--turf-end); }
#fieldMap .yl { stroke: var(--chalk); stroke-opacity: 0.55; stroke-width: 0.6; }
#fieldMap .yl.major { stroke-opacity: 0.85; stroke-width: 1; }
#fieldMap .hash { stroke: var(--chalk); stroke-opacity: 0.55; stroke-width: 0.5; }
#fieldMap .num { fill: var(--chalk); fill-opacity: 0.45; font-family: var(--font-display); font-weight: 700; font-size: 13px; text-anchor: middle; }
#fieldMap .zonelabel { fill: var(--chalk); fill-opacity: 0.5; font-family: var(--font-display); font-weight: 600; font-size: 8px; letter-spacing: 0.18em; text-anchor: middle; }
#fieldMap .axis { fill: var(--map-label); font-family: var(--font-display); font-weight: 600; font-size: 8px; letter-spacing: 0.16em; text-anchor: middle; }
#fieldMap .zone { fill: var(--accent); fill-opacity: 0.18; }
#fieldMap .arc { fill: none; stroke: var(--accent); stroke-width: 2.6; }
#fieldMap .ring { fill: none; stroke: var(--chalk); stroke-opacity: 0.5; stroke-width: 0.6; stroke-dasharray: 3 3; }
#fieldMap .ringlabel { fill: var(--chalk); font-family: var(--font-display); font-weight: 600; font-size: 8px; text-anchor: middle; paint-order: stroke; stroke: var(--halo); stroke-width: 2.4px; stroke-linejoin: round; }
#fieldMap .path { stroke: var(--chalk); stroke-width: 1.2; stroke-dasharray: 4 3; stroke-opacity: 0.9; }
#fieldMap .target { fill: var(--chalk); stroke: var(--halo); stroke-width: 1.5; }
#fieldMap .dot { fill: var(--accent); stroke: var(--chalk); stroke-width: 2; }
#fieldMap .dotlabel { fill: var(--chalk); font-family: var(--font-display); font-weight: 700; font-size: 10px; paint-order: stroke; stroke: var(--halo); stroke-width: 3px; stroke-linejoin: round; }
#fieldMap .cross { fill: var(--accent); stroke: var(--chalk); stroke-width: 1.2; }
#fieldMap .marker { cursor: grab; touch-action: none; }
#fieldMap .marker:active { cursor: grabbing; }
#fieldMap .marker:focus-visible { outline: none; }
#fieldMap .marker:focus-visible .dot { stroke: var(--focus); stroke-width: 3; }
#fieldMap.is-forward { cursor: crosshair; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; margin: 16px 0 0; padding: 0; font-size: 0.82rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; }
.sw-target { background: #fff; border: 2px solid #1d4a29; }
.sw-pos { background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.sw-arc { width: 20px; height: 4px; border-radius: 2px; background: var(--accent); }
.sw-zone { border-radius: 3px; background: var(--accent); opacity: 0.3; }
.map-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.check-inline input { width: 18px; height: 18px; accent-color: var(--accent); }
.btn {
  appearance: none; cursor: pointer; font: inherit; font-weight: 600; font-size: 0.92rem;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius-sm);
  min-height: 40px; padding: 8px 14px;
}
.btn:hover { filter: brightness(1.07); }
.btn-one { background: var(--c-one); color: var(--c-one-ink); }
.btn-round { background: var(--c-round); color: var(--c-round-ink); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
#copyMsg:empty { display: none; }

/* Unit toggle under the map */
.unit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 20px; }
.unit-seg { flex: 0 1 260px; }
.unit-help { margin-top: 6px; }

/* Audio demo and assumptions */
.audio { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 22px; }
.btn-audio { min-height: 44px; }
.audio-msg { font-size: 0.88rem; color: var(--ink-2); flex: 1 1 220px; }
.audio-msg:empty { display: none; }
.assume { margin: 16px 0 0; font-size: 0.85rem; color: var(--ink-2); }
.assume .linklike { font-size: 0.85rem; }

/* Drum Major Mode */
.slider-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; }
.slider-row input[type="range"] { flex: 1 1 auto; min-width: 0; height: 36px; accent-color: var(--c-dm); cursor: pointer; }
.step-btn { appearance: none; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.step-btn:hover { border-color: var(--ink-2); }
.dm-answer { padding: 16px 18px; background: var(--c-dm-soft); border-left: 5px solid var(--c-dm); border-radius: var(--radius-sm); margin-bottom: 16px; }
.dm-kicker { display: block; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.dm-say { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.7rem, 4.5vw, 2.3rem); line-height: 1.1; margin: 2px 0 6px; text-wrap: balance; }
.dm-qual { display: block; font-size: 0.92rem; color: var(--ink-2); }
.notice { margin: 0 0 14px; max-width: 60ch; padding: 10px 12px; background: var(--surface-2); border-left: 5px solid var(--ink-2); border-radius: var(--radius-sm); font-size: 0.95rem; }
#copyMsg { margin-top: 8px; }

/* Guide popup */
dialog#guide {
  border: 1px solid var(--line); border-radius: 14px; padding: 0;
  background: var(--surface); color: var(--ink);
  width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto;
}
dialog#guide::backdrop { background: rgba(6, 14, 9, 0.65); }
.guide-inner { padding: 22px; }
.guide-inner h2 { font-weight: 700; font-size: 2rem; margin-bottom: 10px; }
.guide-quick { margin: 0 0 16px; padding: 10px 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.guide-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.guide-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; }
.guide-one { border-color: var(--c-one); }
.guide-round { border-color: var(--c-round); }
.guide-card.is-current { box-shadow: 0 0 0 3px var(--accent-soft); }
.guide-card h3 { font-weight: 700; font-size: 1.5rem; margin: 8px 0; }
.guide-card p { margin: 0 0 8px; font-size: 0.93rem; }
.guide-card ul { margin: 0 0 10px; padding-left: 1.1rem; font-size: 0.93rem; }
.guide-result { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.guide-note { margin: 14px 0; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Content */
.content { padding-block: 24px 56px; border-top: 1px solid var(--line); }
.prose { max-width: 760px; }
.prose h2 { font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.2rem); margin: 40px 0 12px; }
.prose h2:first-child { margin-top: 16px; }
.prose p { margin: 0 0 14px; max-width: 68ch; }
.steps { padding-left: 1.2rem; margin: 0 0 14px; display: grid; gap: 8px; max-width: 68ch; }
.which-table { margin-bottom: 16px; min-width: 520px; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 12px; }
table.compact th, table.compact td { padding: 6px 8px; }
.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.faq details p { margin-bottom: 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 24px; }
.footer-inner p { margin: 0 0 6px; }
.footer-inner .small { font-size: 0.82rem; color: var(--ink-2); }

/* Phone and tablet */
@media (max-width: 860px) {
  /* One column. Order on a phone: position, temperature, answer, map, detail tables. */
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .col-controls, .col-map { display: contents; }
  .tool-grid { gap: 20px; }
  .card.controls { order: 1; }
  details.temp { order: 2; }
  .card.results { order: 3; }
  .map-card { order: 4; }
  .card.details { order: 5; }
}
@media (max-width: 640px) {
  .tabs { grid-template-columns: 1fr; }
  .dir-seg { grid-auto-flow: row; }
  .guide-cards { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .card { padding: 20px; }
  .tool-grid { gap: 20px; }
  .hero { padding-block: 32px 20px; }
  .guide-inner { padding: 16px; }
  .tab-title { font-size: 1.3rem; }
}

/* Reverse table: center the step numbers */
#revTable th.num-col, #revTable td.num-col { text-align: center; }

/* Header nav */
.header-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }

/* Alert (Drum Major Mode note to the band) */
.alert { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; padding: 14px 16px; background: var(--c-dm-soft); border: 2px solid var(--c-dm); border-radius: var(--radius-sm); }
.alert p { margin: 0; font-size: 0.97rem; }
.alert-icon { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c-dm); color: var(--c-dm-ink); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }

/* About page */
.about-hero { padding-block: 32px 8px; }
.about-hero h1 { font-weight: 700; font-size: clamp(2.1rem, 5.5vw, 3.2rem); }
.about-main { padding-bottom: 56px; }
.keyfacts { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c-one); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0 8px; max-width: 760px; }
.keyfacts h2 { font-size: 1.4rem !important; margin: 0 0 8px !important; }
.keyfacts ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 4px; }
.toc { max-width: 760px; margin: 16px 0 0; padding: 14px 18px; background: var(--surface-2); border-radius: var(--radius); }
.toc strong { font-family: var(--font-display); font-size: 1.15rem; }
.toc ol { margin: 6px 0 0; padding-left: 1.2rem; columns: 2 260px; column-gap: 28px; }
.toc a { text-underline-offset: 3px; }
.prose h3 { font-weight: 700; font-size: 1.35rem; margin: 22px 0 8px; }
.prose ul { margin: 0 0 14px; padding-left: 1.2rem; max-width: 68ch; display: grid; gap: 6px; }
.prose dl.glossary { margin: 0 0 14px; max-width: 68ch; }
.prose dl.glossary dt { font-weight: 600; margin-top: 10px; }
.prose dl.glossary dd { margin: 2px 0 0; color: var(--ink-2); }
.prose .formula { display: block; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92rem; overflow-x: auto; max-width: 68ch; }
.cta { display: inline-block; margin: 6px 0 14px; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--c-one); color: var(--c-one-ink); font-weight: 600; text-decoration: none; }
.cta:hover { filter: brightness(1.07); color: var(--c-one-ink); }

/* Quieter look: collapsible extras */
details.fold { }
details.fold > summary, details.fold-mini > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
details.fold > summary::-webkit-details-marker, details.fold-mini > summary::-webkit-details-marker { display: none; }
details.fold > summary::before, details.fold-mini > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(-45deg); transition: transform .15s; flex: none; }
details.fold[open] > summary::before, details.fold-mini[open] > summary::before { transform: rotate(45deg); }
.fold-body { padding-top: 12px; }
.card.details { padding-block: 12px; }
details.fold-mini { margin-top: 12px; }
details.fold-mini > summary { font-family: var(--font-body); font-weight: 500; font-size: 0.92rem; color: var(--ink-2); min-height: 40px; }
details.fold-mini .check-inline { margin-top: 4px; }
.soft { color: var(--ink-2); }
.use .soft { font-size: 0.9rem; }

/* Drum Major Mode lock + paywall */
.lock-ic { display: none; vertical-align: -2px; margin-left: 4px; }
:root[data-dm="off"] .lock-ic { display: inline-block; }
.lock-sr { display: none; }
:root[data-dm="off"] .lock-sr { display: inline; }
:root[data-dm="off"] #dirDm + label { opacity: 0.92; }
.pill-dm { background: var(--c-dm-soft); color: var(--c-dm-text); }
.btn-dm { background: var(--c-dm); color: var(--c-dm-ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; }
a.btn-dm:hover { color: var(--c-dm-ink); }
dialog#pay { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
dialog#pay::backdrop { background: rgba(6, 14, 9, 0.65); }
.pay-inner { padding: 28px; }
.pay-inner h2 { font-weight: 700; font-size: 2rem; margin: 10px 0 12px; }
.pay-inner p { margin: 0 0 14px; }
.pay-support { background: var(--c-dm-soft); border-left: 5px solid var(--c-dm); border-radius: var(--radius-sm); padding: 12px 14px; }
.pay-list { margin: 0 0 20px; padding-left: 1.2rem; display: grid; gap: 8px; }
.pay-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.pay-code { border-top: 1px solid var(--line); padding-top: 18px; }
.pay-code-row { display: flex; gap: 10px; margin-top: 6px; }
.pay-code-row input { flex: 1 1 auto; min-width: 0; min-height: 44px; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
#payMsg:empty { display: none; }
#payMsg { margin-top: 8px; }
@media (max-width: 520px) { .pay-inner { padding: 20px; } }
.segmented #dirDm + label { display: flex; align-items: center; justify-content: center; gap: 6px; }
.lock-ic { margin-left: 0; }
