/*
  Satz: phrase translator app page (Screenery template)
  A 1950s Swiss poster as a page: a 12-field modular grid you can see, flush-left ragged-right type, black, white and one red.
  Red means one thing only: the other language, the sentence you show. Everything else is black on white.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Grid, guides, shared type
   4. Controls: buttons, fields, select, search, chips, segmented, stepper, checkbox
   5. Header
   6. Phrasebook: side, stage, list, empty state
   7. The app: phone drawing, callouts, specs
   8. Counter card
   9. Language packs, method
  10. Plans and signup
  11. Changes, footer
  12. Show mode dialog
  13. Motion
  14. Breakpoints
  15. Print (the counter card only)
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* The three inks */
  --paper: #f6f5f1;
  --ink: #111111;
  --red: #d4211b;          /* 4.7:1 on paper, white on it is 5.2:1 */

  /* Derived */
  --ink-2: #4f4d48;        /* secondary text, 7.6:1 on paper */
  --ink-3: #6b6862;        /* tertiary meta, 5:1 on paper */
  --rule: #111111;
  --hair: #cfccc4;         /* hairlines between rows */
  --guide: rgb(17 17 17 / 0.04); /* the visible grid fields */
  --red-deep: #a8170f;     /* pressed red */
  --white: #ffffff;
  --red-tint: #fbe9e7;     /* error field ground */

  /* Type: three working sizes plus the display */
  --grot: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;  /* language codes, times, sizes, versions: measurement only */
  --f-meta: 0.75rem;       /* 12, mono labels */
  --f-sm: 0.9375rem;       /* 15 */
  --f-body: 1.0625rem;     /* 17 */
  --f-h3: 1.5rem;
  --f-h2: clamp(1.9rem, 1.1rem + 2.5vw, 3.25rem);

  /* Space and grid */
  --m: clamp(16px, 3.2vw, 48px);  /* page margin */
  --gut: clamp(12px, 1.6vw, 24px); /* column gutter */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 40px; --s7: 64px; --s8: clamp(72px, 9vw, 136px);
  --radius: 0;             /* the style has no rounded corners */
  --ease: cubic-bezier(0.16, 1, 0.3, 1); /* exponential ease-out */
  --header-h: 60px;
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink) var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--f-body)/1.5 var(--grot);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--red);
  accent-color: var(--red);
  overflow-x: clip;
}
::selection { background: var(--red); color: var(--white); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--ink); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--red); }
p, h1, h2, h3, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { text-wrap: balance; font-weight: 700; letter-spacing: -0.02em; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
.defs { position: absolute; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--m); top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip:focus { top: 8px; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.mono { font-family: var(--mono); font-size: var(--f-meta); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }

/* ---------- 3. Grid, guides, shared type ---------- */
.wrap { width: 100%; max-width: 1680px; margin-inline: auto; padding-inline: var(--m); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); }

/* Twelve visible fields behind the phrasebook, aligned to the same columns */
.guides {
  position: absolute; inset: 0; pointer-events: none;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut);
  max-width: 1680px; margin-inline: auto; padding-inline: var(--m);
}
.guides i { background: var(--guide); }

.label { display: block; font-family: var(--mono); font-size: var(--f-meta); letter-spacing: 0.02em; color: var(--ink-2); margin-bottom: 6px; }
.note { font-size: var(--f-sm); color: var(--ink-2); max-width: 46ch; }
.h2 { font-size: var(--f-h2); line-height: 1.04; max-width: 18ch; }
.h3 { font-size: var(--f-h3); line-height: 1.15; }
.sec { padding-block: clamp(56px, 7vw, 112px); }
.sec--rule { padding-top: 0; }
.sec--rule .wrap { background: linear-gradient(var(--rule), var(--rule)) no-repeat var(--m) 0 / calc(100% - 2 * var(--m)) 3px; padding-top: var(--s5); }
.sec__h { grid-column: 1 / span 4; display: flex; flex-direction: column; gap: var(--s4); align-items: flex-start; align-self: start; position: sticky; top: calc(var(--header-h) + var(--s5)); }

/* ---------- 4. Controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 10px 16px;
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font-weight: 600; font-size: var(--f-sm); line-height: 1.1;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--red { background: var(--red); border-color: var(--red); color: var(--white); }
.btn--red:hover { background: var(--red-deep); border-color: var(--red-deep); color: var(--white); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.btn--big { min-height: 52px; padding-inline: 22px; font-size: var(--f-body); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.btn[aria-pressed="true"] .ic { fill: currentColor; }
.btn:disabled { opacity: 0.55; cursor: progress; }

.field { display: block; min-width: 0; border: 0; padding: 0; margin: 0; }
.input, .select {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 0; border-bottom: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--white);
  font-size: var(--f-body);
}
.input::placeholder { color: var(--ink-3); }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--red); outline-offset: 0; }
.field.is-bad .input { border-bottom-color: var(--red); background: var(--red-tint); }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; font-weight: 600;
  padding-right: 34px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23111' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
}
.err { min-height: 0; font-size: var(--f-sm); color: var(--red); margin-top: 6px; }
.err:empty { display: none; }
.hint { color: var(--ink-3); margin-top: 6px; }

.pair { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); gap: var(--s2); align-items: end; }
.swap {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1.5px solid var(--ink); background: transparent; border-radius: var(--radius);
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 420ms var(--ease);
}
.swap:hover { background: var(--ink); color: var(--paper); }
.swap.is-turn { transform: rotate(180deg); }

.search__box { position: relative; }
.search__box .ic { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--ink-2); }
.search__box .input, .search input { padding-left: 38px; }
.search input {
  width: 100%; min-height: 44px; padding: 10px 12px 10px 38px;
  border: 0; border-bottom: 1.5px solid var(--ink); background: var(--white); font-size: var(--f-body);
  border-radius: 0; -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus-visible { outline: 2px solid var(--red); outline-offset: 0; }

.chips__row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px;
  border: 1.5px solid var(--ink); font-size: var(--f-sm); font-weight: 600;
}
.chip span b { font-family: var(--mono); font-weight: 500; font-size: var(--f-meta); }
.chip input:checked + span { background: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 0; padding: 0; margin: 0; }
.seg legend { padding: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; min-height: 48px; padding: 10px 12px;
  border: 1.5px solid var(--ink); margin-left: -1.5px; font-weight: 600;
}
.seg label:first-of-type span { margin-left: 0; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); position: relative; }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; z-index: 1; position: relative; }

.step { display: inline-flex; align-items: stretch; border: 1.5px solid var(--ink); }
.step__b { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; }
.step__b:hover { background: var(--ink); color: var(--paper); }
.step__b:disabled { opacity: 0.35; cursor: not-allowed; background: transparent; color: var(--ink); }
.step__v { min-width: 52px; display: grid; place-items: center; font-size: var(--f-body); border-inline: 1.5px solid var(--ink); }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--f-sm); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; border-radius: 0; }

/* ---------- 5. Header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1.5px solid var(--ink); }
.top__in { display: flex; align-items: center; gap: var(--s5); min-height: var(--header-h); }
.mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.375rem; letter-spacing: -0.03em; text-decoration: none; }
.mark:hover { color: var(--ink); }
.mark__sq { width: 18px; height: 18px; background: var(--red); display: inline-block; }
.nav { display: flex; gap: var(--s5); margin-left: auto; font-size: var(--f-sm); font-weight: 500; }
.nav a { text-decoration: none; padding-block: 10px; }
.nav a:hover { text-decoration: underline; color: var(--ink); }
.top__cta { font-weight: 600; font-size: var(--f-sm); text-decoration: none; background: var(--ink); color: var(--paper); padding: 10px 16px; min-height: 40px; display: inline-flex; align-items: center; }
.top__cta:hover { background: var(--red); color: var(--white); }

/* ---------- 6. Phrasebook ---------- */
.book { position: relative; padding-block: var(--s6); }
.book__grid { position: relative; row-gap: var(--s6); }
.book__side { grid-column: 1 / span 3; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: var(--s5); align-self: start; }
.lede { font-size: 1.5rem; line-height: 1.18; letter-spacing: -0.02em; font-weight: 700; max-width: 20ch; }

.cats { display: flex; flex-direction: column; border-top: 1.5px solid var(--ink); }
.cat {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 10px 0; text-align: left;
  border: 0; border-bottom: 1px solid var(--hair); background: transparent;
  font-weight: 600; font-size: var(--f-sm);
}
.cat__n { font-family: var(--mono); font-size: var(--f-meta); font-weight: 400; color: var(--ink-3); }
.cat:hover { color: var(--red); }
.cat[aria-pressed="true"] { color: var(--red); }
.cat[aria-pressed="true"]::before { content: ""; width: 10px; height: 10px; background: var(--red); align-self: center; margin-right: -2px; order: -1; }
.cat[aria-pressed="true"] .cat__t { margin-right: auto; }
.cat__t { margin-right: auto; }

.stage { grid-column: 4 / span 9; min-height: clamp(320px, 46vh, 500px); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s4); padding-top: var(--s2); }
.stage__meta { display: flex; gap: var(--s5); color: var(--ink-2); text-transform: uppercase; }
.stage__meta span:first-child { color: var(--ink); font-weight: 500; }
.stage__src { font-size: clamp(1.25rem, 0.9rem + 1vw, 1.75rem); font-weight: 500; line-height: 1.2; max-width: 32ch; }
.stage__tgt {
  color: var(--red); font-weight: 700; letter-spacing: -0.035em; line-height: 0.95;
  font-size: clamp(3rem, 1rem + 6.4vw, 7.5rem);
  max-width: 11ch; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word;
  margin-top: auto; padding-bottom: 0.06em;
}
.stage__tgt.is-m { font-size: clamp(2.5rem, 1rem + 4.6vw, 5.5rem); max-width: 14ch; }
.stage__tgt.is-l { font-size: clamp(2rem, 1rem + 3.2vw, 4rem); max-width: 19ch; line-height: 1; }
.stage__acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.toast { color: var(--ink); padding-left: var(--s3); min-height: 1em; }

.list { grid-column: 4 / span 9; border-top: 3px solid var(--ink); }
.list__head { padding: 10px 0; color: var(--ink-2); border-bottom: 1px solid var(--hair); }
.rows li { display: grid; grid-template-columns: minmax(0, 1fr) 48px; border-bottom: 1px solid var(--hair); }
.row__btn {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: var(--gut);
  min-height: 52px; padding: 12px 0; text-align: left; border: 0; background: transparent;
  font-size: var(--f-body); align-items: baseline;
}
.row__src { font-weight: 500; }
.row__tgt { color: var(--ink-2); }
.row__cat { display: block; font-family: var(--mono); font-size: var(--f-meta); color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.row__btn:hover .row__src { text-decoration: underline; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
.row__btn[aria-current="true"] .row__tgt { color: var(--red); font-weight: 600; }
.row__btn[aria-current="true"] .row__src::before { content: ""; display: inline-block; width: 9px; height: 9px; background: var(--red); margin-right: 10px; vertical-align: 0.1em; }
.row__save { border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-3); min-height: 48px; }
.row__save:hover { color: var(--ink); }
.row__save[aria-pressed="true"] { color: var(--ink); }
.row__save[aria-pressed="true"] .ic { fill: currentColor; }
mark { background: none; color: inherit; box-shadow: inset 0 -0.38em 0 rgb(212 33 27 / 0.22); }

.empty { padding: var(--s6) 0 var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.empty__big { font-size: clamp(1.75rem, 1rem + 2.4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; max-width: 20ch; }
.empty__big span { color: var(--red); }
.empty__try { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- 7. The app ---------- */
.app__fig { grid-column: 6 / span 7; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s6) var(--s6); align-items: start; }
.phone { display: contents; }
.phone__body {
  width: 272px; aspect-ratio: 272 / 560; background: var(--ink); border-radius: 38px; padding: 11px;
  box-shadow: 0 30px 50px -30px rgb(17 17 17 / 0.45);
}
.phone__screen {
  height: 100%; border-radius: 28px; background: var(--paper); overflow: hidden;
  display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 0;
}
.ph__bar { display: flex; justify-content: space-between; font-size: 11px; }
.ph__pair { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; font-weight: 500; }
.ph__pair .ic { width: 12px; height: 12px; }
.ph__src { font-size: 13px; font-weight: 500; line-height: 1.25; margin-top: 4px; }
.ph__tgt { font-size: 34px; font-weight: 700; color: var(--red); line-height: 0.98; letter-spacing: -0.035em; hyphens: auto; overflow-wrap: break-word; min-height: 3em; }
.ph__acts { display: flex; gap: 8px; }
.ph__show { background: var(--red); color: var(--white); font-size: 12px; font-weight: 600; padding: 6px 10px; }
.ph__save { width: 28px; border: 1.5px solid var(--ink); }
.ph__list { border-top: 2px solid var(--ink); margin-top: 6px; }
.ph__list li { height: 29px; border-bottom: 1px solid var(--hair); position: relative; }
.ph__list li::before, .ph__list li::after { content: ""; position: absolute; top: 12px; height: 6px; background: var(--ink); }
.ph__list li::before { left: 0; width: 46%; }
.ph__list li::after { left: 56%; width: 30%; background: var(--hair); }
.ph__list li:nth-child(2)::before { width: 38%; } .ph__list li:nth-child(3)::before { width: 50%; } .ph__list li:nth-child(4)::before { width: 30%; } .ph__list li:nth-child(5)::before { width: 42%; } .ph__list li:nth-child(6)::before { width: 34%; }
.ph__tabs { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1.5px solid var(--ink); font-size: 11px; }
.ph__tabs span { padding: 10px 0 16px; }
.ph__tabs .on { color: var(--red); font-weight: 500; }

.callouts ol { counter-reset: c; display: flex; flex-direction: column; border-top: 1.5px solid var(--ink); }
.callouts li { counter-increment: c; position: relative; padding: 12px 0 12px 32px; border-bottom: 1px solid var(--hair); font-size: var(--f-sm); max-width: 46ch; }
.callouts li::before { content: counter(c); position: absolute; left: 0; top: 15px; font-family: var(--mono); font-size: var(--f-meta); color: var(--ink); font-weight: 500; }
.specs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 var(--gut); border-top: 3px solid var(--ink); }
.specs div { padding: 12px 0; border-bottom: 1px solid var(--hair); }
.specs dt { font-family: var(--mono); font-size: var(--f-meta); color: var(--ink-2); }
.specs dd { font-size: var(--f-sm); font-weight: 500; margin-top: 4px; }

/* ---------- 8. Counter card ---------- */
.card__field { width: 100%; max-width: 340px; }
.card__stage { grid-column: 6 / span 7; display: flex; }
.a6 {
  width: min(100%, 460px); aspect-ratio: 105 / 148; background: var(--white); color: var(--ink);
  padding: 7% 7% 5%; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 24px 40px -28px rgb(17 17 17 / 0.4), 0 1px 0 rgb(17 17 17 / 0.08);
}
.a6__top { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px 12px; align-items: center; border-bottom: 3px solid var(--ink); padding-bottom: 12px; }
.a6__sq { width: 22px; height: 22px; background: var(--red); }
.a6__name { font-weight: 700; font-size: clamp(1rem, 0.7rem + 1vw, 1.375rem); letter-spacing: -0.02em; line-height: 1.1; overflow-wrap: anywhere; }
.a6__pair { grid-column: 2; color: var(--ink-2); }
.a6__rows { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.a6__rows li { padding: 9px 0; border-bottom: 1px solid var(--hair); display: flex; flex-direction: column; gap: 2px; }
.a6__t { color: var(--red); font-weight: 700; font-size: clamp(1rem, 0.75rem + 0.8vw, 1.3125rem); line-height: 1.12; letter-spacing: -0.015em; hyphens: auto; }
.a6__s { font-size: var(--f-meta); color: var(--ink-2); line-height: 1.3; }
.a6__empty { flex: 1; color: var(--ink-2); font-size: var(--f-sm); max-width: 30ch; }
.a6__foot { display: flex; justify-content: space-between; color: var(--ink-3); border-top: 1.5px solid var(--ink); padding-top: 8px; font-size: 11px; }

/* ---------- 9. Language packs, method ---------- */
.tablewrap { grid-column: 6 / span 7; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.packs th, .packs td, .ptable th, .ptable td { text-align: left; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--hair); vertical-align: baseline; font-size: var(--f-sm); }
.packs thead th, .ptable thead th { font-family: var(--mono); font-size: var(--f-meta); font-weight: 400; color: var(--ink-2); border-bottom: 1.5px solid var(--ink); }
.packs tbody th { font-weight: 600; }
.packs .num { text-align: right; font-family: var(--mono); font-size: 0.875rem; padding-right: 24px; }
.packs .code { display: inline-block; width: 34px; font-family: var(--mono); font-size: var(--f-meta); font-weight: 500; color: var(--ink-2); }
.packs tfoot th, .packs tfoot td { border-bottom: 0; border-top: 3px solid var(--ink); font-weight: 600; }

.method { grid-column: 6 / span 7; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6) var(--gut); }
.method p { max-width: 40ch; color: var(--ink-2); }
.method b { display: block; color: var(--ink); font-size: 1.1875rem; line-height: 1.25; margin-bottom: 8px; letter-spacing: -0.01em; }

/* ---------- 10. Plans and signup ---------- */
.plans { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: var(--s7); }
.ptabs { display: none; grid-template-columns: repeat(3, 1fr); margin-bottom: calc(-1 * var(--s7) + var(--s4)); }
.ptabs button { min-height: 44px; border: 1.5px solid var(--ink); margin-left: -1.5px; background: transparent; font-weight: 600; font-size: var(--f-sm); }
.ptabs button:first-child { margin-left: 0; }
.ptabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.packs thead .num { font-size: var(--f-meta); }
.ptable thead th { color: var(--ink); font-family: var(--grot); font-size: var(--f-body); font-weight: 700; }
.ptable thead th:first-child { width: 28%; }
.ptable tbody th { font-weight: 400; color: var(--ink-2); }
.ptable tbody tr:first-child td { font-weight: 700; }
.ptable.is-plan-traveller [data-col="1"], .ptable.is-plan-counter [data-col="2"], .ptable.is-plan-street [data-col="3"] { background: var(--white); }
.ptable.is-plan-traveller thead [data-col="1"], .ptable.is-plan-counter thead [data-col="2"], .ptable.is-plan-street thead [data-col="3"] { box-shadow: inset 0 3px 0 var(--ink); }
.ptable td, .ptable th { padding-left: 10px; }
.ptable th:first-child { padding-left: 0; }

.signup { display: flex; flex-direction: column; gap: var(--s5); border-top: 3px solid var(--ink); padding-top: var(--s5); max-width: 640px; }
.signup.is-traveller .shopOnly { display: none; }
.total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s4); border-top: 1.5px solid var(--ink); padding-top: var(--s4); }
.total__line { font-weight: 600; max-width: 34ch; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.alert { border: 1.5px solid var(--red); background: var(--red-tint); padding: 14px 16px; font-size: var(--f-sm); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.alert[hidden] { display: none; }
.alert p { max-width: 46ch; }
.done { border-top: 3px solid var(--ink); padding-top: var(--s5); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s4); max-width: 640px; }
.done[hidden] { display: none; }
.done__sq { width: 40px; height: 40px; background: var(--red); }
.done:focus { outline: none; }
.done__dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 24px; font-size: 0.8125rem; }
.done__dl dt { color: var(--ink-2); }

/* ---------- 11. Changes, footer ---------- */
.log { grid-column: 6 / span 7; }
.log li { display: grid; grid-template-columns: 120px 56px minmax(0, 1fr); gap: var(--gut); padding: 16px 0; border-bottom: 1px solid var(--hair); align-items: baseline; }
.log li:first-child { padding-top: 0; }
.log time { font-weight: 600; font-size: var(--f-sm); }
.log__v { color: var(--ink-2); }
.log p { max-width: 60ch; color: var(--ink-2); }

.foot { background: var(--ink); color: var(--paper); padding-block: var(--s7) var(--s6); }
.foot .grid { row-gap: var(--s5); }
.foot a:hover { color: var(--paper); text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.foot__mark { grid-column: 1 / span 5; align-self: start; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 2.5rem; letter-spacing: -0.04em; line-height: 1; }
.foot__mark .mark__sq { width: 30px; height: 30px; }
.foot__addr { grid-column: 6 / span 2; font-style: normal; font-size: var(--f-sm); }
.foot__contact { grid-column: 8 / span 3; font-size: var(--f-sm); }
.foot__links { grid-column: 11 / span 2; font-size: var(--f-sm); }
.foot__links a { display: inline-block; padding-block: 3px; }
.foot__small { grid-column: 6 / -1; color: #b9b6ae; border-top: 1px solid #3a3936; padding-top: var(--s4); }

/* ---------- 12. Show mode ---------- */
.show {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--red); color: var(--white);
}
.show::backdrop { background: var(--red); }
.show__in { height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s5); padding: clamp(20px, 5vw, 72px); }
.show__meta { color: var(--white); font-size: 0.875rem; }
.show__tgt {
  margin-top: auto; font-weight: 700; letter-spacing: -0.04em; line-height: 0.94;
  font-size: clamp(3rem, 1rem + 8vw, 10rem); max-width: 12ch; hyphens: auto; overflow-wrap: break-word;
}
.show__tgt.is-m { font-size: clamp(2.6rem, 1rem + 6vw, 7.5rem); max-width: 15ch; }
.show__tgt.is-l { font-size: clamp(2.2rem, 1rem + 4.2vw, 5.5rem); max-width: 20ch; }
.show__src { font-size: var(--f-body); max-width: 40ch; border-top: 2px solid var(--white); padding-top: var(--s3); width: min(100%, 560px); }
.show__close {
  position: absolute; top: clamp(12px, 3vw, 40px); right: clamp(12px, 3vw, 40px);
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 14px;
  border: 1.5px solid var(--white); background: transparent; color: var(--white); font-weight: 600;
}
.show__close:hover { background: var(--white); color: var(--red); }
.show__close:focus-visible { outline-color: var(--white); }

/* ---------- 13. Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* The rows settle into their fields as the list scrolls in (from a visible default) */
  @supports (animation-timeline: view()) {
    .rows li, .log li, .packs tbody tr { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    @keyframes settle { from { translate: 0 10px; opacity: 0.35; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* ---------- 14. Breakpoints ---------- */
@media (max-width: 1180px) {
  .nav { gap: var(--s4); }
  .book__side { grid-column: 1 / span 4; }
  .stage, .list { grid-column: 5 / span 8; }
  .sec__h { grid-column: 1 / span 5; }
  .app__fig, .card__stage, .tablewrap, .method, .plans, .log { grid-column: 6 / span 7; }
  .app__fig { grid-template-columns: 1fr; }
  .phone { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s5); align-items: start; }
  .phone__body { width: 230px; }
  .method { grid-template-columns: 1fr; gap: var(--s5); }
}
@media (max-width: 980px) {
  .sec__h { position: static; }
  .nav { display: none; }
  .top__cta { margin-left: auto; }
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .guides { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .guides i:nth-child(n+7) { display: none; }
  /* Phones and tablets: the sentence comes straight after the opening line, controls follow */
  .book__grid { row-gap: var(--s5); }
  .book__side { display: contents; }
  .book__side > * { grid-column: 1 / -1; }
  .lede { order: 1; max-width: 26ch; }
  .stage { order: 2; }
  .book__side .note { order: 3; }
  .pair { order: 4; }
  .search { order: 5; }
  .cats { order: 6; }
  .list { order: 7; }
  .cats { flex-direction: row; flex-wrap: wrap; gap: var(--s2); border-top: 0; }
  .cat { border: 1.5px solid var(--ink); padding: 8px 12px; justify-content: flex-start; }
  .cat__t { margin-right: 0; }
  .cat[aria-pressed="true"], .cat[aria-pressed="true"]:hover { background: var(--ink); color: var(--paper); }
  .cat[aria-pressed="true"] .cat__n { color: #c9c6bd; }
  .cat[aria-pressed="true"]::before { display: none; }
  .stage, .list { grid-column: 1 / -1; }
  .stage { min-height: 0; }
  .stage__tgt { margin-top: var(--s4); }
  .stage { border-top: 3px solid var(--ink); padding-top: var(--s4); }
  .sec__h { grid-column: 1 / -1; margin-bottom: var(--s6); }
  .app__fig, .card__stage, .tablewrap, .method, .plans, .log { grid-column: 1 / -1; }
  .method { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot__mark { grid-column: 1 / -1; }
  .foot__addr { grid-column: 1 / span 2; }
  .foot__contact { grid-column: 3 / span 2; }
  .foot__links { grid-column: 5 / span 2; }
  .foot__small { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .guides { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .guides i:nth-child(n+5) { display: none; }
  .lede { font-size: 1.3125rem; }
  .book__side .note { display: none; }
  .stage__acts .btn { flex: 1 1 auto; justify-content: center; }
  .stage__acts .toast { flex-basis: 100%; padding-left: 0; }
  .row__btn { grid-template-columns: 1fr; gap: 2px; }
  .phone { grid-template-columns: 1fr; }
  .phone__body { width: min(260px, 78vw); }
  .method { grid-template-columns: 1fr; }
  .packs th, .packs td { padding-right: 8px; }
  .packs th:nth-child(4), .packs td:nth-child(4) { display: none; }
  .packs tfoot td[colspan] { display: none; }
  .packs tfoot th { border-top: 0; }
  .packs tfoot tr { border-top: 3px solid var(--ink); }
  .ptabs { display: grid; }
  .ptable [data-col] { display: none; }
  .ptable.is-plan-traveller [data-col="1"], .ptable.is-plan-counter [data-col="2"], .ptable.is-plan-street [data-col="3"] { display: table-cell; }
  .ptable thead th:first-child { width: 42%; }
  .packs .num { padding-right: 10px; }
  .ptable thead th:first-child { width: 30%; }
  .ptable th, .ptable td { padding-left: 6px; font-size: 0.875rem; }
  .seg span { padding-inline: 8px; font-size: var(--f-sm); }
  .log li { grid-template-columns: auto 1fr; gap: 4px var(--s4); }
  .log p { grid-column: 1 / -1; }
  .total .btn { width: 100%; justify-content: center; }
  .foot__mark { font-size: 2rem; }
  .foot__addr, .foot__contact { grid-column: span 2; }
  .foot__links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 20px; }
}

/* ---------- 15. Print: only the counter card ---------- */
@media print {
  @page { size: A6; margin: 0; }
  body { background: #fff; }
  body * { visibility: hidden; }
  .a6, .a6 * { visibility: visible; }
  .a6 { position: fixed; inset: 0; width: 105mm; height: 148mm; box-shadow: none; padding: 8mm; }
  .top, .foot { display: none; }
}
