/* Find Your World: the one stylesheet of the member site and its public shell (Story 1.1).
   Every value is a DESIGN.md token (ux-FindYourWorld-2026-10-15/DESIGN.md), written as a custom property under
   :root and used by name below. Mobile first: the base rules are the phone rules; 760px and 1100px widen.
   Breakpoints (documented here because a custom property cannot carry one): single column below 760px, two
   columns from 760px to 1100px, the container caps at 1160px. No inline styles anywhere; no second accent, no dark
   mode, no new font. The eight Explorer colours are keyed by seat (1 to 8, DESIGN.md's order), never by a name:
   this file is public and ships to dev, which holds fictional names only. */

/* ---- Fonts: self-hosted woff2 under /fonts/ (OFL; see fonts/README.md). No request ever goes to Google. ---- */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens (DESIGN.md) ---- */
:root {
  /* colours */
  --color-navy: #0B1623;
  --color-navy-2: #162434;
  --color-gold: #B5872A;
  --color-gold-2: #C9982E;
  --color-gold-marketing: #C9A84C;
  --color-ivory: #FAF8F4;
  --color-ivory-deep: #F2EDE4;
  --color-white: #FFFFFF;
  --color-text-1: #0B1623;
  --color-text-2: #4A5568;
  --color-text-3: #9CA3AF;
  --color-border: #E4DDD2;
  --color-border-2: #D4CCC0;
  --color-error-bg: #FEF2F2;
  --color-error-border: #FECACA;
  --color-error-text: #B91C1C;
  /* Story 8.78 (AC 9): the warning colours, amber (gold is the success notice's). */
  --color-warning-bg: #FFF4E0;
  --color-warning-border: #D98E04;
  --color-warning-text: #7A4A00;
  /* role tag colours, Mike's admin-users screen (Polish 2026-10-26); Admin is ours */
  --color-role-advocate: #5B21B6;
  --color-role-explorer: #1B5E7C;
  --color-role-family: #1E6B40;
  --color-role-parent: #666666;
  --color-role-admin: #0B1623;
  /* the eight Explorer colours by seat, DESIGN.md order, and their tints */
  --color-explorer-1: #7C4F1E;
  --color-explorer-2: #1B5E7C;
  --color-explorer-3: #7C1E4A;
  --color-explorer-4: #1E3A7C;
  --color-explorer-5: #5C3600;
  --color-explorer-6: #3A1E7C;
  --color-explorer-7: #1E6B40;
  --color-explorer-8: #6B1E1E;
  --color-explorer-1-tint: #FDF4EC;
  --color-explorer-2-tint: #EDF6FC;
  --color-explorer-3-tint: #FCEDF4;
  --color-explorer-4-tint: #EDF1FC;
  --color-explorer-5-tint: #FDF2E8;
  --color-explorer-6-tint: #F0EDFB;
  --color-explorer-7-tint: #EDFAF3;
  --color-explorer-8-tint: #FBEEED;

  /* typography roles */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', 'Helvetica Neue', system-ui, sans-serif;
  --text-display-xl: 32px;   /* 40px from 760px */
  --text-display-lg: 28px;
  --text-display-md: 22px;
  --text-body: 16px;         /* 15px from 760px; 16px on phones so iOS does not zoom inputs */
  --text-body-sm: 13px;
  --text-label: 12px;
  --text-tag: 11px;
  --text-status: 19px;       /* Story 8.20: a gold status word. Gold on white is 3.25:1, which passes only as large text: bold at 18.66px or more */
  --text-nav: 14px;
  --line-display: 1.15;
  --line-display-xl: 1.1;
  --line-body: 1.5;
  --tracking-label: 0.6px;
  --tracking-tag: 0.4px;
  --tracking-nav: 0.2px;

  /* radii */
  --radius-sm: 8px;
  --radius: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --radius-xxl: 20px;
  --radius-full: 9999px;

  /* spacing (4px steps) and widths */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --gutter: 16px;            /* 48px from 760px */
  --container-max: 1160px;
  --content-max: 960px;
  --card-pad: 20px;          /* 24px from 760px */
  --section-gap: 32px;

  /* elevation and overlay */
  --shadow-hover: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-menu: 0 8px 32px rgba(11, 22, 35, 0.35);
  --overlay: rgba(11, 22, 35, 0.65);
  --overlay-blur: 6px;

  /* interaction */
  --tap-min: 44px;
  --focus-ring: 2px solid var(--color-gold);
}

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

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

body {
  margin: 0;
  background: var(--color-ivory);
  color: var(--color-text-1);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--line-body);
}

/* The display face's digits sit on the line in every heading ("Users (9)"): Cormorant's default old-style figures hang below the
   baseline (4.2 Polish fix list B1, 2026-10-29; Docs/render-taste.md rule 9). */
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-variant-numeric: lining-nums;
  font-weight: 600;
  line-height: var(--line-display);
  color: var(--color-navy);
  margin: 0 0 var(--space-3);
}

h1 {
  font-size: var(--text-display-xl);
  line-height: var(--line-display-xl);
}

h2 {
  font-size: var(--text-display-lg);
}

h3 {
  font-size: var(--text-display-md);
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--color-navy);
}

main {
  display: block;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-8) var(--gutter);
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* ---- Components (DESIGN.md Components) ---- */
.button-primary,
.button-dark,
.button-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 13px 28px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-body); /* 16px on phones, 15px from 760px; was 14px (Todd, polish 2026-10-26: "Sign in" read too small on a full-width button) */
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  white-space: nowrap; /* a squeezed table cell broke "Resend" into two lines (Users list, polish 2026-10-26) */
}

/* An arrow or icon after the words gets its own gap: inline-flex drops the space inside the span (polish 2026-10-26). */
.button-primary > span:not(:first-child),
.button-dark > span:not(:first-child),
.button-outline > span:not(:first-child) {
  margin-left: 0.4em;
}

.button-primary {
  background: var(--color-gold);
  color: var(--color-white);
}

.button-primary:hover {
  background: var(--color-gold-2);
}

.button-dark {
  background: var(--color-navy);
  color: var(--color-white);
}

.button-dark:hover {
  background: var(--color-navy-2);
}

.button-outline {
  background: transparent;
  color: var(--color-navy);
  border-color: var(--color-border-2);
  padding: 11px 24px;
}

/* The small variant keeps the 44 px tap minimum on phones (DESIGN.md Components); it shrinks from 760px up. */
.button-small {
  padding: 8px 18px;
  font-size: 13px;
  white-space: nowrap;
}

/* Disable-while-saving (Story 1.13, UX-DR19): form-submit.js disables a form's buttons on the first press and gives the
   pressed one the spinner. Every button, so Sign out in the nav is covered too. */
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.is-saving {
  cursor: progress;
}

.is-saving::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: var(--space-2);
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: form-submit-spin 0.8s linear infinite;
}

@keyframes form-submit-spin {
  to {
    transform: rotate(360deg);
  }
}

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--card-pad);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card img,
.card video {
  border-radius: var(--radius-md);
}

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--color-text-1);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--color-text-2);
  outline: none;
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
}

.textarea {
  min-height: 100px;
  resize: vertical;
}

/* Safari draws a native select shorter than the inputs beside it (the sign and time-zone lists sat half the height
   of their neighbours, polish 2026-10-26): draw it ourselves, same box as .input, with a chevron on the right. */
.select {
  -webkit-appearance: none;
  appearance: none;
  min-height: 46px;
  padding-right: 40px;
  /* Story 8.4: a file, not a data: URI, so img-src needs no data: */
  background-image: url("/img/select-arrow.svg");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* iOS Safari gives a time or date input its own width and centres the value; without this the quiet-hours boxes ran
   past the card's edge on a phone (polish 2026-10-26). */
.input[type="time"],
.input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

.label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-2);
}

/* Story 8.12 (note 18): a label set as a heading (it keeps the h3 for heading order) takes the face every other label uses. */
h3.label {
  font-family: var(--font-body);
  line-height: var(--line-body);
}

.tab {
  display: inline-block;
  padding: 14px 22px;
  min-height: var(--tap-min);
  font-size: var(--text-nav);
  font-weight: 500;
  letter-spacing: var(--tracking-nav);
  color: var(--color-text-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.tab[aria-selected='true'],
.tab.is-active {
  color: var(--color-navy);
  border-bottom-color: var(--color-gold);
}

.tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: var(--radius-full);
  font-size: var(--text-tag);
  font-weight: 600;
  letter-spacing: var(--tracking-tag);
  text-transform: uppercase;
  background: var(--color-ivory-deep);
  color: var(--color-text-2);
  white-space: nowrap; /* "EXPLORER" broke into "EXPLOR ER" in the Users list's role column (polish 2026-10-26) */
}

.tag-role-advocate { background: var(--color-role-advocate); color: var(--color-white); }
.tag-role-explorer { background: var(--color-role-explorer); color: var(--color-white); }
.tag-role-family { background: var(--color-role-family); color: var(--color-white); }
.tag-role-parent { background: var(--color-role-parent); color: var(--color-white); }
.tag-role-admin { background: var(--color-role-admin); color: var(--color-white); }

.nav-bar {
  background: var(--color-navy);
  color: var(--color-white);
}

.nav-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-2) var(--gutter);
  min-height: 56px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-display-md);
  color: var(--color-white);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 var(--space-2);
  font-size: var(--text-nav);
  font-weight: 500;
  letter-spacing: var(--tracking-nav);
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.nav-link:hover,
.nav-link.is-active,
.nav-link[aria-current='page'] {
  color: var(--color-white);
}

/* The phone menu: a <details> so the URL never carries a hash (NFR-2). Story 1.4's _NavPartial renders it. */
.nav-menu {
  position: relative;
}

.nav-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  color: var(--color-white);
  font-size: var(--text-nav);
  font-weight: 500;
}

.nav-menu > summary::-webkit-details-marker {
  display: none;
}

.nav-menu[open] > .nav-menu-sheet {
  position: absolute;
  right: 0;
  left: auto;
  width: calc(100vw - 2 * var(--gutter));
  margin-top: var(--space-2);
  padding: var(--space-4);
  background: var(--color-navy);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-menu);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.error-banner {
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  color: var(--color-error-text);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

/* Story 8.78 (AC 7, 9): a save held back by a warning, the error-banner's shape in amber. */
.warning-banner {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning-text);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

/* The success line after a save (Story 1.6; UX-DR20's gold-bordered banner), the error-banner's shape in gold. */
.notice-banner {
  background: var(--color-ivory);
  border: 1px solid var(--color-gold);
  color: var(--color-text-1);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-4);
}

.field-error {
  color: var(--color-error-text);
  font-size: var(--text-body-sm);
  margin-top: var(--space-1);
}

/* Story 8.78 (AC 2, 9): the yellow note under a field, the field-error's shape in the warning text colour. */
.field-warning {
  display: block;
  color: var(--color-warning-text);
  font-size: var(--text-body-sm);
  margin-top: var(--space-1);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  overflow: hidden;
}

.avatar-fallback {
  background: var(--color-navy);
  color: var(--color-white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-display-md);
}

/* Story 1.10 (decision 14): the fallback's colour is the member's seat, wherever _AvatarPartial renders it: gold for every
   role but an Explorer (seat-0, 1.4's look), the Explorer's colour for seats 1 to 8 (UX-DR2). */
.avatar-fallback.seat-0 {
  background: var(--color-gold);
  color: var(--color-navy);
}

.avatar-fallback.seat-1 {
  background: var(--color-explorer-1);
  color: var(--color-white);
}

.avatar-fallback.seat-2 {
  background: var(--color-explorer-2);
  color: var(--color-white);
}

.avatar-fallback.seat-3 {
  background: var(--color-explorer-3);
  color: var(--color-white);
}

.avatar-fallback.seat-4 {
  background: var(--color-explorer-4);
  color: var(--color-white);
}

.avatar-fallback.seat-5 {
  background: var(--color-explorer-5);
  color: var(--color-white);
}

.avatar-fallback.seat-6 {
  background: var(--color-explorer-6);
  color: var(--color-white);
}

.avatar-fallback.seat-7 {
  background: var(--color-explorer-7);
  color: var(--color-white);
}

.avatar-fallback.seat-8 {
  background: var(--color-explorer-8);
  color: var(--color-white);
}

.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(var(--overlay-blur));
  -webkit-backdrop-filter: blur(var(--overlay-blur));
}

/* ---- Story 1.1 surfaces: the placeholder, the error page, the footer ---- */
.placeholder {
  padding: var(--space-12) 0;
  text-align: center;
}

/* Story 8.35 (AC 11): a Site admin's bar names the Group under the wordmark, small, in the bar's own colour, one line. */
.nav-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nav-group-line {
  margin: 0;
  font-size: var(--text-body-sm);
  color: var(--color-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.wordmark-heading {
  font-size: var(--text-display-xl);
}

.error-page {
  max-width: var(--content-max);
  margin: 0 auto;
}

.error-page-sentence {
  color: var(--color-text-2);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-6) var(--gutter);
  text-align: center;
  color: var(--color-text-3);
  font-size: var(--text-body-sm);
  /* Story 1.17: the wordmark and the Privacy link side by side, wrapping on a narrow phone. */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
}

.site-footer-wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-display-md);
  color: var(--color-navy);
}

/* Story 1.17: a 44 px tap target, underlined so it reads as a link; focus uses the global :focus-visible ring. */
.site-footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-2);
  color: var(--color-text-2);
  text-decoration: underline;
}

.site-footer-link:hover {
  color: var(--color-navy);
}

/* ---- Story 1.17 surface: the privacy page ---- */
.privacy-page {
  max-width: var(--content-max);
  margin: 0 auto;
}

.privacy-section {
  margin-top: var(--space-6);
}

.privacy-mail {
  overflow-wrap: anywhere;
}

/* Story 8.61: under the h1, italic as in Mike's Privacy Policy. */
.privacy-updated {
  margin: 0 0 var(--space-6);
  color: var(--color-text-2);
  font-size: var(--text-body-sm);
  font-style: italic;
}

/* ---- Story 1.20 surface: the terms page ---- */
.terms-page {
  max-width: var(--content-max);
  margin: 0 auto;
}

.terms-section {
  margin-top: var(--space-6);
}

.terms-mail {
  overflow-wrap: anywhere;
}

/* Story 8.61: under the h1, italic as in Mike's Terms of Use. */
.terms-updated {
  margin: 0 0 var(--space-6);
  color: var(--color-text-2);
  font-size: var(--text-body-sm);
  font-style: italic;
}

/* ---- Story 1.3 surfaces: the sign-in panel and the placeholder Wall ---- */
.account-panel {
  max-width: calc(var(--content-max) / 2);
  margin: 0 auto;
}

.account-panel:hover {
  box-shadow: none;
}

.account-lede {
  color: var(--color-text-2);
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.account-field {
  display: flex;
  flex-direction: column;
}

.account-field .label {
  margin-bottom: var(--space-2);
}

.account-submit {
  width: 100%;
  justify-content: center;
}

.account-aside {
  margin: var(--space-4) 0 0;
  text-align: center;
}

.wall {
  max-width: var(--content-max);
  margin: 0 auto;
  min-width: 0;
}

.wall-empty {
  color: var(--color-text-2);
}

/* ---- Story 8.16: the Wall's tiles and the Explorer's destination box (the colours are in app.css). Two to a row below 760 px, three or
   four from it; the icon sits inline before the title and the line wraps under them, never clipped. The margins here are what keep the
   Globe on the first screen at 375 (rule 10: the tiles give way, never the Globe). Story 8.73: the Admin's or an Advocate's own row
   (.wall-role-access) comes first, after the Globe band, with the same margins and the same tiles. ---- */
.wall-tiles,
.wall-role-access {
  margin: var(--space-3) 0;
  min-width: 0;
}

.wall-tiles-heading {
  margin: 0 0 var(--space-1);
  font-size: var(--text-label);
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.wall-tiles-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.wall-tiles-list > li {
  display: flex;
  min-width: 0;
}

.wall-tile {
  display: block;
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--space-2);
  text-decoration: none;
}

.wall-tile-title {
  font-size: var(--text-body);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.wall-tile-icon {
  margin-right: var(--space-1);
}

.wall-tile-line {
  display: block;
  font-size: var(--text-body-sm);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.wall-destination {
  margin: var(--space-3) 0;
  padding: var(--space-2) var(--space-3);
}

.wall-destination .label {
  margin-bottom: 0;
}

.wall-destination-name {
  margin: 0;
}

/* Mike's pin on the empty state (prototype explorer/dashboard). */
.wall-destination-empty::before {
  content: "📍 ";
}

.wall-destination-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  margin-right: var(--space-3);
}

@media (min-width: 760px) {
  .wall-tiles-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wall-tiles-list[data-count="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wall-tile {
    padding: var(--space-3);
  }
}

/* ---- Story 3.5: the Wall's phone layout (the colours are in app.css). An empty slot is zero tall; the filter row is one wrapping
   flex row of Mike's "Filter:" label, Everyone and the pills (R2 F-27); the feed is one column; the card copies the Entry page's
   header; every pill and heart is a 44 px target; nothing in a card is wider than its column. ---- */
.wall-slot {
  margin: 0;
  padding: 0;
  min-width: 0;
}

.wall-filter {
  margin: var(--space-4) 0 var(--space-5);
  min-width: 0;
}

.wall-filter-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.wall-filter-label-item {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
}

.wall-filter-label {
  margin: 0;
}

.wall-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  padding: 0 var(--space-4) 0 var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.wall-filter-pill .avatar {
  flex: none;
}

.wall-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
}

.wall-feed-heading {
  margin: 0;
}

.entry-card {
  min-width: 0;
}

.entry-card:hover {
  box-shadow: none;
}

.entry-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  margin: 0 0 var(--space-1);
  min-width: 0;
}

.entry-card-header .avatar {
  flex: none; /* visual pass 3.4: a long name beside it squeezed the round avatar into a pill */
}

.entry-card-author {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

/* UX-DR4 "Day 3, Lisbon in body-sm text-2": an h2 for heading navigation and the link, sized as the quiet line under the name (R1 F-14). */
.entry-card-label {
  margin: 0 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 400;
  line-height: 1.4;
}

.entry-card .video-control {
  margin: 0 0 var(--space-4);
}

.entry-card .video-frame iframe,
.entry-card .photo-grid-item img {
  max-width: 100%;
  min-width: 0;
}

.entry-card-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
  margin: 0 0 var(--space-4);
}

.entry-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  margin: var(--space-3) 0 0;
}

.heart-form,
.like-form {
  display: inline-flex;
  margin: 0;
}

.heart,
.like {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border-2);
  border-radius: var(--radius-full);
  background: var(--color-white);
  font: inherit;
  cursor: pointer;
}

.heart-glyph,
.like-glyph {
  font-size: 1.15em;
  line-height: 1;
}

.entry-card-comments,
.entry-card-edit {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
}

/* Kept rendered when empty (code review 3.4's live-region rule): the heart's failure sentence lands here. */
.entry-card-foot .field-error {
  flex-basis: 100%;
  margin: 0;
}

.wall-older {
  align-self: center;
  margin: var(--space-2) 0 0;
}

/* ---- Story 1.4: the member nav bar, breadcrumbs, the stub ---- */
.nav-bar {
  position: relative;
}

.nav-member-links,
.nav-phone-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Below 760 px the member items live in the Menu sheet; 1.1's .nav-links (the public bar) is untouched. */
.nav-member-links {
  display: none;
}

.nav-end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-account-toggle {
  min-width: var(--tap-min);
  justify-content: center;
  gap: var(--space-2); /* Story 8.57 (AC 3): the avatar and, from 1100 px, the name beside it */
}

.nav-menu.nav-account[open] > .nav-account-sheet {
  width: auto;
  min-width: 200px;
  z-index: 10;
}

/* The phone sheet hangs from the bar itself, so it spans the viewport with no height constant and no 100vw. */
.nav-menu.nav-menu-phone {
  position: static;
}

.nav-menu.nav-menu-phone[open] > .nav-phone-sheet {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: auto;
  margin-top: 0;
  border-radius: 0;
  z-index: 10;
}

.nav-phone-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav-signout {
  margin: 0;
}

/* Story 8.19: the role worn, at the top of the account menu; a line of text, never a link. */
.nav-account-role {
  margin: 0;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-body-sm);
  white-space: nowrap;
}

.nav-signout-button {
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* ---- Story 8.41: the bar as Mike drew it (polish notes M9). The wordmark's gold globe tile, the Explorers drop-down with its
   dividers, the outlined Admin pill, the name over "My Profile", the bell and the sign-out glyph. Glyphs are aria-hidden text. ---- */
.wordmark {
  gap: var(--space-2);
  white-space: nowrap;
}

.wordmark-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-gold);
  color: var(--color-white);
}

.nav-glyph {
  margin-right: var(--space-1);
}

.nav-label {
  white-space: nowrap;
}

.nav-menu > summary.nav-group-toggle {
  padding: 0 var(--space-2);
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: var(--tracking-nav);
  white-space: nowrap;
}

.nav-menu > summary.nav-group-toggle:hover,
.nav-menu.nav-group[open] > summary.nav-group-toggle {
  color: var(--color-white);
}

.nav-caret {
  margin-left: var(--space-1);
  font-size: 0.65em;
}

/* A current item and the drop-down holding it carry one underline, not only a colour (UX-DR22). */
.nav-member-links .nav-link[aria-current='page'],
.nav-phone-links .nav-link[aria-current='page'],
.nav-menu > summary.nav-group-toggle[aria-current='true'] {
  color: var(--color-white);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* The drop-down's panel hangs from its summary's left edge (the account sheet hangs from the right). */
.nav-menu.nav-group[open] > .nav-group-sheet {
  left: 0;
  right: auto;
  width: auto;
  min-width: 240px;
  padding: var(--space-2) 0;
  z-index: 10;
}

.nav-group-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.nav-member-links .nav-group-links .nav-link {
  display: flex;
  padding: var(--space-1) var(--space-3);
}

.nav-divider {
  height: 1px;
  margin: var(--space-1) var(--space-3);
  background: rgba(255, 255, 255, 0.15);
}

.nav-member-links .nav-link.nav-pill {
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-sm);
}

.nav-member-links .nav-link.nav-pill[aria-current='page'] {
  border-color: var(--color-white);
}

/* The name over "My Profile", the bell and the sign-out glyph: hidden on a phone (the sheet carries them). */
.nav-profile-link,
.nav-bell,
.nav-signout-bar {
  display: none;
}

.nav-profile-link {
  flex-direction: column;
  justify-content: center;
  min-height: var(--tap-min);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.nav-profile-link .nav-account-name {
  display: block;
  color: var(--color-white);
  font-size: var(--text-nav);
  font-weight: 500;
}

.nav-profile-sub {
  color: var(--color-gold-2);
  font-size: var(--text-body-sm);
}

.nav-bell,
.nav-signout-glyph {
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
}

.nav-signout-glyph {
  display: inline-flex;
}

.nav-bell:hover,
.nav-signout-glyph:hover {
  color: var(--color-white);
}

.breadcrumbs {
  max-width: var(--content-max);
  margin: 0 auto var(--space-4);
  font-size: var(--text-body-sm);
  color: var(--color-text-2);
}

/* Story 8.3: one line at every width. A crumb longer than its share (a long full name's "... 's Journey") shortens with an ellipsis
   instead of wrapping the trail onto three lines, which pushed the page's primary button off the first screen at 375 px. */
.breadcrumbs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-1);
}

.breadcrumbs-item {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  flex: 0 0 auto;
}

/* Only a long crumb (over 20 characters, marked by the partial) gives way; two long ones share the shortening by length. A short crumb
   such as Explorers, Interview or Diary stays whole (visual pass 8.3: an even shrink read "Wall / Ex... / ... / Inte..."). */
.breadcrumbs-item-long {
  flex-shrink: 1;
  min-width: 4.5em;
}

.breadcrumbs-item a,
.breadcrumbs-item [aria-current='page'] {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumbs-item + .breadcrumbs-item::before {
  content: "/";
  content: "/" / "";
  margin-right: var(--space-1);
  color: var(--color-text-3);
}

.breadcrumbs-item a {
  display: block;
  line-height: var(--tap-min);
  min-height: var(--tap-min);
  color: var(--color-text-2);
  text-decoration: none;
}

.breadcrumbs-item a:hover {
  text-decoration: underline;
}

.breadcrumbs-item [aria-current='page'] {
  color: var(--color-text-1);
}

.stub-page {
  max-width: var(--content-max);
  margin: 0 auto;
}

.stub-note {
  color: var(--color-text-2);
}

@media (min-width: 760px) {
  .nav-member-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
  }

  .nav-member-links .nav-link {
    padding: 0 var(--space-1);
  }

  .nav-menu.nav-menu-phone {
    display: none;
  }

  /* Story 8.41: the bell and the sign-out glyph from 760 px. */
  .nav-bell,
  .nav-signout-bar {
    display: inline-flex;
  }
}

/* Story 8.41: the name over "My Profile" from 1100 px; in the account summary beside the avatar since Story 8.57 (a click opens the menu). */
@media (min-width: 1100px) {
  .nav-profile-link {
    display: inline-flex;
  }
}

@media (min-width: 900px) {
  .nav-member-links {
    gap: var(--space-2);
  }

  .nav-member-links .nav-link {
    padding: 0 var(--space-2);
  }
}

/* ---- Story 1.6: the admin table's phone layout (CodingStandards CSS, the named exception: rules that keep a page
   from breaking at phone width live here, so the Users list is never wide for the moment before admin.css arrives).
   The card look, padding and label type stay in admin.css. ---- */
@media (max-width: 759.98px) {
  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .admin-table td {
    overflow-wrap: anywhere;
  }

  .admin-table td::before {
    content: attr(data-label);
    display: block;
  }
}

/* ---- Story 2.1: the Journey form's layout (CodingStandards CSS, the named exception: the rules that decide the 375 px
   layout live here, so the page is never wide before app.css arrives). Colours and the header tint are in app.css. ---- */
.journey-form {
  max-width: var(--content-max);
  margin: 0 auto;
}

.journey-form:hover {
  box-shadow: none;
}

/* ---- Story 3.2: the Diary list's layout (the same named exception): one column of rows, each a 44 px link that wraps
   and never pushes the page sideways. ---- */
.diary {
  max-width: var(--content-max);
  margin: 0 auto;
}

.diary:hover {
  box-shadow: none;
}

.diary-quick-post {
  margin: 0 0 var(--space-4);
}

/* Story 3.15 (AC 6): the quick post and "Post all unposted days" share one row that wraps at 375 px, the primary first; the
   Diary's notice is a step tighter, so "Posted. {k} days went..." on two lines keeps the primary inside the first screen. */
.diary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.diary-actions .diary-quick-post {
  margin: 0;
}

.diary-post-all {
  min-height: var(--tap-min);
}

.diary .notice-banner {
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

.diary-days {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.diary-day {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-height: var(--tap-min);
  min-width: 0;
  padding: var(--space-3) var(--space-4);
}

.diary-day-label {
  flex: 1 1 12rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.journey-form-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.journey-section {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-6);
  min-width: 0;
}

.journey-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

/* Story 8.60 (Todd's eye): the five section legends read as headings, one step above the field labels; the uppercase and the letter-spacing
   stay from .label (the Pilot's section heading). DM Sans is self-hosted to 600, so 700 renders at 600. Size and margin only; the gold is app.css's.
   Story 8.52 (decision D1): the flights fold's summary is that section's visible heading now, outside the fieldset, so it joins the rule. */
.journey-section .journey-section-title,
.journey-flights-fold > summary {
  font-size: var(--text-body-sm);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

/* Story 8.38 (AC 2, 3): the home city's City box and State drop-down on one line at every width; the destination airport and the
   destination city stacked below 760 px and side by side from it (the media block below). Layout only; colours stay in app.css. */
.journey-home-row {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}

.journey-home-row .input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.journey-home-row .journey-state {
  flex: 0 0 6.5rem;
  width: 6.5rem;
}

.journey-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-4);
}

/* ---- Story 3.12: the flights section's four sub-sections and Mike's view card under the form (layout; colours in app.css). ---- */
.journey-subsection {
  border: 0;
  padding: 0;
  margin: var(--space-4) 0 0;
  min-width: 0;
}

.journey-subsection-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  padding: 0;
  margin: 0 0 var(--space-3);
}

/* The reveals of journey-flights.js: a hidden leg, field or button stays hidden whatever its display rule. */
.journey-flights [hidden] {
  display: none;
}

.journey-flights [data-flight-action="add-return"] {
  margin: var(--space-4) 0 0;
  min-height: var(--tap-min);
}

/* Story 8.52 (AC 5): the flights section folds under one summary until anything is known, a 44px row with no marker, as the board's toggle
   (its size is the heading rule's above). Closed, the fold keeps the section's bottom gap the hidden fieldset carried (decision D3). Layout only;
   the gold is app.css's. */
.journey-flights-fold > summary {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  cursor: pointer;
  list-style: none;
}

.journey-flights-fold > summary::-webkit-details-marker {
  display: none;
}

.journey-flights-fold:not([open]) {
  margin-bottom: var(--space-6);
}

.journey-flights-fold:not([open]) > summary {
  margin-bottom: 0;
}

.journey-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}

.journey-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  min-width: 0;
}

.journey-check input {
  flex: none;
  width: 22px;
  height: 22px;
}

.journey-check label {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  min-width: 0;
  overflow-wrap: break-word;
}

.flights-card {
  max-width: var(--content-max);
  margin: var(--space-4) auto 0;
  display: grid;
  gap: var(--space-3);
}

.flights-card:hover {
  box-shadow: none;
}

.flights-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.flights-card-head h2 {
  margin: 0;
}

.flights-card-edit,
.flights-card-add {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  justify-self: start;
}

.flights-card-empty,
.flights-card-leg p,
.flights-card-checks-title {
  margin: 0;
}

.flights-card-leg {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  overflow-wrap: anywhere;
}

.flights-card-flight,
.flights-card-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.flights-card-plans {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.flights-card-plans dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.flights-card-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.flights-card-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Story 2.12: the step bar's layout (the phone-safety exception; its colours are in app.css). Mobile first: three full-width rows with a small
   downward arrow between them, a divider, then the links on one row. From 640 px: the steps and arrows on one row, the links on their own row. */
.journey-tabs {
  margin: 0 0 var(--space-3);
}

.journey-steps,
.journey-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.journey-steps {
  display: flex;
  flex-direction: column;
}

.journey-step {
  min-width: 0;
}

.journey-step-link {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 var(--space-2);
  min-height: var(--tap-min);
  padding: 2px 0;
  text-decoration: none;
}

.journey-step-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  font-size: var(--text-label);
  font-weight: 600;
}

.journey-step-label {
  flex: 1 1 0;
  min-width: 0;
  font-size: var(--text-body-sm);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.journey-step-state {
  flex: none;
  font-size: var(--text-label);
}

/* Story 8.59: the Pilot's arrow, an SVG in currentColor (its stroke in app.css), at every width. On the phone it is drawn 16 by 10 and
   turned to point down, centred under the circle in a 6 px box (the height of the triangle it replaced, so the bar does not grow; the turned
   arrow overflows into the step links' empty space and never takes their taps). Right-pointing at the Pilot's 22 by 14 from 640 px. */
.journey-step-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  flex: none;
  width: 24px;
  height: 6px;
  margin: 0;
  pointer-events: none;
}

.journey-arrow {
  display: block;
  flex: none;
  width: 16px;
  height: 10px;
  transform: rotate(90deg);
  pointer-events: none;
}

.journey-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
  margin-top: var(--space-1);
}

.journey-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  font-size: var(--text-body-sm);
  overflow-wrap: anywhere;
}

/* Story 8.59: the Pilot's icons are app.css's ::before content; the space after each is a margin, since a flex item's trailing space collapses. */
.journey-link-videos::before,
.journey-link-chats::before,
.journey-link-card::before {
  margin-right: 0.35em;
}

/* Story 2.12 (Task 3.4, decision 5): below 640 px the bar's 193 px pushed the Interview's Submit to 740 on Review (PageGate). The gaps
   tighten, and the amber box (98 px of "you can't submit yet") follows the button; the green box keeps its place, since it
   says "below". */
@media (max-width: 639px) {
  /* Story 8.12 (notes 1, 9): render-taste rule 11, at phone width only. */
  .journey-step-circle { width: 32px; height: 32px; font-size: var(--text-body); }
  .journey-step-label,
  .journey-step-state,
  .journey-link { font-size: var(--text-body); }
  .journey-step-arrow { width: 32px; margin-left: 0; }
  /* Decision 4: the larger bar takes its height from the page's own gaps, so each page's primary stays in the first screen (PageGate). */
  .journey-step-label { line-height: 1.25; }
  main:has(> .journey-tabs) { padding-top: 0; }
  .breadcrumbs:has(+ .journey-header) { margin-bottom: var(--space-1); }
  .journey-tabs { margin-bottom: 0; }
  .journey-links { margin-top: 0; }
  /* Story 8.59 (run-story 4c): with the icons the three links measure 332 px; at 12 px gaps Travel Card dropped to a third line and pushed
     the Admin's Journey and Review primaries off the first screen (FullPass). A 4 px gap and a narrower icon space keep them on one line. */
  .journey-links { gap: 0 var(--space-1); }
  .journey-link-videos::before,
  .journey-link-chats::before,
  .journey-link-card::before { margin-right: 0.25em; }
  .interview > h2 { margin-bottom: var(--space-1); }
  .interview-review-submit { display: flex; flex-direction: column; }
  .interview .interview-review-submit > .interview-box { margin-bottom: var(--space-1); padding-top: var(--space-2); padding-bottom: var(--space-2); }
  .interview .interview-review-submit > .interview-box.is-open { order: 1; margin-top: var(--space-2); margin-bottom: 0; }
}

@media (min-width: 640px) {
  .journey-steps {
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
  }

  .journey-step {
    flex: 1 1 0;
  }

  .journey-step-link {
    padding: var(--space-1) 0;
  }

  .journey-step-label {
    flex-basis: calc(100% - 32px);
  }

  .journey-step-state {
    flex-basis: 100%;
    padding-left: 32px;
  }

  .journey-step-arrow {
    align-self: center;
    width: auto;
    height: auto;
    padding: 0 2px;
  }

  .journey-arrow {
    width: 22px;
    height: 14px;
    transform: none;
  }
}

/* Story 8.53: from 850 px the bar is Mike's one row (v6.18 .tabrow): each step a column, the circle above the label above the state word, the
   arrows between, a 1 px divider, then the links. Mike's row starts at 760, but ours measures 743 to 752 px against a 664 px content box
   there (the 48 px gutter), so it starts where it fits (Task 1.4). Under 850 the 640 and phone shapes above stand. The wrap is a safety
   net for text zoom and the Admin's longer "View {name}'s page" only.
   Story 8.59: in the Pilot's proportions. The nav is the white band (app.css) flush under the header, and div.journey-row inside it is the
   Pilot's .tabrow; the steps' padding, the 22 px circle, the 14 px words, the tabs with their gold current border, the divider's margins.
   The row breaks its line on the steps' narrowest width (flex-basis 0, min-width min-content), so the links share the steps' line whenever
   that fits, then the steps shrink from their one-line widths and the long labels wrap. Four paddings are the Pilot's only where his row
   fits with them (--bar-*-pad, the min-width W2 block below); from 850 they are a compact set, measured to keep one row at 850 (Task 2.4). */
@media (min-width: 850px) {
  .journey-row {
    --bar-row-pad: 0px;
    --bar-step-pad: 4px;
    --bar-tab-pad: 6px;
    --bar-div-pad: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    max-width: 940px;
    margin: 0 auto;
    padding: 0 var(--bar-row-pad);
  }

  /* The header and the band read as one card: the header's bottom corners go square and the band takes them. */
  .journey-header:has(+ .journey-tabs) {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .journey-tabs {
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
  }

  .journey-steps {
    flex: 1 1 0;
    min-width: min-content;
    align-items: stretch;
    gap: 0;
  }

  /* Equal columns, each no narrower than its longest word: the long labels wrap evenly, two lines where the row allows. */
  .journey-step {
    flex: 1 1 0;
    min-width: auto;
  }

  .journey-step-link {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 4px;
    box-sizing: border-box;
    height: 100%;
    padding: 12px var(--bar-step-pad) 10px;
    text-align: center;
  }

  .journey-step-circle {
    width: 22px;
    height: 22px;
    font-size: var(--text-tag);
    font-weight: 700;
  }

  .journey-step-label {
    flex: none;
    font-size: var(--text-nav);
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: normal;
  }

  .journey-step-state {
    flex: none;
    padding-left: 0;
    font-size: 10.5px; /* the Pilot's .tabsub; no token is 10.5 */
    white-space: nowrap;
  }

  /* Level with the circles: the step's 12 px top padding plus half the 22 px circle, less half the 14 px arrow. */
  .journey-step-arrow {
    align-self: flex-start;
    margin-top: 16px;
  }

  /* app.css is linked after this file, so the list takes the extra class to win over its border-top. The divider is the list's ::before. */
  .journey-tabs .journey-links {
    display: flex;
    flex: none;
    flex-wrap: nowrap;
    align-self: stretch;
    align-items: stretch;
    gap: 0;
    margin-top: 0;
    padding-left: 0;
    border-top: 0;
    border-left: 0;
  }

  .journey-tabs .journey-links::before {
    content: "";
    flex: none;
    width: 1px;
    margin: 12px var(--bar-div-pad);
  }

  .journey-tabs .journey-links > li {
    display: flex;
  }

  .journey-tabs .journey-link {
    align-items: center;
    padding: 14px var(--bar-tab-pad);
    font-size: var(--text-nav);
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
  }
}

/* Story 8.59 (Task 2.4): with every one of the Pilot's numbers the row measures 848 px against the 844 inside his 940 (48 px each side), so
   from 1040 px, where the row reaches its 940 cap, his numbers stand but for the ladder's first rung, the row's side padding at 16 px (it
   fits from 980, but there the steps' labels squeeze to four lines); from 850 to 1039 the compact set above. */
@media (min-width: 1040px) {
  .journey-row {
    --bar-row-pad: 16px;
    --bar-step-pad: 12px;
    --bar-tab-pad: 12px;
    --bar-div-pad: 10px;
  }
}

.journey-cities {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.journey-city {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.journey-city .label,
.journey-city .input,
.journey-city .field-error {
  flex: 1 1 100%;
  min-width: 0;
}

/* Story 8.51: the Stays block as journey-cities.js draws it, one small form and the list beside it (two halves from 760 px, the media
   block below; the form above the list under it). A listed row shows one line of text and its arrows and Remove link; its boxes are hidden
   inputs and its labels carry the hidden attribute, which the author display rules on .label would beat without the rule here. Layout only. */
.journey-stays {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  margin: 0 0 var(--space-3);
}

.journey-city [hidden] {
  display: none;
}

/* Story 8.60: the companion boxes on Solo; .journey-grid's own display: grid would beat the attribute. */
.journey-grid[hidden] {
  display: none;
}

.journey-stays-form {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3);
}

.journey-stays-list .journey-cities {
  margin: 0;
}

.journey-city.is-listed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
  margin: 0;
  padding: 10px 8px 10px 14px;
}

/* Story 8.65 (the room's drawing, Todd 2026-11-12): a listed stay is a card, its one line city first and its arrows and Remove at its
   right; a refused stay's messages sit under the line (order 2). The drawing's sizes, exactly; the colours and the card's edges are in
   app.css. Layout only. */
.journey-stay-line {
  flex: 1 1 auto;
  order: 0;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.journey-stay-city {
  font-weight: 600;
}

.journey-stay-hotel {
  font-weight: 400;
}

.journey-stay-sep {
  margin: 0;
}

.journey-stay-nights {
  display: inline-block;
  margin-left: 2px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: 1px;
}

.journey-city.is-listed .journey-city-actions {
  display: flex;
  flex: 0 0 auto;
  order: 1;
  align-items: center;
  gap: 0;
  margin-top: 0;
}

.journey-stay-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  min-width: var(--tap-min);
  height: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.journey-stay-remove {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 6px 0 var(--space-1);
  font-size: var(--text-body-sm);
}

.journey-stays-empty {
  margin: var(--space-2) 0 0;
}

/* Story 8.65: the count line sits 4 px under the cards, as on the drawing. */
.journey-stays-count {
  margin: var(--space-1) 0 0;
}

/* A listed stay's refused field: the server's error and the fix sentence each on a line of their own under the stay's line (code review 8.51),
   under the card's one line since 8.65. */
.journey-city.is-listed .field-error:not([hidden]),
.journey-stay-fix {
  display: block;
  flex: 1 1 100%;
  order: 2;
}

.journey-stays-empty[hidden],
.journey-stays-count[hidden] {
  display: none;
}

/* Story 8.31: a stay's Nights box is narrow (two digits), never a full-width line. */
.journey-city .input.journey-nights {
  flex: 0 0 6rem;
  width: 6rem;
}

.journey-city-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.journey-city-actions .button-small,
.journey-choice label {
  min-height: var(--tap-min);
}

.journey-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.journey-choice label {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-4);
}

/* Story 8.12 (note 5): one choice a row on a phone, so a radio never ends a line alone with its label wrapped to the next.
   Story 8.65 (the drawing's phone): a stay card's line takes the full width and its arrows and Remove sit under it at the left. */
@media (max-width: 639px) {
  .journey-choice {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .journey-city.is-listed {
    padding-right: 4px;
  }

  .journey-city.is-listed .journey-stay-line {
    flex-basis: 100%;
  }

  .journey-city.is-listed .journey-city-actions {
    margin-left: -10px;
  }
}

.journey-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  background: var(--color-white);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
}

/* Story 3.1: the three journey texts take the full width (Story 3.11 removed the people-to-meet chips). */
.journey-text {
  width: 100%;
  min-width: 0;
}

@media (min-width: 760px) {
  .journey-grid {
    grid-template-columns: 1fr 1fr;
  }

  .journey-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .journey-stays {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-6);
  }

  .journey-city .input {
    flex: 1 1 auto;
    width: auto;
  }

  .journey-city .input.journey-nights {
    flex: 0 0 6rem;
    width: 6rem;
  }

  .journey-city .label,
  .journey-city .field-error {
    flex-basis: 100%;
  }
}

/* ---- Story 2.2: the video control's layout (the named exception, as the Journey form's): the control's block, the
   16:9 frame and tile, the progress bar's width. Colours and the tints are in app.css. ---- */
.video-control {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

/* Story 8.11: a reader's section for a video that never arrived takes no room. */
.video-control[hidden] {
  display: none;
}

/* Mike's 📹 box is the button; the native file input covers it unseen, so a tap anywhere on the box opens the picker.
   Story 2.3: Retry (a failed row) and Replace video (beside a ready player) are the same box. */
.video-add,
.video-retry,
.video-replace {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  align-self: flex-start;
  min-height: var(--tap-min);
  padding: 0 var(--space-4);
  cursor: pointer;
}

.video-add input[type="file"],
.video-retry input[type="file"],
.video-replace input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.video-progress {
  display: block;
  width: 100%;
  height: 12px;
}

/* The bar is hidden until tus reports progress; an author display rule beats the hidden attribute, so say it here
   (visual pass 2026-10-27: an empty bar showed under "Phone camera is fine" before any pick). */
.video-progress[hidden] {
  display: none;
}

.video-frame,
.video-tile {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-width: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  text-align: center;
}

/* 4.2 Polish fix list G2 (2026-10-29): the Processing tile is a line of text, not a 16:9 box; the player takes the frame's shape when it
   arrives. */
.video-tile.video-processing,
.video-tile.video-unfinished {
  aspect-ratio: auto;
  min-height: 96px;
}

/* ---- Story 1.9: the Profile form's layout (the named exception, as the Journey form's: everything that decides the
   375 px layout lives here; the header band and the role pill are in app.css). ---- */
.profile-form {
  max-width: var(--content-max);
  margin: 0 auto;
}

.profile-form:hover {
  box-shadow: none;
}

.profile-form-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.profile-section {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-6);
  min-width: 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin: 0 0 var(--space-4);
}

.profile-switch {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
}

.profile-switch input {
  width: 22px;
  height: 22px;
  flex: none;
}

.profile-switch label {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
}

.profile-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  background: var(--color-white);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
}

.profile-links {
  max-width: var(--content-max);
  margin: var(--space-6) auto 0;
  display: flex;
  justify-content: center;
}

@media (min-width: 760px) {
  .profile-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- Story 1.11: the Family section on the Explorer's Profile (its own card after the Profile form; the 375 px rules
   live here, the 1.6 4c lesson). ---- */
.profile-family {
  max-width: var(--content-max);
  margin: var(--space-6) auto 0;
}

.profile-family:hover {
  box-shadow: none;
}

/* Story 8.55 (AC 2): the line in the Add family member form's place while the Group's FamilyInvites switch is off. */
.family-admin-only {
  margin: var(--space-4) 0 0;
  color: var(--color-text-2);
}

.family-list {
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0;
}

.family-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.family-name {
  font-weight: 600;
}

.family-relationship,
.family-email {
  flex-basis: 100%;
  color: var(--color-text-2);
  overflow-wrap: anywhere;
}

.family-actions {
  display: flex;
  gap: var(--space-3);
}

.family-row form {
  display: inline;
}

.family-row .button-small,
.family-add .button-primary {
  min-height: var(--tap-min);
}

/* ---- Story 8.25: the Advocate team section (Story 1.12's card after Family, its #advocate anchor kept). One card per team, each its own
   form; the picked card carries a gold edge. ---- */
.profile-advocate {
  max-width: var(--content-max);
  margin: var(--space-6) auto 0;
}

.profile-advocate:hover {
  box-shadow: none;
}

.team-empty {
  color: var(--color-text-2);
}

.team-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: var(--space-4);
  margin: 0 0 var(--space-4);
  min-width: 0;
}

.team-card-picked {
  border-color: var(--color-gold);
  box-shadow: inset 4px 0 0 var(--color-gold);
}

.team-card h3 {
  margin: 0 0 var(--space-3);
  overflow-wrap: anywhere;
}

.team-card-advocates {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
}

.team-card-advocates li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.team-card-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Story 8.36 (AC 3): "(not on the site yet)" after a roster name with no joined account; small and quiet, and on a narrow card it drops to
   its own line rather than pushing the name out of the card. */
.team-card-advocates li {
  flex-wrap: wrap;
}

/* Story 8.37 (AC 5): the roster row's own words after the name, quiet; a long tagline wraps inside the card. */
.team-card-tagline {
  font-size: var(--text-body-sm);
  color: var(--color-text-2);
  overflow-wrap: anywhere;
  min-width: 0;
}

.team-card-not-joined {
  font-size: var(--text-body-sm);
  color: var(--color-text-2);
  white-space: nowrap;
}

.team-card-none,
.team-card-line {
  margin: 0 0 var(--space-3);
  color: var(--color-text-2);
}

.team-card-picked .team-card-line {
  color: var(--color-text-1);
  font-weight: 600;
}

.team-card form {
  margin: 0;
}

.team-card .button-outline {
  min-height: var(--tap-min);
}

/* Story 1.12's name style, still read by the Advocate panel's lists. */
.advocate-name {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---- Wider than a phone ---- */
@media (min-width: 760px) {
  :root {
    --text-display-xl: 40px;
    --text-body: 15px;
    --gutter: 48px;
    --card-pad: 24px;
  }

  .nav-menu[open] > .nav-menu-sheet {
    width: auto;
    min-width: 240px;
  }

  .button-small {
    min-height: 36px;
  }
}

/* ---- Story 2.4: the Interview page's 375 px layout (the named exception): the Submit block, the facts band, the theme blocks of
   the read-only page, the confirm dialog, and the Wall's Interview card. Colours are in app.css. Story 2.10 removed the meter;
   the walk-through's own layout is in app.css. ---- */
.interview-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.interview-submit {
  flex: 1 1 100%;
  min-width: 0;
}

.interview-submit .button-primary {
  width: 100%;
}

.interview-submitted {
  margin: 0;
}

.interview-guide {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.interview-guide dd {
  margin: 0;
}

.interview-themes {
  list-style: none;
  margin: 0;
  padding: var(--card-pad);
}

.interview-theme {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
  min-width: 0;
}

.interview-theme:first-child {
  padding-top: 0;
  border-top: 0;
}

.interview-theme h3 {
  margin: 0 0 var(--space-2);
}

.interview-number {
  margin-right: var(--space-2);
}

.interview-answer {
  width: 100%;
  min-width: 0;
  min-height: 120px;
}

.autosave-status {
  display: block;
  min-height: 1.2em;
}

.confirm-dialog {
  border: 0;
  border-radius: var(--radius-xl);
  padding: var(--card-pad);
  max-width: min(92vw, 420px);
}

.confirm-dialog::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(var(--overlay-blur));
  -webkit-backdrop-filter: blur(var(--overlay-blur));
}

.confirm-dialog .confirm-warning {
  color: var(--color-error-text);
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.interview-card {
  display: block;
  text-decoration: none;
  margin: var(--space-4) 0;
}

.interview-card-link {
  display: inline-block;
  margin-top: var(--space-2);
  font-weight: 600;
}

/* ---- Story 8.37 (AC 1; M24): the band under the greeting. One column below 760 px (the card, then the Globe); from 760 px the card on the
   left half and the Globe on the right. A band with no card (every role but an Explorer) is one column at every width, the Globe as wide as
   before. ---- */
.wall-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: var(--space-3) 0;
  align-items: stretch;
}

/* The card keeps its own height beside the taller Globe (the 8.37 visual pass: stretched, it was a tall empty box). */
.wall-band .interview-card {
  margin: 0;
  align-self: start;
}

/* Story 8.37 (AC 5; M22): the Explorer's Advocate team between the destination box and the Travel Card. */
.wall-advocate {
  margin: var(--space-3) 0;
  padding: var(--space-3);
  min-width: 0;
}

.wall-advocate-heading {
  margin: 0 0 var(--space-3);
}

.wall-advocate .team-card:last-child {
  margin-bottom: 0;
}

@media (min-width: 760px) {
  .wall-band:not(.wall-band-solo) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 760px) {
  .interview-submit {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .interview-submit .button-primary {
    width: auto;
  }

  .interview-guide {
    flex-direction: row;
    gap: var(--space-8);
  }
}

@media (min-width: 1100px) {
  main {
    padding-top: var(--space-12);
  }
}

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

/* ---- Story 3.3: the Entry form's layout (the same named exception as the Diary's): the date and the city stacked at 375 px
   and side by side from 480 px, the photo strip and the previews three to a row that never push the page sideways, the
   picker's row, and the sticky actions bar (the .journey-actions shape) so Post is inside the first screen (UX-DR9's gate case). ---- */
.entry {
  max-width: var(--content-max);
  margin: 0 auto;
  min-width: 0;
}

.entry:hover {
  box-shadow: none;
}

.entry-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
}

.entry .account-field {
  margin: 0 0 var(--space-3);
  min-width: 0;
}

.entry-text {
  resize: vertical;
}

.entry-counter {
  display: inline-block;
  margin-top: var(--space-1);
}

.autosave-status {
  display: inline-block;
  margin-top: var(--space-1);
  margin-left: var(--space-3);
}

.photo-grid {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  min-width: 0;
}

.photo-grid-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.photo-grid-item img {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
}

.photo-grid-remove {
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  width: 100%;
}

.entry-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  min-width: 0;
}

.entry-add-photos {
  position: relative;
  min-height: var(--tap-min);
  align-self: flex-start;
}

.entry-photo-hint:empty {
  display: none;
}

.entry-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap; /* visual pass 3.4: two buttons spilled past the card at 375 px; the line by the button and "Post Day 12 to community" wrap the same way */
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

/* Story 8.10 (AC 4): the line by the button, no room while the day holds nothing. */
.entry-state-line {
  flex: 1 1 auto;
  margin: 0;
}

.entry-state-line:empty {
  display: none;
}

/* Story 8.10 (AC 8): below 640 px each editable photo is the card's full width at its own shape, its caption under it, its Remove under that, and an
   empty status line takes no room. From 640 up the strip is as built. */
@media (max-width: 639.98px) {
  section.entry .photo-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  section.entry .photo-grid-item img {
    aspect-ratio: auto;
  }

  section.entry .photo-grid-item .autosave-status:empty {
    display: none;
  }

  /* AC 9: "Hotel, hostel or lodging name and area" reads in full at 375 at the 16px phones keep (iOS zooms on less), so the fieldset gives up its frame. */
  section.entry .entry-lodging {
    border: 0;
    padding: 0;
  }

  section.entry .entry-lodging legend {
    padding: 0;
  }

  section.entry .entry-lodging .input {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }
}

@media (min-width: 480px) {
  .entry-fields {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- Story 3.4: the Entry form's video slot and upload reason, and the Entry page /app/entries/{id} (AC 2; UX-DR4's card
   anatomy: author, label, video, text, photos at full size, then Edit and Delete). One photo per row at 375, two from 760. ---- */
.entry .video-control {
  margin: 0 0 var(--space-4);
  min-width: 0;
}

/* Kept rendered when empty (code review 3.4): a live region that is display:none when filled is often never announced. */
.entry-upload-reason:empty {
  margin: 0;
}

.entry-read {
  max-width: var(--content-max); /* visual pass 3.4: the Entry form's column, so the card lines up with its crumbs */
  margin: 0 auto;
  min-width: 0;
}

.entry-read:hover {
  box-shadow: none;
}

.entry-read-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  margin: 0 0 var(--space-2);
  min-width: 0;
}

.entry-read-header .avatar {
  flex: none; /* visual pass 3.4: a long name beside it squeezed the round avatar into a pill */
}

.entry-read-author {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.entry-read-state {
  margin: 0 0 var(--space-3);
}

.entry-read .video-control {
  margin: 0 0 var(--space-4);
}

.entry-read-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
  margin: 0 0 var(--space-4);
}

.entry-read .photo-grid {
  grid-template-columns: minmax(0, 1fr);
}

.entry-read .photo-grid-item img {
  aspect-ratio: auto;
  object-fit: contain;
}

.entry-read-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
}

.entry-read-actions > a,
.entry-read-actions > button {
  min-height: var(--tap-min);
}

@media (min-width: 760px) {
  .entry-read .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- Story 3.15: captions and Mike's gallery (AC 3, AC 5). Every photo is a figure; read-only, a caption sits under it in body-sm,
   and the list takes Mike's layout: one photo at the width one of two gets (Story 8.16, note 60), two side by side, three or more in the grid above. On the form, each
   photo carries its caption input at the height of its neighbours. ---- */
.photo-grid-item figure {
  margin: 0;
  min-width: 0;
}

.photo-grid-caption {
  margin: var(--space-1) 0 0;
  font-size: var(--text-body-sm);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.photo-grid-caption-input {
  width: 100%;
  min-width: 0;
  min-height: var(--tap-min);
}

.photo-grid.photo-grid-read[data-count="1"],
.photo-grid.photo-grid-read[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* On the Wall card the one or two photos are cropped to Mike's 4:3; the Entry page keeps each photo whole (its own rule above). */
.entry-card .photo-grid.photo-grid-read[data-count="1"] .photo-grid-item img,
.entry-card .photo-grid.photo-grid-read[data-count="2"] .photo-grid-item img {
  aspect-ratio: 4 / 3;
}

/* ---- Story 3.6: the Comments under a day (AC 1, AC 3, AC 6): one column inside the Entry card, each thread's Replies indented under
   their Comment, single-line forms whose input grows beside its 44 px button and wrap at 375; nothing scrolls sideways, a long
   unbroken word wraps. The colours are in app.css. ---- */
.comments {
  margin: var(--space-6) 0 0;
  padding: var(--space-4) 0 0;
  min-width: 0;
}

.comments > h2 {
  margin: 0 0 var(--space-3);
}

.comment-list,
.reply-list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.comment-list > li {
  margin: 0 0 var(--space-4);
  min-width: 0;
}

.reply-list {
  margin: var(--space-2) 0 0 var(--space-3); /* code review 3.6: 12 px margin + 12 px padding = Task 3.6's 24 px indent */
  padding: 0 0 0 var(--space-3);
}

.reply-list > li {
  margin: 0 0 var(--space-3);
  min-width: 0;
}

.post-text {
  min-width: 0;
}

.post-text-header {
  /* Visual pass 3.6: a grid, so a long name wraps beside the avatar instead of pushing it onto a line of its own. */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--space-3);
  align-items: center;
  min-width: 0;
}

.post-text-header .avatar {
  grid-row: 1 / span 3;
  align-self: start;
}

.post-text-header > :not(.avatar) {
  grid-column: 2;
}

.post-text-author {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Story 8.17 (AC 5): a Room line's role chip on the name's row; the name keeps the room to wrap, the chip never does. */
.post-text-header:has(.post-text-role) { grid-template-columns: auto minmax(0, max-content) 1fr; column-gap: var(--space-2); }
.post-text-header:has(.post-text-role) > :not(.avatar) { grid-column: 2 / -1; }
.post-text-header:has(.post-text-role) > .post-text-author { grid-column: 2; }
.post-text-header:has(.post-text-role) > .post-text-role { grid-column: 3; justify-self: start; }

.post-text-body {
  white-space: pre-line;
  overflow-wrap: anywhere;
  margin: var(--space-1) 0 0;
  min-width: 0;
}

.post-text-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  min-width: 0;
}

.post-text-actions > button {
  min-height: var(--tap-min);
}

.post-text-edit {
  min-width: 0;
  max-width: 100%;
}

.post-text-edit > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 var(--space-4);
  cursor: pointer;
  list-style: none;
}

.post-text-edit > summary::-webkit-details-marker {
  display: none;
}

.comment-form,
.reply-form,
.post-text-edit-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  min-width: 0;
}

.comment-form > input[type="text"],
.reply-form > input[type="text"],
.post-text-edit-form > input[type="text"] {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: var(--tap-min);
}

.comment-form > button,
.reply-form > button,
.post-text-edit-form > button {
  min-height: var(--tap-min);
}

.comment-form > .field-error,
.reply-form > .field-error,
.post-text-edit-form > .field-error {
  flex-basis: 100%;
}

.comment-form > .field-error:empty,
.reply-form > .field-error:empty,
.post-text-edit-form > .field-error:empty {
  display: none;
}

/* ---- Story 3.7: the Explorer page and the Explorers index at 375 px (the phone-safety exception: layout here, colours in app.css) ---- */
.explorer-header { display: flex; flex-direction: column; gap: var(--space-4); }
.explorer-header-main { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.explorer-header-text { min-width: 0; }
.explorer-header h1 { margin: var(--space-1) 0; overflow-wrap: anywhere; }
.explorer-all, .explorer-edit { align-self: flex-start; min-height: 44px; }
.explorer-family, .explorer-advocate { margin: 0 0 var(--space-4); }
.explorer-pass-row { display: grid; gap: var(--space-4); margin: 0 0 var(--space-4); }
.boarding-pass-bar { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
/* Phones: the two ends side by side, the flight line beneath them (three columns broke words mid-word; visual pass 3.7). */
.boarding-pass-route { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); padding: var(--space-4); align-items: end; }
.boarding-pass-route p { margin: 0; }
.boarding-pass-end { min-width: 0; overflow-wrap: break-word; }
.boarding-pass-destination { text-align: right; }
.boarding-pass-flight { text-align: center; grid-column: 1 / -1; grid-row: 2; }
/* The stub's cells wrap whole: the status tag never clips (visual pass 3.7). */
.boarding-pass-stub { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); margin: 0; padding: var(--space-3) var(--space-4); }
.boarding-pass-stub > div { flex: 1 1 auto; min-width: 0; }
.boarding-pass-stub dd { margin: 0; overflow-wrap: break-word; }
/* Story 3.12: the members' flight rows under the pass, one column with it (the Globe stays the row's second cell at 1280). */
.explorer-pass-stack { display: grid; gap: var(--space-3); align-content: start; min-width: 0; }
.flight-rows { display: grid; gap: var(--space-2); margin: 0; padding: var(--space-3) var(--space-4); }
.flight-rows > div { display: grid; grid-template-columns: minmax(6.5rem, auto) minmax(0, 1fr); gap: var(--space-2); align-items: baseline; }
.flight-rows dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.explorer-globe-slot:empty { display: none; }
.explorer-people { display: grid; gap: var(--space-4); }
.explorer-family-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.explorer-family-list li { display: flex; flex-wrap: wrap; gap: var(--space-2); overflow-wrap: anywhere; }
/* Story 8.25: the Advocate team card, the team's name then its Advocates' first names. */
.explorer-advocate-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.explorer-advocate-names { margin: var(--space-2) 0 0; color: var(--color-text-2); overflow-wrap: anywhere; }
.explorer-journey { display: grid; gap: var(--space-3); margin: 0 0 var(--space-4); }
.explorer-journey-text { overflow-wrap: anywhere; white-space: pre-line; margin: 0; }
.explorer-interview a { min-height: 44px; }
/* Story 8.44: the Interview section (the Admin's and Advocates' read, or a line and a link); its children stack like Dispatches'. */
.explorer-interview { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); min-width: 0; }
.explorer-interview > h2, .explorer-interview > p { margin: 0; }
.explorer-interview .interview-read-date { margin: 0; }
/* Run-story 4c (8.44): "Open {First}'s Interview" with a long first name ran past 375 px on a nowrap button; it wraps here instead. */
.explorer-interview .button-outline { white-space: normal; text-align: center; max-width: 100%; overflow-wrap: anywhere; line-height: 1.25; }
/* Story 7.7: "Tips from <Advocate>", one group per category, each Tip a card (member text: line breaks kept, never autolinked). */
.explorer-tips { display: grid; gap: var(--space-3); margin: 0 0 var(--space-4); }
.explorer-tips-group { display: grid; gap: var(--space-2); }
.explorer-tips-group h3 { margin: 0; }
.explorer-tip h4 { margin: 0 0 var(--space-1); overflow-wrap: break-word; }
.explorer-tip-text { overflow-wrap: break-word; white-space: pre-line; margin: 0; }
.explorer-tip-day { margin: var(--space-2) 0 0; }
/* Story 8.13 (polish note 46): the cards have the itinerary's day-card gap, and the heading sits one gap above the first. */
.explorer-dispatches { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); min-width: 0; }
.explorer-dispatches > h2 { margin: 0; }
.explorer-dispatches .wall-older { justify-self: center; margin: 0; }
.explorer-dispatches-empty { text-align: center; }
.explorers-grid { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: grid; gap: var(--space-4); }
.explorer-card { position: relative; overflow: hidden; }
.explorer-card-accent { position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.explorer-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
/* The name takes the row; the tag drops beneath it when a long name needs the room (visual pass 3.7). */
.explorer-card-who { flex: 1 1 10rem; min-width: 0; }
.explorer-card-name { overflow-wrap: break-word; }
.explorer-card-name { margin: 0; }
.explorer-card-destination { margin: 0; }
.explorer-card-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin: var(--space-3) 0 0; }
.explorer-card-link { display: inline-block; min-height: 44px; line-height: 44px; }

@media (min-width: 760px) {
  .explorer-header { display: grid; grid-template-columns: 1fr auto; align-items: end; }
  .explorer-all { grid-column: 1 / -1; justify-self: start; }
  .boarding-pass-route { grid-template-columns: 1fr auto 1fr; }
  .boarding-pass-flight { grid-column: 2; grid-row: 1; }
  .explorer-pass-row:has(.explorer-globe-slot:not(:empty)) { grid-template-columns: 2fr 1fr; }
  .explorer-people { grid-template-columns: 1fr 1fr; }
  .explorers-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Story 3.8: the Globe (layout; colours in app.css). The Wall's canvas is open at every width (Story 8.13, render-taste rule 10),
   240 px tall on phones, 360 px from 760 px; without script, which is what draws it, it takes no room and the list shows. On the Explorer page the canvas is a circle in Mike's ivory ring,
   at most 240 px (360 px from 760 px) wide. Once globe.js has a 2D context the list is visually hidden (the clip pattern), still in
   the accessibility tree; without canvas or script it stays visible and wraps. ---- */
.globe { min-width: 0; margin: 0 0 var(--space-4); }
.globe-canvas { display: block; width: 100%; height: 240px; touch-action: pan-y; }
.globe-canvas.globe-canvas-link { cursor: pointer; }
@media (scripting: none) {
  .globe-wall .globe-canvas { display: none; }
}
.globe-frame { display: block; box-sizing: border-box; width: min(100%, 264px); margin: 0 auto; padding: var(--space-3); border-radius: 50%; }
.globe-frame .globe-canvas { height: auto; aspect-ratio: 1; border-radius: 50%; }
.globe-list-heading { margin: var(--space-3) 0 var(--space-2); }
.globe-routes { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-1); }
.globe-routes li { overflow-wrap: anywhere; }
.globe-routes a { display: inline-block; min-height: 44px; line-height: 44px; }
.globe.globe-ready .globe-list-heading,
.globe.globe-ready .globe-routes {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* A keyboard user tabbing into the hidden list sees it (UX-DR22, UX-DR23: focus is visible; code review 3.8). */
.globe.globe-ready .globe-routes:focus-within {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

@media (min-width: 760px) {
  .globe-canvas { height: 360px; }
  .globe-frame { width: min(100%, 384px); }
}

/* Story 3.9: the Key dates card in the Wall's second slot (the colours are in app.css). Mike's card: the date above the label, a rule
   between rows. Below 760 px only the two key-date-next rows show, each on one line, with "All dates" on the heading's line; opening
   the empty details shows every row (decisions 5 and 9: the open state drives it, no script). From 760 px every row shows and the
   toggle is gone. */
.key-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--space-3);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  min-width: 0;
}
.key-dates-heading { order: 1; margin: 0; min-width: 0; }
.key-dates-more { order: 2; margin: 0; }
.key-dates-toggle { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.key-dates-list { order: 3; flex: 1 0 100%; margin: 0; padding: 0; list-style: none; min-width: 0; }
.key-date {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-2);
  padding: var(--space-2) 0 var(--space-2) var(--space-4);
  position: relative;
  min-width: 0;
}
.key-date::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--space-2) + 0.45em);
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.key-date-label { overflow-wrap: anywhere; min-width: 0; }
.key-dates:not(:has(.key-dates-more[open])) .key-date:not(.key-date-next) { display: none; }

@media (min-width: 760px) {
  .key-dates-more { display: none; }
  .key-dates:not(:has(.key-dates-more[open])) .key-date:not(.key-date-next) { display: flex; }
  .key-date { flex-direction: column; align-items: flex-start; gap: var(--space-1); }
}
/* Story 8.26 (AC 4, 5): the done rows wait behind "Show past dates", at every width. Both rules are (0,5,0), the weight of 3.9's two
   :not(.key-date-next) rules above, and come after them (and after their 760 px block), so they win: hidden while the empty
   details.key-dates-past is closed, shown when it is open, on a phone with or without "All dates". */
.key-dates:not(:has(.key-dates-past[open])) .key-date.key-date-done { display: none; }
.key-dates:has(.key-dates-past[open]) .key-date.key-date-done { display: flex; }
.key-dates-past { order: 4; flex: 1 0 100%; margin: 0; }
.key-dates-past-toggle { display: inline-flex; align-items: center; min-height: var(--tap-min); font-size: var(--text-body-sm); cursor: pointer; list-style: none; }
.key-dates-past-toggle::-webkit-details-marker { display: none; }

/* Story 3.10: the Journey board in the Wall's third slot (the colours are in app.css). Below 760 px it loads open with a 44 px "Hide the board"
   (Story 8.13, polish note 26); hidden, it is one row: the heading and the closed-row sentence (up to two small lines, never clipped) beside
   "Show the board", the row at most 60 px. The empty <details>' open state shows the body with no script (the Key dates' shape). From 760 px
   the body always shows. */
.journey-board {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--space-3);
  margin: 0 0 var(--space-4);
  padding: var(--space-1) var(--space-4);
  min-width: 0;
}
.journey-board-head { flex: 1 1 0; min-width: 0; font-size: var(--text-body-sm); line-height: 1.25; }
.journey-board-heading { display: inline; margin: 0; font-size: inherit; line-height: inherit; }
.journey-board-toggle { flex: none; margin: 0; }
.journey-board-toggle > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; list-style: none; font-size: var(--text-body-sm); }
.journey-board-toggle > summary::-webkit-details-marker { display: none; }
.journey-board-toggle:not([open]) .when-open,
.journey-board-toggle[open] .when-closed { display: none; }
.journey-board-body { flex: 1 0 100%; min-width: 0; padding-bottom: var(--space-2); }
.journey-board-number { margin: 0; }
.journey-board-subline { margin: 0 0 var(--space-3); }
.journey-board-bars { display: flex; gap: 3px; margin: 0 0 var(--space-3); }
.journey-board-bar { flex: 1 1 0; min-width: 0; height: 4px; border-radius: var(--radius-full); }
.journey-board-rows { margin: 0; padding: 0; list-style: none; }
.journey-board-row { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.journey-board-avatar { flex: none; width: 32px; height: 32px; }
.journey-board-name { flex: 1 1 0; display: flex; align-items: center; min-width: 0; min-height: 44px; overflow-wrap: anywhere; }
.journey-board-chip { flex: none; }
.journey-board:not(:has(.journey-board-toggle[open])) .journey-board-body { display: none; }
.journey-board:has(.journey-board-toggle[open]) .journey-board-summary { display: none; }

/* Story 8.13 (render-taste rule 11): it is tapped, so body size on a phone. */
@media (max-width: 759px) {
  .journey-board-toggle > summary { font-size: var(--text-body); }
}

@media (min-width: 760px) {
  .journey-board { padding: var(--space-3) var(--space-4); }
  .journey-board-toggle,
  .journey-board-summary { display: none; }
  .journey-board:not(:has(.journey-board-toggle[open])) .journey-board-body { display: block; }
  .journey-board-head { flex: 1 0 100%; font-size: var(--text-body); }
  .journey-board-body { padding-top: var(--space-2); }
}

/* ---- Story 6.2: the Guides (layout; colours in app.css). The index: one tile per destination, one column on a phone, two from 640 px,
   three from 1024 px (Mike's desktop); the art band carries the flag and the name over its bottom edge. A Guide: the hero band, the stats
   strip (two columns on a phone), the cost card (its rows one column on a phone; from 1024 px the four rows and the Bank block are one
   row of five cards with the Total bar under them, Mike's card), then the text sections (one column; from 1024 px airport, stay and eat
   on the left and plan and know on the right, then visa and health side by side). Every long value wraps (375 px, no sideways scroll). ---- */
.guides-region { margin: var(--space-8) 0 0; }
.guides-grid { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: grid; gap: var(--space-4); }
.guides-grid > li { min-width: 0; }
.guide-tile { display: flex; flex-direction: column; height: 100%; min-height: var(--tap-min); padding: 0; overflow: hidden; text-decoration: none; }
.guide-tile-band { position: relative; display: flex; align-items: flex-end; gap: var(--space-2); min-height: 96px; padding: var(--space-3) var(--card-pad); overflow: hidden; }
.card .guide-tile-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.guide-tile-flag { position: relative; flex: none; }
.guide-tile-name { position: relative; margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: var(--text-display-md); }
.guide-tile .guide-tagline { margin: 0; padding: var(--space-3) var(--card-pad) 0; overflow-wrap: anywhere; }
.guide-tile-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; padding: var(--space-3) var(--card-pad) var(--card-pad); }
/* The chip's "Best months:" is for screen readers; Mike's chip shows the months alone (the clip pattern, as the Globe's list). */
.guide-chip-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.guide-chip { display: inline-block; max-width: 100%; padding: 3px 11px; border-radius: var(--radius-full); font-size: var(--text-label); font-weight: 600; overflow-wrap: anywhere; }

.guide-hero { position: relative; display: flex; align-items: flex-end; min-height: 220px; margin: 0 0 var(--space-4); padding: var(--space-6) var(--card-pad); border-radius: var(--radius-xl); overflow: hidden; }
.guide-hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.guide-hero-text { position: relative; min-width: 0; }
.guide-back { display: inline-flex; align-items: center; min-height: var(--tap-min); padding: 0 var(--space-4); margin: 0 0 var(--space-4); border-radius: var(--radius-full); font-size: var(--text-body-sm); font-weight: 600; text-decoration: none; }
.guide-hero-title { display: flex; align-items: center; gap: var(--space-3); }
.guide-hero-title h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.guide-hero-flag { flex: none; font-size: 32px; line-height: 1; }
.guide-hero .guide-tagline { margin: var(--space-2) 0 0; overflow-wrap: anywhere; }

.guide-stats { margin: 0 0 var(--space-4); padding: var(--space-4) var(--card-pad); border-radius: var(--radius-xl); }
.guide-stats ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
.guide-stats li { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.guide-stats li strong { display: block; margin: 0 0 var(--space-1); font-size: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; }

.guide-cost { display: grid; gap: var(--space-3); margin: 0 0 var(--space-6); }
.guide-cost h2 { margin: 0; }
.guide-cost-body { display: grid; gap: var(--space-3); min-width: 0; }
.guide-cost-body ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.guide-cost-body li { min-width: 0; padding: var(--space-3); border-radius: var(--radius-md); overflow-wrap: anywhere; font-size: var(--text-body-sm); }
.guide-cost-body li strong { display: block; margin: 0 0 var(--space-1); font-size: var(--text-label); }
.guide-cost-body p { margin: 0; overflow-wrap: anywhere; }
.guide-cost-body p:has(> strong) { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-md); }
.guide-bank { min-width: 0; padding: var(--space-3); border-radius: var(--radius-md); overflow-wrap: anywhere; }
.guide-bank p { margin: 0; }
.guide-bank-label { margin: 0 0 var(--space-1); }

.guide-sections,
.guide-column,
.guide-pair { display: grid; gap: var(--space-6); align-content: start; min-width: 0; }
.guide-section { min-width: 0; }
.guide-section h2 { margin: 0 0 var(--space-3); }
.guide-section p { margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
.guide-section ul,
.guide-section ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.guide-section li { min-width: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); overflow-wrap: anywhere; }
.guide-airport > p,
.guide-stay > p { padding: var(--space-4); border-radius: var(--radius-md); }
.guide-visa,
.guide-health { padding: var(--card-pad); border-radius: var(--radius-xl); }
/* Mike's numbered day rows: "DAY" and the number in the navy column, the day's plan beside it. */
/* Child selectors: a sub-list Mike nests inside a day stays a plain list and never takes a day number (code review 6.2). */
.guide-plan > ol { counter-reset: guide-day; gap: 0; border-radius: var(--radius-md); overflow: hidden; }
.guide-plan li li { display: list-item; padding: 0; border: none; }
.guide-plan > ol > li { counter-increment: guide-day; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--space-3); align-items: center; padding: 0 var(--space-4) 0 0; border-radius: 0; }
.guide-plan > ol > li::before { content: "Day " counter(guide-day); display: flex; align-items: center; justify-content: center; align-self: stretch; min-height: 48px; font-size: var(--text-label); font-weight: 600; text-transform: uppercase; }

@media (min-width: 640px) {
  .guides-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-cost-body ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 760px) {
  .guide-stats ul { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

@media (min-width: 1024px) {
  .guides-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .guide-cost { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .guide-cost h2 { grid-column: 1 / -1; }
  .guide-cost-body { display: contents; }
  .guide-cost-body ul { grid-column: 1 / 5; grid-row: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .guide-bank { grid-column: 5; grid-row: 2; }
  .guide-cost-body p { grid-column: 1 / -1; }
  .guide-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-8); }
  .guide-pair { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-8); align-items: start; }
}

/* ---- Story 5.1: the Rooms list and a Room at 375 px (the phone-safety exception: layout here, colours in app.css): the list's rows
   are one tappable link each (avatar, name over the sub-label, the time at the right), the Room header is the Explorer page's band
   with the avatar beside the words, the Messages reuse the Comments' line shape, and the composer stacks the avatar and the textarea,
   the video control, then Post and the error slot; nothing scrolls sideways, a long unbroken word wraps, a name stays on one line
   beside its avatar at desktop widths (render-taste 8). ---- */
/* Story 8.17: the chat, one markup. The list above the room below 760 px, in a capped height of its own so the room starts on the first screen
   (decision 4); two panes from 760 px, the list 240 px wide as Mike's. */
.chat { min-width: 0; }
.chat-heading { margin: 0 0 var(--space-4); }
.chat-panes { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-width: 0; }
.chat-rooms { min-width: 0; max-height: 10rem; overflow-y: auto; }
.chat-room { min-width: 0; }
@media (min-width: 760px) {
  .chat-panes { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
  .chat-rooms { position: sticky; top: var(--space-4); max-height: calc(100vh - var(--space-8)); }
}
.room-list { list-style: none; margin: 0; padding: 0; min-width: 0; }
.room-list > li { margin: 0 0 var(--space-2); min-width: 0; }
.room-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-3);
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-3);
  text-decoration: none;
  min-width: 0;
}
.room-avatar { flex: 0 0 auto; }
.room-avatar-community {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}
.room-text { display: flex; flex-direction: column; min-width: 0; }
.room-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-sub { min-width: 0; overflow-wrap: anywhere; }
.room-when { white-space: nowrap; }

.room-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}
.room-header-text { min-width: 0; flex: 1 1 auto; }
/* Story 5.2: the Admin's Clear room sits at the header row's end, one line at every width (render-taste 8). */
.room-clear { flex: 0 0 auto; min-height: var(--tap-min); white-space: nowrap; }
/* Visual pass 5.1: a long first name wraps on a phone as the Explorer page's does (a cut name with an ellipsis lost half of it at 375);
   at 1280 every name fits on one line beside its avatar (render-taste 8). */
.room-header h2 { margin: 0 0 var(--space-1); overflow-wrap: anywhere; }
.room-meta { margin: 0; overflow-wrap: anywhere; }

.room { min-width: 0; }
.room-earlier { display: inline-flex; align-items: center; min-height: var(--tap-min); margin: 0 0 var(--space-4); }
.message-list { list-style: none; margin: 0; padding: 0; min-width: 0; }
.message-list > li { margin: 0 0 var(--space-4); min-width: 0; }
.post-text-video { max-width: 100%; margin: var(--space-2) 0 0; min-width: 0; }
/* Story 8.28 (AC 6): a Message's one photo, at a lone Entry photo's rule (polish note 60: one of two columns with the grid's gap) of the Message's
   own content box, natural ratio, never cropped; the link opens the full photo. */
.post-text-photo { width: calc((100% - var(--space-2)) / 2); max-width: 100%; margin: var(--space-2) 0 0; }
.post-text-photo-link { display: block; }
.post-text-photo img { display: block; width: 100%; max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.room-empty { margin: var(--space-4) 0; }
/* Story 5.3 (AC 1): the advocate line on the Explorer's own Room, a quiet sentence directly above the composer; its Profile link keeps
   the 44 px target inside the sentence. */
.room-advocate { margin: var(--space-4) 0 0; overflow-wrap: anywhere; }
.room-advocate a { display: inline-flex; align-items: center; min-height: var(--tap-min); }
/* Story 5.2: a line's Like (the heart's layout above), the Reply summary that opens a thread's reply form (.reply-list and .reply-form
   are the Comments' rules, by class), each control at 44 px. */
.post-text-like { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-height: var(--tap-min); margin: var(--space-2) 0 0; }
.post-text-like > .field-error:empty { display: none; }
.message-reply { margin: var(--space-2) 0 0; min-width: 0; }
.message-reply > summary { display: inline-flex; align-items: center; min-height: var(--tap-min); cursor: pointer; }
/* Story 8.26 (AC 1): a Message's controls on one line under the words, small and grey (Mike's "the edit, delete, and heart could all be on
   one line"): the Like, Reply, Edit, Delete, each at least 44 px tall by min-height (render-taste rule 11's height), 13 px text (decision 5).
   Closed, they sit on one row; an open Reply or Edit takes the line's width and its form opens under its own summary (decision 2). Every
   rule starts with .post-text-line, so the Comments' row and the Entries' heart are untouched. */
.post-text-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 var(--space-1); margin: var(--space-1) 0 0; min-width: 0; }
.post-text-line > .post-text-like { margin: 0; min-height: 0; }
.post-text-line > .message-reply { margin: 0; }
.post-text-line > details[open] { flex-basis: 100%; }
.post-text-line .like,
.post-text-line > details > summary,
.post-text-line > .post-text-delete {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap-min);
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-2);
  font: inherit;
  font-size: var(--text-body-sm);
  line-height: 1;
  cursor: pointer;
  list-style: none;
}
.post-text-line > details > summary::-webkit-details-marker { display: none; }
.post-text-line .like-glyph { font-size: 1.15em; }
/* A liked line: the heart keeps .like.is-liked's gold (app.css); the count stays grey, since gold on white is too faint for 13 px words. */
.post-text-line .like.is-liked .like-glyph { color: var(--color-gold); }
.room-empty-glyph { display: block; font-size: 32px; line-height: 1; margin: 0 0 var(--space-2); }

.message-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  min-width: 0;
}
.message-form-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--space-3);
  align-items: start;
  min-width: 0;
}
.message-form-field { display: flex; flex-direction: column; min-width: 0; }
.message-form textarea.input { min-height: 100px; width: 100%; box-sizing: border-box; resize: vertical; }
.message-counter { margin: var(--space-1) 0 0; }
.message-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }
.message-form-actions > button { min-height: var(--tap-min); }
.message-form-actions > .field-error { flex-basis: 100%; }
.message-form-actions > .field-error:empty { display: none; }
/* Story 8.28 (AC 1, 2), Story 8.34 (AC 8): the composer's two visible buttons under the box and before Post, "📷 Add photo" and the video control's
   "Add video", side by side and 44 px each; the photo choice is display: contents here, so its label and the video section are the row's two items and
   the held photo's thumbnail with Remove and the photo's sentence wrap onto their own rows under them (flex-basis 100%). */
.composer-media { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); margin: 0 0 var(--space-2); min-width: 0; }
.composer-media .composer-photo-choice:not([hidden]) { display: contents; }
.composer-photo-choice { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); min-width: 0; }
.composer-photo-choice[hidden] { display: none; }
.composer-photo-add, .message-photo-add { position: relative; display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--tap-min); padding: 0 var(--space-4); cursor: pointer; }
.composer-photo-add input[type="file"], .message-photo-add input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.composer-photo-add.is-uploading, .message-photo-add.is-uploading { opacity: 0.7; cursor: progress; }
.composer-photo-choice > .field-error { flex-basis: 100%; }
.composer-photo-choice > .field-error:empty { display: none; }
.composer-photo-slot { flex-basis: 100%; min-width: 0; }
/* Story 8.43 (AC 1 to 4): a posted Message's media row: the photo control (Add, or Replace and Remove) and the shared video control side by side,
   wrapping on a narrow screen; the choice's own parts join the row (the composer's display: contents), its sentence takes a line of its own. */
.message-media { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); margin: var(--space-2) 0 0; min-width: 0; }
.message-media .message-photo-choice:not([hidden]) { display: contents; }
.message-photo-choice[hidden] { display: none; }
.message-photo-choice > .field-error { flex-basis: 100%; }
.message-photo-choice > .field-error:empty { display: none; }
.message-photo-remove-form { margin: 0; }
.message-photo-remove-form[hidden] { display: none; }
.message-photo-remove-form button { min-height: var(--tap-min); }
.message-media .post-text-video { margin: 0; }
/* Story 8.80 (AC 1, Todd's 8.79 polish): the video item takes the room left beside Add photo and never forces a line break, so the limits
   sentence reads on one line at 1280 as it does in the composer and wraps naturally at 375 with Add video still beside Add photo. */
.message-media .post-text-video { flex: 1 1 0; min-width: 0; }
.composer-photo-slot:empty { display: none; }
.composer-photo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: 0; }
.composer-photo img { display: block; width: 120px; max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.composer-photo-remove { min-height: var(--tap-min); }
.explorer-room-row { margin: var(--space-4) 0; }
.explorer-interview { margin: 0 0 var(--space-4); }
.explorer-room { min-height: var(--tap-min); }
/* One small line under the strip (no new tab): compact, so the Journey page's primary button stays inside the first 375 x 667 screen
   (PageGate; JourneyDiaryDaysTests found the first draft 6 px over). */
.journey-room { margin: 0 0 var(--space-2); font-size: var(--text-body-sm); line-height: 1.4; }

/* ---- Story 6.3: the Safety page (layout; colours in app.css). The emergency box first: on a phone the four steps are one compact column
   with the number beside the title, so the whole box sits in the first 375x667 screen (AC 5); two columns from 640 px, three from 1024 px
   (Mike's desktop: three, the fourth under them). The questions are details rows, each summary a 44 px target with a chevron; one name
   across the page, so one opens at a time without script. The resource links are Mike's cards (one, two, three columns); the footer is
   his navy band with the button under the line on a phone and beside it from 640 px. ---- */
.safety-header { margin: 0 0 var(--space-3); }
.safety-header h1 { margin: 0; }
.safety-eyebrow { margin: 0 0 var(--space-1); }
.safety-emergency { margin: 0 0 var(--space-6); padding: var(--space-3); }
.safety-emergency h2 { margin: 0 0 var(--space-2); font-size: 18px; }
.safety-emergency ol { list-style: none; counter-reset: safety-step; margin: 0; padding: 0; display: grid; gap: 6px; }
.safety-emergency ol > li { counter-increment: safety-step; position: relative; min-width: 0; padding: var(--space-2) 10px var(--space-2) 40px; border-radius: var(--radius-md); font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.safety-emergency ol > li::before { content: counter(safety-step); position: absolute; left: 10px; top: var(--space-2); width: 22px; height: 22px; border-radius: var(--radius-full); font-size: var(--text-label); font-weight: 700; line-height: 22px; text-align: center; }
.safety-emergency ol > li strong { display: block; }
.safety-emergency > p { margin: 6px 0 0; font-size: var(--text-body-sm); }
.safety-step-link { display: block; min-height: var(--tap-min); margin: calc(-1 * var(--space-2)) -10px; padding: var(--space-2) 10px; border-radius: var(--radius-md); color: inherit; text-decoration: none; }
.safety-step-link strong { text-decoration: underline; text-underline-offset: 3px; }
.safety-lede { margin: 0 0 var(--space-6); }
.safety-category { margin: 0 0 var(--space-6); }
.safety-category h2 { margin: 0 0 var(--space-3); font-size: var(--text-display-md); }
.safety-answer { margin: 0 0 var(--space-2); border-radius: var(--radius-md); }
.safety-answer > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--tap-min); padding: var(--space-2) var(--space-4); list-style: none; cursor: pointer; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.safety-answer > summary::-webkit-details-marker { display: none; }
.safety-answer > summary::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -4px; }
.safety-answer[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.safety-answer-body { padding: 0 var(--space-4) var(--space-4); overflow-wrap: anywhere; }
.safety-answer-body > :last-child { margin-bottom: 0; }
.safety-links { margin: var(--space-8) 0 var(--space-6); }
.safety-links h2 { margin: 0 0 var(--space-4); font-family: var(--font-body); font-size: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.safety-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.safety-links li { min-width: 0; padding: var(--space-4); border-radius: var(--radius-md); font-size: var(--text-body-sm); overflow-wrap: anywhere; }
.safety-links li strong { display: block; font-size: 14px; }
.safety-links li a { display: inline-block; font-weight: 600; }
.safety-footer { display: grid; gap: var(--space-4); padding: var(--space-6); border-radius: var(--radius-xl); }
.safety-footer h2 { margin: 0 0 var(--space-1); font-size: var(--text-display-md); }
.safety-footer p { margin: 0; }
.safety-footer-button { justify-self: start; white-space: normal; text-align: center; }

@media (min-width: 640px) {
  .safety-emergency { padding: var(--space-6); }
  .safety-emergency h2 { font-size: var(--text-display-md); }
  .safety-emergency ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .safety-links ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .safety-footer { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}

@media (min-width: 1024px) {
  .safety-emergency ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .safety-links ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Story 2.11 (decision 1; the named exception: a phone-width rule lives in the sheet every page has loaded): below 640 px the Trip status card
   opens closed behind its empty "Show the checklist" details, so each My Journey page's primary stays inside the first 375x667 screen
   (PageGate, UX-DR21); from 640 px up the toggle is hidden and the body always shows. The _KeyDatesPartial shape. */
.trip-status-toggle:not([open]) ~ .trip-status-body { display: none; }

@media (min-width: 640px) {
  .trip-status-toggle { display: none; }
  .trip-status-toggle:not([open]) ~ .trip-status-body { display: block; }
}

/* Story 2.11 (decision 12, measured with PageGate at 375x667): with the Trip status card above it, the Diary's one primary ("Post something
   now", or "Enter your Journey" before a Journey exists) moves above the lede on phones, so it stays inside the first screen; the heading
   stays first. From 640 px up the order is Story 3.2's. */
@media (max-width: 639px) {
  .diary.card { display: flex; flex-direction: column; }
  .diary.card > h2 { order: -2; }
  .diary.card > .button-primary { order: -1; align-self: flex-start; }
  .diary.card > .diary-actions { order: -1; } /* Story 3.15's wrapper around the quick post */
}

/* Story 2.11: the Journey form's intro (heading, lede, banners) is the form's first flex item, so the form's gap does not land between them. */
.journey-form-intro > :last-child { margin-bottom: 0; }

/* Story 8.78 (AC 7, 12; measured at 375x667 with the Trip status card folded): the "not saved" banner is drawn first in the intro on phones, above
   the heading and lede, so its sentence sits above the sticky Save bar on the first screen (the Story 2.11 decision 12 shape: the order moves, the
   markup does not). */
@media (max-width: 639px) {
  .journey-form-intro:has(> .journey-not-saved) { display: flex; flex-direction: column; }
  .journey-form-intro > .journey-not-saved { order: -1; margin: 0 0 var(--space-4); }
}

/* ---- Story 3.13: the itinerary builder (layout; decoration in app.css). The chips scroll inside their row; nothing else scrolls sideways at 375. ---- */
.itinerary {
  max-width: var(--content-max);
  margin: var(--space-4) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  min-width: 0;
}

.itinerary-suggest {
  white-space: normal;
  height: auto;
  text-align: left;
}

.itinerary > * {
  min-width: 0;
}

.itinerary-heading {
  margin: 0;
  font-size: var(--text-display-md);
}

/* ---- Story 8.42: the itinerary is a block of the Journey card between Stays and Flights, not a page of its own: the card's width, a rule above it,
   and the same space below as a section. The day card opens on its stay's three lines and the link to the Stays, 44 px to tap. ---- */
.journey-form > .journey-itinerary {
  max-width: none;
  margin: 0 0 var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.itinerary-day-stay {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-1) 0 var(--space-3);
  min-width: 0;
}

.itinerary-day-line {
  margin: 0;
  font-size: var(--text-body-sm);
  overflow-wrap: anywhere;
}

.itinerary-day-stays-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 44px;
  font-size: var(--text-body-sm);
}

.itinerary-actions,
.itinerary-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.itinerary-plan-actions {
  align-items: flex-end;
}

/* .button-outline's display would otherwise beat the hidden attribute itinerary.js sets on Save and Move (3.13, Story 8.14 AC 5). */
.itinerary-plan-actions [hidden] {
  display: none;
}

/* Story 8.32 (R1 C1): the same for the Start and Print buttons, whose display would otherwise show both Suggest shapes and a dead Print without script. */
.itinerary-actions [hidden] {
  display: none;
}

.itinerary-chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-2);
}

.itinerary-chip {
  display: grid;
  gap: 2px;
  width: 132px;
  min-height: 44px;
  padding: var(--space-2);
  text-decoration: none;
}

.itinerary-chip-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.itinerary-count {
  margin: 0;
}

.itinerary-days {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
  min-width: 0;
}

.itinerary-day {
  min-width: 0;
  scroll-margin-top: var(--space-4);
}

.itinerary-day > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  cursor: pointer;
}

/* Mike's ▼/▲ at the end of a day's header: display: flex takes the browser's own marker away. */
.itinerary-day > summary::after {
  content: "▼" / "";
  margin-left: auto;
  flex: none;
  font-size: var(--text-tag);
}

.itinerary-day[open] > summary::after {
  content: "▲" / "";
}

.itinerary-day-number {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.itinerary-day-heading {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.itinerary-day-count {
  flex: none;
}

.itinerary-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
  margin: var(--space-2) 0;
  padding: var(--space-3);
  min-width: 0;
  scroll-margin-top: var(--space-4);
}

/* Story 8.14 AC 3: below 640 the title is first and alone on its line, Time under it; from 640 Mike's row, Time on the left. */
.itinerary-plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}

.itinerary-title-input {
  min-height: 46px;
  resize: none;
  overflow: auto;
  line-height: 1.25;
  field-sizing: content;
}

/* An empty time input collapses on an iPhone, and its padding draws it 49 tall in Chromium; 46 is .select's height. */
.itinerary-time .input {
  min-height: 46px;
  padding-top: 0;
  padding-bottom: 0;
}

/* Story 8.20 AC 1: an empty time reads as the grey words (colour in app.css), never the browser's sample time. Focused, the browser's own editor shows. Each pseudo has its own rule: a browser drops a whole selector list holding one it does not know. */
.itinerary-time-box {
  position: relative;
}

.itinerary-time-empty {
  display: none;
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  align-items: center;
  pointer-events: none;
  white-space: nowrap;
}

.itinerary-time-input.is-empty:not(:focus) + .itinerary-time-empty {
  display: flex;
}

.itinerary-time-input.is-empty:not(:focus) {
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.itinerary-time-input.is-empty:not(:focus)::-webkit-datetime-edit {
  opacity: 0;
}

.itinerary-time-input.is-empty:not(:focus)::-webkit-date-and-time-value {
  opacity: 0;
}

.itinerary-time-input.is-empty:not(:focus)::-webkit-calendar-picker-indicator {
  opacity: 0;
}

/* Story 8.20 AC 2: the text sits in the middle of the Time box: 46 less its two borders and the 2px WebKit pads its fields with on each side (Chromium's 1px leaves the box at min-height's 46). */
.itinerary-time-input {
  line-height: 40px;
}

/* Story 8.20 AC 1: focused and empty, WebKit paints its sample time pale blue (note 55); only the input's own text fill reaches those parts, so it reads grey while a time is typed. */
.itinerary-time-input.is-empty:focus {
  -webkit-text-fill-color: var(--color-text-2);
}

/* Story 8.20 AC 5: the Link box's words are in full at a phone's width; the placeholder alone gives, so the input stays 16px and iOS does not zoom. */
@media (max-width: 639.98px) {
  .itinerary-link-input::placeholder {
    font-size: var(--text-body-sm);
  }
}

@media (min-width: 640px) {
  .itinerary-plan-row {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: start;
  }

  .itinerary-time {
    order: -1;
  }
}

/* Story 8.20 AC 3: the status is its own line under the lede, and a form's page keeps that line so nothing jumps under the Explorer's fingers (19px at 1.5).
   Story 8.32 AC 2: each plan's own line, just above its form, keeps its height the same way. */
.itinerary-status,
.itinerary-plan-status {
  display: block;
}

.itinerary-status.is-reserved,
.itinerary-plan-status.is-reserved {
  min-height: 29px;
}

.itinerary-plan-status {
  margin: var(--space-2) 0 0;
}

/* The line takes the plan's own top margin, so the gap between two plans grows by the line alone. */
.itinerary-plan-status + .itinerary-plan {
  margin-top: 0;
}

.itinerary-status:not(.is-reserved):empty {
  display: none;
}

/* Story 8.14 AC 4: Mike's star button (colour in app.css). The real checkbox lies over the star, and the label carries a tap anywhere else on the button to it, so it stays the tap target and the screen reader's control, with or without script. */
.itinerary-star {
  position: relative;
  display: inline-block;
  justify-self: start;
}

.itinerary-star input {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 44px;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.itinerary-star-button {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  min-height: 44px;
  padding: 0 var(--space-3);
}

.itinerary-star input:focus-visible + .itinerary-star-button {
  outline: var(--focus-ring);
  outline-offset: 1px;
}

/* Story 8.14 AC 5: "Move to…" directly above its own dropdown, on a line of its own on a phone. */
.itinerary-move {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1 1 100%;
  min-width: 0;
}

.itinerary-move .label {
  margin: 0;
}

@media (min-width: 640px) {
  .itinerary-move {
    flex: 0 1 auto;
  }
}

.itinerary-arrow {
  min-width: 44px;
}

.itinerary-move-to {
  max-width: 100%;
  min-height: 44px;
}

.itinerary-add {
  margin: var(--space-2) 0;
}

.itinerary-read {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.itinerary-read p {
  margin: 0;
  overflow-wrap: anywhere;
}

.itinerary-read-time {
  white-space: nowrap;
}

.itinerary-read-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.itinerary-card {
  max-width: var(--content-max);
  margin: var(--space-4) auto 0;
  display: grid;
  gap: var(--space-2);
}

.itinerary-card p {
  margin: 0;
}

/* "Open {First}'s itinerary" carries a member's name: it wraps where .button-outline's nowrap would push the page sideways at 375. */
.itinerary-card-link {
  justify-self: start;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: var(--line-body);
}

.explorer-itinerary {
  max-width: var(--content-max);
  margin: var(--space-4) auto 0;
  display: grid;
  gap: var(--space-3);
}

.explorer-itinerary-count,
.explorer-itinerary-line {
  margin: 0;
}

/* ---- Story 8.18: the Travel Card's layout (colours in app.css). The figures wrap rather than widen the page at 375. ---- */
.journey-card-page { display: grid; gap: var(--space-4); }
.journey-card-page h1,
.journey-card-lede { margin: 0; }
.travel-card { padding: var(--space-5); border-radius: var(--radius-lg); }
.travel-card-compact { padding: var(--space-4); margin: var(--space-2) 0 var(--space-3); }
.travel-card-name { margin: 0 0 var(--space-4); font-size: var(--text-label); letter-spacing: 0.08em; overflow-wrap: anywhere; }
.travel-card-figures { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); margin: 0 0 var(--space-4); }
.travel-card-figure { min-width: 0; }
.travel-card-figure dt { font-size: var(--text-label); letter-spacing: 0.06em; }
.travel-card-figure dd { margin: var(--space-1) 0 0; font-size: var(--text-display-md); font-variant-numeric: lining-nums; font-weight: 600; }
.travel-card-compact .travel-card-figure dd { font-size: var(--text-body); }
.travel-bar { display: block; width: 100%; height: var(--space-2); border: 0; border-radius: var(--radius-full); overflow: hidden; appearance: none; -webkit-appearance: none; }
.travel-card-under { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); margin-top: var(--space-2); }
.travel-categories h2,
.travel-tips h2,
.travel-history h2 { margin: 0; }
.travel-category-list,
.travel-tip-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.travel-category { display: flex; justify-content: space-between; gap: var(--space-3); }
.travel-history-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-3); }
.travel-history-empty { margin: 0; }
.travel-history-table { width: 100%; border-collapse: collapse; }
.travel-history-table th,
.travel-history-table td { padding: var(--space-2); text-align: left; overflow-wrap: anywhere; }
@media (max-width: 759px) {
  .travel-history-table thead { display: none; }
  .travel-history-table,
  .travel-history-table tbody,
  .travel-history-table tr,
  .travel-history-table td { display: block; width: 100%; }
  .travel-history-table tr { padding: var(--space-2) 0; }
  .travel-history-table td { padding: var(--space-1) 0; }
  .travel-history-table td::before { content: attr(data-label) ": "; font-size: var(--text-label); }
}
.wall-travel-card { margin: var(--space-4) 0; }
.wall-travel-card-heading { margin: 0; }

/* ---- Story 8.46 (AC 1; M23): the Family Directory on the Wall, after the Journey board (the colours are in app.css). Mike's grid of
   white cards, one column on a phone and up to three at desktop; the avatar a rounded square beside the name and chip; every tapped
   link 16 px and 44 px tall on a phone (render-taste 11; the mid-sentence "My Profile" by padding, so the sentence keeps its line);
   long names, emails and cities wrap inside the card. ---- */
.wall-directory {
  margin: var(--space-6) 0 var(--space-4);
  min-width: 0;
}

.wall-directory-heading {
  margin: 0 0 var(--space-2);
}

.wall-directory-intro {
  margin: 0 0 var(--space-4);
  max-width: 34rem;
}

.wall-directory-intro a {
  padding-block: 12px;
}

.directory-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.directory-card {
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.directory-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.avatar.directory-avatar {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
}

.directory-who {
  flex: 1 1 auto;
  min-width: 0;
}

.directory-name {
  margin: 0 0 var(--space-1);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.directory-role {
  display: inline-block;
  padding: 2px var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--text-tag);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.directory-pencil {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.directory-lines {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: var(--space-2);
  min-width: 0;
}

.directory-lines p {
  margin: 0;
}

.directory-city,
.directory-airport,
.directory-phone,
.directory-email,
.directory-empty {
  font-size: var(--text-body);
  overflow-wrap: anywhere;
  max-width: 100%;
}

a.directory-phone,
a.directory-email,
.directory-empty a.directory-add {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
}

@media (min-width: 640px) {
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 760px) {
  .directory-city,
  .directory-airport,
  .directory-phone,
  .directory-email,
  .directory-empty { font-size: var(--text-body-sm); }
  a.directory-phone,
  a.directory-email,
  .directory-empty a.directory-add { min-height: 0; }
  .wall-directory-intro a { padding-block: 0; }
}

/* The visually hidden label (Story 3.6, the file input's clip rule under a name for labels): here since Story 8.47, for every page; it lived in
   app.css, so on the admin pages (site.css and admin.css) the Teams page's "Team for {name}" and "Move {name} to" labels showed and squeezed
   their selects. */
.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;
}
