/* Morse Trainer. Loads after m3-tokens.css and uses its semantic variables
   (--bg, --bg2, --text, --accent ...) so light and dark follow the M3 standard. */

:root {
  --radius: 12px;
  --radius-sm: 8px;
  --gap: clamp(14px, 2.4vw, 22px);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --btn-fill: var(--m3-deep-teal);
  --btn-ink: #ffffff;
  --lit: var(--m3-teal);
  --lit-glow: rgba(42, 161, 170, 0.45);
  --unlit: #c9d6d8;
  --ok: #1f7a4d;
  --ok-bg: #e5f4ec;
  --bad: #a3342a;
  --bad-bg: #fbeae7;
  --focus: var(--m3-deep-teal);
  /* The token file's --text3 measures 4.16:1 on --bg3 and 4.41:1 on cream; this passes on all of them. */
  --text3: #4f656a;
  --tap: 44px;     /* primary controls */
  /* Type roles, on a fixed rem scale. Glacial Indifference ships 400 and 700 only. */
  --fs-display: 1.75rem;   /* the thing being worked on: chart glyph, quiz answer box, score, sent text */
  --fs-title: 1.375rem;    /* page and lesson titles, glyphs in a message, pad labels */
  --fs-heading: 1.25rem;   /* card headings */
  --fs-body: 1.0625rem;    /* prose, inputs, tabs */
  --fs-control: 0.9375rem; /* buttons, segmented choices, chips, field labels, data strings */
  --fs-meta: 0.875rem;     /* hints, captions, help, footer */
  --tap-sm: 40px;  /* secondary controls; the audience includes kids */
}
[data-theme="dark"] {
  --btn-fill: #34b6c0;
  --btn-ink: #062227;
  --lit: #7fd6dd;
  --lit-glow: rgba(127, 214, 221, 0.5);
  --unlit: #2a5159;
  --ok: #7fd6a4;
  --ok-bg: #12382a;
  --bad: #f2a196;
  --bad-bg: #3d1f1c;
  --focus: #7fd6dd;
  /* The token file's dark --text3 #6a8e94 measures 4.07:1 on the dark page. */
  --text3: #8fb0b5;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Light text on a dark ground reads thinner: a touch more leading and tracking. */
[data-theme="dark"] body { line-height: 1.56; letter-spacing: 0.006em; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--m3-font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; }
p { margin: 0; }
code, .mono { font-family: var(--mono); }
code { font-size: 0.88em; background: var(--bg3); padding: 0.05em 0.35em; border-radius: 4px; }
kbd {
  font-family: var(--mono); font-size: 0.82em;
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  padding: 0 0.4em; background: var(--bg2);
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--info); color: #0a2e34; }
html { accent-color: var(--m3-teal); }
textarea, input { caret-color: var(--lit); }
.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;
}
.skip { position: absolute; left: 12px; top: -60px; background: var(--bg2); color: var(--accent); font-weight: 700; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; z-index: 10; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.icon { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ── Masthead ───────────────────────────────────────────────────── */
.masthead { background: var(--bg2); border-bottom: 1px solid var(--border2); }
.masthead__row { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; flex: none; min-height: var(--tap); padding-right: 16px; border-right: 1px solid var(--border2); }
/* A background image, so only the current theme's logo is downloaded (an <img> with display:none still is). */
.brand__logo { display: block; height: 38px; width: 106px; background: url("../img/m3-logo-black-114.webp") left center / contain no-repeat; }
[data-theme="dark"] .brand__logo { background-image: url("../img/m3-logo-white-114.webp"); }
@media (forced-colors: active) { .brand__logo { background: none; width: auto; } .brand__logo::after { content: "M3"; font-weight: 700; } }
.masthead__title { flex: 1; min-width: 0; }
.masthead__title h1 { font-size: var(--fs-title); letter-spacing: 0.01em; }
.masthead__sub { font-size: var(--fs-meta); color: var(--text3); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg2); display: grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--bg3); }
.icon-btn .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--sun { display: none; }
[data-theme="dark"] .icon--sun { display: block; }
[data-theme="dark"] .icon--moon { display: none; }
@media (max-width: 480px) {
  .brand__logo { height: 30px; width: 84px; }
  .brand { padding-right: 12px; }
  .masthead__row { gap: 12px; min-height: 60px; }
  .masthead__title h1 { font-size: var(--fs-heading); }
  .masthead__sub { font-size: var(--fs-meta); line-height: 1.3; }
}

.sound-note { margin-top: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bad-bg); color: var(--bad); font-size: var(--fs-control); }

/* ── Console (sound settings) ───────────────────────────────────── */
.console { padding: 16px 0 0; }
.console__box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.console__summary {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer;
  list-style: none; user-select: none; border-radius: var(--radius);
}
.console__summary::-webkit-details-marker { display: none; }
.console__readout { font-family: var(--mono); font-size: var(--fs-meta); color: var(--text2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console__hint { font-size: var(--fs-meta); color: var(--text3); display: flex; align-items: center; gap: 6px; }
.console__hint::after {
  content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform 0.15s;
}
.console__box[open] .console__hint::after { transform: rotate(-135deg) translateY(-2px); }
.console__grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 24px;
  padding: 4px 16px 18px; border-top: 1px solid var(--border2); padding-top: 16px;
}
@media (max-width: 860px) { .console__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .console__grid { grid-template-columns: 1fr; gap: 14px; } }

.lamp {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  background: var(--unlit); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: background-color 0.02s linear, box-shadow 0.02s linear;
}
.lamp.is-on { background: var(--lit); box-shadow: 0 0 0 4px var(--lit-glow), 0 0 14px var(--lit-glow); }
@media (prefers-reduced-motion: reduce) {
  .lamp, .pill, .pad, .btn, .switch__track, .switch__track::after, .progress span { transition: none; }
  .lamp.is-on { box-shadow: none; }
}

.ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ctl__label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: var(--fs-control); color: var(--text2); }
.ctl__label output { font-family: var(--mono); font-size: var(--fs-control); color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.ctl__help { font-size: var(--fs-meta); color: var(--text3); line-height: 1.4; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: var(--tap-sm); background: transparent; cursor: pointer; margin: 0; border-radius: 999px;
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--lit) var(--fill, 50%), var(--bg4) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--bg4); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--lit); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; margin-top: -7px;
  background: var(--bg2); border: 2px solid var(--accent); box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--bg2); border: 2px solid var(--accent); }
input[type="range"]:focus-visible { outline-offset: 0; }

/* ── Tabs ───────────────────────────────────────────────────────── */
.tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-top: 14px; }
.tabs__list {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }
.tabs__list [role="tab"] {
  flex: 1 0 auto; background: none; border: 0; cursor: pointer; padding: 12px 14px 11px;
  color: var(--text3); font-size: var(--fs-body); min-height: var(--tap);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tabs__list [role="tab"]:hover { color: var(--text); background: var(--bg3); }
.tabs__list [role="tab"][aria-selected="true"] { color: var(--text); font-weight: 700; box-shadow: inset 0 -3px 0 var(--lit); }
.tabs__list [role="tab"]:focus-visible { outline-offset: -2px; }
@media (min-width: 720px) { .tabs__list [role="tab"] { flex: 0 0 auto; padding: 12px 20px 11px; } }
@media (max-width: 400px) { .tabs__list [role="tab"] { padding: 12px 8px 11px; font-size: var(--fs-control); } }

/* ── Panels and cards ───────────────────────────────────────────── */
main { padding-top: calc(var(--gap) + 4px); padding-bottom: 48px; }
.panel { display: flex; flex-direction: column; gap: var(--gap); }
.panel[hidden] { display: none; }
.panel__intro { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.panel__intro > p { color: var(--text2); max-width: 66ch; }

.card {
  background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.card.card--feature { background: var(--bg-feature); border-color: var(--border); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card__head h2 { font-size: var(--fs-heading); }
.card__tools { display: flex; gap: 8px; }

.field-label { font-size: var(--fs-control); color: var(--text2); font-weight: 700; }
.hint { font-size: var(--fs-meta); color: var(--text3); max-width: 66ch; }
.note { font-size: var(--fs-meta); color: var(--bad); }
@media (pointer: coarse) { .kbd-hint { display: none; } }

textarea, input[type="text"], select {
  width: 100%; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; line-height: 1.45; resize: vertical;
}
.card--feature textarea { font-size: var(--fs-title); }
textarea:focus-visible, input[type="text"]:focus-visible, select:focus-visible { border-color: var(--accent2); outline-offset: 0; }
textarea::placeholder, input::placeholder { color: var(--text3); opacity: 0.8; }

/* ── Buttons and controls ───────────────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg2); color: var(--text); font-weight: 700; font-size: var(--fs-control);
  transition: background-color 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover:not(:disabled) { background: var(--bg3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary:disabled { background: var(--bg4); border-color: var(--bg4); color: var(--text2); opacity: 1; }
.btn--primary { background: var(--btn-fill); border-color: var(--btn-fill); color: var(--btn-ink); }
.btn--primary:hover:not(:disabled) { background: var(--btn-fill); filter: brightness(1.12); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--accent); }
.btn--quiet:hover:not(:disabled) { background: var(--bg3); }
.btn--sm { min-height: var(--tap-sm); padding: 0 14px; font-size: var(--fs-control); }
.card--feature .btn--quiet:hover:not(:disabled) { background: rgba(20, 83, 94, 0.07); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: var(--tap); padding: 0 6px; font-size: var(--fs-control); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { width: 40px; height: 24px; border-radius: 12px; background: var(--bg4); position: relative; transition: background-color 0.15s; flex: none; border: 1px solid var(--border); }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg2); box-shadow: var(--shadow-sm); transition: transform 0.15s; }
.switch input:checked + .switch__track { background: var(--lit); border-color: var(--lit); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg3); border-radius: 999px; border: 1px solid var(--border2); }
.seg--wrap { flex-wrap: wrap; border-radius: 22px; }
.seg button {
  border: 0; background: transparent; border-radius: 999px; padding: 0 16px; min-height: var(--tap-sm); cursor: pointer;
  color: var(--text2); font-size: var(--fs-control); white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--bg2); color: var(--text); font-weight: 700; box-shadow: var(--shadow-sm); }

.select select { width: auto; min-height: var(--tap); padding: 8px 36px 8px 14px; -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 18px center, right 13px center; background-size: 5px 5px; background-repeat: no-repeat; }

/* ── Morse glyphs: a dot is a circle, a dash a bar three times as long ── */
.pills { display: inline-flex; align-items: center; gap: 4px; }
.pill { height: 8px; width: 8px; border-radius: 4px; background: var(--unlit); transition: background-color 0.03s; }
.pill--dah { width: 24px; }
.pill.is-on { background: var(--lit); }
.pill.is-done { background: var(--text2); }

.glyphs { display: flex; flex-wrap: wrap; gap: 14px 28px; min-height: 64px; align-items: flex-start; }
.glyphs__empty { color: var(--text3); }
.word { display: flex; flex-wrap: wrap; gap: 6px 4px; }
.cell {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 34px;
  padding: 6px 6px 8px; border-radius: var(--radius-sm); transition: background-color 0.08s;
}
.cell__ch { font-size: var(--fs-title); font-weight: 700; line-height: 1; }
.cell.is-current { background: var(--info); }
[data-theme="dark"] .cell.is-current { background: var(--bg4); }
.cell--unknown .cell__ch { color: var(--text3); text-decoration: line-through; }
.cell--unknown { outline: 1px dashed var(--border); }
.cell--prosign .cell__ch { text-decoration: overline; font-size: var(--fs-body); }
.morse-row { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--border2); }
.morse-row__label { font-size: var(--fs-meta); color: var(--text3); }
.morse-text { font-family: var(--mono); font-size: var(--fs-control); color: var(--text2); word-break: break-word; line-height: 1.7; }
.decoded { font-size: var(--fs-title); font-weight: 700; min-height: 1.5em; word-break: break-word; }
.decoded .bad { color: var(--bad); font-family: var(--mono); font-size: var(--fs-control); font-weight: 400; }

/* ── Chart ──────────────────────────────────────────────────────── */
.chart-group + .chart-group { margin-top: var(--gap); }
.chart-group h2 { font-size: var(--fs-control); color: var(--text2); margin-bottom: 10px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.key {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 12px 12px 10px; min-height: 92px; text-align: left; cursor: pointer;
  background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-sm);
  transition: border-color 0.1s, background-color 0.1s;
}
.key:hover { border-color: var(--border); background: var(--bg3); }
.key.is-current { border-color: var(--lit); background: var(--info); }
[data-theme="dark"] .key.is-current { background: var(--bg4); }
.key__ch { font-size: var(--fs-display); font-weight: 700; line-height: 1; }
.key .pills { flex-wrap: wrap; row-gap: 5px; max-width: 100%; }
.key__code { font-family: var(--mono); font-size: var(--fs-meta); color: var(--text3); margin-top: auto; }
.key__n { position: absolute; top: 9px; right: 10px; font-size: var(--fs-meta); color: var(--text3); font-family: var(--mono); }
.key__note { font-size: var(--fs-meta); color: var(--text3); line-height: 1.3; }
.key--prosign .key__ch { text-decoration: overline; font-size: var(--fs-title); }
@media (max-width: 480px) { .chart-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); } .key { min-height: 84px; padding: 10px; } }

/* ── Quiz ───────────────────────────────────────────────────────── */
.quiz { align-items: center; text-align: center; gap: 16px; padding-top: 28px; padding-bottom: 28px; }
.play-orb {
  width: 88px; height: 88px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--btn-fill); color: var(--btn-ink); display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(20, 83, 94, 0.25); transition: transform 0.08s, filter 0.12s;
}
.play-orb .icon { width: 34px; height: 34px; margin-left: 4px; }
.play-orb:hover { filter: brightness(1.1); }
.play-orb:active { transform: scale(0.97); }
.play-orb.is-on { background: var(--lit); color: #062227; }
.quiz__form { display: flex; gap: 10px; width: 100%; max-width: 420px; }
.quiz__input { text-align: center; font-size: var(--fs-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; min-height: 56px; }
.quiz__input:disabled { background: var(--bg3); }
.quiz__form .btn { min-height: 56px; }
.quiz__hint { font-size: var(--fs-meta); color: var(--text3); }
.quiz__feedback { min-height: 64px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.verdict { font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: var(--fs-body); }
.verdict--ok { color: var(--ok); background: var(--ok-bg); }
.verdict--bad { color: var(--bad); background: var(--bad-bg); }
.answer { display: flex; align-items: center; gap: 12px; font-size: var(--fs-title); font-weight: 700; }

.tally { display: flex; justify-content: center; gap: 8px 28px; flex-wrap: wrap; margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--border2); width: 100%; }
.tally div { display: flex; align-items: baseline; gap: 8px; }
.tally dt { font-size: var(--fs-meta); color: var(--text3); }
.tally dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; min-height: var(--tap-sm);
  border-radius: 999px; background: var(--bg3); border: 1px solid var(--border2); font-size: var(--fs-control); cursor: pointer;
}
.chip b { font-size: var(--fs-body); }
.chip small { color: var(--text3); font-family: var(--mono); }
.chip:hover { border-color: var(--border); }
.chips__empty { color: var(--text3); font-size: var(--fs-meta); }

/* ── Lessons ────────────────────────────────────────────────────── */
.lesson__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lesson__head h2 { font-size: var(--fs-title); }
.chips--keys .chip { min-width: var(--tap); min-height: var(--tap); justify-content: center; font-weight: 700; font-size: var(--fs-body); }
.chips--keys .chip.is-new { background: var(--bg-feature); border-color: var(--m3-teal); }
[data-theme="dark"] .chips--keys .chip.is-new { border-color: var(--lit); }
.chips--keys .chip.is-current { background: var(--info); }
[data-theme="dark"] .chips--keys .chip.is-current { background: var(--bg4); }
.lesson__run { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.progress { height: 6px; border-radius: 3px; background: var(--bg4); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--lit); transition: width 0.25s linear; }
.copybox { font-size: var(--fs-title); letter-spacing: 0.08em; text-transform: uppercase; }
.result:empty { display: none; }
.result { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius-sm); background: var(--bg3); }
.result__score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.result__pct { font-size: var(--fs-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.compare { display: flex; flex-wrap: wrap; gap: 8px 14px; font-family: var(--mono); font-size: var(--fs-control); }
.compare__g { display: flex; flex-direction: column; gap: 2px; }
.compare__sent { color: var(--text3); }
.compare__miss { color: var(--bad); text-decoration: underline; text-underline-offset: 3px; }
.history { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.history li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg3); font-size: var(--fs-control); }
.history .is-pass { color: var(--ok); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.history .is-pass .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.history__empty { color: var(--text3); font-size: var(--fs-meta); grid-column: 1 / -1; background: none !important; padding: 0 !important; }

/* ── Keyer ──────────────────────────────────────────────────────── */
.keyer { align-items: stretch; gap: 16px; }
.keyer__pattern { min-height: 28px; display: flex; justify-content: center; align-items: center; }
.keyer__pattern .pill { height: 12px; width: 12px; border-radius: 6px; background: var(--text2); }
.keyer__pattern .pill--dah { width: 36px; }
.keyer__pads { display: flex; justify-content: center; }
.keyer__pads[hidden] { display: none; }
.keyer__pads--two { gap: 14px; }
.keyer__pads--two .pad { flex: 1; max-width: 260px; }
.pad {
  width: 100%; max-width: 520px; min-height: 180px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: background-color 0.03s, transform 0.03s;
}
.pad__label { font-size: var(--fs-title); font-weight: 700; }
.pad__hint { font-size: var(--fs-meta); color: var(--text3); }
.pad.is-down { background: var(--lit); border-color: var(--lit); color: #062227; transform: scale(0.995); }
.pad.is-down kbd { background: transparent; border-color: currentColor; color: inherit; }
.pad.is-down .pad__hint { color: #062227; }
.keyer__speed { text-align: center; font-size: var(--fs-meta); color: var(--text3); font-variant-numeric: tabular-nums; min-height: 1.3em; }
.sent { font-size: var(--fs-display); font-weight: 700; letter-spacing: 0.04em; word-break: break-word; min-height: 1.5em; }
.sent .bad { color: var(--bad); font-family: var(--mono); font-size: var(--fs-control); font-weight: 400; letter-spacing: 0; }
.sent__empty { color: var(--text3); font-weight: 400; font-size: var(--fs-body); letter-spacing: 0; }
.sent .caret { display: inline-block; width: 2px; height: 1.1em; background: var(--lit); vertical-align: -0.15em; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sent .caret { animation: none; } }

/* ── Footer ─────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border2); padding: 20px 0 28px; color: var(--text3); font-size: var(--fs-meta); }
.footer__row { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
