/* Launch Part 2b: the app fits small phones (iPhone X 375 px, the smallest 320 px) and keeps
   UX rule 15 (targets at least 44 px, text at least 16 px). Loaded last. Found by measuring
   every screen at 375, 320 and 1280 px (the inventory of 2026-11-17); no colours here. */

/* The notch and the home bar (viewport-fit=cover in index.html). */
.wrap { padding-top: max(18px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right)); }
.legal-foot { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: env(safe-area-inset-bottom); }

/* A long German or French word in a title or on a button breaks with a hyphen instead of
   leaving its box (i18n.js sets the page language). Running text is never hyphenated: it is
   easier to read whole. Flex and grid children may shrink. */
body { overflow-wrap: break-word; }
h1, h2, .btn, .toggle { hyphens: auto; }
.wrap > *, .row > *, .cd-row > *, .child-row > *, .ev > *, .apps > *, .vocab-cells > *, .flash > * { min-width: 0; }

/* Practice screens: nothing touches. Counter and progress bar stay a pair. */
#panel > * + * { margin-top: 12px; }
#panel > .meta + .progress { margin-top: 4px; }
.chips.dirs { margin-bottom: 0; }
.tag + .page { margin-left: 8px; }
.list-miss div { flex-wrap: wrap; gap: 0 8px; }
.list-miss div .kind { flex: 1 1 100%; min-width: 0; }
.card > .list-miss + .row, .card > .row + .btn, .card > .list-miss + .btn { margin-top: 12px; }
.row { flex-wrap: wrap; }
.row > * { flex: 1 1 8rem; }
.chip small { white-space: nowrap; font-size: 1rem; }

/* Tabs: even rows on a phone (2 + 2, or 3 + 2 with the second row stretched; two a row on
   the smallest phones, where "Karteikarten" needs the room), one row from 560 px. */
.tabs { display: flex; flex-wrap: wrap; }
.tab { flex: 1 1 30%; min-height: 44px; padding: 9px 2px; font-size: 1rem; }
.tabs:has(.tab:nth-child(4):last-child) .tab { flex-basis: 40%; }
@media (max-width: 359px) { .tabs .tab { flex-basis: 40%; } }
@media (min-width: 560px) { .tabs .tab, .tabs:has(.tab:nth-child(4):last-child) .tab { flex: 1 1 0; } }

/* Countdown: the link goes under the text when there is no room beside it; the date form
   is one field per line on a phone, the button last and full width. */
.cd-row { flex-wrap: wrap; }
.cd-row .cd-text { flex: 1 1 13rem; }
.cd-field { flex: 1 1 9rem; font-size: 1rem; }
.cd-field input, .cd-field select { width: 100%; min-height: 44px; }
.cd-form .btn { flex: 1 1 100%; }
.cd-saved { align-items: center; }

/* Patterns (D75): the speaker button of a row, 44 × 44 px. */
.group td.say { width: 60px; padding: 4px 8px; text-align: right; }
.say-btn { width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; font-size: 1.1rem; }

/* Patterns: on a phone each verb is two lines (the three forms, then meaning and group),
   so nothing is cut off and nothing scrolls sideways. */
@media (max-width: 599px) {
  .group table, .group thead, .group tbody { display: block; }
  .group tr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--line); }
  .group td, .group th { border-top: 0; padding: 6px 8px; grid-column: span 2; }
  .group td:nth-child(4), .group th:nth-child(4) { grid-column: 1 / 4; padding-top: 0; }
  .group td:nth-child(5), .group th:nth-child(5) { grid-column: 4 / 6; padding-top: 0; }
  .group td.say { grid-column: 6; width: auto; padding: 0 8px 6px 0; justify-self: end; }
  .group td:first-child, .group th:first-child { padding-left: 14px; }
  .group td.unit { white-space: normal; }
  .group td.unit .tag { display: inline-block; padding: 2px 8px; }
}

/* Review: fields show their whole text; the two bars that stay on screen are lower. */
.field textarea { field-sizing: content; }
.field textarea.one-line { min-height: 44px; resize: none; }
.review-bar { gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 8px rgba(0,0,0,.08); }
.review-bar > .btn { flex: 1 1 auto; }
.review-approve { flex: 99 1 auto; gap: 8px; }
.review-approve .btn { flex: 1 1 auto; }
.group-move { padding: 8px 12px; }
.group-move .field { flex: 1 1 9rem; }
.child-row .name { flex: 1 1 4rem; overflow-wrap: anywhere; }
.top-bar { flex-wrap: wrap; }
.lang-switch { margin-left: auto; white-space: nowrap; }

/* UX rule 15: targets of at least 44 px. Links in a line of text get the height, so two
   links never lie on each other when the line wraps. */
a.back { white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; padding: 4px 14px; font-size: 1rem; }
.toggle { min-height: 44px; }
.linkish { display: inline-block; min-height: 44px; padding: 10px 0; }
.legal-links { gap: 0 14px; font-size: 1rem; }
.legal-links a { display: inline-block; min-height: 44px; padding: 10px 2px; }
.field input, .field select, .num input, .ask input { min-height: 44px; }
.kw label { min-height: 44px; }
