/* The one stylesheet. Look: design draft C (design/draft-C.html), chosen 21 Nov 2026 — a calm,
   plain app on cool grey paper with white cards; the blue-red airmail stripe appears only as a
   thin line at the top of the header.
   Draft C names the web fonts Onest and Kalam; the site loads no outside fonts (CSP), so it uses
   the system-font fallback the draft names (system-ui, sans-serif).
   Templates use only the class names in this file; no inline styles anywhere (CSP forbids them). */

:root {
  /* colours, light (draft C) */
  --color-bg: #f2f4f7;
  --color-surface: #ffffff;
  --color-soft: #f5f7fa;          /* quiet fill inside cards */
  --color-text: #111823;
  --color-muted: #5a6474;
  --color-line: #e1e5ec;
  --color-accent: #2756be;
  --color-accent-soft: #e9effb;
  --color-accent-text: #ffffff;
  --color-red: #c93445;
  --color-red-soft: #fbebed;
  --color-focus: #2756be;
  --color-error: #a82a38;
  --color-error-bg: #fbebed;
  --color-warn: #7a4b00;
  --color-warn-bg: #fdf3dd;
  --color-ok: #1e7a55;
  --color-ok-bg: #e4f3ec;
  --color-danger: #c93445;
  --color-danger-text: #ffffff;
  --color-new: #c93445;           /* "new since last visit" dots */
  --stripe-blue: #2756be;
  --stripe-red: #c93445;
  --stripe-gap: transparent;
  --shadow-pressed: 0 1px 2px rgba(0, 0, 0, 0.12);

  /* type: system fonts (draft C's own fallback) */
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-base: 1.125rem;      /* 18px: large enough for readers in their 60s */
  --text-small: 1rem;
  --text-title: clamp(1.75rem, 6.4vw, 2.5rem);
  --text-subtitle: 1.25rem;
  --line-height: 1.55;

  /* shape and space */
  --radius: 12px;
  --radius-small: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --card-pad: 18px;
  --gutter: 16px;
  --max-width: 40rem;
  --tap: 48px;                /* smallest tap target */
  --tabbar-height: 60px;      /* the section bar at the bottom of a phone screen */
  --header-gap: 12px;         /* between the links in the site header (one line at 360px) */
  --header-text: 1rem;
  --border: 1px solid var(--color-line);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0d1117;
    --color-surface: #161c26;
    --color-soft: #1c2330;
    --color-text: #e8ecf2;
    --color-muted: #9aa4b4;
    --color-line: #273041;
    --color-accent: #7ea3f0;
    --color-accent-soft: #1d2a44;
    --color-accent-text: #0d1117;
    --color-red: #f07b88;
    --color-red-soft: #3a1f26;
    --color-focus: #7ea3f0;
    --color-error: #f07b88;
    --color-error-bg: #3a1f26;
    --color-warn: #f0c574;
    --color-warn-bg: #372a12;
    --color-ok: #5cc796;
    --color-ok-bg: #12301f;
    --color-danger: #f07b88;
    --color-danger-text: #1a0b0e;
    --color-new: #f07b88;
    --stripe-blue: #4a76d6;
    --stripe-red: #d2505f;
    --shadow-pressed: 0 1px 2px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height);
  overflow-wrap: anywhere;    /* long German and Spanish words never push the page wider */
  hyphens: auto;
}

a { color: var(--color-accent); text-underline-offset: 0.15em; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--gutter); top: var(--space-2); background: var(--color-surface); padding: var(--space-2); z-index: 10; }

/* the airmail stripe: red and blue slants with gaps, as on an airmail envelope */
.stripe {
  height: 4px;
  background: repeating-linear-gradient(135deg,
    var(--stripe-red) 0 8px, var(--stripe-gap) 8px 12px,
    var(--stripe-blue) 12px 20px, var(--stripe-gap) 20px 24px);
}

/* header */
.site-header { border-bottom: var(--border); background: var(--color-surface); }
.site-header__inner, .main, .site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 56px; gap: 0 var(--header-gap); }
.site-header__nav { display: flex; flex-wrap: wrap; gap: 0 var(--header-gap); margin-left: auto; font-size: var(--header-text); }
.site-header__nav a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--color-muted); font-weight: 500; text-decoration: none; }
.site-header__nav a:hover { color: var(--color-accent); }
.site-header__name {
  font-family: var(--font-heading); font-weight: 800; color: var(--color-text); text-decoration: none;
  min-height: var(--tap); display: flex; align-items: center; gap: var(--space-2);
}
/* a small envelope drawn in CSS before the site name (draft C's logo) */
.site-header__name::before {
  content: ""; flex: none; width: 22px; height: 16px; border: 2px solid currentColor; border-radius: 3px;
  background: linear-gradient(to bottom right, transparent calc(50% - 1px), currentColor calc(50% - 1px), currentColor calc(50% + 1px), transparent calc(50% + 1px)) left top / 50% 60% no-repeat,
              linear-gradient(to bottom left, transparent calc(50% - 1px), currentColor calc(50% - 1px), currentColor calc(50% + 1px), transparent calc(50% + 1px)) right top / 50% 60% no-repeat;
}

/* on phones the envelope gives its room to the header links (one line in es/de) */
@media (max-width: 440px) { .site-header__name::before { display: none; } }

.main { padding-top: var(--space-4); padding-bottom: var(--space-5); }
.site-footer { color: var(--color-muted); font-size: var(--text-small); padding-bottom: var(--space-5); border-top: var(--border); padding-top: var(--space-3); }

.title { font-family: var(--font-heading); font-size: var(--text-title); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 var(--space-3); }
.subtitle { font-family: var(--font-heading); font-size: var(--text-subtitle); font-weight: 700; line-height: 1.3; margin: var(--space-4) 0 var(--space-2); }
/* draft C's section heading: a short plain word in small bold grey above the cards */
.label { font-size: var(--text-small); font-weight: 700; color: var(--color-muted); margin: var(--space-5) 0 10px; line-height: 1.3; }
.tabbar + .label, .main > .label:first-child { margin-top: var(--space-2); }
.lead { color: var(--color-muted); margin: 0 0 var(--space-4); }
.crumb { margin: 0 0 var(--space-2); font-size: var(--text-small); font-weight: 600; }
.crumb a { display: inline-flex; min-height: var(--tap); align-items: center; text-decoration: none; }
.empty { color: var(--color-muted); }

.card { background: var(--color-surface); border: var(--border); border-radius: var(--radius); padding: var(--card-pad); margin: 0 0 var(--space-3); }
.card > .subtitle:first-child, .card > .title:first-child { margin-top: 0; }

.form { display: grid; gap: var(--space-3); }
.field { display: grid; gap: var(--space-1); }
.field__label { font-weight: 600; }
.field__help { color: var(--color-muted); font-size: var(--text-small); margin: 0; }
.field__input {
  font: inherit;
  min-height: var(--tap);
  width: 100%;
  padding: 10px 12px;
  border: var(--border);
  border-radius: var(--radius-small);
  background: var(--color-soft);
  color: var(--color-text);
}
.field__input:focus { border-color: var(--color-accent); }

/* buttons: draft C's .btn (filled blue) and .btn.sec (white with blue text) */
.button {
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 9px 16px;
  border: var(--border);
  border-radius: var(--radius-small);
  background: var(--color-surface);
  color: var(--color-accent);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { border-color: var(--color-accent); }
.button--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-text); }
.button--quiet { border-color: transparent; background: none; color: var(--color-accent); padding-left: var(--space-2); padding-right: var(--space-2); }
.button--quiet:hover { border-color: transparent; text-decoration: underline; }
.button--wide { width: 100%; }
.button--danger { background: var(--color-danger); border-color: var(--color-danger); color: var(--color-danger-text); }
.button:disabled { opacity: 0.6; cursor: wait; }

.notice { border-radius: var(--radius-small); padding: 10px 12px; margin: 0; }
.notice--error { background: var(--color-error-bg); color: var(--color-error); }
.notice--warn { background: var(--color-warn-bg); color: var(--color-warn); }
.notice--ok { background: var(--color-ok-bg); color: var(--color-ok); }
.notice + .notice, .notice + .card, .notice + div { margin-top: var(--space-3); }
.main > .notice { margin-bottom: var(--space-3); }

.list { list-style: none; margin: 0 0 var(--space-3); padding: 0; background: var(--color-surface); border: var(--border); border-radius: var(--radius); overflow: hidden; }
.list__item + .list__item { border-top: var(--border); }
.list__link { display: grid; gap: 2px; padding: 14px var(--space-3); min-height: var(--tap); color: inherit; text-decoration: none; }
.list__link:hover .list__title { color: var(--color-accent); }
.list__item > .list__title { display: block; padding: var(--space-3); }
.list__title { font-weight: 700; }
.list__meta { color: var(--color-muted); font-size: var(--text-small); }
.list__item--cancelled .list__title { text-decoration: line-through; }

.item__address, .item__protected { margin: var(--space-2) 0; }
.item__protected { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); padding: 12px; border: var(--border); border-radius: 10px; }
.item__protected .field__label { width: 100%; color: var(--color-muted); font-size: var(--text-small); }
.visibility { color: var(--color-muted); font-size: var(--text-small); margin: var(--space-3) 0 0; padding-top: 14px; border-top: var(--border); }

.secret { font-family: var(--font-mono); font-size: var(--text-base); letter-spacing: 0.05em; word-break: break-all; }
.item__protected .secret { font-family: var(--font-body); font-size: 1.5rem; font-weight: 800; letter-spacing: 0.16em; font-variant-numeric: tabular-nums; }
.codes { padding-left: var(--space-5); display: grid; gap: var(--space-2); }

/* sign-in, devices and members (steps 4-6) */
.actions { display: grid; gap: var(--space-2); margin: var(--space-2) 0 0; }
.actions form { display: grid; gap: var(--space-1); margin: 0; }
.steps { padding-left: var(--space-4); display: grid; gap: var(--space-2); margin: 0 0 var(--space-3); }
.device { display: grid; gap: var(--space-2); padding: var(--space-3); }
.device__head { display: grid; gap: var(--space-1); }
.device__state { margin: 0; color: var(--color-ok); font-weight: 600; }
.device__state--waiting { color: var(--color-warn); }
.confirm-code { font-family: var(--font-mono); font-size: var(--text-subtitle); letter-spacing: 0.15em; }
.confirm { text-align: center; }
.confirm__code { font-family: var(--font-mono); font-size: 3rem; font-weight: 700; letter-spacing: 0.3em; margin: 0; color: var(--color-accent); }
.member .subtitle:first-child { margin-top: 0; }
.member__invite { color: var(--color-muted); margin: 0 0 var(--space-2); }
.invite-message { white-space: pre-line; font-size: var(--text-small); background: var(--color-soft); border-radius: var(--radius-small); padding: var(--space-3); }
.lost__write-in { font-size: var(--text-subtitle); }

/* trip pages (steps 7-9) */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* the section bar (draft C): a row of tabs on wide screens, fixed at the bottom on phones */
.tabbar { display: flex; flex-wrap: wrap; gap: var(--space-1) 2px; margin: 0 0 var(--space-4); padding: 0 0 var(--space-2); border-bottom: var(--border); }
.tabbar__link { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 12px; border-radius: 6px; color: var(--color-muted); font-weight: 600; text-decoration: none; }
.tabbar__link:hover { color: var(--color-accent); }
.tabbar__link[aria-current] { background: var(--color-accent-soft); color: var(--color-accent); }
.tabbar__icon { flex: none; width: 20px; height: 20px; }
.tabbar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-new); }
@media (max-width: 759px) {
  /* room under the page for the bar and the iPhone's home bar */
  body:has(.tabbar) { padding-bottom: calc(var(--tabbar-height) + 1px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
    margin: 0; padding: 0 0 env(safe-area-inset-bottom);
    background: var(--color-surface); border-top: var(--border); border-bottom: 0;
  }
  .tabbar__link {
    flex-direction: column; justify-content: center; gap: 2px; min-height: var(--tabbar-height); padding: 6px 2px;
    border-radius: 0; font-size: 0.8125rem; line-height: 1.15; text-align: center;
    overflow-wrap: normal; hyphens: manual;
  }
  .tabbar__link[aria-current] { background: none; color: var(--color-accent); box-shadow: inset 0 3px 0 var(--color-accent); }
  .tabbar__icon { width: 24px; height: 24px; }
  .tabbar__dot { position: absolute; top: 8px; left: calc(50% + 10px); }
  .tabbar + .label { margin-top: 0; }
}
.more-list__link { grid-template-columns: 24px minmax(0, 1fr); align-items: center; column-gap: 12px; }
.more-list__link .tabbar__icon { width: 24px; height: 24px; color: var(--color-accent); }
.dot { color: var(--color-new); font-size: 0.75em; }
.tag { display: inline-block; font-size: var(--text-small); font-weight: 700; line-height: 1.5; padding: 0 var(--space-2); border-radius: 4px; background: var(--color-soft); color: var(--color-muted); margin: 0; }
.tag--new { color: var(--color-new); background: var(--color-red-soft); }
.tag--cancelled { color: var(--color-warn); background: var(--color-warn-bg); }
.tag--proposed { color: var(--color-red); background: var(--color-red-soft); }
.card--cancelled .title { text-decoration: line-through; }
.plain-list { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); }
.plain-list a { display: inline-flex; min-height: var(--tap); align-items: center; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); margin: 0 0 var(--space-3); }
.pager .button { color: var(--color-text); font-weight: 600; }
.pager__next { margin-left: auto; }
.item__when, .item__text { margin: var(--space-2) 0; }
.item__when { color: var(--color-muted); font-weight: 600; }
.file-line { margin: 0; padding: 0 var(--space-3) var(--space-3); }
.file-line a { display: inline-flex; min-height: var(--tap); align-items: center; font-weight: 600; text-decoration: none; }

/* the trip's opening card: title and dates */
.trip-card .title { margin-bottom: var(--space-1); }
.trip-card .lead { margin: 0; font-weight: 600; }

/* the days as a route: a dot per day on a thin line (draft C) */
.route { list-style: none; margin: 0 0 var(--space-3); padding: var(--space-2) var(--card-pad); background: var(--color-surface); border: var(--border); border-radius: var(--radius); }
.route__day { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; }
.route__day::before { content: ""; position: absolute; left: 10px; top: 26px; bottom: -14px; border-left: 2px solid var(--color-line); }
.route__day:last-child::before { display: none; }
.route__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--color-accent); background: var(--color-accent); position: relative; z-index: 1; margin-top: 14px; }
.route__day--proposed .route__dot { background: var(--color-surface); }
.route__day--open .route__dot { background: var(--color-surface); border-style: dashed; border-color: var(--color-muted); }
.route__day--cancelled .route__dot { background: var(--color-surface); border-color: var(--color-line); }
.route__day--cancelled .route__title { text-decoration: line-through; color: var(--color-muted); }
.route__link { display: grid; gap: 0; min-height: var(--tap); padding: 10px 0; color: inherit; text-decoration: none; }
.route__link:hover .route__title { color: var(--color-accent); }
.route__when { color: var(--color-muted); font-size: var(--text-small); font-weight: 600; }
.route__title { font-weight: 700; line-height: 1.3; }
.route__title .tag { margin-left: 6px; vertical-align: 2px; }

/* one day (draft C): date and city on top, the plan as lines with thin rules between */
.day-top { margin: 0 0 var(--space-2); }
.day-top .title { font-size: 1.5rem; margin: 0; }
.day-top__date { margin: 0; color: var(--color-muted); font-weight: 600; }
.day-top__city { margin: 0; color: var(--color-accent); font-weight: 700; }
.day-lines { list-style: none; margin: 14px 0 0; padding: 0; }
.day-lines li { padding: 12px 0; border-top: var(--border); }
.day-note { margin: 12px 0 0; background: var(--color-soft); border-radius: var(--radius-small); padding: 10px 12px; color: var(--color-muted); white-space: pre-line; }

.add { padding: 0; }
.add__summary { cursor: pointer; font-weight: 700; color: var(--color-accent); min-height: var(--tap); display: flex; align-items: center; padding: var(--space-2) var(--card-pad); }
.add[open] .add__summary { border-bottom: var(--border); }
.add > .form, .add > form { padding: var(--card-pad); }
.fieldset { border: var(--border); border-radius: var(--radius-small); padding: var(--space-2) var(--space-3) var(--space-3); margin: 0; min-width: 0; }
.choice { display: flex; align-items: center; gap: 10px; min-height: var(--tap); }
.choice input { width: 1.4em; height: 1.4em; flex: none; margin: 0; accent-color: var(--color-accent); }
.choice-group { display: grid; padding-left: var(--space-4); }
.field__input--long { min-height: calc(var(--tap) * 2); resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: var(--space-3); }
.vis-sentence { margin: 0; padding: 10px 12px; border-left: 4px solid var(--color-accent); background: var(--color-accent-soft); border-radius: var(--radius-small); }

/* questions to vote on (draft C's poll): each choice a bordered box, the reader's own in blue */
.question__title { font-size: var(--text-subtitle); font-weight: 700; line-height: 1.3; margin: 0 0 var(--space-2); }
.question__title a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.question__title a:hover { color: var(--color-accent); }
.option { display: grid; gap: var(--space-1); margin: 0 0 10px; }
.option__button { width: 100%; justify-content: flex-start; text-align: left; min-height: 56px; padding: 12px 14px; border-radius: 10px; color: var(--color-text); }
.option__button.button--primary { background: var(--color-accent-soft); border-color: var(--color-accent); color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.option .list__meta { padding-left: 14px; }
.find { display: grid; }
.find__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0 var(--space-3) 14px; }
.find__actions form { margin: 0; }

/* comments (draft C): name in bold, the time in grey, a thin rule between them */
.comments { list-style: none; margin: 0 0 var(--space-3); padding: 0 var(--card-pad); display: grid; background: var(--color-surface); border: var(--border); border-radius: var(--radius); }
.comment { padding: 12px 0; }
.comment + .comment { border-top: var(--border); }
.comment__who { margin: 0; font-weight: 700; }
.comment__who .list__meta { font-weight: 500; margin-left: 6px; }
.comment__text { margin: var(--space-1) 0; white-space: pre-line; }

.totals__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); margin: var(--space-2) 0; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  .page--card .card { break-inside: avoid; border-color: #999; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---- steps 10-12: language switch, "in English" label, owner notes, offline pack ---- */
.lang-switch { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.lang-switch__buttons { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--color-soft); border: var(--border); border-radius: var(--radius-small); padding: 3px; }
.lang-switch__button { color: var(--color-muted); border-radius: 6px; min-height: 42px; padding: 0 12px; }
.lang-switch__button:hover { text-decoration: none; color: var(--color-text); }
.lang-switch__button[aria-current="true"] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-pressed); }
.in-english { display: inline-block; margin: 0 0 var(--space-2); padding: 0 var(--space-2); font-size: var(--text-small);
  color: var(--color-muted); background: var(--color-soft); border-radius: 4px; }
.item__text { white-space: pre-line; }
.owner-fields { margin: var(--space-3) 0; padding: var(--space-3); background: var(--color-soft); border-radius: var(--radius-small);
  font-size: var(--text-small); }
.owner-field { display: grid; grid-template-columns: minmax(0, 1fr); margin-bottom: var(--space-2); }
.owner-field dt { color: var(--color-muted); }
.owner-field dd { margin: 0; overflow-wrap: anywhere; }
.offline-banner { position: sticky; top: 0; z-index: 2; margin: 0; border-radius: 0; text-align: center; }
.offline-status { font-weight: 600; }
.member__lang select { min-height: var(--tap); }

/* readability for older readers (audit): question title links are at least 44px tall (see
   .question__title a; list and plain-list links have --tap, 48px); the "tap your choice" line
   sits above the vote buttons */
.vote-tap { margin: 0 0 var(--space-2); font-weight: 700; color: var(--color-red); }
.proposed { font-weight: 700; color: var(--color-red); background: var(--color-red-soft); border-radius: var(--radius-small); padding: 8px 12px; }
