/* ===========================================================================
   Blood Donor Registration — design system
   Tokens first. Every colour, space and radius below comes from this block.
   =========================================================================== */
:root {
  /* Palette: cool paper, ink, one crimson accent, one clinical teal */
  --ink:        #14181f;
  --ink-2:      #3d4552;
  --ink-3:      #6b7382;
  --rule:       #d9dde4;
  --rule-soft:  #eceef2;
  --paper:      #f7f8fa;
  --surface:    #ffffff;
  --accent:     #b0142c;   /* used only for required markers + primary action */
  --accent-ink: #7d0d1f;
  --accent-wash:#fdeef0;
  --ok:         #0d6a5c;
  --ok-wash:    #e6f3f0;
  --warn:       #8a5a00;
  --warn-wash:  #fdf3e0;

  /* Type */
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --fs-xs: .75rem;  --fs-sm: .8125rem; --fs-base: .9375rem;
  --fs-md: 1.0625rem; --fs-lg: 1.375rem; --fs-xl: 1.875rem; --fs-2xl: 2.375rem;

  /* Space */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(20,24,31,.06), 0 8px 24px -12px rgba(20,24,31,.18);
  --focus: 0 0 0 3px rgba(176,20,44,.28);
  --wrap: 62rem;
}

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

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

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 var(--s3); line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0 0 var(--s3); }
a { color: var(--accent-ink); }
a:hover { color: var(--accent); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s4); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* --- Masthead ------------------------------------------------------------ */
.masthead {
  background: var(--ink);
  color: #fff;
  padding-block: var(--s6) var(--s7);
  border-bottom: 4px solid var(--accent);
}
.masthead__org {
  margin: 0 0 var(--s3);
  font-size: var(--fs-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #9aa3b1;
}
.masthead__title { font-size: var(--fs-xl); font-weight: 700; margin-bottom: var(--s3); }
.masthead__lede { max-width: 44ch; color: #c6ccd6; margin: 0; }

/* --- Form shell ---------------------------------------------------------- */
.form { margin-block: calc(var(--s6) * -1) var(--s7); display: grid; gap: var(--s4); }
main.wrap { padding-top: var(--s6); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--s5) var(--s4) var(--s4);
  margin: 0;
}
.card.has-error { border-color: var(--accent); }
.card__legend {
  display: flex; align-items: center; gap: var(--s3);
  float: left; width: 100%;
  margin-bottom: var(--s4); padding: 0;
  font-size: var(--fs-md); font-weight: 650; letter-spacing: -.01em;
}
.card__legend + * { clear: both; }
.card__num {
  display: grid; place-items: center;
  width: 1.5rem; height: 1.5rem; flex: none;
  background: var(--ink); color: #fff;
  font-size: var(--fs-xs); font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 2px;
}

/* --- Fields -------------------------------------------------------------- */
.field { margin-bottom: var(--s4); }
.field:last-child { margin-bottom: 0; }
.row { display: grid; gap: 0 var(--s4); }

label, .label-as-text {
  display: block;
  margin-bottom: var(--s2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
}
.req { color: var(--accent); font-weight: 700; }
.opt { font-weight: 400; color: var(--ink-3); font-size: var(--fs-xs); }

input[type=text], input[type=tel], input[type=email], input[type=date],
input[type=number], input[type=password], select, textarea {
  width: 100%;
  padding: .625rem .75rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: var(--focus); outline: none;
}
[aria-invalid="true"] { border-color: var(--accent); background: var(--accent-wash); }
textarea { resize: vertical; min-height: 5rem; }
select {
  appearance: none;
  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% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

.field__static {
  margin: 0; padding: var(--s3);
  background: var(--paper); border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm); font-size: var(--fs-sm);
}
.hint { margin: var(--s2) 0 0; font-size: var(--fs-xs); color: var(--ink-3); }
.hint--lead { margin: 0 0 var(--s3); font-size: var(--fs-sm); }
.hint--spaced { margin-top: var(--s4); }
.hint--spaced-below { margin-bottom: var(--s4); }
.err {
  margin: var(--s2) 0 0; font-size: var(--fs-xs);
  font-weight: 600; color: var(--accent-ink);
}

/* --- Blood group grid (the signature control) ---------------------------- */
.groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.group { margin: 0; }
.group input { position: absolute; opacity: 0; width: 0; height: 0; }
.group__chip {
  display: grid; place-items: center;
  min-height: 3rem;
  font-size: var(--fs-md); font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.group__chip:hover { border-color: var(--ink-3); }
.group input:checked + .group__chip {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.group input:focus-visible + .group__chip { box-shadow: var(--focus); }
.group--wide { grid-column: 1 / -1; }
.group--wide .group__chip { font-size: var(--fs-base); font-weight: 550; min-height: 2.75rem; }

/* --- Yes / no choices ---------------------------------------------------- */
.choices { display: flex; flex-wrap: wrap; gap: var(--s2); }
.choice { margin: 0; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice span {
  display: inline-block;
  padding: .5rem 1rem;
  font-size: var(--fs-sm); font-weight: 550; color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
}
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice input:focus-visible + span { box-shadow: var(--focus); }

.subblock {
  margin: var(--s4) 0;
  padding: var(--s4);
  background: var(--paper);
  border-left: 3px solid var(--rule);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* --- Consent + submit ---------------------------------------------------- */
.card--consent { border-top: 3px solid var(--accent); }
.consent { display: flex; gap: var(--s3); align-items: flex-start; font-weight: 400; color: var(--ink-2); }
.consent input { flex: none; width: 1.15rem; height: 1.15rem; margin-top: .2rem; accent-color: var(--accent); }
.consent--sm { margin-top: var(--s3); font-size: var(--fs-sm); font-weight: 400; }
.finepoint { margin: var(--s3) 0 0; font-size: var(--fs-xs); color: var(--ink-3); }

.btn {
  display: inline-block; margin-top: var(--s4);
  padding: .75rem 1.5rem;
  font: inherit; font-weight: 650; text-decoration: none;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.btn--primary { width: 100%; background: var(--accent); color: #fff; font-size: var(--fs-md); }
.btn--primary:hover { background: var(--accent-ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { background: var(--surface); color: var(--ink); }
.btn--sm { padding: .375rem .75rem; font-size: var(--fs-sm); margin-top: 0; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; color: #fff; }

/* --- Alerts, receipt, notices -------------------------------------------- */
.alert {
  padding: var(--s4); margin-bottom: var(--s5);
  border-radius: var(--radius); border: 1px solid;
}
.alert__title { font-size: var(--fs-base); margin-bottom: var(--s2); }
.alert ul { margin: 0; padding-left: 1.1rem; font-size: var(--fs-sm); }
.alert li { margin-bottom: var(--s1); }
.alert--error { background: var(--accent-wash); border-color: #f0c2c9; color: var(--accent-ink); }
.alert--ok { background: var(--ok-wash); border-color: #b9ddd5; color: var(--ok); }
.alert--warn { background: var(--warn-wash); border-color: #f0dcb4; color: var(--warn); }

.receipt {
  background: var(--surface); border: 1px solid var(--rule);
  border-top: 4px solid var(--ok);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: var(--s5) var(--s4);
  margin-block: calc(var(--s6) * -1) var(--s7);
}
.receipt__eyebrow {
  font-size: var(--fs-xs); letter-spacing: .16em; text-transform: uppercase;
  color: var(--ok); font-weight: 700; margin-bottom: var(--s2);
}
.receipt__name { font-size: var(--fs-lg); }
.receipt__meta { display: grid; gap: var(--s3); margin: var(--s4) 0; padding: 0; }
.receipt__meta div { display: grid; grid-template-columns: 7rem 1fr; gap: var(--s3); align-items: baseline; }
.receipt__meta dt { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.receipt__meta dd { margin: 0; font-weight: 550; }
.receipt__ref { font-family: var(--font-mono); font-size: var(--fs-md); letter-spacing: .04em; }
.receipt__note {
  padding: var(--s3); border-radius: var(--radius-sm);
  background: var(--ok-wash); font-size: var(--fs-sm); color: var(--ok);
}
.receipt__note--stop { background: var(--accent-wash); color: var(--accent-ink); }
.receipt__note--check { background: var(--warn-wash); color: var(--warn); }
.receipt__foot { font-size: var(--fs-xs); color: var(--ink-3); }

.notice {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: var(--s6) var(--s4);
  margin-block: calc(var(--s6) * -1) var(--s7); text-align: center;
}

/* --- Footer -------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--rule);
  padding-block: var(--s5);
  font-size: var(--fs-xs); color: var(--ink-3);
  background: var(--surface);
}
.foot p { margin: 0 0 var(--s1); }
.foot__admin a { color: var(--ink-3); }

/* ===========================================================================
   Admin
   =========================================================================== */
.page-admin { background: var(--paper); }

.adminbar { background: var(--ink); color: #fff; }
.adminbar .wrap {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s3) var(--s5); padding-block: var(--s3);
}
.adminbar__brand { font-weight: 700; letter-spacing: -.01em; margin: 0; }
.adminbar__brand span { display: block; font-size: var(--fs-xs); font-weight: 400; color: #9aa3b1; letter-spacing: .1em; text-transform: uppercase; }
.adminbar nav { display: flex; flex-wrap: wrap; gap: var(--s4); margin-left: auto; }
.adminbar nav a { color: #c6ccd6; text-decoration: none; font-size: var(--fs-sm); font-weight: 550; }
.adminbar nav a:hover, .adminbar nav a[aria-current="page"] { color: #fff; }
.adminbar__who { font-size: var(--fs-xs); color: #9aa3b1; }

.admin-main { padding-block: var(--s5) var(--s7); }
.admin-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s3); margin-bottom: var(--s4); }
.admin-h h1 { font-size: var(--fs-lg); margin: 0; }
.admin-h__count { font-size: var(--fs-sm); color: var(--ink-3); }
.admin-h__actions { margin-left: auto; display: flex; gap: var(--s2); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin-bottom: var(--s5); }
.stat {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: var(--s3) var(--s4);
}
.stat__n { display: block; font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.stat__l { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.stat--accent .stat__n { color: var(--accent); }

.bg-spread { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.bg-spread__item {
  display: flex; align-items: baseline; gap: var(--s2);
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-sm); padding: var(--s2) var(--s3);
  font-size: var(--fs-sm);
}
.bg-spread__k { font-weight: 700; font-family: var(--font-mono); }
.bg-spread__v { color: var(--ink-3); font-variant-numeric: tabular-nums; }

.filters {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s4); margin-bottom: var(--s4);
  display: grid; gap: var(--s3);
}
.filters__grid { display: grid; gap: var(--s3); }
.filters__actions { display: flex; gap: var(--s2); align-items: center; }
.filters .field { margin: 0; }

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 46rem; }
table.data th, table.data td { padding: .625rem var(--s3); text-align: left; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
table.data thead th {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); background: var(--paper); border-bottom: 1px solid var(--rule);
  white-space: nowrap; position: sticky; top: 0;
}
table.data tbody tr:hover { background: var(--paper); }
table.data td.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: var(--fs-xs); }

.tag {
  display: inline-block; padding: .125rem .5rem; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 650; white-space: nowrap;
  background: var(--rule-soft); color: var(--ink-2);
}
.tag--ok { background: var(--ok-wash); color: var(--ok); }
.tag--warn { background: var(--warn-wash); color: var(--warn); }
.tag--stop { background: var(--accent-wash); color: var(--accent-ink); }
.tag--dark { background: var(--ink); color: #fff; }
.tag--group { font-family: var(--font-mono); background: var(--ink); color: #fff; }
.tag--group.is-unknown { background: var(--rule-soft); color: var(--ink-3); }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s4); font-size: var(--fs-sm); }
.pager a, .pager span {
  padding: .375rem .75rem; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  text-decoration: none; background: var(--surface); color: var(--ink-2);
}
.pager .is-current { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 650; }
.pager__info { border: 0; background: none; color: var(--ink-3); margin-left: auto; padding-left: 0; }

.empty { padding: var(--s7) var(--s4); text-align: center; color: var(--ink-3); }

.panel {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s4);
}
.panel h2 { font-size: var(--fs-base); margin-bottom: var(--s3); padding-bottom: var(--s2); border-bottom: 1px solid var(--rule-soft); }
.deflist { display: grid; gap: var(--s3); margin: 0; }
.deflist div { display: grid; grid-template-columns: 9rem 1fr; gap: var(--s3); align-items: baseline; }
.deflist dt { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.deflist dd { margin: 0; }
.detail-grid { display: grid; gap: var(--s4); }

.login-shell { display: grid; place-items: center; min-height: 100vh; padding: var(--s4); }
.login-card { width: 100%; max-width: 24rem; background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s5) var(--s4); }
.login-card h1 { font-size: var(--fs-md); }
.login-card .btn { width: 100%; }

/* --- Responsive ---------------------------------------------------------- */
@media (min-width: 30em) {
  .row { grid-template-columns: 1fr 1fr; }
  .groups { grid-template-columns: repeat(4, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .btn--primary { width: auto; min-width: 16rem; }
}
@media (min-width: 48em) {
  :root { --fs-xl: 2.25rem; }
  .card { padding: var(--s5); }
  .masthead { padding-block: var(--s7) var(--s8); }
  .masthead__lede { font-size: var(--fs-md); }
  .stats { grid-template-columns: repeat(5, 1fr); }
  .filters__grid { grid-template-columns: repeat(3, 1fr); }
  .receipt, .notice { padding: var(--s6); }
  .groups { grid-template-columns: repeat(8, 1fr); }
  .group--wide { grid-column: span 8; }
}
@media (min-width: 64em) {
  .filters__grid { grid-template-columns: repeat(4, 1fr); }
  .detail-grid { grid-template-columns: 3fr 2fr; align-items: start; }
}
@media (min-width: 90em) {
  :root { --wrap: 76rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .masthead, .foot, .adminbar, .filters, .pager, .btn { display: none !important; }
  body { background: #fff; }
  .card, .panel, .tablewrap { box-shadow: none; border-color: #999; }
}

/* ===========================================================================
   Language switcher — sits directly above step 1, framed as a question
   =========================================================================== */
.langswitch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-block: calc(var(--s6) * -1) var(--s4);
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.langswitch__label {
  font-size: var(--fs-xs);
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex: none;
}
.langswitch__list {
  display: flex;
  flex: 1 1 auto;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.langswitch__list li { flex: 1 1 0; display: flex; }
.langswitch__btn {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .375rem .75rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-2);
  text-align: center;
  text-decoration: none;
  border-radius: 3px;
  transition: background .12s ease, color .12s ease;
}
.langswitch__btn:hover { background: rgba(20, 24, 31, .06); color: var(--ink); }
.langswitch__btn.is-active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 2px rgba(20, 24, 31, .18);
}
.langswitch__btn.is-active:hover { background: var(--ink); color: #fff; }
.langswitch__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Confirmation shown after a switch carried the answers across */
.langnote {
  margin: calc(var(--s3) * -1) 0 var(--s4);
  padding: var(--s2) var(--s3);
  font-size: var(--fs-sm);
  color: var(--ok);
  background: var(--ok-wash);
  border: 1px solid #b9ddd5;
  border-radius: var(--radius-sm);
}

/* ===========================================================================
   Right-to-left (Urdu)
   =========================================================================== */
.is-rtl .subblock {
  border-left: 0;
  border-right: 3px solid var(--rule);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.is-rtl select {
  background-position: 18px 50%, 23px 50%;
  padding-right: .75rem;
  padding-left: 2.25rem;
}
.is-rtl .pager__info { margin-left: 0; margin-right: auto; }
.is-rtl .admin-h__actions { margin-left: 0; margin-right: auto; }

/* Latin-script and numeric content stays LTR inside an RTL page */
.is-rtl input[dir="ltr"],
.is-rtl .group__chip[dir="ltr"],
.is-rtl .receipt__ref,
.is-rtl .mono { text-align: left; direction: ltr; }
.is-rtl .receipt__ref { text-align: right; }

/* Indic and Nastaliq scripts need more leading than Latin */
:lang(ur) body, .is-rtl body { line-height: 1.8; }
:lang(hi) body { line-height: 1.72; }
:lang(ur) .masthead__title,
:lang(hi) .masthead__title { line-height: 1.35; }
:lang(ur) .card__legend,
:lang(hi) .card__legend { line-height: 1.4; }
:lang(ur) .group__chip { line-height: 1.4; }

/* ===========================================================================
   Mobile refinements — touch targets, iOS zoom, overflow
   =========================================================================== */
@media (max-width: 30em) {
  :root { --fs-xl: 1.625rem; }

  .wrap { padding-inline: var(--s3); }
  .card { padding: var(--s4) var(--s3); }
  .masthead { padding-block: var(--s5) var(--s6); }

  /* iOS Safari zooms the viewport on focus for any field under 16px, and
     never zooms back out. Hold every control at exactly 16px. */
  input[type=text], input[type=tel], input[type=email], input[type=date],
  input[type=number], input[type=password], input[type=search],
  select, textarea {
    font-size: 16px;
    min-height: 44px;
  }
  textarea { min-height: 6rem; }

  .groups { grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
  .group__chip { min-height: 48px; }
  .group--wide { grid-column: 1 / -1; }
  .group--wide .group__chip { min-height: 48px; }

  .choice span {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: .5rem 1.125rem;
  }

  .consent input { width: 1.375rem; height: 1.375rem; }
  .btn--primary { width: 100%; min-height: 50px; }

  .receipt__meta div { grid-template-columns: 1fr; gap: var(--s1); }
  .receipt, .notice { padding: var(--s4) var(--s3); }

  /* Switcher stacks its label above the segments on narrow screens */
  .langswitch {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s2);
    padding: var(--s3);
  }
  .langswitch__list { width: 100%; }
  .langswitch__btn { min-height: 44px; padding: .5rem .375rem; }
}

/* Very small phones (320px) */
@media (max-width: 22.5em) {
  .group__chip { font-size: var(--fs-sm); }
  .card__legend { font-size: var(--fs-base); gap: var(--s2); }
  .langswitch__btn { font-size: var(--fs-xs); }
}

/* Nothing may push the page sideways */
html, body { max-width: 100%; overflow-x: hidden; }
img, table, pre { max-width: 100%; }
