/* Morse Code Translator. Functional layout before the design pass; existing tokens only.
   Unsupported characters and groups that aren't Morse are marked with an outline and a label, not
   color alone. The light is small and in --ink, never saturated red (spec §7, photosensitivity);
   off by default under prefers-reduced-motion (main.js). The boxes are 16px or more, so iOS doesn't
   zoom on focus, and three rows tall, so both fit at 360px with the keyboard open. */

.t-morse { padding-block: var(--s3) var(--s7); }
.t-morse__intro { margin-bottom: var(--s3); }
.t-morse__intro h1 { font-size: 24px; }
.t-morse__intro p { margin-top: var(--s1); max-width: 60ch; }

/* ---------- tool card ---------- */
.t-morse__tool { max-width: 760px; margin-inline: 0; display: grid; gap: var(--s4); padding: var(--s3); }
@media (min-width: 400px) { .t-morse__tool { padding: var(--s4); } }
.t-morse__tool:focus { outline: none; }

.t-morse__field { display: grid; gap: var(--s1); min-width: 0; }
.t-morse__label-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.t-morse__label { font-weight: 700; font-size: 15px; }
.t-morse__label-row .btn { min-height: 36px; font-size: 14px; }
.t-morse__box {
  width: 100%; min-height: 84px; padding: var(--s2) var(--s3); resize: vertical;
  font-size: 18px; line-height: 1.4;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 12px;
}
.t-morse__box:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.t-morse__box--code { font-size: 20px; font-weight: 700; letter-spacing: .08em; overflow-wrap: anywhere; }
.t-morse__help { font-size: 13px; }

/* notes under a box: what was converted, skipped or not understood */
.t-morse__notes { font-size: 14px; color: var(--ink-2); }
.t-morse__notes:empty { display: none; }
.t-morse__notes p + p { margin-top: 2px; }
.t-morse__mark {
  display: inline-block; margin: 0 2px; padding: 0 6px; border-radius: 4px;
  outline: 1px dashed var(--state-wrong); color: var(--ink); background: var(--surface-2);
  font-weight: 700; white-space: pre;
}

/* ---------- player ---------- */
.t-morse__player { display: flex; align-items: center; gap: var(--s3); min-height: 44px; flex-wrap: wrap; }
.t-morse__play { min-width: 96px; touch-action: manipulation; }
.t-morse__light {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 2px solid var(--line-strong); background: transparent;
}
.t-morse__light[data-on] { background: var(--ink); border-color: var(--ink); }
.t-morse__light[data-off] { visibility: hidden; }
.t-morse__hint { flex: 1 1 160px; font-size: 13px; }

/* ---------- settings ---------- */
.t-morse__settings {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s2) var(--s4);
  border: 0; margin: 0; padding: 0; min-width: 0;
}
.t-morse__range { display: grid; gap: 2px; font-size: 14px; }
.t-morse__range output { font-weight: 700; font-variant-numeric: tabular-nums; }
.t-morse__range input { width: 100%; min-height: 32px; accent-color: var(--ink); margin: 0; }
.t-morse__range[hidden] { display: none; }
.t-morse__toggle { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; font-size: 15px; }
.t-morse__toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.t-morse__toggle[hidden] { display: none; }

.t-morse__actions { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- about ---------- */
.t-morse__about { max-width: 760px; margin-top: var(--s6); }
.t-morse__about > h2 { margin-top: var(--s6); }
.t-morse__about > h3 { margin-top: var(--s4); }
.t-morse__about p, .t-morse__about ol, .t-morse__about ul { margin-top: var(--s2); }
.t-morse__about ol, .t-morse__about ul { padding-left: 1.4em; }
.t-morse__about li + li { margin-top: var(--s1); }
.t-morse__keys { margin-top: var(--s2); border-collapse: collapse; }
.t-morse__keys th, .t-morse__keys td { text-align: left; padding: var(--s1) var(--s3) var(--s1) 0; vertical-align: top; }
