:root {
  --page: #f4f7f8;
  --surface: #ffffff;
  --surface-soft: #e6ecef;
  --text: #324044;
  --text-strong: #162326;
  --muted: #5d6b70;
  --line: #d6e0e4;
  --line-strong: #bdcbd1;
  --accent: #0b7a75;
  --accent-dark: #075955;
  --accent-soft: #e1f1f0;
  --radius: 8px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - var(--container)) / 2));
  border-bottom: 1px solid var(--line-strong);
  background: #fbfcfd;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-strong);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  position: relative;
  flex: 0 0 34px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: transparent;
  font-size: 0;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  background: #ffffff;
  transform: translateY(-50%);
}

.brand-mark::before {
  left: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.brand-mark::after {
  right: 6px;
  width: 13px;
  height: 7px;
  border-radius: 999px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.nav-links a:hover {
  color: var(--accent);
}

.hero-workspace {
  padding: 38px 20px 44px;
  border-bottom: 1px solid var(--line);
}

.signal-backdrop {
  display: none;
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
}

.hero-copy {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 22px;
  text-align: left;
}

.eyebrow {
  display: none;
}

h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: 0;
}

.hero-lede {
  margin: 0;
  max-width: 430px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
  font-weight: 500;
}

.translator-shell {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(59, 48, 32, 0.07);
  overflow: hidden;
}

.translator-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #fbfcfd;
}

.workspace-label {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 800;
}

.workspace-status {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.example-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.example-row button,
.panel-actions button,
.segmented button {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
}

.panel-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.button-icon {
  display: inline-grid;
  place-items: center;
  width: 1em;
  min-width: 1em;
  line-height: 1;
  font-size: 0.95em;
}

.button-icon svg {
  width: 1em;
  height: 1em;
  display: block;
}

.example-row button:hover,
.panel-actions button:hover,
.segmented button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

.input-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-top: 0;
  background: var(--surface);
}

.input-panel + .input-panel {
  border-left: 1px solid var(--line);
}

.input-panel:last-of-type {
  border-bottom: 0;
}

.panel-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #eef3f5;
}

.panel-head label {
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 800;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

textarea {
  flex: 1;
  display: block;
  width: 100%;
  min-height: 230px;
  resize: vertical;
  border: 0;
  outline: 0;
  padding: 18px 18px;
  background: #ffffff;
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1.45;
}

textarea::placeholder {
  color: #9aa4b1;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
  font-size: 18px;
  letter-spacing: 0;
}

.morse-panel textarea {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

.input-panel:focus-within .panel-head {
  background: var(--accent-soft);
}

.panel-actions {
  min-height: 48px;
  justify-content: flex-end;
  padding: 8px 16px;
  background: #eef3f5;
}

.panel-actions .primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.panel-actions .primary-action:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #ffffff;
}

.settings-rail {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line-strong);
  border-radius: 0 0 var(--radius) var(--radius);
  background: #fbfcfd;
}

.setting-block {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}

.setting-block:last-child {
  border-right: 0;
}

.setting-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.setting-block strong {
  color: var(--text-strong);
  font-size: 18px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.segmented .active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.separators {
  color: var(--muted);
  font-size: 13px;
}

.separators label {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 8px;
}

.separators select {
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 8px;
}

.translator-note {
  min-height: 0;
  margin: 0;
  padding: 0 16px;
  color: #9a4d11;
  background: #fff7ed;
  font-size: 13px;
  line-height: 1.45;
}

.translator-note:not(:empty) {
  padding-top: 10px;
  padding-bottom: 10px;
  border-top: 1px solid #fed7aa;
}

.content-section {
  padding: 56px 20px;
}

.content-section + .content-section {
  border-top: 1px solid var(--line);
}

.section-kicker {
  max-width: var(--container);
  margin: 0 auto 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.section-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 42px;
  align-items: start;
}

h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: 0;
}

.steps-list,
.faq-list {
  display: grid;
  gap: 12px;
}

.prose-block {
  display: grid;
  gap: 14px;
  max-width: 720px;
}

.prose-block p {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
}

.tool-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.tool-link-grid a {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tool-link-grid a:hover strong {
  color: var(--accent);
}

.tool-link-grid strong {
  color: var(--text-strong);
  font-size: 17px;
}

.tool-link-grid span {
  color: var(--muted);
  line-height: 1.45;
}

.steps-list p {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
}

.steps-list span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.alphabet-table {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.chart-stack {
  display: grid;
  gap: 14px;
}

.mini-chart {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.mini-chart div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mini-chart strong {
  color: var(--text-strong);
}

.alphabet-table div {
  min-height: 62px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.alphabet-table strong {
  color: var(--text-strong);
  font-size: 16px;
}

.alphabet-table span,
.mini-chart span,
.phrase-list code {
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

.phrase-list {
  display: grid;
  border: 1px solid var(--line);
  background: var(--surface);
}

.phrase-list a {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.phrase-list a:last-child {
  border-bottom: 0;
}

.phrase-list a:hover span {
  color: var(--accent);
}

.phrase-list span {
  color: var(--text-strong);
  font-weight: 800;
}

.timing-visual {
  display: grid;
  border: 1px solid var(--line);
  background: var(--surface);
}

.timing-visual div {
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.timing-visual div:last-child {
  border-bottom: 0;
}

.timing-visual span {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.timing-visual .dot {
  width: 10px;
}

.timing-visual .dash {
  width: 48px;
}

.timing-visual .gap-letter {
  width: 72px;
  background: repeating-linear-gradient(90deg, var(--muted), var(--muted) 8px, transparent 8px, transparent 16px);
}

.timing-visual .gap-word {
  width: 120px;
  background: repeating-linear-gradient(90deg, var(--accent), var(--accent) 10px, transparent 10px, transparent 18px);
}

.timing-visual p {
  margin: 0;
  font-size: 16px;
}

.use-case-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.use-case-list p {
  margin: 0;
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.use-case-list strong {
  color: var(--text-strong);
  font-size: 16px;
}

.use-case-list span {
  color: var(--muted);
  line-height: 1.45;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 16px;
}

summary {
  cursor: pointer;
  color: var(--text-strong);
  font-weight: 800;
}

details p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.site-footer {
  max-width: var(--container);
  margin: 0 auto;
  padding: 48px 20px 36px;
  border-top: 1px solid var(--line);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px 28px;
}

.footer-brand {
  max-width: 340px;
}

.footer-brand .brand {
  font-size: 18px;
}

.footer-brand .brand-mark {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 7px;
}

.footer-brand .brand-mark::before {
  left: 7px;
  width: 6px;
  height: 6px;
}

.footer-brand .brand-mark::after {
  right: 5px;
  width: 12px;
  height: 6px;
}

.footer-brand p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 56px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.footer-col-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-strong);
  margin-bottom: 3px;
}

.footer-col a {
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--muted);
}

.footer-bottom p {
  margin: 0;
}

.content-hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 44px 20px 30px;
}

.content-hero-copy {
  max-width: 760px;
}

.content-hero .section-kicker {
  margin-left: 0;
  margin-right: 0;
}

.content-hero p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.phrase-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 32px;
  align-items: start;
}

.answer-panel {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(59, 48, 32, 0.06);
  overflow: hidden;
}

.answer-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.answer-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.answer-row strong {
  color: var(--text-strong);
  font-size: 22px;
}

.answer-row code,
.phrase-card code,
td code {
  color: var(--text-strong);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.answer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: #eef3f5;
}

.answer-actions button,
.answer-actions a,
td button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 750;
}

.answer-actions button:hover,
.answer-actions a:hover,
td button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.table-icon-button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

.table-icon-button svg {
  width: 13px;
  height: 13px;
  display: block;
}

.table-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  line-height: 1;
}

.table-detail-link svg {
  width: 13px;
  height: 13px;
  display: block;
}

.table-detail-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.answer-actions button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.answer-actions button:first-child:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #ffffff;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-strong);
  background: #eef3f5;
  font-size: 13px;
  font-weight: 850;
}

td {
  color: var(--text);
}

tr:last-child td {
  border-bottom: 0;
}

.compact-list {
  display: grid;
  border: 1px solid var(--line);
  background: var(--surface);
}

.compact-list p {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  line-height: 1.5;
}

.compact-list p:last-child {
  border-bottom: 0;
}

.phrase-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.phrase-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

.phrase-card h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
}

.phrase-card .answer-actions {
  margin: 0 -16px -16px;
}

.practice-hero {
  padding-bottom: 20px;
}

.practice-shell {
  max-width: var(--container);
  margin: 0 auto 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(59, 48, 32, 0.06);
  overflow: hidden;
}

.practice-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 0.8fr);
  border-bottom: 1px solid var(--line-strong);
  background: #fbfcfd;
}

.practice-control,
.practice-speed {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.practice-speed {
  border-right: 0;
}

.practice-speed strong {
  color: var(--text-strong);
}

.practice-segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.practice-control:first-child .practice-segmented {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.practice-board {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  min-height: 320px;
}

.practice-prompt {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: #eef3f5;
}

.practice-prompt span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.practice-prompt strong {
  color: var(--text-strong);
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

.practice-prompt .morse-prompt {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.practice-actions {
  padding: 0;
  background: transparent;
}

.practice-actions button:first-child {
  min-width: 86px;
}

.practice-prompt p {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.practice-prompt p[data-state="correct"] {
  color: var(--accent-dark);
}

.practice-prompt p[data-state="incorrect"] {
  color: #9a4d11;
}

.practice-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: center;
  padding: 28px;
}

.practice-choices button {
  min-height: 64px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-strong);
  font-size: 24px;
  font-weight: 850;
}

.practice-choices button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.practice-choices button.correct {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.practice-choices button.incorrect {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a4d11;
}

.practice-choices button:disabled {
  cursor: default;
}

.practice-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  background: #fbfcfd;
}

.practice-stats p {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.practice-stats p:last-child {
  border-right: 0;
}

.practice-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.practice-stats strong {
  color: var(--text-strong);
  font-size: 24px;
}

.reveal,
.reveal-delay,
.reveal-delay-long {
  animation: none;
}

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    justify-content: center;
    padding: 14px 18px;
  }

  .brand {
    grid-column: auto;
    font-size: 22px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
  }

  .hero-copy {
    display: block;
    text-align: center;
  }

  .hero-workspace {
    padding: 34px 14px 38px;
  }

  .hero-lede {
    margin: 12px auto 24px;
    font-size: 16px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .input-panel + .input-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .translator-topline,
  .panel-head {
    align-items: flex-start;
  }

  .settings-rail,
  .section-grid {
    grid-template-columns: 1fr;
  }

  .setting-block {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .setting-block:last-child {
    border-bottom: 0;
  }

  .section-grid {
    gap: 22px;
  }

  .alphabet-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-link-grid,
  .use-case-list,
  .phrase-card-grid,
  .phrase-hero,
  .practice-topbar,
  .practice-board {
    grid-template-columns: 1fr;
  }

  .practice-shell {
    margin-left: 14px;
    margin-right: 14px;
  }

  .practice-control,
  .practice-speed,
  .practice-prompt {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .practice-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-hero {
    padding-top: 34px;
  }

  .answer-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .mini-chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phrase-list a,
  .timing-visual div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .footer-nav {
    gap: 24px 40px;
  }

  .footer-brand {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .nav-links {
    display: none;
  }

  .brand {
    font-size: 20px;
  }

  h1 {
    font-size: 28px;
  }

  .example-row,
  .panel-actions {
    justify-content: flex-start;
  }

  .panel-head {
    display: grid;
  }

  textarea {
    min-height: 150px;
    font-size: 18px;
  }

  .content-section {
    padding: 42px 14px;
  }

  .content-hero {
    padding-left: 14px;
    padding-right: 14px;
  }

  table {
    min-width: 560px;
  }

  .practice-choices,
  .practice-prompt {
    padding: 18px;
  }

  .practice-stats {
    grid-template-columns: 1fr;
  }

  .practice-stats p {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .practice-stats p:last-child {
    border-bottom: 0;
  }
}

/* Legal / prose headings and inline links */
.prose-block h3 {
  margin: 8px 0 0;
  font-size: 17px;
  color: var(--text-strong);
}

.prose-block h3:first-child {
  margin-top: 0;
}

.inline-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-link:hover {
  color: var(--accent-dark);
}

/* Back-to-top button */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(11, 122, 117, 0.35);
  cursor: pointer;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s, background-color 0.15s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-dark);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  display: block;
}

@media (max-width: 560px) {
  .back-to-top {
    right: 16px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .back-to-top {
    transition: none;
  }
}
