/* App styles. Layout, chrome and the shared components every tab is built from.
 *
 * Tab-specific rules live at the bottom under a clear heading. Everything above is used by more
 * than one tab and should stay that way: a rule that only one tab needs belongs in that tab's
 * section, or it quietly becomes a thing nobody dares change.
 *
 * The look is the Maple Weddings one, described at the top of css/tokens.css. The short version
 * for this file: content sits straight on the cream page, a section is a serif heading under a
 * thin rule, and only things you can pick up or tap (a stat tile, the countdown, a table on the
 * plan, an alert) are soft surfaces. Buttons and chips are pills, fields are 12px. Colours come
 * from tokens and nowhere else; test/a11y-static.mjs fails the build if one is written here.
 */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

/* Every count, cost and date keeps a constant width as its value changes, so a column of
   figures aligns and a chip stops resizing as its number ticks over. Inherited app-wide. */
html { font-variant-numeric: tabular-nums; }

/* Lets a <details> height animate between closed and auto in Chrome 129+, ignored elsewhere. */
html { interpolate-size: allow-keywords; }
::details-content { transition: height .2s ease, content-visibility .2s allow-discrete; height: 0; overflow: clip; }
[open]::details-content { height: auto; }

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---- keyboard focus ----
 *
 * One visible ring for everything you can reach with Tab: a 2px accent outline held 2px off the
 * element, so it reads on the page, on a card and on a soft fill alike (test/contrast.mjs checks
 * the accent at 3:1 against all of them, in all six accents, in both themes). It is a ring on
 * :focus-visible, so a mouse click on a button does not draw one, but a keyboard user, or anyone
 * focusing a text field, always sees where they are. Nothing in this file is allowed to remove
 * it: `outline: none` is a lint failure unless it is `:focus:not(:focus-visible)`. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ---- motion ----
 *
 * The tab pill slides, a closed section eases open, a toast rises and a menu fades in. All of it
 * is decoration, so anyone who has asked their system for less motion gets none: state changes
 * still happen, instantly. */
@media (prefers-reduced-motion: reduce) {
  /* Unless the person has chosen "full" motion in Settings (css/prefs.css, js/prefs.js). */
  html:not([data-motion="full"]) *, html:not([data-motion="full"]) *::before, html:not([data-motion="full"]) *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- the iOS zoom trap ----
 *
 * Safari on iOS zooms the whole page in when you focus a text field whose font is smaller than
 * 16px, and it does NOT zoom back out when the field loses focus. There is no way to zoom back
 * programmatically, and maximum-scale=1 would disable pinch-zoom for people who need it, so the
 * fix is to never trigger it: 16px on touch devices, scoped to coarse pointers so the desktop
 * keeps its denser size. !important because several of these controls carry inline styles. */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Icons.
 *
 * Served from our own origin, subsetted to the icons this app actually uses. Material Symbols is
 * a ligature font: the markup says <span>chevron_right</span> and the font turns those letters
 * into a glyph, so while the font is missing you get the icon NAMES as words. Google's full font
 * is 5.3MB for about eighty glyphs and had not arrived by first paint; subsetted it is around
 * 120KB and the service worker caches it with the shell. fonts/icons.txt is the manifest,
 * tools/build-icon-font.sh regenerates the file, and test/icons.mjs fails if the app renders an
 * icon the manifest does not carry. See the README for the whole story. */
@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: 100 700;
  /* block, not swap: with a local 120KB file the wait is imperceptible, and showing the ligature
     names for even one frame is the exact bug this is all about. */
  font-display: block;
  src: url('../fonts/material-symbols-rounded.woff2') format('woff2');
}

.material-symbols-rounded {
  font-family: var(--icons);
  font-weight: normal;
  font-style: normal;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: -4px;
  user-select: none;
}

/* Content that exists only on paper. A custom field marked "show on printed sheets" renders
   with this class, so ticking that box adds it to the printout without cluttering the screen it
   came from. css/print.css turns it back on. */
.print-only { display: none; }

/* Screen-reader-only text. Used for labels that a control's shape already communicates
   visually, so the accessibility tree keeps them without the layout carrying them. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- layout ---- */

#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* The header. Its layout (brand, areas, tools, the tabs inside the open area) is in css/shell.css;
   this is the bar itself, which stays at the top while the page scrolls. */
#topbar {
  padding: max(var(--space-8), env(safe-area-inset-top)) max(var(--space-48), env(safe-area-inset-right)) 0 max(var(--space-48), env(safe-area-inset-left));
  background: var(--bg); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}

/* Frosted bar: content scrolling underneath ghosts through. color-mix keeps it correct in both
   themes since --bg is theme-driven. The shadow appears only once the page has scrolled, so
   the bar is flat at rest and anchored in motion. */
@supports (backdrop-filter: blur(10px)) {
  #topbar {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: box-shadow .2s ease;
  }
  #topbar.scrolled { box-shadow: 0 2px 12px rgba(0, 0, 0, .07); }
}

/* The mark: a maple leaf with a heart cut out, in the couple's accent. An inline SVG drawn in
   currentColor (js/ui/brand.js), so it follows the accent with no second asset to keep in step. */
.brand-mark { display: inline-flex; flex: none; color: var(--accent); }
.brand-mark svg { display: block; width: 100%; height: 100%; }

main { flex: 1; padding: var(--space-48) var(--space-gutter) 120px; max-width: 1320px; width: 100%; margin: 0 auto; }
@media (max-width: 640px) { main { padding: var(--space-24) var(--space-gutter) var(--space-48); } }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ------------------------------------------------------------------ tabs ---- */

/* The areas, the tabs inside them and the phone bottom bar are in css/shell.css, drawn by
   js/ui/nav.js from the TABS list in js/main.js.

   What stays here is the little popup list that grew out of the old "More" tab: a soft floating
   panel of rows, each with its icon. The "Add guest" and "Add room" buttons still open one. */
.tab-more-caret { font-size: 18px; margin-left: calc(var(--space-4) * -1); color: inherit; }
.tab-more-pop {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; min-width: 200px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg); padding: var(--space-8);
}
.tab-more-pop.open { display: block; }
.tab-more-pop button {
  display: flex; align-items: center; gap: var(--space-8); width: 100%; border: none; background: none;
  padding: var(--space-8) var(--space-16); border-radius: var(--radius); font-size: 14px; font-weight: 600;
  color: var(--text); text-align: left; font-family: var(--font-family);
}
.tab-more-pop button:hover { background: var(--surface); }
.tab-more-pop button.selected { color: var(--accent-dark); font-weight: 700; }
.tab-more-pop .material-symbols-rounded { font-size: 18px; color: var(--muted); }

/* --------------------------------------------------------------- buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8);
  min-height: 46px; padding: 0 var(--space-24);
  border: 1px solid var(--control); background: transparent; color: var(--text);
  font-weight: 600; font-family: var(--font-family); font-size: 14.5px; line-height: 1;
  border-radius: var(--radius-pill); white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface); }
.btn .material-symbols-rounded { font-size: 18px; vertical-align: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* The "add something" button: the accent on a soft fill, so it invites without competing with
   the one primary action on a screen. Reads its colour from the tab it sits in via --tab-accent,
   so a new tab needs no button CSS of its own. */
.btn.add {
  background: var(--tab-accent-soft, var(--accent-soft));
  border-color: transparent;
  color: var(--accent-dark);
}
.btn.add:hover { border-color: var(--accent); background: var(--accent-soft); }

.btn.danger { color: var(--error); border-color: var(--control); }
.btn.danger:hover { background: var(--error-soft); border-color: var(--error); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface); }
.btn.small { min-height: 38px; padding: 0 var(--space-16); font-size: 13.5px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 1px solid transparent; background: none; border-radius: 50%; color: var(--muted);
  transition: background .15s, color .15s; flex: none;
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn.danger:hover { background: var(--error-soft); color: var(--error); }
/* The gear, while Settings is the open tab. The only icon button that carries this state. */
.icon-btn.active { background: var(--accent-soft); color: var(--accent-dark); }

/* ------------------------------------------------------- chips and badges ---- */

/* A label, not a control: it names a part of the day, a count, a status. A pill on the soft fill.
   The pressable pills (filters, check chips, swatches) are further down and have a control edge. */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-4); font-size: 12px; font-weight: 700;
  padding: var(--space-4) var(--space-8); border-radius: var(--radius-pill); flex: none; white-space: nowrap;
  background: var(--surface); color: var(--muted); border: 1px solid transparent;
}
.chip .material-symbols-rounded { font-size: 14px; vertical-align: -2px; }
.chip.solid { border-color: transparent; }
.chip.event-chip { border-color: transparent; }
.chip button { border: none; background: none; padding: 0; color: inherit; display: inline-flex; }

/* A status, as a word on a soft fill with a dot. Never colour alone. */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-8); font-size: 12.5px; font-weight: 700;
  padding: var(--space-4) var(--space-8); border-radius: var(--radius-pill); flex: none; white-space: nowrap; line-height: 1.5;
  background: var(--status-gray-soft); color: var(--status-gray);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.bad { background: var(--error-soft); color: var(--error); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }

/* Money status in text (amounts and dates), one treatment per meaning wherever it shows: Costs, Suppliers and the Overview
   (review 23 Nov 2026, item 11). The words always sit beside it (a column heading, "paid", "still owed", an Overdue badge),
   so colour never carries the meaning alone. Tokens only; test/contrast.mjs checks each on the card, page and surface fills
   in light, dark and every accent.
     paid .............. --good, normal weight          money already out of the account
     owed / due soon ... --warning, bold               still to pay, or falling due within 14 days
     overdue ........... --error, bold                 past its date and still owed (also the Overdue badge)
   A settled line is the .badge.good "Settled" and an unset amount is .cell-muted, as before. */
.money-paid { color: var(--good); }
.money-owed, .money-soon { color: var(--warning); font-weight: 700; }
.money-overdue { color: var(--error); font-weight: 700; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

/* The four soft blocks, as tags and bands. Each is an ink on its own tint. */
.t-blush { background: var(--blush); color: var(--blush-ink); }
.t-powder { background: var(--powder); color: var(--powder-ink); }
.t-sand { background: var(--sand); color: var(--sand-ink); }
.t-sage { background: var(--sage-tint); color: var(--sage-ink); }

/* ----------------------------------------------------------------- cards ---- */

/* A card is an open section: a thin rule, then the content, with no box around it. The serif
   heading (.section-head h3) is what names it, and whitespace is what separates it from the
   next. Only the things you can pick up or tap are surfaces, and they say so with .soft. */
.card {
  background: transparent; border: 0; border-top: 1px solid var(--border-strong); border-radius: 0;
  padding: var(--space-card) 0 0;
}
.card.soft {
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-card);
  padding: var(--space-card);
}
.card.hero {
  background: var(--accent-soft); border: 0; border-radius: var(--radius-xl);
}

/* A section keeps its spacing from a .stack wrapper rather than from `.card + .card { margin-top }`.
   The sibling rule also fired inside grid containers, where the second card onwards picked up a
   top margin its row-mates did not. Spacing that belongs to a layout should be set by the layout.
   A stack is the page-level column of sections, so its gap is the room between sections. */
.stack { display: flex; flex-direction: column; gap: var(--space-section); }

/* A list of rows that ENDS its card drops the separator under the final row, which would
   otherwise draw a line into the padding with nothing beneath it. Applied by class rather than
   to every last-child, because plenty of these lists are followed by an "add" bar, and there the
   trailing rule is doing its job. */
.rows > *:last-child { border-bottom: none !important; }

.section-head {
  display: flex; align-items: baseline; gap: var(--space-16); flex-wrap: wrap; margin-bottom: var(--space-field);
}
.section-head h2 { font-family: var(--font-display); font-size: 36px; font-weight: 500; margin: 0; letter-spacing: -.01em; line-height: 1.1; }
.section-head h3 { font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -.01em; margin: 0; }
.section-head .spacer { margin-left: auto; }
.section-byline { font-size: 13px; font-weight: 600; color: var(--muted); }
.card.soft .section-head { margin-bottom: var(--space-16); }

.empty-state {
  padding: var(--space-48) var(--space-24); border: 1.5px dashed var(--control); border-radius: var(--radius-card);
  font-size: 14px; color: var(--muted); text-align: center; line-height: 1.6;
}
.empty-state strong { color: var(--text); display: block; font-size: 15px; margin-bottom: var(--space-4); }

/* --------------------------------------------------- disclosure and help ---- */

/* A collapsible section. See js/ui/disclosure.js for why this is a component: three tabs each
   had their own hand-styled <details>, and the Costs one had removed its disclosure marker
   without putting anything in its place. It is an open section like a card: a rule above, no
   box, and a chevron that turns. */
.disclosure { background: transparent; border: 0; border-top: 1px solid var(--border-strong); border-radius: 0; }
.disclosure-head {
  display: flex; align-items: center; gap: var(--space-8); cursor: pointer; flex-wrap: wrap;
  padding: var(--space-16) 0; font-size: 15px; font-weight: 700;
  list-style: none; border-radius: var(--radius);
}
.disclosure-head::-webkit-details-marker { display: none; }
.disclosure-head:hover { color: var(--accent-dark); }
.disclosure-chevron {
  font-size: 20px; color: var(--muted); margin-left: calc(var(--space-4) * -1);
  transition: transform .18s ease;
}
.disclosure[open] > .disclosure-head > .disclosure-chevron { transform: rotate(90deg); }
/* The line a closed section can be read by. Pushed right so it reads as an answer to the title
   rather than as part of it. */
.disclosure-meta {
  margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted);
  text-align: right; min-width: 0;
}
.disclosure-body { padding: var(--space-4) 0 var(--space-24); }

/* Explanatory prose that folds away once you have clearly done the thing it explains. The
   collapsed state is a plain text button rather than a bordered control, because six of these
   down one page as buttons would be six more things to look at than the controls they sit above. */
.help-note { margin: 0 0 var(--space-16); }
.help-note-toggle {
  display: inline-flex; align-items: center; gap: var(--space-4);
  border: none; background: none; padding: 0; cursor: pointer;
  font-family: var(--font-family); font-size: 13px; font-weight: 700; color: var(--muted);
}
.help-note-toggle:hover { color: var(--accent-dark); }
.help-note-toggle .material-symbols-rounded { font-size: 15px; vertical-align: -3px; }
.help-note-body { display: none; }
.help-note.open .help-note-body { display: block; }
.help-note-body p {
  font-size: 13px; color: var(--muted); line-height: 1.6; margin: var(--space-8) 0 0; max-width: 74ch;
}

/* A guest's name anywhere outside the guests tab, as a way back to their record. Underlined on
   hover only: a page of permanently underlined names reads as a link farm, and these sit inside
   sentences and table cells where the surrounding text is doing the explaining. */
.guest-link {
  border: none; background: none; padding: 0; cursor: pointer; text-align: left;
  font-family: var(--font-family); font: inherit; color: inherit; font-weight: 700;
  border-radius: 3px;
}
.guest-link:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
/* Inside a chip the surrounding weight is already deliberate, so the link should not overrule it
   and make one chip in a row heavier than its neighbours. */
.chip .guest-link { font-weight: inherit; }

/* -------------------------------------------------- to-dos and attachments ---- */

/* The inline add box on the Overview to-do list. Deliberately not a .search-bar: it is an entry
   field, and looking like search would invite typing a filter into it. */
.todo-add {
  display: flex; align-items: center; gap: var(--space-8); margin-top: var(--space-8);
  border: 1.5px dashed var(--control); border-radius: var(--radius); padding: 0 var(--space-16);
  transition: border-color .15s;
}
.todo-add:focus-within { border-style: solid; border-color: var(--accent); }
.todo-add .material-symbols-rounded { font-size: 18px; color: var(--muted); }
.todo-add input {
  border: none; background: none; padding: var(--space-8) 0; font-size: 14px;
  color: var(--text); width: 100%; font-family: var(--font-family);
}
/* The wrapper draws the focus state (above); the ring on the field itself would double it. */
.todo-add input:focus-visible { outline: none; }
.todo-add:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.task-row {
  display: flex; align-items: center; gap: var(--space-8); width: 100%;
  padding: var(--space-16) 0; border-bottom: 1px solid var(--border);
  font-size: 14px; cursor: pointer; text-align: left;
}
.task-row:hover .task-title { color: var(--accent-dark); }
/* min-width:0 so a long to-do ellipsises instead of pushing its date chip out of the card. */
.task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.attachments { display: flex; flex-direction: column; gap: var(--space-8); }
.attachment {
  display: flex; align-items: center; gap: var(--space-8);
  background: var(--surface); border-radius: var(--radius); padding: var(--space-8) var(--space-16);
}
.attachment .material-symbols-rounded { font-size: 18px; color: var(--muted); flex: none; }
.attachment-name {
  border: none; background: none; padding: 0; text-align: left; cursor: pointer;
  font-family: var(--font-family); font-size: 14px; font-weight: 700; color: var(--text);
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attachment-name:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.attachment-size { font-size: 12px; color: var(--muted); flex: none; }

/* ---------------------------------------------------- the payment calendar ---- */

/* A row on the payment calendar. The whole row opens the cost, so it needs to say so on hover
   rather than looking like a static list. */
.pay-row {
  display: flex; align-items: center; gap: var(--space-16);
  padding: var(--space-16) 0; border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 14px;
}
.pay-row:hover .pay-item { color: var(--accent-dark); }

/* The date, as a number over a weekday. Fixed width so a column of them lines up regardless of
   whether the day is one digit or two, which is what makes it scan as a calendar rather than a
   list that happens to start with numbers. */
.pay-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 48px; flex: none; padding: var(--space-4) 0;
  background: var(--surface); border-radius: var(--radius);
}
.pay-day-num { font-size: 16px; font-weight: 800; line-height: 1.1; }
.pay-day-dow { font-size: 12px; font-weight: 700; color: var(--muted); }

.pay-item { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-sub { font-size: 12px; color: var(--muted); margin-top: 0; }
.pay-amount { font-weight: 800; font-size: 14.5px; flex: none; }

/* ------------------------------------------------------------ CSV import ---- */

/* The mapping table's dropdowns, given the same edge, radius and type as every other control. */
.table-wrap select,
.import-map select {
  width: 100%;
  border: 1.5px solid var(--control); border-radius: var(--radius);
  background: var(--card); color: var(--text);
  font-family: var(--font-family); font-size: 14px; font-weight: 600;
  padding: var(--space-8) var(--space-8);
  transition: border-color .15s;
}

/* A column that has been given a home reads differently from one that is still "ignore", so the
   half-finished state of a mapping is visible without reading every row. */
.table-wrap select.is-mapped { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }

/* The progress bar, across the top of the import modal. Zero height until an import starts, so it
   takes no space on the mapping screen. */
.import-progress { position: relative; height: 0; overflow: hidden; transition: height .2s ease; scroll-margin: 70px 0 80px; }
.import-progress.active { height: 32px; margin-block: var(--space-16); }
.import-progress-bar {
  position: absolute; inset: 0 auto 0 0; background: var(--accent-soft);
  border-radius: var(--radius-pill); transition: width .2s ease;
}
.import-progress-label {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 0 var(--space-16);
  font-size: 13px; font-weight: 700; color: var(--accent-dark);
}

/* ----------------------------------------------------------------- table ---- */

/* A table sits straight on the page: no box, a strong rule under the header, hairlines between
   rows. Wide ones scroll sideways inside their own wrapper rather than the page. */
.table-wrap { background: transparent; border: 0; border-radius: 0; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; font-size: 13px; font-weight: 700; color: var(--muted);
  padding: var(--space-16) var(--space-16) var(--space-16) 0; border-bottom: 1px solid var(--border-strong); white-space: nowrap;
  background: var(--bg); position: sticky; top: 0; z-index: 1;
}
table.data th:last-child, table.data td:last-child { padding-right: 0; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data th .sort-arrow { font-size: 14px; vertical-align: -3px; opacity: .7; }
table.data td { padding: var(--space-16) var(--space-16) var(--space-16) 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface); }
/* A selected row is tinted rather than outlined, so a run of selected rows reads as one block
   and the tick column is not the only signal. */
table.data tbody tr.is-selected { background: var(--info-soft); }
table.data tbody tr.is-selected:hover { background: var(--info-soft); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.actions { text-align: right; white-space: nowrap; width: 1%; }
table.data .cell-strong { font-weight: 700; }
table.data .cell-muted { color: var(--muted); }
table.data tfoot td {
  font-weight: 800; border-top: 1px solid var(--border-strong); border-bottom: none;
}

.table-toolbar {
  display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; margin-bottom: var(--space-24);
}
.table-toolbar .spacer { margin-left: auto; }
/* The action buttons stay together and stay against the right edge, wrapping as one block
   rather than letting a single button fall to the next line on its own. */
.toolbar-actions {
  display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap;
  margin-left: auto; flex: none;
}
@media (max-width: 640px) {
  .toolbar-actions { margin-left: 0; width: 100%; }
}
.result-count { font-size: 13px; font-weight: 700; color: var(--muted); }

/* --------------------------------------------------------------- filters ---- */

.search-bar {
  display: flex; align-items: center; gap: var(--space-8); background: var(--card);
  border: 1.5px solid var(--control); border-radius: var(--radius); padding: 0 var(--space-16);
  min-width: 200px; flex: 1; max-width: 380px; min-height: 46px;
}
.search-bar:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-bar .material-symbols-rounded { font-size: 18px; color: var(--muted); }
.search-bar input {
  border: none; background: none; padding: var(--space-8) 0; font-size: 15px;
  color: var(--text); width: 100%;
}
.search-bar input:focus-visible { outline: none; }
.search-bar input::placeholder { color: var(--muted); opacity: 1; }

/* One filter, as a pill that opens its options. See tableToolbar in js/ui/table.js for why the
   pill rows this replaced could not be made to fit.

   The button says which option is chosen, not just which group it is, so nothing is lost by
   collapsing it. When something other than "any" is picked the pill takes the accent AND turns
   bold AND gets a thicker accent edge, so a filtered view is obvious at a glance and is not told
   by colour alone. */
.filter-menu-btn {
  display: inline-flex; align-items: center; gap: var(--space-8); flex: none;
  border: 1.5px solid var(--control); background: transparent; color: var(--text);
  font-family: var(--font-family); font-size: 13.5px; font-weight: 600;
  min-height: 40px; padding: 0 var(--space-16) 0 var(--space-16); border-radius: var(--radius-pill); white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.filter-menu-btn:hover { background: var(--surface); }
.filter-menu-btn .material-symbols-rounded { font-size: 17px; color: var(--muted); }
.filter-menu-btn .filter-menu-caret { font-size: 18px; margin-left: calc(var(--space-4) * -1); }
.filter-menu-label { color: var(--muted); font-weight: 600; }

.filter-menu-btn.active {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 700;
}
.filter-menu-btn.active .material-symbols-rounded,
.filter-menu-btn.active .filter-menu-label { color: inherit; }

/* The label is what goes when there is no room: the chosen value is the information, and the
   icon already says which filter it belongs to. */
@media (max-width: 720px) {
  .filter-menu-label { display: none; }
}

/* A segmented switch, used by the guests tab's people/parties view. Both states stay visible;
   the chosen one is bold and lifted onto a card, not just a different colour. */
.filter-group {
  display: inline-flex; gap: var(--space-4); background: var(--surface); border-radius: var(--radius-pill);
  padding: var(--space-4); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.filter-group::-webkit-scrollbar { display: none; }
.filter-btn {
  border: none; background: none; font-family: var(--font-family); font-size: 13.5px;
  font-weight: 600; color: var(--muted); min-height: 38px; padding: 0 var(--space-16); border-radius: var(--radius-pill);
  transition: color .15s, background .15s;
  /* Without this a filter named "Night before" breaks over two lines and doubles the height of
     the whole toolbar on a phone. The group scrolls sideways inside itself instead. */
  white-space: nowrap; flex: none;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--card); color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .16); }

/* ---------------------------------------------------------------- fields ---- */

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

/* The record editor's own layout: a label column on the left, the control taking the rest of
 * the line, every field its own row. Scoped to .field-lr rather than to .field itself, so sign
 * in, the setup wizard, the password prompts and the CSV column mapper (all built from plain
 * .field divs, all already a shape that suits them) are untouched; only openRecordForm's own
 * fields, the ones behind every "add" and "edit" in the app, pick it up.
 *
 * The rule that places a field's control is deliberately general: anything in a .field-lr that
 * is not the label goes in column two, in the order it was added. A plain field has one such
 * child, the input. One with a hint, or the relativeTo date's presets, has two or three, and
 * they stack in that same column, under each other, label left blank beside them rather than
 * repeated. */
.field-lr { display: grid; grid-template-columns: 140px 1fr; column-gap: var(--space-field); row-gap: var(--space-label); align-items: start; margin-bottom: var(--space-field); }
.field-lr > .field-label { grid-column: 1; text-align: right; padding-top: var(--space-16); margin-bottom: 0; }
.field-lr > :not(.field-label) { grid-column: 2; min-width: 0; }
.field-lr .field-hint { margin-top: var(--space-4); }

/* A phone has no width to spare for a second column, so under 480px this falls back to the
   label sitting above its control, exactly like every other field in the app. */
@media (max-width: 480px) {
  .field-lr { grid-template-columns: 1fr; row-gap: var(--space-label); }
  .field-lr > .field-label { grid-column: 1; text-align: left; padding-top: 0; }
  .field-lr > :not(.field-label) { grid-column: 1; }
}

.field-label {
  display: block; font-size: 13px; font-weight: 700; color: var(--muted);
  margin-bottom: var(--space-label);
}
/* Every field is a box with a real edge (--control, 3:1 against the page) and a 12px corner.
   The old record editor drew a dashed underline instead; that was a quiet look but the edge of
   the control sat below 3:1, which is the one thing a field must not do. */
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; border: 1.5px solid var(--control); border-radius: var(--radius);
  background: var(--card); color: var(--text); font-size: 15px; padding: 0 var(--space-16);
  transition: border-color .15s;
}
.field input[type="checkbox"], .field input[type="radio"] { width: auto; min-height: 0; padding: 0; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; padding: var(--space-16) var(--space-16); }
.field-hint { font-size: 12.5px; color: var(--muted); margin-top: var(--space-label); line-height: 1.45; }
.field-hint.warn { color: var(--warning); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-field); }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-field); }
.field-row .field, .field-row-3 .field { margin-bottom: var(--space-field); }
/* Once a paired row stacks, the grid gap has nothing left to do: the fields' own margin already
   separates them. Leaving it on added the two together, so a half-width pair like "Time" and
   "Lasts" sat apart twice over, which read as an accidental gap above the pair rather than as
   spacing. */
@media (max-width: 560px) {
  .field-row, .field-row-3 { grid-template-columns: 1fr; gap: 0; }
}

/* A group of related flags as pills in one row (type: 'checks' in form.js). Pressed is bold, on
   the accent soft fill and with an accent edge, so it is never told by colour alone. */
.check-chips { display: flex; flex-wrap: wrap; gap: var(--space-8); padding-top: var(--space-4); }
.check-chip {
  display: inline-flex; align-items: baseline; gap: var(--space-8); font: inherit; font-size: 13.5px; font-weight: 600;
  min-height: 40px; padding: 0 var(--space-16); border: 1.5px solid var(--control); background: transparent;
  color: var(--text); cursor: pointer; line-height: 1.35; border-radius: var(--radius-pill); align-items: center;
}
.check-chip b { font-weight: 700; color: var(--muted); }
.check-chip:hover { background: var(--surface); }
.check-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 700; }
.check-chip[aria-pressed="true"] b { color: var(--accent-dark); }

.check-row { display: flex; align-items: center; gap: var(--space-8); margin-bottom: var(--space-8); font-size: 14.5px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* The "3 months before" row under a relativeTo date field. Small and quiet, since picking one
   is the shortcut and typing a date directly is still the normal path. */
.date-presets { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-8); }
.date-presets .check-chip { min-height: 36px; font-size: 13px; padding: 0 var(--space-16); }
.date-presets .check-chip:disabled { opacity: .55; cursor: default; }
@media (max-width: 640px) { .date-presets .check-chip { min-height: 44px; } }

/* Costs: Status as coloured pills, with the couple's own list (js/tabs/costs.js, js/shared/cost-status.js). The
   tone is only ever beside the words, never instead of them. */
.status-pills { display: grid; gap: var(--space-8); }
.status-pill-set { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.status-pill { position: relative; }
.status-pill .check-chip { gap: var(--space-8); }
.status-pill .check-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status-pill.tone-yellow .check-chip::before { background: var(--warning); }
.status-pill.tone-green .check-chip::before { background: var(--good); }
.status-pill.tone-yellow .check-chip[aria-pressed="true"] { background: var(--warning-soft); border-color: var(--warning); color: var(--text); }
.status-pill.tone-green .check-chip[aria-pressed="true"] { background: var(--good-soft); border-color: var(--good); color: var(--text); }
.status-pill.tone-grey .check-chip[aria-pressed="true"] { background: var(--surface); border-color: var(--text); color: var(--text); }
.status-pill-remove { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-left: calc(var(--space-4) * -1); padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; vertical-align: middle; }
.status-pill-remove:hover { background: var(--surface); color: var(--text); }
.status-pill-remove .material-symbols-rounded { font-size: 18px; }
.status-pill-own { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; }
.status-pill-own input { flex: 1 1 160px; width: auto; min-width: 0; min-height: 40px; padding: var(--space-8) var(--space-16); font: inherit; font-size: 16px; border: 1.5px solid var(--control); border-radius: var(--radius); background: var(--card); color: var(--text); }
.status-pill-own select { flex: none; width: auto; min-height: 40px; font: inherit; font-size: 16px; padding: var(--space-8) var(--space-8); border: 1.5px solid var(--control); border-radius: var(--radius); background: var(--card); color: var(--text); }
@media (max-width: 640px) {
  .status-pill .check-chip, .status-pill-own input, .status-pill-own select, .status-pill-own .btn { min-height: 44px; }
  .status-pill-remove { width: 44px; height: 44px; }
}

/* ---------------------------------------------------------------- modals ---- */

/* Heights are in dvh, not vh, and that is the whole of the iOS bug.
 *
 * On iOS Safari `100vh` is the LARGE viewport: the height the page would have if the address bar
 * and the bottom toolbar were retracted. It is bigger than what you can actually see. So
 * `max-height: calc(100vh - 40px)` let the box grow taller than the screen, and the bottom of it,
 * which is where Delete, Cancel and Save live, sat underneath Safari's own toolbar.
 *
 * `dvh` is the dynamic viewport: it tracks the visible area as those bars slide in and out. The
 * vh line is kept first as the fallback for anything that does not know dvh. */
.modal {
  display: none; position: fixed; inset: 0; z-index: 40; align-items: center;
  justify-content: center; padding: var(--space-24); background: rgba(0, 0, 0, .4);
}
.modal.open { display: flex; }
:root[data-theme="dark"] .modal { background: rgba(0, 0, 0, .6); }
.modal-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg); padding: var(--space-32); width: 100%; max-width: 580px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  /* The sticky header and footer below are positioned against this box, so it has to be the
     scroll container rather than the page. */
  position: relative;
}
.modal-box.wide { max-width: 840px; }

.modal-head {
  display: flex; align-items: center; gap: var(--space-8); margin-bottom: var(--space-24);
  /* Sticky so a long form always says what you are editing and always offers a way out. The
     negative margins let it span the box's padding, and the matching positive padding puts the
     content back where it was. */
  position: sticky; top: calc(var(--space-32) * -1); z-index: 2;
  background: var(--card);
  margin: calc(var(--space-32) * -1) calc(var(--space-32) * -1) var(--space-24); padding: var(--space-24) var(--space-32) var(--space-16);
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 500; letter-spacing: -.01em; margin: 0; }
.modal-head .spacer { margin-left: auto; }

/* Sticky too, and this is the change that matters most on a phone. The timing editor is nine
   fields tall; before this you had to scroll to the very bottom of it to reach Save, every time.
   Now the actions sit on the form wherever you are in it. */
.modal-foot {
  display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap;
  position: sticky; bottom: calc(var(--space-32) * -1); z-index: 2;
  background: var(--card);
  margin: var(--space-24) calc(var(--space-32) * -1) calc(var(--space-32) * -1); padding: var(--space-16) var(--space-32) var(--space-24);
  border-top: 1px solid var(--border);
}
.modal-foot .spacer { margin-left: auto; }

/* On a phone the modal is a sheet: full width, anchored to the bottom, rounded at the top only.
   A centred card with a 20px moat on every side wastes about a fifth of a small screen on
   dimmed background, and the thumb is at the bottom, not the middle. */
@media (max-width: 640px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal-box {
    max-width: none;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
    padding: var(--space-24) var(--space-24);
    /* Clears the home indicator on a phone without a chin. env() is 0 anywhere it does not
       apply, so this costs nothing elsewhere. */
    padding-bottom: calc(var(--space-24) + env(safe-area-inset-bottom, 0));
  }
  .modal-head { top: calc(var(--space-24) * -1); margin: calc(var(--space-24) * -1) calc(var(--space-24) * -1) var(--space-16); padding: var(--space-24) var(--space-24) var(--space-16); }
  .modal-foot {
    bottom: calc(var(--space-24) * -1);
    margin: var(--space-24) calc(var(--space-24) * -1) calc(calc(var(--space-24) * -1) - env(safe-area-inset-bottom, 0));
    padding: var(--space-16) var(--space-24) calc(var(--space-24) + env(safe-area-inset-bottom, 0));
  }
}

/* iOS centres the value inside a date or time input, which puts one field's text in a different
   place from every other field on the form and reads as a rendering fault. */
.field input[type="time"],
.field input[type="date"] {
  text-align: left;
}

/* ---------------------------------------------------------------- picker ---- */

.picker-btn {
  display: inline-flex; align-items: center; gap: var(--space-8); width: 100%;
  border: 1.5px solid var(--control); background: var(--card); color: var(--text);
  font-family: var(--font-family); font-size: 15px; font-weight: 500;
  padding: 0 var(--space-16); border-radius: var(--radius); text-align: left; min-height: 46px;
}
.picker-btn:hover { background: var(--surface); }
.picker-btn .picker-placeholder { color: var(--muted); font-weight: 500; }
.picker-btn .material-symbols-rounded { margin-left: auto; font-size: 18px; color: var(--muted); }
.picker-btn .picker-values { display: flex; gap: var(--space-8); flex-wrap: wrap; min-width: 0; }

.picker-pop {
  position: fixed; z-index: 50; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-lg); width: 300px;
  max-height: 360px; display: flex; flex-direction: column; overflow: hidden;
}
/* A picker opened without its search box, for a short fixed list such as a toolbar filter. It
   sizes to its options rather than holding the 300px a searchable list needs. */
.picker-pop.no-search { width: auto; min-width: 200px; padding: var(--space-8) 0; }

.picker-search {
  margin: var(--space-8) var(--space-8) 0; border: 1.5px solid var(--control); border-radius: var(--radius); background: var(--card);
  padding: var(--space-8) var(--space-16); min-height: 42px; font-size: 14px; color: var(--text); font-family: var(--font-family);
}
/* The search keeps its whole edge when focused (owner's feedback, 4 Dec: the pop-up's rounded corner cut it off). */
.picker-search:focus { border-color: var(--accent); }
.picker-search:focus-visible { outline-offset: 2px; }
.picker-list { overflow-y: auto; padding: var(--space-8); }
.picker-group-label {
  font-size: 12px; font-weight: 700; color: var(--muted); padding: var(--space-8) var(--space-8) var(--space-4);
}
/* A heading after the first options draws a thin line above it, so fixed choices and the list read apart. */
.picker-list > .picker-option + .picker-group-label { border-top: 1px solid var(--border); margin-top: var(--space-8); padding-top: var(--space-16); }
.picker-option {
  display: flex; align-items: center; gap: var(--space-8); width: 100%; border: none; background: none;
  padding: var(--space-8) var(--space-8); border-radius: var(--radius); font-size: 14px; font-weight: 600;
  color: var(--text); text-align: left; font-family: var(--font-family);
}
.picker-option:hover, .picker-option.cursor { background: var(--surface); }
.picker-option .picker-tick { font-size: 18px; color: var(--accent-dark); margin-left: auto; opacity: 0; }
.picker-option.selected { font-weight: 700; }
.picker-option.selected .picker-tick { opacity: 1; }
.picker-option .picker-sub { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: var(--space-8); }
/* A plus or minus before "Add to" and "Take off" (owner's feedback, 18 Nov): the two used to look the same. */
.picker-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 50%; font-weight: 800; font-size: 15px; line-height: 1; }
.picker-mark.add { background: var(--good-soft); color: var(--good); }
.picker-mark.remove { background: var(--error-soft); color: var(--error); }
/* An option worth noticing first, such as a table with room (the Table plan). Words in its sub-line say why. */
/* Options that fit (a table with a free seat) are listed first under their own heading; they look like any other
   option (owner's feedback, 4 Dec: the tinted rows with a bar down the left looked odd). */
.picker-empty { padding: var(--space-16) var(--space-16); font-size: 13px; color: var(--muted); text-align: center; }
.picker-foot { border-top: 1px solid var(--border); padding: var(--space-8); }
.picker-foot button {
  width: 100%; border: none; background: none; padding: var(--space-8); border-radius: var(--radius);
  font-size: 13px; font-weight: 700; color: var(--muted); font-family: var(--font-family);
}
.picker-foot button:hover { background: var(--surface); color: var(--text); }

/* ---------------------------------------------------------------- toasts ---- */

/* Full width, centring its toasts, rather than left: 50% with a shift: that left a toast only half the screen to
   wrap in, so a longer one on a phone was squeezed into a narrow, tall blob (24 Nov 2026). */
#toasts {
  position: fixed; bottom: 24px; left: 0; right: 0; padding: 0 var(--space-16); z-index: 60;
  display: flex; flex-direction: column; gap: var(--space-8); align-items: center; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--space-16); background: var(--text); color: var(--bg);
  border-radius: var(--radius-pill); padding: var(--space-16) var(--space-24); font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); pointer-events: auto; max-width: min(100%, 480px); line-height: 1.4;
  animation: toast-in .18s ease;
}
/* The page colour on the error fill: 6:1 in light and 8:1 in dark. White on the dark theme's
   pale salmon was 2.5:1, so the text colour is a token and not a literal. */
.toast.bad { background: var(--error); color: var(--bg); }
/* A toast that wraps onto two lines is a rounded box, not a stretched pill. */
@media (max-width: 640px) { .toast { border-radius: 16px; padding: var(--space-16) var(--space-16); } }
.toast button {
  border: none; background: none; color: inherit; font-family: var(--font-family);
  font-size: 13.5px; font-weight: 800; text-decoration: underline; padding: 0; flex: none;
}
.toast button:focus-visible { outline-color: currentColor; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- sync state ---- */

/* The sync words in the header (js/ui/nav.js) are styled in css/shell.css. */

/* ------------------------------------------------------------ boot screen ---- */

#boot {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: center;
  justify-content: center; flex-direction: column; gap: var(--space-16); background: var(--bg);
  text-align: center; padding: var(--space-24);
}
#boot.hidden { display: none; }
/* On /demo the banner goes in above the planner while the opening screen still covers it. Kept invisible until then,
   so the page behind the cover moving down is not measured as a layout shift (batch C, 5 Dec 2026). */
html.demo:has(#boot:not(.hidden)) #app { visibility: hidden; }
#boot .brand-mark { width: 56px; height: 56px; }
#boot h1 { font-family: var(--font-display); font-size: 26px; font-weight: 500; letter-spacing: -.01em; margin: 0; }
#boot p { font-size: 14.5px; color: var(--muted); margin: 0; max-width: 460px; line-height: 1.6; }
#boot code {
  font-family: var(--mono); font-size: 13px; background: var(--surface);
  border-radius: 6px; padding: var(--space-4) var(--space-8);
}

/* ------------------------------------------- signing in, and first-run setup ---- */

/* Both are full-page panels over the app rather than modals in it. Before sign-in there is no
   app to be modal over, and the setup wizard is the one moment the tabs behind it are noise.
   The sign-in panel sits above the boot screen; the wizard sits below it, so it only appears
   once the app underneath has actually loaded. */
#auth, #onboarding {
  display: none; position: fixed; inset: 0; overflow-y: auto;
  background: var(--bg); padding: var(--space-24) var(--space-16);
  padding-bottom: calc(var(--space-24) + env(safe-area-inset-bottom));
}
#auth { z-index: 80; padding: 0; }
#onboarding { z-index: 60; }
#auth.open, #onboarding.open { display: flex; align-items: flex-start; justify-content: center; }

.onboarding-card {
  width: 100%; margin: auto 0; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: var(--space-32); max-width: 600px;
}
.auth-card h1, .onboarding-card h1 { font-family: var(--font-display); font-size: 36px; font-weight: 500; letter-spacing: -.01em; line-height: 1.1; margin: 0 0 var(--space-8); }
.auth-lead { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 var(--space-4); }

/* Sign in is two halves on a wide screen: the brand on the accent soft fill (the mark, the name,
   the line, the address) and the form beside it. On a phone the brand folds into a band across
   the top and the form follows, so the name and the line are never lost, only made smaller. */
.auth-shell { display: flex; width: 100%; min-height: 100%; }
.auth-brand {
  flex: 0 0 min(40%, 560px); background: var(--accent-soft); color: var(--accent-dark);
  padding: var(--space-64); display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-48);
}
.auth-lockup { display: flex; align-items: center; gap: var(--space-16); align-self: flex-start; min-height: 44px; color: inherit; text-decoration: none; border-radius: var(--radius); }
.auth-back { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--accent-dark); text-underline-offset: 3px; }
.auth-lockup .brand-mark { width: 52px; height: 52px; }
.auth-name { font-family: var(--font-display); font-weight: 500; font-size: 30px; line-height: 1; letter-spacing: -.015em; color: var(--text); }
.auth-tagline-wrap { display: flex; flex-direction: column; gap: var(--space-16); }
.auth-tagline-wrap .brand-mark { width: 150px; height: 150px; }
.auth-tagline { font-family: var(--font-display); font-weight: 500; font-size: clamp(32px, 3.6vw, 46px); line-height: 1.12; letter-spacing: -.01em; margin: 0; color: var(--accent-dark); }

.auth-main { flex: 1 1 0; min-width: 0; display: grid; place-items: center; padding: var(--space-64) var(--space-48); }
.auth-card { width: 100%; max-width: 400px; margin: auto 0; }
.auth-head { display: flex; flex-direction: column; gap: var(--space-8); margin-bottom: var(--space-32); }
.auth-head h1 { font-size: 42px; margin: 0; }
.auth-card form .field { margin-bottom: var(--space-24); }

.auth-submit { width: 100%; justify-content: center; min-height: 52px; margin-top: var(--space-4); }
.auth-message { min-height: 18px; margin: 0 0 var(--space-8); font-size: 13.5px; line-height: 1.5; font-weight: 600; color: var(--error); }
.auth-message:empty { min-height: 0; margin: 0; }
.auth-small { font-size: 13px; line-height: 1.55; color: var(--muted); margin: 0 0 var(--space-16); }
.auth-small a { color: var(--accent-dark); text-decoration: underline; }
.auth-or { text-align: center; margin: var(--space-16) 0; }

.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-8) var(--space-16); margin-top: var(--space-24); }
.auth-link {
  border: none; background: none; padding: var(--space-8) 0; font: inherit; font-size: 13.5px;
  font-weight: 700; color: var(--accent-dark); cursor: pointer; border-radius: 6px;
}
.auth-link:hover { text-decoration: underline; }

/* The recovery code is going to be read off a screen and written on paper, so it is set large,
   monospaced and allowed to wrap between its groups rather than scroll sideways. */
.auth-code {
  display: flex; align-items: center; gap: var(--space-16); padding: var(--space-16) var(--space-16); margin-bottom: var(--space-16);
  background: var(--surface); border-radius: var(--radius);
}
.auth-code code {
  flex: 1; font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: .04em;
  overflow-wrap: anywhere; user-select: all;
}

@media (max-width: 860px) {
  .auth-shell { flex-direction: column; }
  .auth-brand { flex: none; padding: var(--space-32) var(--space-24); gap: var(--space-16); }
  .auth-lockup .brand-mark { width: 40px; height: 40px; }
  .auth-name { font-size: 24px; }
  .auth-tagline-wrap .brand-mark { display: none; }
  .auth-tagline { font-size: 24px; }
  .auth-back { font-size: 14px; }
  .auth-main { padding: var(--space-32) var(--space-24) var(--space-48); place-items: start center; }
  .auth-head h1 { font-size: 34px; }
}

.onboarding-progress { display: flex; gap: var(--space-8); margin-bottom: var(--space-24); }
.onboarding-progress span { flex: 1; height: 5px; border-radius: var(--radius-pill); background: var(--track); transition: background .2s; }
.onboarding-progress span.done { background: var(--accent); }
.onboarding-foot { display: flex; align-items: center; gap: var(--space-8); margin-top: var(--space-32); }
.onboarding-foot .spacer { margin-left: auto; }

.shape-list { display: grid; gap: var(--space-8); }
.shape {
  display: grid; gap: var(--space-4); text-align: left; padding: var(--space-16) var(--space-24); font: inherit; color: var(--text);
  background: var(--card); border: 1.5px solid var(--control); border-radius: var(--radius-card);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.shape:hover { background: var(--surface); }
.shape.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.shape-title { font-size: 15px; font-weight: 700; }
.shape.selected .shape-title { font-weight: 800; }
.shape-blurb { font-size: 13.5px; color: var(--muted); }
.shape.selected .shape-blurb { color: var(--text); }
.shape-parts { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-8); }

.onboarding-summary {
  display: grid; gap: var(--space-8); padding: var(--space-16) var(--space-16); font-size: 14px;
  background: var(--surface); border-radius: var(--radius-card);
}
.onboarding-summary > div { display: flex; align-items: center; gap: var(--space-8); }
.onboarding-summary .material-symbols-rounded { font-size: 16px; color: var(--accent-dark); }

@media (max-width: 480px) {
  #onboarding { padding: 0; background: var(--card); }
  .onboarding-card { border: none; box-shadow: none; border-radius: 0; margin: 0; max-width: none; padding: var(--space-32) var(--space-24); }
}
@media (pointer: coarse) {
  .onboarding-card select { font-size: 16px; }
}

/* ------------------------------------------------------- sharing and account ---- */

.member-row {
  display: flex; align-items: center; gap: var(--space-16); padding: var(--space-16) 0; border-top: 1px solid var(--border);
}
.member-row:first-of-type { border-top: none; }
.member-who { flex: 1; min-width: 0; }
.member-who strong { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-who span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.invite-link {
  display: flex; gap: var(--space-8); align-items: center; margin-top: var(--space-16); padding: var(--space-16) var(--space-16);
  background: var(--surface); border-radius: var(--radius);
}
.invite-link code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; user-select: all; }

/* A viewer may look and not change. The API refuses their writes regardless; hiding the
   controls is only so the app does not offer what it will then decline. */
body.read-only .btn.add,
body.read-only .inline-add,
body.read-only .btn.danger { display: none; }

/* ------------------------------------------------------------ accent picker ---- */

/* Round swatches with the colour's name, used in setup and Settings. The chosen one is bold, has
   an accent-weight ring and an offset second ring, so it is told by shape and weight and not by
   colour alone. */
.accent-swatch {
  display: inline-flex; align-items: center; gap: var(--space-8); min-height: 48px; padding: 0 var(--space-16) 0 var(--space-8);
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--text);
  background: transparent; border: 1.5px solid var(--control); border-radius: var(--radius-pill);
}
.accent-swatch:hover { background: var(--surface); }
.accent-swatch.selected { border-color: var(--text); font-weight: 700; box-shadow: 0 0 0 3px var(--accent-soft); }
.accent-dot { width: 30px; height: 30px; border-radius: 50%; display: inline-block; }

/* The countdown is the one thing everybody comes to the Overview to see, so the number is set
   large in the display face. The card: a calendar tile, the number, the couple, the place. The
   mark behind it is decoration at a tenth of the accent's strength (test/contrast.mjs checks the
   words over it); it is not drawn when there is a wedding image. */
.card.hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: var(--space-32) var(--space-48); flex-wrap: wrap; padding: var(--space-48) var(--space-64); }
.countdown-main { position: relative; display: flex; align-items: center; gap: var(--space-48); flex: none; }
.countdown-where { position: relative; margin-left: auto; text-align: right; }
.countdown-watermark {
  position: absolute; right: -46px; top: -40px; width: 320px; height: 320px;
  color: var(--accent); opacity: .1; pointer-events: none;
}
.countdown-watermark .brand-mark { display: block; width: 100%; height: 100%; color: inherit; }

.date-tile { width: 118px; flex: none; border-radius: 18px; background: var(--card); overflow: hidden; text-align: center; }
.date-tile-month { background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px; padding: var(--space-8) var(--space-8); white-space: nowrap; }
.date-tile-day { font-family: var(--font-display); font-weight: 500; font-size: 58px; line-height: 1.05; padding-top: var(--space-8); color: var(--text); }
.date-tile-weekday { font-size: 13px; font-weight: 700; color: var(--muted); padding-bottom: var(--space-16); }

.countdown-number {
  font-family: var(--font-display); font-weight: 500; color: var(--accent-dark);
  font-size: 68px; line-height: 1; letter-spacing: -.03em;
}
.countdown-sub { margin-top: var(--space-8); font-size: 14.5px; font-weight: 700; color: var(--accent-dark); }
.countdown-names { font-family: var(--font-display); font-weight: 500; font-size: 32px; line-height: 1.15; letter-spacing: -.01em; }
/* Muted, nudged a quarter of the way to the text colour: plain muted is 4.3:1 on the darkest patch
   of the watermark behind it (4.5:1 is the line), and this is 5:1 and still reads as the quiet line. */
.countdown-when { margin-top: var(--space-8); font-size: 14.5px; color: color-mix(in srgb, var(--muted) 75%, var(--text)); display: flex; align-items: center; gap: var(--space-8); justify-content: flex-end; }
.countdown-pin { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* A wedding image heads the card: it keeps its own rounded top and the card below it squares off. */
.ov-hero.no-image .card.hero { border-radius: var(--radius-xl); }

@media (max-width: 640px) {
  .card.hero { flex-direction: column; align-items: flex-start; gap: var(--space-16); padding: var(--space-24); }
  .countdown-main { gap: var(--space-16); }
  .countdown-where { margin-left: 0; text-align: left; }
  .countdown-when { justify-content: flex-start; align-items: flex-start; }
  .countdown-watermark { right: -44px; top: -34px; width: 210px; height: 210px; }
  .date-tile { width: auto; min-width: 92px; border-radius: 16px; }
  .date-tile-month { font-size: 13px; padding: var(--space-4) var(--space-8); }
  .date-tile-day { font-size: 42px; padding-top: var(--space-4); }
  .date-tile-weekday { padding-bottom: var(--space-8); }
  .countdown-number { font-size: 46px; }
  .countdown-sub { margin-top: var(--space-4); }
  .countdown-weeks { display: none; }
  .countdown-names { font-size: 25px; }
  .countdown-when { margin-top: var(--space-4); }
}

/* ------------------------------------------------------------- phone bottom bar ---- */

/* The bar itself is in css/shell.css. What lives here is the room the page leaves for it. */
@media (max-width: 640px) {
  /* Room for the bar under the content, and for toasts above it. */
  main { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* The mini preview in the setup colour step. Every colour is a token, so it follows the swatch. */
.accent-preview { margin-top: var(--space-24); border-radius: var(--radius-card); overflow: hidden; background: var(--bg); border: 1px solid var(--border); }
.ap-top { display: flex; align-items: center; gap: var(--space-16); padding: var(--space-16) var(--space-16); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ap-mono { display: inline-flex; align-items: center; gap: var(--space-8); font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1; }
.ap-mono .brand-mark { width: 24px; height: 24px; }
.ap-tabs { display: flex; gap: var(--space-4); }
.ap-tab { font-size: 13px; font-weight: 600; color: var(--muted); padding: var(--space-8) var(--space-16); border-radius: var(--radius-pill); }
.ap-tab.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.ap-body { display: grid; gap: var(--space-16); padding: var(--space-16); }
.ap-count { display: flex; align-items: baseline; gap: var(--space-8); padding: var(--space-16) var(--space-16); border-radius: var(--radius-card); background: var(--accent-soft); font-size: 14px; font-weight: 700; color: var(--accent-dark); }
.ap-count .countdown-number { font-size: 40px; }
.ap-row { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; }
.ap-row .spacer { margin-left: auto; }
.ap-link { font-size: 13.5px; font-weight: 700; color: var(--accent-dark); text-decoration: underline; }

/* The table plan: tables on the left, the not-seated list on the right, and one column below
   900px. Print has its own layout rule in print.css. */
.tableplan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-24); align-items: start; }
@media (max-width: 900px) { .tableplan-layout { grid-template-columns: minmax(0, 1fr); } }

/* Icons are drawn at weight 300 for a lighter, more elegant line. The very small ones (the tab
   bar and inline chips) keep a little more weight, because a hairline at 13 to 16px simply
   disappears against the page. The font keeps its weight axis, so this costs nothing. */
.chip .material-symbols-rounded,
.help-note-toggle .material-symbols-rounded { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20; }

/* ----------------------------------------------------------- filter popout ---- */

.filter-pop-wrap { position: relative; flex: none; }
.filter-count {
  min-width: 20px; height: 20px; padding: 0 var(--space-8); border-radius: var(--radius-pill); display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
  background: var(--accent); color: var(--accent-ink);
}
.filter-pop {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 35;
  width: 360px; max-width: calc(100vw - 24px); padding: var(--space-24); gap: var(--space-16);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  /* The guest list puts its views above four filter groups, which is taller than a short laptop
     screen or a phone sheet; the panel scrolls rather than running off the bottom. */
  max-height: min(70vh, 640px); overflow-y: auto; overscroll-behavior: contain;
}
.filter-pop-wrap.open .filter-pop { display: grid; }
.filter-pop-group { display: grid; gap: var(--space-8); }
.filter-pop-label { display: flex; align-items: center; gap: var(--space-8); font-size: 13px; font-weight: 700; color: var(--muted); }
.filter-pop-label .material-symbols-rounded { font-size: 16px; }
.filter-pop-options { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.filter-opt {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); background: transparent;
  border: 1.5px solid var(--control); border-radius: var(--radius-pill); min-height: 38px; padding: 0 var(--space-16);
}
.filter-opt:hover { background: var(--surface); }
.filter-opt.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 700; }
.filter-pop-foot { display: flex; justify-content: space-between; align-items: center; padding-top: var(--space-16); border-top: 1px solid var(--border); }

/* The label stays visible here even on a phone, unlike the single-filter button: "Filters" is
   the only thing telling you what the icon is. */
@media (max-width: 720px) { .filter-pop-wrap .filter-menu-label { display: inline; } }
/* On a phone the popout is a sheet above the bottom bar, like the More menu, rather than a box
   hanging off a button near the edge of the screen. */
@media (max-width: 640px) {
  .filter-pop-wrap { position: static; }
  .filter-pop {
    position: fixed; left: 8px; right: 8px; width: auto; max-width: none; top: auto; z-index: 30;
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

/* -------------------------------------------------------- record fields ---- */

/* The record editor keeps its label-left layout (above) and gets the same boxed controls as
   every other form. A native select keeps a drawn chevron so it still reads as a menu. */
.field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236B5F57' stroke-width='1.6'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
  padding-right: var(--space-48);
}
:root[data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23A9A49C' stroke-width='1.6'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
}

.field-lr .picker-btn { width: 100%; }
.field-lr .check-row { padding: var(--space-4) 0; }

/* ------------------------------------------------------------- fading row actions ---- */

/* Move up, move down, edit, and the standing "add one" row underneath a list: real controls,
 * needed while you are building the list and rarely once it is settled. Resting at a low opacity
 * rather than hidden outright, so there is still a hint that something is there to find;
 * hovering the row, or tabbing to a control inside it with the keyboard, brings it to full
 * strength.
 *
 * Only on a fine pointer. A touch screen has no hover to reveal anything with, so a phone keeps
 * these at full opacity. The fade is .5 and not lower: a faded icon is still an icon you have to
 * be able to see, and the controls are 3:1 against the page even at rest. */
@media (pointer: fine) {
  .row-actions { opacity: .55; transition: opacity .15s ease; }
  *:hover > .row-actions,
  .row-actions:hover,
  .row-actions:focus-within { opacity: 1; }
}

/* An explicit "Edit menu" toggle, the same move Table plan makes for its own edit pencils:
   this overrides the resting fade so every row's controls show at once, for reordering several
   rows in a row rather than hovering each in turn. */
.edit-mode .row-actions { opacity: 1; }

/* ---- email composer (js/ui/email.js) ---- */
.material-symbols-rounded.flip { transform: scaleX(-1); }
.modal-box.composer { max-width: 1040px; }
.composer-banner {
  display: flex; gap: var(--space-8); align-items: flex-start; font-size: 13px; line-height: 1.5;
  background: var(--surface); color: var(--muted); padding: var(--space-16) var(--space-16); margin-bottom: var(--space-16); border-radius: var(--radius);
}
.composer-banner .material-symbols-rounded { font-size: 17px; }
.composer-label { font-size: 13px; font-weight: 700; color: var(--muted); min-width: 64px; }
.composer-audience { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; margin-bottom: var(--space-16); font-size: 14px; }
.composer-note { font-size: 12.5px; color: var(--warning); }
.seg { display: inline-flex; padding: var(--space-4); border-radius: var(--radius-pill); background: var(--surface); gap: var(--space-4); }
.seg button {
  font: inherit; font-size: 13.5px; font-weight: 600; min-height: 36px; padding: 0 var(--space-16); border: none; cursor: pointer;
  background: transparent; color: var(--muted); display: inline-flex; gap: var(--space-8); align-items: center; border-radius: var(--radius-pill);
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .16); }
.seg-count { font-size: 12px; font-weight: 700; color: var(--muted); }
.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-32); }
@media (max-width: 760px) { .composer-grid { grid-template-columns: 1fr; } }
.composer-write { display: grid; gap: var(--space-16); align-content: start; }
.composer-templates, .composer-fields { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; }
.composer-subject, .composer-body {
  width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--card);
  border: 1.5px solid var(--control); border-radius: var(--radius); padding: var(--space-8) var(--space-16);
}
.composer-subject { font-weight: 700; min-height: 46px; }
.composer-body { resize: vertical; line-height: 1.6; min-height: 240px; }
.composer-subject:focus, .composer-body:focus { border-color: var(--accent); }
.composer-preview { background: var(--surface); padding: var(--space-16); align-self: start; min-width: 0; border-radius: var(--radius-card); }
.composer-preview-nav { display: flex; align-items: center; gap: var(--space-8); margin-bottom: var(--space-16); }
.composer-to { flex: 1; min-width: 0; display: grid; font-size: 13px; line-height: 1.35; }
.composer-to span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-to span.bad { color: var(--error); }
.composer-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.composer-warning { font-size: 12.5px; color: var(--error); margin-bottom: var(--space-8); }
.composer-empty { font-size: 14px; color: var(--muted); padding: var(--space-24) var(--space-8); text-align: center; }
/* An email is drawn on white paper whatever the theme, because that is what the guest's mail
   app will do. These are the email's own colours, not the app's. */
.composer-mail { background: #FFFDF9; color: #2B2224; padding: var(--space-24) var(--space-24); font-family: Georgia, 'Times New Roman', serif; font-size: 14.5px; border-radius: var(--radius); }
.composer-mail p { margin: 0 0 var(--space-16); line-height: 1.6; white-space: pre-line; }
.composer-mail-subject { font-family: var(--font-family); font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: var(--space-8); }
.composer-mail-button { display: inline-block; margin-top: var(--space-8); background: var(--accent); color: var(--accent-ink); font-family: var(--font-family); font-weight: 600; font-size: 14px; padding: var(--space-8) var(--space-16); }
:root[data-theme="dark"] .composer-mail-button { background: var(--accent-dark); }
.check-chip[aria-pressed] span { color: inherit; }

/* Table plan, unseated list grouped by party (js/tabs/tables.js). */
/* A person waiting: a handle, the name, an underlined Seat (owner's feedback, 4 Dec). */
.unseated-row {
  display: flex; align-items: center; gap: var(--space-8); padding: var(--space-8); background: var(--card);
  border-radius: var(--radius-sm); font-size: 13px; cursor: grab;
}
.unseated-name, .unseated-party-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.unseated-seat { flex: none; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.unseated-group { display: flex; flex-direction: column; gap: var(--space-8); }
/* By party: one white box per party, its name on top and its people inside (owner's feedback, 4 Dec). */
.unseated-group.party-box {
  gap: var(--space-4); padding: var(--space-4); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.unseated-party {
  display: flex; align-items: center; gap: var(--space-8); padding: var(--space-8); font-size: 13px; font-weight: 700;
  color: var(--text); cursor: grab;
}
.unseated-party-count { font-size: 12px; color: var(--muted); font-weight: 600; }
.party-box-people { display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.unseated-row.nested { background: none; font-weight: 500; }
.unseated-row.nested:hover, .unseated-party:hover { background: var(--surface); border-radius: var(--radius-sm); }

/* ---- Table plan cards (js/tabs/tables.js) ---- */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: var(--space-16); }
.table-card { transition: border-color .15s, background .15s, opacity .15s; }
.table-card.over { border-color: var(--error); }
.table-card.editing { cursor: grab; }
.table-card.dragging { opacity: .5; }
.table-card.drop-on { border-color: var(--teal); background: var(--teal-soft); }
.table-card.swap-on { border-color: var(--accent); border-style: dashed; background: var(--accent-soft); }
/* Edit tables: the table's own tools, small, in its top corner; the name keeps the full width under them. */
.table-tools { display: flex; align-items: center; gap: var(--space-4); margin: calc(var(--space-8) * -1) calc(var(--space-8) * -1) var(--space-4) 0; }
.table-tools > .spacer { flex: 1; }
/* Move earlier and later: only where there is no dragging (a phone, a tablet); a laptop drags. */
.table-tools .table-order { display: none; }
.table-tools .table-tool { width: 32px; height: 32px; }
.table-tools .table-tool .material-symbols-rounded, .table-move .material-symbols-rounded { font-size: 18px; }
.table-tools .table-tool:disabled { opacity: .4; cursor: default; }
.table-move { display: inline-flex; align-items: center; gap: var(--space-4); color: var(--muted); cursor: grab; }
.table-head { display: flex; align-items: flex-start; gap: var(--space-8); margin-bottom: var(--space-8); }
.table-name {
  border: none; background: none; padding: 0; font: inherit; font-weight: 800; font-size: 14px; color: var(--text);
  flex: 1; text-align: left; cursor: pointer;
}
.table-usage.over { background: var(--error-soft); color: var(--error); border-color: transparent; }
.table-usage.full { background: var(--accent-soft); color: var(--accent-dark); border-color: transparent; }
.table-seats { display: flex; flex-direction: column; gap: var(--space-4); min-height: 40px; }
.drop-hint {
  font-size: 12px; color: var(--muted); text-align: center; padding: var(--space-16) 0;
  border: 1px dashed var(--control); border-radius: var(--radius-sm);
}
.table-seats.has-marker > .drop-hint { display: none; }
.seat-someone { margin-top: var(--space-8); width: 100%; justify-content: center; }
/* Where a dragged guest will land (owner's feedback, 4 Dec). */
.drop-marker {
  display: flex; align-items: center; gap: var(--space-8); padding: var(--space-4) var(--space-8); font-size: 12.5px; font-weight: 700;
  color: var(--accent-dark); background: var(--card); border: 1.5px dashed var(--accent); border-radius: var(--radius-sm);
}
.drop-marker .material-symbols-rounded { font-size: 16px; }
/* The picture under the pointer while dragging: it floats, so it has the shadow. Drawn off screen for the browser. */
.drag-ghost {
  position: fixed; top: -1000px; left: -1000px; display: inline-flex; align-items: center; gap: var(--space-8);
  padding: var(--space-8) var(--space-16) var(--space-8) var(--space-8); background: var(--card); color: var(--text);
  border: 1.5px solid var(--accent); border-radius: var(--radius-pill); box-shadow: var(--shadow-lg);
  font: 700 13.5px var(--font-family); white-space: nowrap;
}
.drag-ghost .material-symbols-rounded { font-size: 18px; color: var(--muted); }
/* Edit tables: the next table, drawn in outline, adds one when pressed (owner's feedback, 4 Dec). */
.table-add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-8); min-height: 140px;
  border: 1.5px dashed var(--control); border-radius: var(--radius-card); background: none; color: var(--muted);
  font: 700 14px var(--font-family); cursor: pointer; transition: border-color .15s, color .15s;
}
.table-add-card .material-symbols-rounded { font-size: 28px; }
.table-add-card:hover { border-color: var(--accent); color: var(--accent-dark); }
.menu-key-empty h3 { margin: 0 0 var(--space-4); font-size: 14px; }
.menu-key-empty p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* Money fields carry the wedding's currency symbol (form.js, type: 'money'). The wrapper is the
   box, so the input inside gives up its own edge. */
.money-input { display: flex; align-items: center; gap: var(--space-4); border: 1.5px solid var(--control); border-radius: var(--radius); background: var(--card); padding-left: var(--space-16); }
.money-input:focus-within { border-color: var(--accent); }
.field .money-input input { border: none !important; background: none; flex: 1; min-width: 0; padding-left: 0; min-height: 43px; }
.field .money-input input:focus-visible { outline: none; }
.money-input:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.money-prefix { color: var(--muted); font-size: 15px; }
.field-presets { display: flex; gap: var(--space-8); margin-top: var(--space-8); }

/* ---- music (js/tabs/music.js) ----
   Every row, the link line, the empty line and the add bar share one left edge. Nothing is boxed
   or inset, which is what made the old link bar sit out of line. */
.music-row { display: flex; align-items: center; gap: var(--space-16); padding: var(--space-16) 0; border-bottom: 1px solid var(--border); }
.music-row:last-child { border-bottom: none; }
.music-main { flex: 1; min-width: 0; }
.music-line { display: flex; align-items: baseline; gap: var(--space-8); flex-wrap: wrap; }
.music-title { font-weight: 700; font-size: 14.5px; }
.music-artist { font-size: 13px; color: var(--muted); }
.music-line .badge, .music-line .chip { align-self: center; }
.music-sub { font-size: 12.5px; color: var(--muted); margin-top: var(--space-4); }
.music-decide { display: inline-flex; align-items: center; gap: var(--space-4); }
.music-link { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-4) 0 var(--space-16); font-size: 13px; border-bottom: 1px solid var(--border); }
.music-link .material-symbols-rounded { font-size: 18px; color: var(--muted); }
.music-link a { font-weight: 700; color: var(--accent-dark); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-link .cell-muted { flex: 1; }
.music-empty { font-size: 14px; color: var(--muted); padding: var(--space-16) 0 var(--space-4); }
.music-add { padding-top: var(--space-16); }
.music-list-tools { display: flex; gap: var(--space-4); flex-wrap: wrap; margin: calc(var(--space-4) * -1) 0 var(--space-8); }
.btn.ghost.danger { color: var(--error); }

/* ---- overview (js/tabs/overview.js, overview-cards.js) ---- */
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--space-48) var(--space-48); align-items: start; }
.ov-grid-wide { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--space-24); margin-bottom: var(--space-48); }
.ov-heading { font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -.01em; margin: 0 0 var(--space-24); }
.ov-card { padding-top: var(--space-24); }
.ov-card-head { display: flex; align-items: center; gap: var(--space-8); margin-bottom: var(--space-16); color: var(--text); }
.ov-card-head h3 { font-family: var(--font-display); font-size: 20px; font-weight: 500; letter-spacing: -.01em; margin: 0; flex: 1; color: var(--text); }
.ov-card-head .material-symbols-rounded { font-size: 18px; color: var(--muted); }
.ov-go { opacity: .7; transition: opacity .15s ease; color: var(--accent-dark); }
.ov-card:hover .ov-go { opacity: 1; }
.ov-headline { display: flex; align-items: baseline; gap: var(--space-8); flex-wrap: wrap; margin-bottom: var(--space-16); }
.ov-big { font-family: var(--font-display); font-size: 32px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.ov-sub { font-size: 13px; color: var(--muted); }
.ov-bar { display: flex; height: 12px; background: var(--track); border-radius: var(--radius-pill); overflow: hidden; gap: var(--space-4); margin-bottom: var(--space-16); }
.ov-bar > span { height: 100%; }
.ov-legend { display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-16); font-size: 13px; color: var(--muted); margin-bottom: var(--space-8); }
.ov-legend > span { display: inline-flex; align-items: center; gap: var(--space-8); }
.ov-legend b { color: var(--text); font-weight: 700; }
.ov-line { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: var(--space-4); }
.ov-line.strong { color: var(--text); font-weight: 600; }
.ov-line.warn { color: var(--warning); }
.ov-line.bad { color: var(--error); }
.ov-chips { display: flex; flex-wrap: wrap; gap: var(--space-8); margin: var(--space-4) 0 var(--space-8); }
.ov-cats { display: grid; gap: var(--space-8); margin: var(--space-16) 0 var(--space-4); }
.ov-cat { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; gap: var(--space-8); align-items: center; font-size: 13px; }
.ov-cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-cat-bar { height: 8px; background: var(--track); border-radius: var(--radius-pill); overflow: hidden; }
.ov-cat-bar > span { display: block; height: 100%; background: var(--accent); }
.ov-cat-value { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.ov-timeline { display: grid; gap: var(--space-8); font-size: 13.5px; }
.ov-timeline > div { display: grid; grid-template-columns: 56px 1fr; gap: var(--space-8); }
.ov-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.composer-from { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; margin-bottom: var(--space-16); font-size: 14px; }
.composer-from-name {
  font: inherit; font-weight: 700; color: var(--text); background: var(--card); min-width: 160px; flex: 0 1 260px;
  border: 1.5px solid var(--control); border-radius: var(--radius); padding: var(--space-8) var(--space-16); min-height: 42px;
}
.composer-from-name:focus { border-color: var(--accent); }
.composer-from-address { color: var(--muted); font-size: 13px; }

/* Wedding image: the Overview hero, the Settings thumbnail and the composer preview. */
.ov-hero { display: grid; }
.ov-hero-image { position: relative; height: 240px; overflow: hidden; background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.ov-hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ov-hero .card.hero { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
@media (max-width: 480px) { .ov-hero-image { height: 150px; } }
.wedding-image-row { display: flex; align-items: center; gap: var(--space-16); flex-wrap: wrap; margin-top: var(--space-24); padding-top: var(--space-16); border-top: 1px solid var(--border); }
.wedding-image-thumb { width: 96px; height: 60px; flex: none; background: var(--surface); border-radius: var(--radius); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.wedding-image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.composer-mail-image { display: block; width: calc(100% + 40px); margin: calc(var(--space-24) * -1) calc(var(--space-24) * -1) var(--space-16); max-height: 200px; object-fit: cover; }
.composer-mail-body h1, .composer-mail-body h2, .composer-mail-body h3 { font-family: inherit; }
.composer-mail-body a { pointer-events: none; }

/* Composer toolbar and the slash menu (js/ui/slash.js). */
.composer-toolbar { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; }
/* On a phone the tip takes its own line, so it keeps its shape instead of being squeezed to a column
   beside the Insert and Discard draft buttons. */
@media (max-width: 640px) { .composer-toolbar .slash-tip { flex: 1 1 100%; border-radius: var(--radius); } .composer-toolbar .spacer { display: none; } }
.slash-tip { display: inline-flex; align-items: center; gap: var(--space-8); font-size: 12.5px; color: var(--muted); background: var(--surface); border-radius: var(--radius-pill); padding: var(--space-4) var(--space-16); cursor: help; }
.slash-tip kbd { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text); background: var(--card); border: 1px solid var(--control); border-radius: 5px; padding: 0 var(--space-8); }
.slash-menu {
  position: fixed; z-index: 400; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-lg); padding: var(--space-8); width: 330px; max-height: 360px; overflow-y: auto;
  animation: menu-in .14s ease both;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.slash-group { font-size: 12px; font-weight: 700; color: var(--muted); padding: var(--space-8) var(--space-16) var(--space-4); text-transform: none; }
.slash-item {
  display: grid; grid-template-columns: 22px 1fr; column-gap: var(--space-8); align-items: center; width: 100%;
  border: none; background: none; cursor: pointer; text-align: left; font: inherit; padding: var(--space-8) var(--space-16); color: var(--text);
  border-radius: var(--radius);
}
.slash-item .material-symbols-rounded { font-size: 18px; color: var(--muted); grid-row: span 2; }
.slash-label { font-size: 13.5px; font-weight: 600; }
.slash-hint-text { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slash-item:hover, .slash-item.active { background: var(--surface); }
.slash-item.active { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .slash-menu { animation: none; } }

/* ---- brand block (Settings) ---- */
.brand-block { display: flex; align-items: center; gap: var(--space-16); flex-wrap: wrap; }
.brand-block .brand-mark { width: 56px; height: 56px; }
.brand-block-text { flex: 1 1 240px; min-width: 0; }
.brand-block-name { font-family: var(--font-display); font-weight: 500; font-size: 24px; letter-spacing: -.01em; }
.brand-block-domain { font-size: 13px; color: var(--muted); }
.brand-link { font-size: 13.5px; font-weight: 700; color: var(--accent-dark); display: inline-flex; align-items: center; }
.brand-link:hover { text-decoration: underline; }

/* ------------------------------------------------- phones: lists, not wide tables ---- */

/* A table with eight columns does not fit a phone, and scrolling it sideways inside a page that
   scrolls up and down is the "erroneous scrolling" it used to cause: two directions fighting for
   one thumb, with the name column gone the moment you looked at anything to its right. So under
   641px every shared table (guests, costs, suppliers, gifts) is drawn as a list of cards. The first
   column leads, in larger type; the tick sits to its left and the edit pencil to its right; every
   other value names itself (each cell carries its column's label, js/ui/table.js) and an empty
   value is left out. The heading row is replaced by a "Sort by" menu above the list. A column that
   is not worth a line on a small screen can say `phone: 'hide'`. */
.table-sort { display: none; }
.hide-on-phone { }

@media (max-width: 640px) {
  .hide-on-phone { display: none !important; }

  .table-sort { display: flex; align-items: center; gap: var(--space-8); margin-bottom: var(--space-4); }
  .table-sort label { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); }
  .table-sort select {
    flex: 1; min-width: 0; min-height: 44px; padding: 0 var(--space-16); font: inherit; font-weight: 600;
    border: 1.5px solid var(--control); border-radius: var(--radius); background: var(--card); color: var(--text);
  }

  .table-wrap { overflow: visible; }
  table.data, table.data tbody, table.data tfoot { display: block; min-width: 0; }
  table.data thead { display: none; }

  table.data tbody tr, table.data tfoot tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-16); row-gap: var(--space-8); align-items: start;
    margin: 0 calc(var(--space-8) * -1); padding: var(--space-16) var(--space-8); border-bottom: 1px solid var(--border); border-radius: var(--radius);
  }
  table.data.has-select tbody tr { grid-template-columns: auto minmax(0, 1fr) auto; }
  table.data tbody tr:last-child { border-bottom: 1px solid var(--border); }
  table.data tbody tr:hover { background: transparent; }
  table.data tbody tr.is-selected, table.data tbody tr.is-selected:hover { background: var(--info-soft); }
  table.data tfoot tr { background: var(--surface); border-bottom: 0; margin-top: var(--space-8); }

  table.data td, table.data td.num { display: block; min-width: 0; padding: 0 !important; border: 0 !important; text-align: left; width: auto; }
  table.data td:empty, table.data td.phone-hide, table.data td.cell-empty { display: none; }

  table.data td[data-key="__select"] { grid-column: 1; grid-row: 1; padding-top: var(--space-4) !important; }
  table.data td.cell-primary { grid-column: 1; grid-row: 1; font-size: 16px; font-weight: 700; line-height: 1.3; }
  table.data.has-select td.cell-primary { grid-column: 2; }
  table.data td.actions { grid-column: 2; grid-row: 1; white-space: nowrap; }
  table.data.has-select td.actions { grid-column: 3; }

  /* Not on an empty cell: "Menu", "Dietary" and "Gift" with nothing beside them were drawn as bare labels,
     because this rule outranked the one above that hides them. */
  table.data td:not([data-key="__select"]):not(.cell-primary):not(.actions):not(.cell-empty):not(.phone-hide) {
    grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-4) var(--space-8); font-size: 14px; line-height: 1.45;
  }
  table.data.has-select td:not([data-key="__select"]):not(.cell-primary):not(.actions) { grid-column: 2 / -1; }
  table.data td[data-label]:not([data-key="__select"]):not(.cell-primary):not(.actions)::before {
    content: attr(data-label); flex: 0 0 88px; font-size: 12.5px; font-weight: 700; color: var(--muted);
  }
  table.data td .chip, table.data td .badge { white-space: normal; }

  /* Compact rows (code review, 22 Nov 2026: about two guests fitted on a screen). The name keeps its own line, with
     the tick before it and the pencil after it; everything else flows on beneath it in one wrapping line instead
     of a labelled line each. A badge or a pill says what it is, so its label goes; a plain value (an amount, a
     date, a side) keeps a small one. */
  table.data tbody tr:not(.group-row) { display: block; position: relative; padding: var(--space-16) var(--space-8); }
  table.data tbody tr:not(.group-row) > td.cell-primary { display: block; padding-right: var(--space-48) !important; margin-bottom: var(--space-4); }
  table.data.has-select tbody tr:not(.group-row) { padding-left: var(--space-48); }
  table.data tbody tr:not(.group-row) > td[data-key="__select"] { position: absolute; left: 10px; top: 13px; }
  table.data tbody tr:not(.group-row) > td.actions { position: absolute; right: 10px; top: 4px; display: flex; width: max-content; }
  table.data tbody tr:not(.group-row) > td:not([data-key="__select"]):not(.cell-primary):not(.actions):not(.cell-empty):not(.phone-hide) {
    display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-4) var(--space-4); margin: var(--space-4) var(--space-16) 0 0; vertical-align: top;
    font-size: 14px; line-height: 1.4; max-width: 100%;
  }
  table.data tbody tr:not(.group-row) > td[data-label]:not([data-key="__select"]):not(.cell-primary):not(.actions)::before {
    flex: none; font-size: 12px; font-weight: 600;
  }
  table.data tbody tr:not(.group-row) > td:has(.badge, .chip, .tag, .g-tag, .ev-tag)::before { display: none !important; }
}

/* ------------------------------------------------------------ touch and scrolling ---- */

/* Buttons and links answer a tap at once: no double-tap-to-zoom wait, no grey flash. */
button, a, summary, [role="button"], label, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* A sheet, a menu or a list that scrolls inside the page must not hand its overscroll to the page
   behind it: reach the end of a long form and keep dragging, and the page underneath used to start
   moving. (The page itself is locked while a modal is open; this covers the lists inside it.) */
.modal-box, .picker-list, .filter-pop, .search-panel, .slash-menu, .composer-body { overscroll-behavior: contain; }

@media (max-width: 640px) {
  /* A full-width button row never wraps one button onto a line of its own. */
  .toolbar-actions .btn { flex: 1 1 auto; }
}

/* ------------------------------------------------------- the table plan on a phone ---- */

/* On a phone there is no dragging: a page that scrolls and a drag that moves things want the same
   gesture. So seating is done with buttons that are always there (Seat on each unseated guest,
   Seat all on a party, Seat someone on a table, Change table on a seated guest), and the things
   that only a mouse can use are not drawn (the drag handles, "Drop a guest here"). And the list of
   people still to seat comes FIRST, above the tables: it is the job, and it was at the very bottom
   of a very long page. */
.if-touch { display: none; }
.seat-someone:not(.always) { display: none; }
.seated-actions { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-4); }

@media (max-width: 900px) {
  /* A column, with Not seated on top. The DOM order is unchanged (print relies on it). */
  .tableplan-unseated { order: -1; }
}
@media (max-width: 900px), (pointer: coarse) {
  .seat-someone { display: inline-flex !important; }
  .drag-handle { display: none; }
  .if-mouse { display: none; }
  .if-touch { display: inline; }
  .unseated-seat { min-height: 44px; padding: 0 var(--space-8); }
  .unseated-row { min-height: 52px; padding: var(--space-4) var(--space-8) var(--space-4) var(--space-16); }
  .unseated-party { min-height: 52px; padding: var(--space-4) var(--space-8) var(--space-4) var(--space-16); cursor: default; }
  .table-tools .table-tool { width: 44px; height: 44px; }
  .table-tools .table-order { display: inline-flex; }
  .seated-head { min-height: 44px; }
  .seated-actions .btn { min-height: 44px; }
  /* The list of people to seat is part of the page, not a box to scroll inside the page. */
  .unseated-list { max-height: none !important; overflow: visible !important; }
  /* A handful of people needs no search and no ordering: just the people. */
  .tableplan-unseated[data-few="1"] .unseated-controls { display: none !important; }
}

/* ---------------------------------------------------------- Settings: the side nav ---- */

/* The page is two columns: a nav that stays in view while you read, and the sections. The sections
   are in the order the nav lists them (you, your wedding, the app). Under 900px the nav becomes a
   row of chips pinned under the header. */
.settings-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-64); align-items: start; margin-top: var(--space-8); }
.settings-sections { display: flex; flex-direction: column; gap: var(--space-section); min-width: 0; }
.settings-section, .settings-part, .settings-about { scroll-margin-top: 104px; }

.section-nav { position: sticky; top: 104px; align-self: start; max-height: calc(100vh - 128px); overflow-y: auto; }
/* Each group (You, Your wedding, Sharing, The app) is named like a section title, in the heading face and the text
   colour, with a line above all but the first, so the four groups read as four places (owner's feedback, 3 Dec 2026:
   "the titles of the sections should be more prominent"). */
.section-nav-groups { display: flex; flex-direction: column; gap: var(--space-24); }
.section-nav-group + .section-nav-group { padding-top: var(--space-24); border-top: 1px solid var(--border); }
.section-nav-label { font-family: var(--font-display); font-size: 18px; font-weight: 500; line-height: 1.3; color: var(--text); margin: 0 0 var(--space-8) var(--space-16); }
.section-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.section-nav-link {
  display: block; padding: var(--space-8) var(--space-16); border-radius: var(--radius-pill);
  font-size: 14.5px; font-weight: 600; color: var(--muted); text-decoration: none;
}
.section-nav-link:hover { background: var(--surface); color: var(--text); }
/* The section being read: bold, on the accent's soft fill, and marked with a dot, so it is told by
   weight and shape as well as by colour. */
.section-nav-link[aria-current="true"] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.section-nav-link[aria-current="true"]::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin: 0 var(--space-8) 0 calc(var(--space-4) * -1); vertical-align: middle;
}

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-24); }
  .settings-section, .settings-part, .settings-about { scroll-margin-top: 160px; }
  /* A row of chips pinned under the header, scrolling sideways. The group names stay for a screen
     reader and leave the screen; the lists flatten into the one row. */
  .section-nav {
    position: sticky; top: 76px; z-index: 15; max-height: none; overflow: visible;
    margin: 0 calc(var(--space-48) * -1); padding: var(--space-8) var(--space-48); background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .section-nav-groups { flex-direction: row; gap: var(--space-8); overflow-x: auto; scrollbar-width: none; padding: var(--space-4); }
  .section-nav-groups::-webkit-scrollbar { display: none; }
  .section-nav-group, .section-nav ul { display: contents; }
  .section-nav li { flex: none; }
  .section-nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; margin: 0; }
  .section-nav-link {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-16); white-space: nowrap;
    border: 1.5px solid var(--control); background: transparent; color: var(--text);
  }
  .section-nav-link[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
}
@media (max-width: 640px) {
  .section-nav { top: 60px; margin: 0 calc(var(--space-16) * -1); padding: var(--space-8) var(--space-16); }
  .settings-section, .settings-part, .settings-about { scroll-margin-top: 140px; }
}

/* ---------------------------------------------------------- Settings: people and invites ---- */

.invite-heading { font-size: 15px; font-weight: 700; margin: var(--space-24) 0 var(--space-8); }
.invite-form { margin-top: var(--space-24); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.invite-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-16); align-items: end; }
.invite-row .field { margin-bottom: 0; }
.invite-send { min-height: 46px; }
.invite-waiting { margin-top: var(--space-8); }
.invite-notice { margin-top: var(--space-16); padding: var(--space-16) var(--space-16); border-radius: var(--radius-card); font-size: 14.5px; line-height: 1.5; font-weight: 600; }
.invite-notice.good { background: var(--good-soft); color: var(--good); }
.invite-notice.warn { background: var(--warning-soft); color: var(--warning); }
.invite-notice.bad { background: var(--error-soft); color: var(--error); }
.invite-notice .invite-link { background: var(--card); }
.invite-notice .invite-link code { color: var(--text); font-weight: 500; }
.invite-fallback { margin-top: var(--space-24); }
.invite-fallback summary, .choice-more summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--accent-dark); padding: var(--space-8) 0; border-radius: 6px; }
.invite-fallback-body { padding: var(--space-4) 0 var(--space-4); }
@media (max-width: 760px) {
  .invite-row { grid-template-columns: minmax(0, 1fr); }
  .invite-send { width: 100%; }
}

/* ---------------------------------------------------------- Settings: import and export dialogs ---- */

.dialog { max-width: 640px; }
.dialog-lead { margin: calc(var(--space-4) * -1) 0 var(--space-16); color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.dialog-foot { margin: var(--space-16) 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.choice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-8); }
.choice-row { display: flex; align-items: center; gap: var(--space-8); }
.choice {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-16); text-align: left; min-height: 64px;
  padding: var(--space-16) var(--space-16); border: 1.5px solid var(--control); border-radius: var(--radius-card);
  background: transparent; color: var(--text); font: inherit; cursor: pointer;
}
.choice:hover { background: var(--surface); }
.choice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.choice-title { font-weight: 700; font-size: 15.5px; display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; }
.choice-sub { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.choice .material-symbols-rounded { color: var(--muted); font-size: 22px; flex: none; }
/* Nothing to export: still there, still reachable, and it says why. Dashed, on the soft fill. */
.choice.is-disabled { cursor: not-allowed; border-style: dashed; background: var(--surface); }
.choice.is-disabled:hover { background: var(--surface); }
.choice-template { flex: none; }
.choice-more { margin-top: var(--space-16); }
.choice-more summary { display: flex; align-items: center; gap: var(--space-4); list-style: none; }
.choice-more summary::-webkit-details-marker { display: none; }
.choice-more .choice-more-chevron { color: var(--accent-dark); transition: transform .18s ease; }
.choice-more[open] .choice-more-chevron { transform: rotate(90deg); }
.choice-more .choice-list { margin-top: var(--space-8); }
.badge.accent { background: var(--accent-soft); color: var(--accent-dark); }
@media (max-width: 640px) {
  .choice-row { flex-direction: column; align-items: stretch; }
  .choice-template { align-self: flex-start; }
}

/* ---- tap targets ----
 *
 * 44px by 44px for everything you press, on a phone or any touch screen (Apple asks for 44pt,
 * Google 48dp, WCAG 2.5.5 44px). Height is grown with min-height and padding rather than with
 * larger text, so the visual weight stays and only the part your thumb can land on grows. The
 * desktop keeps its density. Inline links inside a sentence are exempt, as the standard allows.
 * The rule lists what is pressed, so a new button class has to be added here to be covered. */
@media (max-width: 640px), (pointer: coarse) {
  .btn,
  .btn.small,
  .filter-btn,
  .filter-menu-btn,
  .filter-opt,
  .check-chip,
  .seg button,
  .accent-swatch,
  .picker-option,
  .picker-foot button,
  .tab-more-pop button,
  .slash-item,
  .auth-link,
  .help-note-toggle,
  .section-nav-link,
  .brand-link,
  select,
  .choice,
  .invite-fallback summary,
  .choice-more summary,
  .task-row,
  .ov-card-head,
  .todo-add,
  .pay-row,
  .disclosure-head { min-height: 44px; }

  /* A run of full-width buttons (the Overview's "needs doing" list, the more sheet). */
  #panel-overview .rows button, .rows > button { min-height: 44px; }

  .search-bar { min-height: 48px; }
  .search-bar input, .todo-add input { min-height: 44px; }

  /* The touch rules for ticks, party chips, guest names and text links are in css/shell.css. */
  .inline-input { min-height: 44px !important; }

  /* !important because a few of these carry an inline size (the take-off-this-table cross). */
  .icon-btn { min-width: 44px !important; min-height: 44px !important; }

  /* A click handler on a plain element (js/util.js gives it a tab stop and role=button) is the whole
     row or card, so it is at least a thumb tall. A label chip that is also a button keeps its look
     and gets a larger hit area from a pseudo-element instead. */
  div[role="button"][tabindex="0"] { min-height: 44px; }
  .chip[role="button"] { position: relative; }
  .chip[role="button"]::after { content: ""; position: absolute; inset: -11px -2px; }
  .table-name { min-height: 44px; }

  /* The row tick and the to-do tick: drawn at 24px, tappable at 44px (see css/shell.css). */

  /* A tapped row in a table is the whole row, so its cells need the height to be tappable. */
  table.data td { padding-top: var(--space-16); padding-bottom: var(--space-16); }
}

/* ------------------------------------------------------------ costs: the money tiles ---- */
.cost-tiles { margin-bottom: var(--space-16); }
.cost-tile-value { font-size: 30px; }
/* No budget yet: one quiet line with a link, not a box (owner's request, 16 Nov). */
.cost-nobudget { margin: 0 0 var(--space-24); font-size: 13.5px; color: var(--muted); }
.cost-nobudget .link-btn { font-size: inherit; min-height: 0; padding-block: var(--space-16); margin-block: calc(var(--space-16) * -1); }

/* ------------------------------------------------ "Your free trial has ended" (js/ui/trial-ended.js) ---- */
/* A calm box floating over the planner, which stays readable underneath. */
.te-scrim { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: var(--space-24) var(--space-16); overflow-y: auto; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.te-card { box-sizing: border-box; width: min(520px, 100%); padding: var(--space-32) var(--space-32) var(--space-24); border-radius: var(--radius-xl, 28px); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lg), 0 30px 80px -20px rgba(0, 0, 0, .35); text-align: center; }
.te-mark { width: 44px; height: 44px; margin: 0 auto var(--space-16); color: var(--accent); }
.te-mark svg { width: 100%; height: 100%; display: block; }
.te-eyebrow { margin: 0 0 var(--space-8); font-size: 15px; font-weight: 700; color: var(--accent-dark); }
:root[data-theme="dark"] .te-eyebrow { color: var(--accent); }
.te-card h2 { margin: 0 0 var(--space-16); font-family: var(--font-display); font-weight: 500; font-size: 30px; line-height: 1.15; }
.te-lead { margin: 0 auto var(--space-16); max-width: 42ch; font-size: 16px; line-height: 1.55; }
.te-points { list-style: none; margin: 0 auto var(--space-24); padding: var(--space-16) var(--space-16); max-width: 42ch; text-align: left; background: var(--surface); border-radius: var(--radius-card); display: grid; gap: var(--space-8); font-size: 14.5px; line-height: 1.45; }
.te-points li { position: relative; padding-left: var(--space-24); }
.te-points li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.te-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-8); }
.te-actions .btn { min-height: 48px; }
.te-unlock { min-width: 200px; justify-content: center; text-decoration: none; }
.te-member { flex: 1 1 100%; margin: 0 0 var(--space-8); font-size: 15px; line-height: 1.5; }
.te-keep { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--space-8); padding: 0 var(--space-16); font: inherit; font-size: 14.5px; font-weight: 600; color: var(--muted); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.te-fine { margin: var(--space-4) 0 0; font-size: 13px; color: var(--muted); }
.te-fine a { color: var(--muted); }
@media (max-width: 640px) {
  .te-scrim { place-items: end center; padding: var(--space-16) var(--space-16) max(var(--space-16), env(safe-area-inset-bottom)); }
  .te-card { padding: var(--space-32) var(--space-24) var(--space-16); }
  .te-card h2 { font-size: 26px; }
  .te-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .te-card { animation: te-in .3s ease-out both; }
  @keyframes te-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
}
@media print { .te-scrim { display: none; } }

/* A big Done tick in a form (owner's feedback, 17 Nov): the whole row is the target, the box is 30px, and it fills
   with the accent and a white mark when ticked. The real checkbox stays in the page for keyboards and screen
   readers; the drawn box follows it. */
.field-big-check { grid-column: 1 / -1; }
.check-big { position: relative; display: flex; align-items: center; gap: var(--space-16); min-height: 60px; padding: var(--space-8) var(--space-16); border: 1.5px solid var(--control); border-radius: var(--radius-card); background: var(--card); cursor: pointer; font-size: 17px; font-weight: 700; color: var(--text); }
.check-big:hover { border-color: var(--accent); }
.check-big input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-big-box { flex: none; position: relative; width: 30px; height: 30px; border: 2px solid var(--control); border-radius: 9px; background: var(--bg); transition: background .15s, border-color .15s; }
.check-big input:checked + .check-big-box { background: var(--accent); border-color: var(--accent); }
.check-big input:checked + .check-big-box::after { content: ''; position: absolute; left: 9px; top: 3px; width: 8px; height: 15px; border-right: 3px solid var(--accent-ink); border-bottom: 3px solid var(--accent-ink); transform: rotate(45deg); }
.check-big input:checked ~ .check-big-label { color: var(--accent-dark); }
.check-big:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.check-big:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .check-big-box { transition: none; } }

/* The recovery code as a second way in, on Forgot your password? (js/auth.js). */
.auth-alt { margin-top: var(--space-24); padding-top: var(--space-16); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-8); }
.auth-alt-title { margin: 0; font-weight: 700; }
.auth-alt .auth-small { margin: 0 0 var(--space-8); }

/* Setting up: light or dark under the colours, and the note that both can change later (js/onboarding.js). */
.theme-pick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8) var(--space-16); margin-top: var(--space-16); }
.theme-pick-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.theme-choices { display: inline-flex; gap: var(--space-8); flex-wrap: wrap; }
.theme-choice { display: inline-flex; align-items: center; gap: var(--space-8); min-height: 44px; padding: 0 var(--space-16); border-radius: var(--radius-pill); border: 1.5px solid var(--control); background: var(--card); color: var(--text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.theme-choice:hover { background: var(--surface); }
.theme-choice[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.theme-icon { display: inline-flex; width: 20px; height: 20px; font-size: 20px; }
.theme-icon svg { width: 20px; height: 20px; }
.onboarding-note { display: flex; align-items: center; gap: var(--space-8); margin: var(--space-16) 0 0; padding: var(--space-16) var(--space-16); border-radius: var(--radius-card); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; font-size: 15px; }
.onboarding-note .material-symbols-rounded { font-size: 20px; flex: none; }

/* The Add menus (Guests, Costs, Rooms): the button and the menu that hangs from it. Here rather than in the tab's
   code, so a phone can float the whole thing (css/mobile.css, `.fab`). */
.add-guest-menu, .add-cost-menu, .add-room-menu { position: relative; flex: none; }
/* "Add" on a laptop; the floating button on a phone says "Add guest" (css/mobile.css). */
.add-guest-menu .add-more { display: none; }

/* The Menu tab's Add menu, like the other Add menus. A choice that cannot be used yet is shown greyed out. */
.add-menu-menu { position: relative; flex: none; }
.tab-more-pop button:disabled { color: var(--muted); cursor: not-allowed; opacity: .7; }
.tab-more-pop button:disabled:hover { background: none; }

/* The Printables dialog (owner's feedback, 18 Nov): kept out of css/printables.css, which stays print-only and fill-free: fields styled like the rest of Maple, the picker only as wide as it needs, a bigger preview. */
.pr-tabs { justify-self: start; }
.pr-field input, .pr-field select {
  box-sizing: border-box; min-height: 44px; padding: 0 var(--space-16); border: 1.5px solid var(--control); border-radius: 12px;
  background: var(--card); color: var(--text); font: inherit; font-size: 16px;
}
.pr-field input[type="number"] { max-width: 120px; }
.pr-field input:focus-visible, .pr-field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pr-summary-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8) var(--space-16); }
.pr-summary-row .pr-summary { flex: 1 1 260px; }
.pr-big { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; background: var(--bg); }
.pr-big-bar { display: flex; align-items: center; gap: var(--space-16); padding: var(--space-16) var(--space-24); border-bottom: 1px solid var(--border); background: var(--card); }
.pr-big-pages { flex: 1; overflow: auto; display: grid; justify-content: center; gap: var(--space-24); padding: var(--space-24); }
.pr-big-page { margin: 0; position: relative; overflow: hidden; background: var(--card); box-shadow: var(--shadow-lg); }
@media (max-width: 640px) { .pr-tabs { justify-self: stretch; } .pr-field input[type="number"] { max-width: none; } }

/* ---- Rooms: the rooms beside the room helper, as the Table plan sits beside "Not seated" ---- */
.rooms-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-24); align-items: start; }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-16); }
.room-card { cursor: pointer; border: 1px solid var(--border); background: var(--card); display: grid; gap: var(--space-8); align-content: start; }
/* Everything in a room card can shrink and wrap, so a long name, or words beside icons, never pushes it past the screen. */
.room-card > * { min-width: 0; }
.room-card { grid-template-columns: minmax(0, 1fr); }
.room-people li > :first-child { min-width: 0; overflow-wrap: anywhere; text-align: left; }
.room-people li > .room-occupant-out { flex: none; }
.room-card.over { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.room-card.drop-over { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.room-card-head { display: flex; align-items: flex-start; gap: var(--space-8); }
.room-card-name {
  flex: 1; min-width: 0; min-height: 32px; padding: 0; margin: 0; text-align: left; cursor: pointer;
  background: none; border: 0; color: var(--text); font: inherit; font-family: var(--font-display); font-size: 19px; font-weight: 500; line-height: 1.25;
}
.room-card-name:hover span { text-decoration: underline; text-underline-offset: 3px; }
.room-card-cost { font-weight: 800; font-size: 15px; padding-top: var(--space-4); }
.room-card-sub, .room-card-money { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.room-card-money { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-16); color: var(--text); }
.room-card-each { color: var(--muted); }
.room-card-tags { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: center; margin-top: var(--space-4); }
.room-over { display: flex; align-items: flex-start; gap: var(--space-8); margin: var(--space-4) 0 0; padding: var(--space-8) var(--space-8); border-radius: var(--radius); background: var(--error-soft); color: var(--text); font-size: 13.5px; line-height: 1.45; }
.room-over .material-symbols-rounded { flex: none; font-size: 19px; color: var(--error); }
.room-card-people { display: grid; gap: var(--space-4); margin-top: var(--space-8); padding-top: var(--space-8); border-top: 1px solid var(--border-strong); }
.room-people { list-style: none; margin: 0; padding: 0; display: grid; }
.room-people li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); min-height: 36px; border-bottom: 1px solid var(--border); font-size: 14px; }
.room-people li:last-child { border-bottom: 0; }
.room-card-empty { margin: 0; font-size: 13.5px; color: var(--muted); padding: var(--space-4) 0; }
.room-free { font-size: 13px; color: var(--muted); }
.room-occupant-out { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.room-occupant-out:hover { background: var(--surface); color: var(--text); }
.room-occupant-out .material-symbols-rounded { font-size: 18px; }
.room-card-foot { display: flex; gap: var(--space-8); flex-wrap: wrap; align-items: center; }
.rooms-over { display: flex; align-items: flex-start; gap: var(--space-8); padding: var(--space-16) var(--space-16); border-radius: var(--radius); background: var(--error-soft); border: 1px solid var(--error); font-size: 14px; line-height: 1.5; }
.rooms-over .material-symbols-rounded { flex: none; color: var(--error); }
.rooms-filters { display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-16); align-items: center; }
@media (max-width: 640px) {
  .room-people li, .room-card-name { min-height: 44px; }
  .room-occupant-out { width: 44px; height: 44px; }
  .rooms-filters .filter-group { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
}
.room-add-person { padding: 0 var(--space-8); }
.room-helper .section-head { margin-bottom: var(--space-8); }
.room-helper-list { display: flex; flex-direction: column; gap: var(--space-4); }
.room-helper-row, .room-helper-party-head { display: flex; align-items: center; gap: var(--space-8); min-height: 40px; padding: var(--space-4) var(--space-4) var(--space-4) var(--space-8); border-radius: var(--radius-sm); background: var(--card); }
.room-helper-row[draggable="true"], .room-helper-party-head[draggable="true"] { cursor: grab; }
.room-helper-name, .room-helper-party-name { flex: 1; min-width: 0; overflow-wrap: break-word; font-size: 13.5px; line-height: 1.3; }
.room-helper-party-name { font-weight: 700; }
.room-helper-party { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); }
.room-helper-party .room-helper-party-head { background: none; }
.room-helper-row.nested { background: none; }
.room-helper-row.nested:hover, .room-helper-party-head:hover { background: var(--surface); }
/* "Place": an underlined link, like the Table plan's "Seat" (owner's feedback, 4 Dec). */
.room-helper-place { flex: none; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 0 var(--space-4); }
.room-helper-done { display: flex; align-items: flex-start; gap: var(--space-8); margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.room-helper-done .material-symbols-rounded { color: var(--good); font-size: 20px; }
.room-helper-note { margin: var(--space-8) 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.room-helper-others { margin-top: var(--space-16); border-top: 1px solid var(--border); padding-top: var(--space-8); }
.room-helper-others summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; font-weight: 700; font-size: 13.5px; list-style: none; }
.room-helper-others summary::-webkit-details-marker { display: none; }
.room-helper-others[open] .room-helper-caret { transform: rotate(180deg); }
@media (max-width: 900px) {
  .rooms-layout { grid-template-columns: minmax(0, 1fr); }
  .room-helper { order: -1; }
}
@media (max-width: 640px) {
  .room-helper-row, .room-helper-party-head { min-height: 48px; }
  .room-helper-place { min-height: 44px; padding: 0 var(--space-8); }
  .room-occupant-out { width: 44px; height: 44px; margin: calc(var(--space-8) * -1) calc(var(--space-8) * -1) calc(var(--space-8) * -1) 0; }
}
.room-helper-party-head { flex-wrap: wrap; row-gap: var(--space-4); padding-top: var(--space-4); padding-bottom: var(--space-4); }
.room-helper-party-name { flex: 1 1 110px; }

/* Search this tab: a round button that opens into a box in the same place (owner's sign-off, 18 Nov). */
.tab-search { display: flex; align-items: center; min-width: 0; }
.tab-search-btn { display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1.5px solid var(--control); background: var(--card); color: var(--text); cursor: pointer; }
.tab-search-btn:hover { background: var(--surface); }
.tab-search-btn .material-symbols-rounded { font-size: 21px; }
.tab-search > .search-bar { display: none; }
.tab-search.open > .tab-search-btn { display: none; }
.tab-search.open > .search-bar { display: flex; width: min(340px, 60vw); min-width: 0; max-width: none; flex: 1 1 auto; padding-right: var(--space-4); border-radius: var(--radius-pill); border-color: var(--accent); }
.tab-search.open { flex: 0 1 340px; }
.tab-search-close { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.tab-search-close:hover { background: var(--surface); color: var(--text); }
.tab-search .search-bar input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
/* Only when pressed open, not on every redraw while open (each redraw would replay it). */
@media (prefers-reduced-motion: no-preference) { .tab-search.open.opening > .search-bar { animation: tab-search-open .18s ease-out; } }
@keyframes tab-search-open { from { opacity: 0; transform: scaleX(.7); transform-origin: left; } }
@media (max-width: 640px) {
  .tab-search-btn { width: 48px; height: 48px; }
  .tab-search-close { width: 44px; height: 44px; }
  .tab-search.open { flex: 1 1 0; }
  .tab-search.open > .search-bar { width: auto; }
}
/* A view switch at the start of the toolbar row (js/ui/table.js, lead). On a phone it fills the line beside search
   and Filters; while searching, the box takes the next line. */
.toolbar-lead { display: flex; }
@media (max-width: 640px) {
  .table-toolbar.has-lead { flex-wrap: wrap; }
  .table-toolbar.has-lead > .toolbar-lead { flex: 1 1 0; min-width: 0; }
  .table-toolbar.has-lead > .toolbar-lead .filter-group { flex: 1; min-width: 0; flex-wrap: nowrap; }
  .table-toolbar.has-lead > .toolbar-lead .filter-btn { flex: 1 1 0; justify-content: center; padding-inline: var(--space-8); white-space: nowrap; }
  .table-toolbar.has-lead > .toolbar-lead .filter-btn .material-symbols-rounded { display: none; }
  .table-toolbar.has-lead:has(.tab-search.open) > .toolbar-lead { flex-basis: 100%; }
}
@media (max-width: 640px) {
  .table-toolbar.has-lead > .toolbar-lead > .btn { flex: none; }
}

/* Form A (owner's sign-off, 18 Nov): the label's icon, or a course's letter, sits just before the words, so the two
   read together in the right-aligned label column; above the box on a phone, icon first. */
.field-lr > .field-label { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-8); min-height: 46px; padding-top: 0; }
.field-label-icon { font-size: 17px; color: var(--muted); flex: none; }
.field-badge { display: inline-grid; place-items: center; flex: none; min-width: 22px; height: 22px; padding: 0 var(--space-4); box-sizing: border-box; border-radius: var(--radius-pill); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 800; }
@media (max-width: 480px) {
  .field-lr > .field-label { justify-content: flex-start; min-height: 0; }
}

/* A switch in place of a tick box: the native checkbox (named as a switch) drawn as a track and knob. */
.switch-row { position: relative; display: inline-flex; align-items: center; gap: var(--space-16); min-height: 46px; font-size: 15px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; width: 52px; height: 30px; margin: 0; cursor: pointer; }
/* The track and thumb are Settings' switch (css/sharing.css), so every switch in Maple looks the same. */
.switch-row .switch-track { flex: none; }
.switch-row input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch-row input:checked + .switch-track .switch-thumb { left: 26px; background: var(--accent-ink); }
.switch-row input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.field-lr > .switch-row { justify-self: start; justify-content: flex-start; width: auto; }
/* A button for a tool worth noticing (the Seating helper): the accent outline and words, without competing with the
   page's main action. */
.btn.btn-feature { border-color: var(--accent); color: var(--accent-dark); }
.btn.btn-feature:hover { background: var(--accent-soft); }

/* A one-time tip in the page (js/ui/tips.js, pageTip). */
.tip-card { display: flex; align-items: flex-start; gap: var(--space-8); margin: 0 0 var(--space-16); padding: var(--space-16) var(--space-8) var(--space-16) var(--space-16); border-radius: var(--radius); background: var(--accent-soft); color: var(--text); }
.tip-card > .material-symbols-rounded { flex: none; margin-top: var(--space-4); font-size: 19px; color: var(--accent-dark); }
.tip-card-text { flex: 1; min-width: 0; margin: 0; font-size: 14.5px; line-height: 1.5; }
.tip-card .tip-link { margin-left: var(--space-8); color: var(--accent-dark); font-weight: 700; }
.tip-card .tip-close { width: 36px; height: 36px; margin: calc(var(--space-8) * -1) 0; }
@media (max-width: 640px) { .tip-card .tip-close { width: 44px; height: 44px; margin: calc(var(--space-8) * -1) calc(var(--space-4) * -1) calc(var(--space-8) * -1) 0; } }
/* Room at both ends of every table row, so the hover colour does not touch the words (owner's feedback, 20 Nov). */
@media (min-width: 641px) {
  table.data td:first-child, table.data th:first-child { padding-left: var(--space-16); }
  table.data td:last-child, table.data th:last-child { padding-right: var(--space-16); }
}
/* ONE CARD STYLE FOR LIST ITEMS (owner's choice, review 23 Nov 2026, item 14). The soft card (.card.soft: the surface fill and
   the rounded corners most of the app already uses for things you can tap) at one padding and one gap, on every tab that lists
   things as cards: Ceremony items, Music playlists and requests, Rooms, and Table plan tables. A tab gives the card the class
   "list-card" and puts several in a ".list-cards" column (Rooms and Table plan lay theirs out in a grid with the same gap).
   Nothing else about a card changes: each tab keeps its own contents and behaviour. */
.card.soft.list-card { padding: var(--space-16) var(--space-16); background: var(--card); border: 1px solid var(--border); }
/* The hierarchy (owner's feedback, 2 Dec 2026: "the table plan boxes should carry that style through to the ceremony page"):
   a thing you work with (a party, a room, a table, a ceremony item, a music section or playlist) is white with an outline;
   a note or a summary (cost totals, the budget bar, Needs a room, Not seated, a tip) keeps the filled background. */
.list-cards { display: flex; flex-direction: column; gap: var(--space-16); }
/* A disclosure used as a list card (Music playlists): the rule above it goes, and it needs no room underneath. */
.disclosure.list-card { border-top-width: 1px; }
.disclosure.list-card > .disclosure-head { padding: var(--space-4) 0 var(--space-8); }
.disclosure.list-card > .disclosure-body { padding: 0; }
.disclosure.list-card .music-row:last-child { padding-bottom: var(--space-4); }
/* Ceremony: the reorder arrows and the pencil rest at full strength (they were faded to .55 on a laptop, which on this
   fill read as missing), in the muted text colour, 4.5:1 on the card. The reading's words line up with the item's title. */
.cer-item .row-actions { opacity: 1; }
.cer-item .row-actions .icon-btn:not(:disabled) { color: var(--muted); }
.cer-item .row-actions .icon-btn:not(:disabled):hover { color: var(--text); }
.cer-text { margin-top: var(--space-8); font-size: 13px; line-height: 1.6; white-space: pre-wrap; color: var(--text); }
/* Colour swatches in a form (js/ui/form.js, type 'swatches'). */
.swatch-set { display: flex; flex-wrap: wrap; gap: var(--space-8); padding-top: var(--space-4); }
.swatch { display: inline-flex; align-items: center; gap: var(--space-8); min-height: 40px; padding: 0 var(--space-16) 0 var(--space-8); border-radius: var(--radius-pill); border: 1.5px solid var(--control); background: var(--card); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.swatch[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.swatch-dot { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-strong); flex: none; }
.swatch-hex { margin-top: var(--space-8); max-width: 160px; }
@media (max-width: 640px) { .swatch { min-height: 44px; } }
/* Several cards in one Settings section (Spreadsheets, Backup, Delete this wedding) read as one section: no rule
   directly under the buttons above, just space (owner's feedback, 20 Nov: "odd lines below the buttons"). */
.settings-section .card + .card { border-top: 0; margin-top: var(--space-card); padding-top: 0; }
/* The sample wedding playground's banner (js/demo/demo-ui.js). */
.demo-bar { display: flex; align-items: center; justify-content: center; gap: var(--space-16) var(--space-16); flex-wrap: wrap; padding: var(--space-8) var(--space-16); background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--border); }
.demo-bar-text { margin: 0; font-size: 14px; line-height: 1.45; max-width: 760px; }
.demo-bar-btn { flex: none; text-decoration: none; }
@media (max-width: 640px) { .demo-bar { justify-content: flex-start; } .demo-bar-text { font-size: 13.5px; } }
.tp-flags { margin: 0 0 var(--space-16); }
.section-head .helper-count { margin-left: var(--space-8); }
/* The sample wedding playground's tour (js/demo/demo-tour.js): one tip at a time, pointing at the next thing to try. */
.tour-tip {
  position: fixed; z-index: 60; padding: var(--space-16) var(--space-16) var(--space-16); border-radius: var(--radius-card);
  background: var(--text); color: var(--bg); box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
}
.tour-tip[hidden], .tour-tip [hidden] { display: none !important; }
.tour-text { margin: 0 0 var(--space-8); font-size: 14.5px; line-height: 1.5; }
.tour-actions { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; }
.tour-count { font-size: 12px; font-weight: 700; opacity: .75; }
.tour-tip .btn { background: var(--bg); color: var(--text); border-color: var(--bg); }
.tour-tip .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tour-tip .tour-off { color: var(--bg); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 var(--space-8); }
.tour-arrow { position: absolute; left: var(--arrow-x, 50%); width: 12px; height: 12px; background: var(--text); transform: translateX(-50%) rotate(45deg); }
.tour-tip[data-side="below"] .tour-arrow { top: -6px; }
.tour-tip[data-side="above"] .tour-arrow { bottom: -6px; }
.tour-tip[data-side="none"] .tour-arrow { display: none; }
.tour-target { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); animation: tour-pulse 1.6s ease-in-out infinite; }
@keyframes tour-pulse { 50% { outline-color: var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .tour-target { animation: none; } }
html:not([data-motion="full"]) .tour-target { animation: none; }
/* Taps go through the tip to whatever is under it (a guest in the list, a table), except on its own buttons. */
.tour-tip { pointer-events: none; }
.tour-tip .tour-actions button { pointer-events: auto; }
.status-pills > .link-btn { justify-self: start; }
.cost-per-head { display: inline-flex; flex-wrap: wrap; gap: 0 var(--space-8); justify-content: flex-end; }

/* To-dos given to someone (js/tabs/overview.js): a chip with their name, and the list filtered by person. */
.task-who { display: inline-flex; align-items: center; gap: var(--space-4); }
.task-who .material-symbols-rounded { font-size: 15px; }
.todo-who { display: inline-flex; flex-wrap: nowrap; margin: var(--space-4) 0 var(--space-8); max-width: 100%; overflow-x: auto; }
.todo-who .filter-btn { flex: none; }

/* Costs, What is due when: money out by month (js/tabs/costs.js, forecast). Bars with the amount written above
   each, so the length is never the only way to read it; the wedding's month is starred. */
.forecast { margin: 0 0 var(--space-24); padding: var(--space-16); border-radius: var(--radius-card); background: var(--surface); }
.forecast-lead { margin: 0 0 var(--space-16); font-size: 14.5px; line-height: 1.5; }
.forecast-lead span { color: var(--muted); }
.forecast-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(64px, 88px); justify-content: start; gap: var(--space-8); overflow-x: auto; }
.forecast-bars li { display: grid; grid-template-rows: auto 110px auto; gap: var(--space-4); justify-items: center; text-align: center; min-width: 0; }
.forecast-amount { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.forecast-bar { display: flex; align-items: flex-end; width: 28px; height: 100%; border-radius: 6px; background: var(--track); overflow: hidden; }
.forecast-bar span { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; }
.forecast-bars li.wedding .forecast-bar span { background: var(--accent-dark); }
.forecast-month { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* "Today" on the wedding day (js/ui/day-of.js): large and plain, for a phone in a busy room. */
.dayof { display: grid; gap: var(--space-16); margin-bottom: var(--space-24); padding: var(--space-24); border-radius: var(--radius-card); background: var(--accent-soft); border: 1.5px solid var(--accent); }
.dayof-title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 30px; color: var(--accent-dark); }
.dayof-block { display: grid; gap: var(--space-8); }
.dayof-block h3 { margin: 0; font-size: 15px; font-weight: 800; }
.dayof-next { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-8); }
.dayof-next li { display: grid; grid-template-columns: 72px 1fr; gap: var(--space-8); align-items: baseline; padding: var(--space-8) var(--space-16); border-radius: var(--radius); background: var(--card); font-size: 17px; }
.dayof-next li.now { outline: 2px solid var(--accent); }
.dayof-next b { font-variant-numeric: tabular-nums; }
.dayof-next em { display: block; font-style: normal; font-size: 14px; color: var(--muted); }
.dayof-calls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-8); }
.dayof-call { min-height: 52px; justify-content: flex-start; font-size: 15.5px; background: var(--card); white-space: normal; text-align: left; text-decoration: none; border-radius: var(--radius); }
.dayof input[type="search"] { min-height: 52px; padding: 0 var(--space-16); font: inherit; font-size: 17px; border: 1.5px solid var(--control); border-radius: var(--radius); background: var(--card); color: var(--text); width: 100%; box-sizing: border-box; }
.dayof-found { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.dayof-found li { display: flex; justify-content: space-between; gap: var(--space-16); padding: var(--space-8) var(--space-16); border-radius: var(--radius); background: var(--card); font-size: 16px; }
.dayof-found li strong { text-align: right; }
.dayof-found .dayof-none { color: var(--muted); }

/* Help (js/ui/help.js): a search box, then the answers as fold-outs, then Send feedback. */
.help { display: grid; gap: var(--space-16); }
.help input[type="search"] { min-height: 48px; padding: 0 var(--space-16); font: inherit; font-size: 16px; border: 1.5px solid var(--control); border-radius: var(--radius); background: var(--card); color: var(--text); }
.help-list { display: grid; }
.help-item { border-top: 1px solid var(--border); }
.help-item:last-child { border-bottom: 1px solid var(--border); }
.help-item summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; font-weight: 700; font-size: 15px; }
.help-item p { margin: 0 0 var(--space-16); line-height: 1.55; font-size: 14.5px; }
.help-none { margin: 0; color: var(--muted); }
.help-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); color: var(--muted); font-size: 14px; }
.help-foot .btn { min-height: 44px; }

/* Ceremony: the item's name opens it (no pencil); the arrows show only in Reorder mode (js/tabs/ceremony.js). */
.cer-open { padding: 0; margin: 0; min-height: 32px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 800; font-size: 14px; text-align: left; cursor: pointer; }
.cer-open:hover span { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .cer-open { min-height: 44px; } }

/* ---- Long words and wrapped headers (snag list 25 Nov 2026: Q3-002, Q3-006) ---- */

/* A name with no spaces (a pasted web address) wraps inside its card instead of pushing the page sideways. The class is
   for any text node in a flex row; the selectors below name the ones on Table plan, Rooms, Menu, Ceremony and Music. */
.wrap-anywhere { min-width: 0; overflow-wrap: anywhere; }
.table-name, .room-card-name, .room-card-name span, .room-card-sub, .room-card-money, .room-card-empty,
.cer-title, .cer-text, .cer-notes, .opt-name, .opt-desc,
.music-title, .music-artist, .music-sub, .music-link a,
.card > .section-head > h3, .modal-head h2 { min-width: 0; overflow-wrap: anywhere; }
.table-name { white-space: normal; }
.modal-head h2 { flex: 0 1 auto; }

/* A header whose buttons wrap under the title keeps them at the right, like the tabs where they fit on one row. The
   spacer (made by js/ui/head-actions.js) fills the title row; a wrapped row has none, so it is packed to the end. Phones
   have their own header rules (css/mobile.css). */
@media (min-width: 641px) {
  .section-head:has(> .head-spacer) { justify-content: flex-end; }
  .section-head > .spacer.head-spacer { flex: 1 1 0; min-width: 0; margin-left: 0; }
}

/* Big money figures: shrink when long, and never push the page sideways (Q4-002). */
.cost-tile { min-width: 0; }
.cost-tile-value, .ov-stat-n, .ov-big { overflow-wrap: anywhere; }
.cost-tile-value.fit-long { font-size: 24px; }
.cost-tile-value.fit-longer { font-size: 19px; }
.ov-stat-n.fit-long { font-size: clamp(22px, 2.6vw, 30px); }
.ov-stat-n.fit-longer { font-size: clamp(18px, 2.1vw, 24px); }
.ov-big.fit-long { font-size: 26px; }
.ov-big.fit-longer { font-size: 20px; }
@media (max-width: 640px) {
  .cost-tile-value.fit-long { font-size: 18px; }
  .cost-tile-value.fit-longer { font-size: 15px; }
}
/* A card that had its own Settings section before the 26 Nov regrouping sits in a wrapper (it keeps its old address),
   spaced like any second card in a section. About is a quiet foot under the last section. */
.settings-section > * + .settings-part { margin-top: var(--space-16); }
.settings-about { opacity: .92; }

/* Rooms and tables are list cards (white with an outline, above). "Needs a room" and "Not seated" keep their filled
   background, so they read as the lists they are, not as one more card. */
.card.soft.room-card.over { border-color: var(--error); }
/* The next empty bed: a quiet "Add someone" where a name would be, underlined with dots. */
.room-slot { justify-content: flex-start; }
.room-add-slot .material-symbols-rounded { text-decoration: none; display: inline-block; margin-right: var(--space-4); }
.room-add-slot { display: inline-flex; align-items: center; min-height: 36px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 4px; cursor: pointer; }
.room-add-slot:hover { color: var(--accent-dark); }
@media (max-width: 640px) { .room-add-slot { min-height: 44px; } }

/* Rooms: the drop marker in a room's list of people (js/ui/room-helper.js). */
.room-people > li.drop-marker { justify-content: flex-start; min-height: 0; margin: var(--space-4) 0; border: 1.5px dashed var(--accent); font-size: 12.5px; }
/* While the sample wedding's tour is showing a tip, the pages' own pointing tips wait, so only one bubble is up. */
body:has(.tour-tip:not([hidden])) .tip-anchor > .tip-bubble { display: none; }
