/* Mobile-first styles. Brand values come from brand.css. */
:root {
  --text: var(--brand-text);
  --muted: #5e5e5e;
  --line: #e6e6e6;
  --bg: var(--brand-background);
  --bg-soft: #f7f7f7;
  --accent: var(--brand-accent);
  --accent-hover: var(--brand-accent-hover);
  --accent-soft: var(--brand-accent-soft);
  --ok: #16794a;
  --ok-soft: #e8f5ee;
  --warn: #8a5a00;
  --warn-soft: #fff6e0;
  --err: #b42318;
  --err-soft: #fdeceb;
  --info-soft: #eef4ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.05), 0 16px 40px rgba(0, 0, 0, 0.08);
  --radius-lg: var(--brand-radius-lg);
  --radius: var(--brand-radius);
  --radius-sm: var(--brand-radius-sm);
  --tap: 48px;
  /* Type scale (rem, so the browser's text-size setting still applies). */
  --text-xs: 0.75rem;
  --lh-xs: 1.33;
  --text-sm: 0.875rem;
  --lh-sm: 1.43;
  --text-base: 1rem;
  --lh-base: 1.5;
  --text-lg: 1.25rem;
  --lh-lg: 1.3;
  --text-xl: 1.5rem;
  --lh-xl: 1.25;
  --text-2xl: 1.75rem;
  --lh-2xl: 1.2;
  --text-hero: 2.25rem;
  --lh-hero: 1.1;
  --weight-regular: 400;
  --weight-semibold: 600;
  --weight-bold: 700;
  /* Spacing scale (rem, so the browser's text-size setting still applies). */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  /* The thin line between rows of a list inside a card (lighter than the
     card border, --line). */
  --divider: #efefef;
  /* Control sizes: three button heights (the default is the 48px tap
     height), three icon sizes, and the smallest tap area. */
  --btn-sm: 40px;
  --btn-md: 48px;
  --btn-lg: 56px;
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;
  --tap-min: 44px;
  /* Layout breakpoints (separate layouts): mobile up to 767px, tablet
     768-1023px, desktop from 1024px. Desktop-only rules live inside
     @media (min-width: 1024px) and never change anything below it.
     Desktop layout: the widest page container, the sidebar's width and the
     space between the columns (and between the cards in each column). */
  --container-wide: 1280px;
  --sidebar-w: 360px;
  --gap-layout: var(--space-5);
}

@media (min-width: 640px) {
  :root {
    --text-2xl: 2.25rem;
    --lh-2xl: 1.17;
    --text-hero: 3rem;
  }
}

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

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

body {
  margin: 0;
  font-family: var(--brand-font);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1,
.h1 {
  font-size: var(--text-2xl);
  line-height: var(--lh-2xl);
  font-weight: var(--weight-bold);
}

h2 {
  font-size: var(--text-xl);
  line-height: var(--lh-xl);
}

/* An h2 inside a card is the card's heading (home steps, How it works). */
.card h2:not(.h1) {
  font-size: var(--text-lg);
  line-height: var(--lh-lg);
}

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

p {
  margin: 0 0 1em;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
}

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

/* Layout. Every page, the header and the footer sit in a .container, so the
   logo, the cards and the footer text share one left edge: the page margin,
   12px on phones and 24px from 640px. */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.container.narrow {
  max-width: 720px;
}

/* Desktop (from 1024px): the header, footer and page containers widen to
   --container-wide together, so the logo lines up with the cards on every
   page. Narrow pages and the home hero keep their own widths. */
@media (min-width: 1024px) {
  .container:not(.narrow, .hero-inner) {
    max-width: var(--container-wide);
  }
}

.section {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.site-main {
  flex: 1;
}

/* A page ends at its section padding: the last thing on it adds no margin of
   its own, so the space above the footer is the same on every page. */
.section > :last-child {
  margin-bottom: 0;
}

.stack > * + * {
  margin-top: var(--space-5);
}

.stack-sm > * + * {
  margin-top: 0.75rem;
}

.center {
  text-align: center;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  font-weight: var(--weight-semibold);
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.lead {
  font-size: var(--text-base);
  color: var(--muted);
}

/* In a card (event header, My events): 8px from the eyebrow to the title. */
:where(.card) .eyebrow {
  margin-bottom: var(--space-2);
}

/* Small links and buttons with a tap role keep their look and layout; an
   invisible area centred on them makes the tap target at least 44px tall. */
.btn-sm,
.account-btn,
.nav-link,
.footer-links a,
.back-link,
.breadcrumb a,
.text-action,
.card-head > a.small,
.center > a:only-child,
.danger-link,
.sort-link,
.admin-table td > a:only-child:not([class]) {
  position: relative;
}

.btn-sm::after,
.account-btn::after,
.nav-link::after,
.footer-links a::after,
.back-link::after,
.breadcrumb a::after,
.text-action::after,
.card-head > a.small::after,
.center > a:only-child::after,
.danger-link::after,
.sort-link::after,
.admin-table td > a:only-child:not([class])::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: max(100%, var(--tap-min));
  transform: translateY(-50%);
}

/* In the admin tables: a sort link's area starts at the top of its header
   cell (the scroll box clips anything above it) and reaches 44px down; "Delete
   permanently" sits 9.6px under Disable, so its area starts 4px above it and
   reaches down, never over Disable's. */
.sort-link::after {
  top: calc(-1 * var(--space-3));
  height: var(--tap-min);
  transform: none;
}

.admin-actions .danger-link::after {
  top: calc(-1 * var(--space-1));
  height: var(--tap-min);
  transform: none;
}

/* A link alone in an admin cell (a count, an id): at least 44px wide too. */
.admin-table td > a:only-child:not([class])::after {
  left: 50%;
  right: auto;
  width: max(100%, var(--tap-min));
  transform: translate(-50%, -50%);
}

/* Icons sized only in the markup get a size token here (16 / 20 / 24). */
.cal-caret,
.final-icon,
.icon-inline,
.choice-check,
.stepper-btn svg,
.social-icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.share-icon {
  width: var(--icon-md);
  height: var(--icon-md);
}

.pw-toggle svg,
.attend-choices .choice-check {
  width: var(--icon-lg);
  height: var(--icon-lg);
}

/* Header + footer */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-weight: var(--weight-bold);
  font-size: 1.1rem;
  min-height: var(--tap);
}

.brand:hover {
  color: var(--text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.brand span,
.site-nav a {
  white-space: nowrap;
}

.site-nav .btn-sm {
  padding: var(--space-2) var(--space-3);
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 0.6rem 0.5rem;
  border-radius: 999px;
  font-weight: var(--weight-semibold);
}

.nav-link:hover {
  background: var(--bg-soft);
  color: var(--text);
}

/* Account menu (signed in). Without JS the links show inline. */
.account-menu {
  position: relative;
}

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  max-width: 12rem;
  padding: 0.2rem 0.65rem 0.2rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.account-btn[hidden] {
  display: none;
}

.account-btn:hover,
.account-btn[aria-expanded='true'] {
  box-shadow: var(--shadow);
}

.account-btn:focus-visible,
.account-item:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caret {
  font-size: var(--text-xs);
  color: var(--muted);
}

.account-panel {
  display: flex;
  align-items: center;
}

.account-panel[hidden] {
  display: none;
}

.js-menu .account-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  flex-direction: column;
  align-items: stretch;
  min-width: 11rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.account-item {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: var(--weight-semibold);
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.account-item:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.account-logout {
  margin: 0;
}

/* Phones: avatar only (the button keeps its accessible name). */
@media (max-width: 639px) {
  .account-btn {
    padding: 0.2rem;
    border-color: transparent;
  }

  .account-btn .account-name,
  .account-btn .caret {
    display: none;
  }
}

/* Ended events and passed options: calm and neutral, not an error. */
.ended-card {
  background: var(--bg-soft);
  border-color: var(--line);
  box-shadow: none;
  /* Same gap as the alerts that can sit in this spot. */
  margin-bottom: var(--space-5);
}

.ended-card p {
  margin: 0 0 var(--space-4);
  color: var(--muted);
}

.ended-card p:last-child {
  margin-bottom: 0;
}

.vote-row-passed {
  opacity: 0.55;
}

.vote-row-passed .seg {
  cursor: not-allowed;
}

.passed-tag,
.dh-passed {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.grid-opt-passed .dh-md,
.grid-opt-passed .dh-wd {
  color: var(--muted);
}

/* Admin */
.admin-badge {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}

.admin-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  max-width: 100%;
}

.admin-tab {
  padding: 0.7rem 0.85rem;
  color: var(--muted);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab.is-current {
  color: var(--text);
  border-bottom-color: var(--text);
}

.admin-logout {
  margin: 0 0 0.35rem;
}

.admin-stats {
  display: grid;
  gap: var(--space-5);
}

.stat-card p {
  margin: 0.15rem 0;
}

.stat-label {
  margin: 0 0 0.5rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

.stat-big {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}

.grid-table.admin-table th,
.grid-table.admin-table td {
  text-align: left;
  vertical-align: middle;
}

.grid-table.admin-table thead th {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.admin-actions form {
  margin: 0;
}

.grid-table.admin-table td.cell-actions {
  white-space: nowrap;
}

/* Admin tables with more than ADMIN_TABLE_SCROLL_ROWS (10) body rows get
   .table-vscroll .admin-vscroll and reuse the long-table box (see "Host and
   guest page tables with more than TABLE_SCROLL_ROWS" below): sticky header,
   sticky Total row in Outbound clicks, sticky first column, fade and hint,
   capped below the viewport. Only the sizes differ, measured at 1280px with
   12px cell padding: header 41px, Total row 46px; a row is 45px in Guest
   page opens and Outbound clicks, 47px in Feature flags, 65px in Users
   (action button) and 95px in Events (actions and a second line). */
.table-vscroll.admin-vscroll {
  --vscroll-rows: 10;
  --vscroll-row-h: 2.95rem;
  --vscroll-head: 2.6rem;
  --vscroll-foot: 0rem;
}

.admin-vscroll.admin-vscroll-total {
  --vscroll-foot: 2.9rem;
}

.admin-vscroll[data-scroll-key='admin-flags'] {
  --vscroll-row-h: 3rem;
}

.admin-vscroll[data-scroll-key='admin-users'] {
  --vscroll-row-h: 4.4rem;
}

.admin-vscroll[data-scroll-key='admin-events'] {
  --vscroll-row-h: 5.95rem;
}

/* Permanent, destructive: red text link, separate from the main action. */
.danger-link {
  margin-left: 0.5rem;
  color: var(--err);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.danger-link:hover {
  color: var(--err);
}

/* Phones: stack the actions so the column stays narrow and on screen. */
@media (max-width: 639px) {
  .cell-actions .admin-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .danger-link {
    margin-left: 0;
  }
}

.text-danger,
.btn.text-danger {
  color: var(--err);
}

.status-upcoming,
.status-active {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-ended {
  background: var(--bg-soft);
  color: var(--muted);
}

.status-disabled {
  background: var(--err-soft);
  color: var(--err);
}

.flag-settings {
  font-size: var(--text-sm);
}

.flag-setting {
  display: inline-block;
  margin-right: 0.75rem;
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.gift-type {
  margin-bottom: var(--space-5);
}

.gift-admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gift-admin-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--divider);
}

.gift-admin-list li > div:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gift-url {
  overflow-wrap: anywhere;
}

.gift-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gift-list li + li {
  margin-top: var(--space-4);
}

.gift-list a {
  font-weight: var(--weight-bold);
}

@media (min-width: 640px) {
  .admin-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Quiet secondary actions: small text link with an icon. */
.text-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-action:hover {
  color: var(--text);
}

.icon-inline {
  flex: none;
}

.event-card-actions .text-action {
  margin-left: var(--space-2);
}

/* Collapsed cards: "More actions" (host page) and "How long to get there?"
   (guest page). A native <details> whose summary is a 44px-high target. */
.more-actions summary,
.travel-card > summary {
  cursor: pointer;
  list-style: revert;
  min-height: 2.75rem;
  padding: 0.6rem 0;
  margin: -0.6rem 0;
}

.more-actions summary .card-title,
.travel-card > summary .card-title {
  display: inline;
  margin: 0;
}

.more-actions-body,
.travel-body {
  margin-top: var(--space-4);
}

.more-actions-body .hint {
  margin: var(--space-1) 0 0;
}

/* In More actions every action (and the summary) is a 44px-high target. */
.more-actions-body .text-action {
  min-height: 2.75rem;
}

/* Delete: the same quiet layout as Duplicate, in the danger colour, below a
   divider with room on both sides so the two can't be tapped by mistake. */
.delete-action {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}

.delete-action .check {
  font-size: var(--text-sm);
}

.delete-error {
  margin: 0 0 0.5rem;
  /* Focused after a failed attempt: land below the sticky header, with room. */
  scroll-margin-top: 6rem;
}

/* A text button that looks like the other text actions. */
button.text-action {
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

.text-action-danger,
.text-action-danger:hover {
  color: var(--err);
}

.text-action-danger:hover {
  text-decoration-thickness: 2px;
}

/* Breadcrumbs (signed-in hosts) and the back link (guest hosts). */
.breadcrumb {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  min-width: 0;
}

.breadcrumb li:first-child,
.breadcrumb li:last-child:not(:nth-child(2)) {
  flex: none;
}

.breadcrumb li + li::before {
  content: '›';
  content: '›' / '';
  margin: 0 0.45rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb [aria-current='page'] {
  color: var(--text);
  font-weight: var(--weight-semibold);
}

.crumb-title {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-link {
  display: inline-block;
  margin: 0 0 var(--space-4);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.hosted-by {
  margin: calc(-1 * var(--space-1)) 0 var(--space-2);
  color: var(--muted);
  font-weight: var(--weight-semibold);
}

/* Guest page title card: "5 going · 2 maybe" right under the title (muted,
   small), 8px above "Hosted by" when there is one. */
.card.event-header > h1 + .proof-line {
  margin: 0 0 var(--space-3);
}

.empty-state .btn {
  margin-top: 0;
}

.hide-sm {
  display: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  margin-top: var(--space-4);
  padding: var(--space-8) 0;
}

.footer-inner {
  display: grid;
  gap: var(--space-5);
}

.footer-brand {
  font-weight: var(--weight-bold);
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.footer-links a {
  color: var(--text);
  display: inline-block;
  padding: 0.4rem 0;
}

/* Footer "Follow us" (only when a SOCIAL_*_URL is set): the footer links'
   style, with a small outline icon and a 44px tap height. */
.footer-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

.footer-social-title {
  font-weight: var(--weight-semibold);
  margin: 0;
}

.footer-social-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-social-list a {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
}

.social-icon {
  flex: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--btn-md);
  padding: 0.7rem var(--space-4);
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
  text-align: center;
}

.btn:active {
  transform: translateY(1px);
}

/* Buttons give their own press feedback: no grey tap flash on iPhone. */
.btn {
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: #c9c9c9;
}

/* Mouse only: on touch screens a tap leaves :hover on, which kept a
   near-black border on the button after tapping it. */
@media (hover: hover) and (pointer: fine) {
  .btn-secondary:hover {
    border-color: var(--text);
    color: var(--text);
  }
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-ghost:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.btn-danger {
  background: var(--err);
  color: #fff;
}

.btn-danger:hover {
  background: #8f1c13;
  color: #fff;
}

/* Outlined danger: white with the danger colour for the border and text,
   for a destructive choice next to a primary one (the vote-delete warning). */
.btn-outline-danger {
  background: var(--bg);
  color: var(--brand-danger);
  border-color: var(--brand-danger);
}

/* Mouse only (a tap leaves :hover on, see .btn-secondary). */
@media (hover: hover) and (pointer: fine) {
  .btn-outline-danger:hover {
    background: var(--brand-danger-soft);
    color: var(--brand-danger);
  }
}

.btn-whatsapp {
  background: #1d7d47;
  color: #fff;
}

.btn-whatsapp:hover {
  background: #156237;
  color: #fff;
}

.btn-sm {
  min-height: var(--btn-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.btn-lg {
  min-height: var(--btn-lg);
  padding: var(--space-2) var(--space-6);
  /* A label that needs two lines is balanced, with the same padding above
     and below, so the button stays close to 56px. */
  text-wrap: balance;
  font-size: var(--text-base);
}

.btn svg {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

/* Mouse only: on touch screens a tap leaves :hover on, which kept a
   near-black border on the button after tapping it. */
@media (hover: hover) and (pointer: fine) {
  .btn-icon:hover {
    border-color: var(--text);
    color: var(--text);
  }
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.button-row .hint {
  flex-basis: 100%;
  margin: 0;
}

:where(.card) .button-row {
  gap: var(--space-2);
}

/* Cards */
.card {
  --card-pad-y: var(--space-5);
  --card-pad-x: var(--space-4);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--card-pad-y) var(--card-pad-x);
}

.card-title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

/* Any heading of a card (a card title, a plain h1 or h2, the heading row of
   a card with an action beside it): 16px to the first element below it. */
.card > :is(h1, h2, .card-head) {
  margin-bottom: var(--space-4);
}

/* A hint or description line right under a card heading ("Hosted by", the
   lead under "Event created", the line under "This event has ended", the
   address under "Where"): 4px below the heading, then 16px to what follows. */
.card :is(.card-title, .card-head):has(+ :is(.hint, .muted, .lead, .place-card-address)),
.card > :is(h1, h2):has(+ :is(.hint, .muted, .lead, .hosted-by)),
.card .alert > .card-title:has(+ p),
.card.ended-card > :is(h1, .card-title):has(+ p),
.card.cta-card > h2:has(+ p) {
  margin-bottom: var(--space-1);
}

.card :is(.card-title, .card-head) + :is(.hint, .muted, .lead, .place-card-address),
.card > :is(h1, h2) + :is(.hint, .muted, .lead, .hosted-by),
.card .alert > .card-title + p,
.card.ended-card > :is(h1, .card-title) + p,
.card.cta-card > h2 + p {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

/* A card title inside a part of a card (the created card's "Guest link"). */
.card :is(.card-title, .card-head) {
  margin-bottom: var(--space-4);
}

.card .alert > .card-title:last-child,
.card .card-head > .card-title {
  margin-bottom: 0;
}

/* A card that stacks its parts: 16px between them (the page's own .stack
   between cards is unchanged). */
.card.stack > * + * {
  margin-top: var(--space-4);
}

/* Guest page: one place on its own card above the reply form. Its "Where"
   heading is highlighted: the brand colour (5.6:1 on white), slightly larger
   and bolder than other card headings, with a small filled map pin. */
.place-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--accent);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.place-card-icon {
  flex: none;
  width: var(--icon-md);
  height: var(--icon-md);
}

.place-card-address {
  margin: 0;
  /* A long unbroken address wraps inside the card instead of widening the page. */
  overflow-wrap: anywhere;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: 0.75rem;
}

.card-head .card-title {
  margin: 0;
}

.subhead {
  font-size: var(--text-base);
  color: var(--muted);
  margin-top: 1rem;
}

/* In a card a section heading ("Dates", "Places" in Votes) starts 24px below
   what is above it, 16px when right under the card heading or its hint. */
.card .subhead {
  margin-top: var(--space-6);
}

.card :is(.card-title, .card-head, .host-votes-head, .hint) + .subhead {
  margin-top: var(--space-4);
}

/* Alerts */
.alert {
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: var(--space-5);
  border: 1px solid transparent;
}

.alert p:last-child {
  margin-bottom: 0;
}

.alert-success {
  background: var(--ok-soft);
  border-color: #b7e0c8;
}

.alert-warning {
  background: var(--warn-soft);
  border-color: #f1d48a;
}

.alert-error {
  background: var(--err-soft);
  border-color: #f4b8b3;
  color: var(--err);
  font-weight: var(--weight-semibold);
}

.alert-info {
  background: var(--info-soft);
  border-color: #c9d8f5;
}

.alert .card-title {
  margin-bottom: 0.25rem;
}

/* Vote-delete warning (edit page): a clear gap between Keep and Delete; on
   narrow phones (up to 400px) both full width, stacked, Keep on top. */
.vote-warning-actions {
  gap: var(--space-3);
}

@media (max-width: 400px) {
  .vote-warning-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Home */
.hero {
  padding: var(--space-8) 0 var(--space-6);
}

.hero-inner {
  max-width: 820px;
}

.hero-title {
  font-size: var(--text-hero);
  line-height: var(--lh-hero);
  letter-spacing: -0.02em;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: var(--space-6) 0 var(--space-4);
}

/* Phones: the hero buttons are full width with 16px sides, so "Create an
   event, no sign-up needed" fits on one line where it can (from 360px);
   at 320px its two lines are balanced (see .btn-lg). */
@media (max-width: 639px) {
  .hero-actions .btn {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

.privacy-note {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.section-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-5);
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-5);
}

.step {
  position: relative;
}

.step-number {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}

.chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  background: #fff;
  font-weight: var(--weight-semibold);
}

.chip-muted {
  color: var(--muted);
  border-style: dashed;
}

.cta-card {
  --card-pad-y: var(--space-8);
  text-align: center;
  background: var(--accent-soft);
  border-color: transparent;
  box-shadow: none;
}

.prose-card {
  margin-bottom: var(--space-5);
}

/* How it works: questions as a list of native <details>, closed by default.
   Each question is a full-width target at least 48px high. */
.faq-item + .faq-item {
  border-top: 1px solid var(--divider);
}

.faq-item > summary {
  min-height: var(--tap);
  padding: var(--space-3) 0;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  list-style: revert;
}

.faq-item > p {
  margin: 0 0 var(--space-4);
}

.prose h2 {
  margin-top: 1.75rem;
}

/* Legal pages: the text sits in .legal-body (beside the table of contents
   from 1024px); it ends at the section padding like any page. */
.legal-body > :last-child {
  margin-bottom: 0;
}

/* Desktop-only parts of the home, How it works and legal pages: not shown
   below 1024px (the hero preview, the event-type toggle, the legal table of
   contents). */
@media not all and (min-width: 1024px) {
  .hero-preview,
  .types-toggle,
  .legal-toc {
    display: none;
  }
}

/* Home, How it works and legal pages from 1024px (desktop). Nothing here
   applies below 1024px. */
@media (min-width: 1024px) {
  /* Hero: the text on the left, a static preview of a guest page on the
     right, in the wide container. */
  .container.hero-inner {
    max-width: var(--container-wide);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--sidebar-w));
    gap: var(--space-12);
    align-items: center;
  }

  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  /* Looks like a card, but is not one (not part of the page's cards). */
  .preview-card {
    background: var(--bg);
    border: thin solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-6);
  }

  .preview-title {
    font-size: var(--text-lg);
    line-height: var(--lh-lg);
    font-weight: var(--weight-bold);
    margin: 0 0 var(--space-1);
  }

  .preview-summary {
    color: var(--muted);
    margin: 0 0 var(--space-5);
  }

  .preview-subtitle {
    font-size: var(--text-sm);
    line-height: var(--lh-sm);
    font-weight: var(--weight-semibold);
    margin: 0;
  }

  .preview-ranked {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .preview-ranked .vr-name {
    white-space: nowrap;
  }

  /* Event types: two rows of chips until "Show all event types" is open
     (a native <details>, so it works without JavaScript; the whole list
     stays in the page). Chips are one line, a fixed height, so two rows are
     an exact height. */
  .types-section {
    --chip-h: calc(var(--text-base) * var(--lh-base) + 2 * var(--space-2));
  }

  .types-section .chip {
    display: inline-flex;
    align-items: center;
    height: var(--chip-h);
    padding-top: 0;
    padding-bottom: 0;
    white-space: nowrap;
  }

  .types-section:has(.types-toggle:not([open])) .chips {
    max-height: calc(2 * var(--chip-h) + var(--space-2));
    overflow: hidden;
  }

  .types-toggle {
    margin-top: var(--space-4);
  }

  .types-toggle > summary {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min);
    color: var(--accent);
    font-weight: var(--weight-semibold);
    text-decoration: underline;
    text-underline-offset: calc(var(--space-1) / 2);
    cursor: pointer;
    list-style: none;
  }

  .types-toggle > summary::-webkit-details-marker {
    display: none;
  }

  .types-toggle > summary:hover {
    color: var(--accent-hover);
  }

  .types-toggle[open] .types-show-all,
  .types-toggle:not([open]) .types-show-fewer {
    display: none;
  }

  /* How it works: the three steps in a row, then the two "What ..." cards
     side by side, then About and Questions side by side; the button stays
     centred below. */
  .container.narrow.how-page {
    max-width: var(--container-wide);
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--gap-layout);
    align-items: start;
  }

  .how-page > * {
    grid-column: 1 / -1;
  }

  .how-page > h1,
  .how-page > .lead {
    margin-bottom: 0;
  }

  /* The paired cards keep their own height (the grid aligns them to the
     top), so opening a question doesn't grow the card beside it. The three
     steps stretch to one height. */
  .how-page > .prose-card {
    margin-bottom: 0;
  }

  .how-page > .how-step {
    grid-column: span 2;
    align-self: stretch;
  }

  .how-page > .how-pair {
    grid-column: span 3;
  }

  .how-page > .how-cta {
    margin-top: var(--space-4);
  }

  /* Legal pages: a sticky table of contents (the h2 headings) on the left,
     the text on the right at about 70 characters a line, one step up the
     type scale. */
  .container.narrow.legal {
    /* Below the sticky site header, plus a gap. */
    --legal-top: calc(var(--space-12) + var(--space-4) + var(--space-6));
    --toc-line: calc(var(--space-1) / 2);
    max-width: var(--container-wide);
    display: grid;
    grid-template-columns: minmax(0, var(--sidebar-w)) minmax(0, 70ch);
    gap: var(--space-12);
    align-items: start;
  }

  .legal-toc {
    position: sticky;
    top: var(--legal-top);
    max-height: calc(100vh - var(--legal-top) - var(--space-6));
    overflow-y: auto;
    padding-right: var(--space-2);
  }

  .legal-toc-title {
    font-size: var(--text-sm);
    line-height: var(--lh-sm);
    font-weight: var(--weight-semibold);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 var(--space-3);
  }

  .legal-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: var(--toc-line) solid var(--line);
  }

  .legal-toc a {
    display: flex;
    align-items: center;
    min-height: var(--tap-min);
    margin-left: calc(-1 * var(--toc-line));
    padding: var(--space-1) var(--space-3);
    border-left: var(--toc-line) solid transparent;
    color: var(--muted);
    text-decoration: none;
    line-height: var(--lh-sm);
  }

  .legal-toc a:hover {
    color: var(--text);
    text-decoration: underline;
  }

  .legal-toc a[aria-current] {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: var(--weight-semibold);
  }

  .legal-body {
    grid-column: 2;
    grid-row: 1;
    font-size: var(--text-lg);
    line-height: var(--lh-base);
  }

  /* A page without h2 headings has no table of contents: one text column,
     centred in the container. */
  .container.narrow.legal:not(:has(.legal-toc)) {
    grid-template-columns: minmax(0, 70ch);
    justify-content: center;
  }

  .legal:not(:has(.legal-toc)) > .legal-body {
    grid-column: 1;
  }

  .legal-body .lead {
    font-size: var(--text-lg);
  }

  .legal-body .legal-updated {
    font-size: var(--text-base);
  }

  .legal-body h2 {
    scroll-margin-top: var(--legal-top);
  }

  /* Footer: the brand on the left, every link on one line on the right. */
  .site-footer .footer-inner {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: var(--space-8);
  }

  .footer-links,
  .footer-social {
    justify-content: flex-end;
  }
}

/* From 1280px every footer link fits on one line, even with all of them on. */
@media (min-width: 1280px) {
  .footer-links {
    flex-wrap: nowrap;
    white-space: nowrap;
  }
}

/* Forms */
.form-card .field + .field,
.form-card .field + .check,
.form-card .check + .field {
  margin-top: var(--space-4);
}

.form-card .check + .check {
  margin-top: var(--space-2);
}

/* A field followed by its buttons (in any form, e.g. "How long to get
   there?"): the same 1rem as between fields, so the button never touches the
   input above it. */
.field + .button-row,
.field + .btn,
.check + .button-row,
.check + .btn {
  margin-top: var(--space-4);
}

.field {
  display: block;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

label,
legend {
  display: block;
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: 0.35rem;
  padding: 0;
}

/* Single-line fields are one button height (48px), like the buttons beside
   them (copy-link rows). Compact controls set their own height below. */
input[type='text'],
input[type='email'],
input[type='password'],
input[type='url'],
input[type='number'],
input[type='datetime-local'],
select {
  height: var(--btn-md);
}

/* In a card: 8px from a label to its field (also in the small stacked
   forms, whose 12px rhythm would otherwise push the field down). */
:where(.card) :is(label, legend) {
  margin-bottom: var(--space-2);
}

.card .stack-sm > * + * {
  margin-top: var(--space-4);
}

.card .stack-sm > label + * {
  margin-top: 0;
}

.card .stack-sm > :is(.hint, .field-error) {
  margin-top: var(--space-1);
}

/* A form that is a row of buttons ("Reopen" under the votes): 16px below
   the content above it. */
.card > form.button-row {
  margin-top: var(--space-4);
}

.optional {
  font-weight: var(--weight-regular);
  color: var(--muted);
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='url'],
input[type='number'],
input[type='datetime-local'],
select,
textarea {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text);
  background: #fff;
  border: 1.5px solid #b8b8b8;
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
}

/* No resize grip: WebKit draws it over the bottom-right corner, so that
   corner looked different from the other fields'. The box keeps its height
   and scrolls when the text is longer. */
textarea {
  resize: none;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
  /* A chosen option longer than the box (a place name plus a long address in
     the host's confirm form) ends in "…" inside the box. Without this, WebKit
     (Safari, and Chrome on iPhone) lets the text spill out of a select with
     appearance: none, which made the whole host page wider than the screen. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--text);
  outline: 3px solid var(--accent-soft);
  outline-offset: 0;
}

/* Text fields, selects and text areas while focused (tap, click or
   keyboard): the border stays its normal grey and a 2px brand ring with a
   faint shadow shows instead of a near-black border. The ring is the
   brand colour at 70%: the lightest that keeps 3:1 against white and the
   tinted panels (3.3:1 or more), so keyboard users still see it clearly.
   The transparent outline shows as a real outline in forced-colours mode,
   where shadows are not drawn. After blur the field is back to normal,
   filled or not. Checkboxes, radios and the time zone select keep their
   own focus style. */
input[type='text']:focus,
input[type='email']:focus,
input[type='password']:focus,
input[type='url']:focus,
input[type='number']:focus,
input[type='datetime-local']:focus,
select:not(.tz-select):focus,
textarea:focus {
  border-color: #b8b8b8;
  /* The field's own corner, also when :focus-visible matches: the site-wide
     :focus-visible rule (4px corners for buttons and links) outranks the
     plain `select` and `textarea` selectors and used to give those two
     fields 4px corners while focused. The ring is a box-shadow, so it
     follows this corner (outer radius = this radius + 2px). */
  border-radius: var(--radius-sm);
  outline: 2px solid transparent;
  outline-offset: 0;
  box-shadow: 0 0 0 2px var(--accent), 0 1px 6px rgba(0, 0, 0, 0.06);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent), 0 1px 6px rgba(0, 0, 0, 0.06);
}

/* Our own focus feedback replaces the browser's grey tap flash on fields. */
input[type='text'],
input[type='email'],
input[type='password'],
input[type='url'],
input[type='number'],
input[type='datetime-local'],
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

[aria-invalid='true'] {
  border-color: var(--err) !important;
}

.input-short {
  max-width: 9rem;
}

.hint {
  color: var(--muted);
  font-size: var(--text-sm);
  margin: 0.35rem 0 0;
}

.field-error {
  color: var(--err);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  margin: 0.35rem 0 0;
}

/* In a card: 4px from a field to its hint or error. */
:where(.card) :is(.hint, .field-error) {
  margin-top: var(--space-1);
}

/* Reply form: list of problems at the top, each linking to its field. */
.error-summary {
  border: 2px solid var(--err);
  border-radius: var(--radius);
  background: var(--err-soft);
  padding: 0.85rem 1rem;
}

.error-summary:focus {
  outline: 3px solid var(--accent-soft);
}

.error-summary-title {
  font-size: var(--text-base);
  margin: 0 0 0.35rem;
  color: var(--err);
}

.error-summary-list {
  margin: 0;
  padding-left: 1.2rem;
}

.error-summary-list li + li {
  margin-top: 0.25rem;
}

.error-summary-list a {
  color: var(--err);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
}

/* An unanswered group of options: a red bar beside the options. */
.vote-group[data-invalid] {
  border-left: 3px solid var(--err);
  padding-left: 0.75rem;
}

.vote-row[aria-invalid='true'] {
  border-color: var(--line) !important;
}

.check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  font-weight: var(--weight-regular);
  min-height: var(--tap);
  cursor: pointer;
  margin: 0;
}

.check input {
  width: 1.3rem;
  height: 1.3rem;
  accent-color: var(--accent);
  flex: none;
  margin: 0;
}

.radio-grid {
  display: grid;
  gap: 0 1rem;
}

.repeat {
  border: 0;
  padding: 0;
  margin: 1rem 0 0;
  min-width: 0;
}

/* Create and edit, When: the time zone as one compact row, a globe and the
   zone name with a caret, no box. It is the native select styled as plain
   text (the select rule above clips a long name with an ellipsis); app.js
   sizes it to the chosen name so the caret follows the text. 44px tall. */
.tz-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.tz-globe {
  flex: none;
  width: var(--icon-sm);
  height: var(--icon-sm);
  color: var(--muted);
}

select.tz-select {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: var(--tap-min);
  padding: 0 1.4rem 0 0;
  border: 0;
  background-color: transparent;
  background-position: calc(100% - 10px) 50%, calc(100% - 4px) 50%;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

select.tz-select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Create and edit, When card with the calendar (public/js/when.js): one
   rhythm (--when-gap, 16px) between the time zone row, the chosen dates, the
   calendar and its note. The × buttons and the next-month arrow share the
   right edge. */
.when-card,
.basics-card,
.where-card,
.guests-card {
  --when-gap: var(--space-4);
}

.when-card {
  /* Switches: the thin line between chosen dates, and the light shadow at the
     top edge of the calendar. Set either to transparent to remove it. */
  --when-divider: var(--divider);
  --when-cal-shadow: rgba(0, 0, 0, 0.06);
}

/* The heading's calendar icon: the globe's size, stroke and colour. "The
   basics" uses the same for its heading icon and its folds' icons. */
.when-title-icon,
.basics-title-icon,
.basics-fold-icon,
.where-title-icon,
.guests-title-icon {
  width: var(--icon-md);
  height: var(--icon-md);
  margin-right: var(--space-2);
  color: var(--muted);
  vertical-align: -0.15em;
}

/* The folds' icons sit beside 16px text: the small size. */
.basics-fold-icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.when-card > .card-title,
.when-card > .hint,
.basics-card > .card-title,
.where-card > .card-title,
.where-card > .hint,
.guests-card > .card-title {
  padding: 0 var(--space-1);
}

/* "The basics": the When card's padding (above), heading inset and gap. */
.basics-card .field + .field {
  margin-top: var(--when-gap);
}

/* Optional fields folded: a native <details> whose summary is a 44px-high
   target with the native caret (as "More actions"), an icon and the label.
   While closed, the value follows the label on one line, cut with an
   ellipsis. */
.basics-fold > summary {
  min-height: 2.75rem;
  padding: 0.6rem 0;
  overflow: hidden;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  list-style: revert;
}

.basics-fold-value {
  font-weight: var(--weight-regular);
}

.basics-fold[open] .basics-fold-value,
.basics-fold[data-filled]:not([open]) .basics-fold-optional {
  display: none;
}

.basics-fold-body {
  margin-top: calc(var(--space-4) - 0.6rem);
}

.when-card .tz-field {
  margin-top: var(--space-4);
}

.when > * + * {
  margin-top: var(--when-gap);
}

.when-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A line only BETWEEN dates: every row keeps its 1px top (first row) and
   bottom borders, so no row moves or changes size, but only the borders
   between two rows are visible. */
.when-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  border-bottom: 1px solid var(--when-divider);
}

.when-line:first-child {
  border-top: 1px solid transparent;
}

.when-line:last-child {
  border-bottom-color: transparent;
}

.when-line-main {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: var(--space-3) var(--space-1);
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  line-height: 1.35;
  cursor: pointer;
}

span.when-line-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  cursor: default;
}

button.when-line-main:focus-visible,
.when-remove:focus-visible,
.when-nav:focus-visible,
.when-day:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  border-radius: var(--radius-sm);
}

/* The date and the time each stay on one line; a narrow line wraps between
   them. */
.when-line-date,
.when-line-time {
  white-space: nowrap;
}

.when-line.is-passed .when-line-main,
.when-tag {
  color: var(--muted);
}

.when-line.is-invalid,
.when-line.is-warn {
  border-left: 3px solid var(--err);
  padding-left: var(--space-2);
}

.when-line .field-error,
.when-line-msg {
  flex-basis: 100%;
  margin: 0 0 var(--space-3) var(--space-1);
  color: var(--err);
  font-size: var(--text-sm);
}

.when-remove,
.when-nav {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  cursor: pointer;
}

.when-remove svg,
.when-nav svg {
  width: var(--icon-md);
  height: var(--icon-md);
}

/* "Where" (views/events/form.ejs, public/js/where.js): the chosen places as
   a list like the dates in "When" (a pin, the name in bold and the address,
   the x on the right; a thin line only between rows), then the pair of fields
   and "Add". The same 12px rhythm (--when-gap) as the When card. */
/* "Guests": the When and Where cards' 16px rhythm between its groups (the
   guest limit, the two checkboxes, the food-order link). The two checkbox
   rows are one group, 8px apart; each keeps its full 48px tap height. */
.guests-card > .field + .field,
.guests-card > .field + .check,
.guests-card > .check + .field {
  margin-top: var(--when-gap);
}

.guests-card > .check + .check {
  margin-top: var(--space-2);
}

/* A wrapped checkbox label keeps 4px above and below it (16px between two
   wrapped rows); a one-line row stays at its full 48px tap height. */
.guests-card > .check {
  padding: var(--space-1) 0;
}

/* "Guests must vote on dates and places": one more row of the checkbox group
   (8px below the one above it), its hint and note close under it, and the
   group gap before the next field. */
.guests-card > .check + .votes-toggle {
  margin-top: var(--space-2);
}

.guests-card > .votes-toggle + .field {
  margin-top: var(--when-gap);
}

.votes-toggle > .check {
  padding: var(--space-1) 0;
}

.votes-toggle > .hint {
  margin: var(--space-1) 0 0;
}

.where-card > .where {
  margin-top: var(--when-gap);
}

.where-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.where-list[hidden] {
  display: none;
}

.where-list:not([hidden]) + .where-editor {
  margin-top: var(--when-gap);
}

.where-line {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border-bottom: 1px solid var(--when-divider, var(--divider));
}

.where-line:last-child {
  border-bottom-color: transparent;
}

.where-pin {
  flex: none;
  width: var(--icon-sm);
  height: var(--icon-sm);
  margin-left: var(--space-1);
  color: var(--muted);
}

/* Long names and addresses wrap (also unbroken text) and never push the
   x out of the card. */
.where-line-main {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: var(--space-3) var(--space-1);
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}

button.where-line-main {
  cursor: pointer;
}

.where-line-name {
  font-weight: var(--weight-bold);
}

.where-line-sep {
  color: var(--muted);
}

/* Edit page: how many votes a saved date or place has ("3 votes"), small and
   muted; the place's count sits before the x and never wraps. */
.where-line-votes {
  flex: none;
  color: var(--muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.when-votes {
  font-size: var(--text-sm);
  white-space: nowrap;
}

.where-remove {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  cursor: pointer;
}

.where-remove[hidden] {
  display: none;
}

.where-remove svg {
  width: var(--icon-md);
  height: var(--icon-md);
}

/* The row being changed in the fields below (no size change). */
.where-line.is-editing {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.where-line.is-editing .where-pin {
  color: var(--accent);
}

.where-editor > :not([type='hidden']) ~ :not([hidden]) {
  margin-top: var(--when-gap);
}

.where-editor > .field-error,
.where-msg {
  margin-bottom: 0;
  color: var(--err);
}

.where-msg[hidden] {
  display: none;
}

.where-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  }

.where-add[hidden] {
  display: none;
}

.where-add svg {
  flex: none;
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.where-add[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}

.where-cancel {
  display: block;
  min-height: 44px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 0.75rem;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  cursor: pointer;
}

.where-cancel[hidden] {
  display: none;
}

.when-nav[aria-disabled='true'] {
  color: var(--line);
  cursor: default;
}

/* Calendar: full width, the card's own background. */
/* The only separator between the list and the calendar: an 8px shadow at
   the calendar's top edge, a background (behind everything, no space). */
.when-cal {
  position: relative;
  background: linear-gradient(var(--when-cal-shadow), transparent) top / 100% 8px no-repeat;
}

.when-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.when-month {
  margin: 0;
  font-size: var(--text-base);
  text-align: center;
}

.when-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.when-grid th {
  padding: 0 0 0.25rem;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-align: center;
}

.when-grid td {
  padding: 0;
  text-align: center;
}

.when-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  scroll-margin: 6rem 0 6rem;
}

.when-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid transparent;
  border-radius: 50%;
}

/* Past days: muted and not selectable (also aria-disabled). */
.when-day.is-past {
  color: var(--muted);
  cursor: default;
}

.when-day.is-past .when-day-num {
  text-decoration: line-through;
}

/* Today: a ring in the brand colour, bold. */
.when-day.is-today .when-day-num {
  border-color: var(--accent);
  font-weight: var(--weight-bold);
}

/* A day with a chosen date: filled with the Yes green, bold white text. */
.when-day.is-chosen .when-day-num {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
  font-weight: var(--weight-bold);
}

.when-day.is-today.is-chosen .when-day-num {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}

.when-day[aria-disabled='true']:not(.is-past) {
  cursor: not-allowed;
}

@media (hover: hover) {
  .when-day:not([aria-disabled='true']):hover .when-day-num {
    border-color: var(--text);
  }

  .when-day.is-chosen:not([aria-disabled='true']):hover .when-day-num {
    border-color: var(--ok);
  }
}

.when-note {
  margin: 0;
  padding: 0 var(--space-1);
  color: var(--muted);
  font-size: var(--text-sm);
}

.when > .field-error {
  padding: 0 var(--space-1);
}

/* The time popup, compact: placed by app script next to the tapped day,
   inside the calendar, above everything on the page (also the consent
   banner). A heading row (the day, a 44px close button), one control row
   (hour and minute chips, AM/PM, the check button) and, when a chip is
   open, a grid of hours or minutes. Every control is 44px tall. */
.when-pop {
  position: absolute;
  z-index: 60;
  top: 2.75rem;
  left: 50%;
  /* The card's side padding grew from 12px to 16px: the popup takes those 4px
     per side back, so it keeps its width (and its controls their layout). */
  width: min(calc(100% + 0.5rem), 20rem);
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  transform: translateX(-50%);
}

.when-pop[hidden] {
  display: none;
}

.when-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}

.when-pop-title {
  margin: 0;
  padding-left: 0.25rem;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}

.when-pop-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  cursor: pointer;
}

.when-pop-close svg {
  width: 18px;
  height: 18px;
}

/* One row; where it can't fit (below about 330px wide) the check button
   moves to its own right-aligned line. */
.when-pop-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.when-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 44px;
  height: 44px;
  padding: 0 0.35rem;
  border: 1.5px solid #767676;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.when-chip[aria-expanded='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.when-chip-caret {
  flex: none;
  width: 10px;
  height: 6px;
  color: var(--muted);
}

.when-pop-colon {
  font-weight: var(--weight-bold);
}

.when-ampm {
  display: inline-flex;
  /* The frame is an outline (drawn over the buttons), so each button keeps a
     full 44px target. */
  outline: 1.5px solid #767676;
  outline-offset: -1.5px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.when-ampm-btn {
  min-width: 40px;
  height: 44px;
  padding: 0 0.3rem;
  border: 0;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  cursor: pointer;
}

.when-ampm-btn + .when-ampm-btn {
  border-left: 1.5px solid #767676;
}

/* The chosen one: a brand tint, bold, dark text (and aria-pressed). */
.when-ampm-btn[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: var(--weight-bold);
}

.when-ok {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin-left: auto;
  padding: 0;
}

.when-ok svg {
  width: 20px;
  height: 20px;
}

.when-pick {
  display: grid;
  grid-template-columns: repeat(var(--when-pick-cols, 4), minmax(0, 1fr));
  gap: 4px;
  margin-top: 0.375rem;
}

.when-pick[hidden] {
  display: none;
}

.when-cell {
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.when-cell[aria-pressed='true'] {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  font-weight: var(--weight-bold);
}

/* An existing minute that isn't a multiple of 5 (8:02): marked too. */
.when-cell.is-extra {
  border-style: dashed;
  border-color: #767676;
}

.when-cell.is-extra[aria-pressed='true'] {
  border-style: solid;
  border-color: var(--accent);
}

.when-pop-close:focus-visible,
.when-chip:focus-visible,
.when-ampm-btn:focus-visible,
.when-cell:focus-visible,
.when-ok:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

/* One line kept for a message (no jump when one appears). */
.when-pop-msg {
  min-height: 1rem;
  margin: 0.125rem 0 0;
  padding-left: 0.25rem;
  color: var(--err);
  font-size: var(--text-xs);
  line-height: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .when-pop:not([hidden]) {
    animation: when-pop-in 0.12s ease-out;
  }
}

@keyframes when-pop-in {
  from {
    opacity: 0;
  }
}

.repeat-rows > * + * {
  margin-top: 0.85rem;
}

.option-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.option-row > .field {
  grid-column: 1;
}

.option-row > [data-remove-row] {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.repeat > [data-add-row] {
  margin-top: 0.6rem;
  padding-left: 0;
}

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

.vote-group > legend {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.form-card .vote-group,
.form-card .vote-group + .field,
.form-card .vote-group + fieldset.field {
  margin-top: var(--space-6);
}

/* Voting */
.vote-group {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.vote-row {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--divider);
}

.vote-row:first-of-type {
  border-top: 0;
}

.vote-label {
  display: block;
  margin-bottom: var(--space-2);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.seg {
  position: relative;
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--lh-base);
  font-weight: var(--weight-semibold);
}

.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1.5px solid #c9c9c9;
  border-radius: var(--radius-sm);
  background: #fff;
}

.segmented-lg .seg span {
  min-height: 52px;
  font-size: var(--text-base);
}

.seg input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.seg-yes input:checked + span {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.seg-maybe input:checked + span {
  background: #7a5b00;
  border-color: #7a5b00;
  color: #fff;
}

.seg-no input:checked + span {
  background: #4a4a4a;
  border-color: #4a4a4a;
  color: #fff;
}

/* Vote tables (guests × options). Scrolls inside its own box on narrow
   screens; the guest-name column stays put. */
.scroll-table {
  max-width: 100%;
}

.vote-grid {
  margin-top: 0.5rem;
}

.grid-hint {
  display: none;
  margin: 0 0 0.4rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

.grid-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Fade on the right edge hints that more columns are off-screen. */
.grid-frame::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.25rem;
  pointer-events: none;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), #fff 85%);
  opacity: 0;
  transition: opacity 0.2s;
}

.grid-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.grid-scroll:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.grid-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

.grid-table th,
.grid-table td {
  padding: var(--space-3);
  line-height: var(--lh-sm);
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.grid-table tbody tr:last-child > * {
  border-bottom: 0;
}

.grid-table thead th {
  vertical-align: bottom;
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.col-leading {
  background: var(--ok-soft);
}

.col-confirmed {
  background: var(--accent-soft);
}

.grid-name {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  text-align: left !important;
  font-weight: var(--weight-semibold);
  /* The same text width as before (6.5rem and 10rem of text with 9.6px
     sides), now with 12px padding on each side: names and dates wrap exactly
     where they did. */
  min-width: 6.8rem;
  max-width: 10.3rem;
  overflow-wrap: anywhere;
  border-right: 1px solid var(--line);
}

.grid-opt {
  min-width: 5.25rem;
}

.grid-opt-place {
  min-width: 7.5rem;
  white-space: normal !important;
}

.opt-head {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dh {
  display: block;
  line-height: 1.2;
}

.dh-wd {
  font-size: var(--text-xs);
  color: var(--muted);
}

.dh-md {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}

.dh-yr {
  font-size: var(--text-xs);
  color: var(--muted);
}

.dh-time {
  margin-top: 0.15rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--muted);
}

.ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  max-width: 10rem;
}

.ph-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1.25;
  overflow-wrap: break-word;
}

.ph-toggle {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
}

/* The 32px button keeps its look; an invisible ring makes it a 44px target. */
.ph-toggle {
  position: relative;
}

.ph-toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--tap-min);
  height: var(--tap-min);
  transform: translate(-50%, -50%);
}

.ph-toggle[hidden] {
  display: none;
}

/* Mouse only: on touch screens a tap leaves :hover on, which kept a
   near-black border on the button after tapping it. */
@media (hover: hover) and (pointer: fine) {
  .ph-toggle:hover {
    border-color: var(--text);
  }
}

.ph-toggle:focus-visible,
.ph-map:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.ph-toggle[aria-expanded='true'] span[aria-hidden] {
  transform: rotate(180deg);
}

.ph-toggle span[aria-hidden] {
  display: inline-block;
  transition: transform 0.15s;
}

.grid-badge {
  display: block;
  width: max-content;
  margin: 0.35rem auto 0;
  font-size: var(--text-xs);
  padding: 0.1rem 0.5rem;
}

/* Vote icons: shape and text label carry the meaning; color only helps. */
.vi {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-weight: var(--weight-bold);
  line-height: 1;
}

.vi-yes {
  background: var(--ok);
  color: #fff;
}

.vi-maybe {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid #e9c46a;
}

.vi-no {
  background: var(--bg-soft);
  color: #4a4a4a;
  border: 1px solid #d4d4d4;
}

.vi-none {
  color: #8a8a8a;
}

.grid-table tfoot th,
.grid-table tfoot td {
  border-top: 2px solid var(--line);
  border-bottom: 0;
  vertical-align: top;
}

.grid-total {
  font-size: var(--text-sm);
  white-space: nowrap;
}

.tot {
  display: block;
  line-height: 1.5;
}

.tot-num {
  font-weight: var(--weight-semibold);
}

.tot-yes {
  color: var(--ok);
}

.tot-maybe {
  color: var(--warn);
}

.tot-no {
  color: var(--muted);
}

.grid-empty {
  text-align: left !important;
}

.place-info-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.place-info {
  padding: 0.75rem 1rem;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.place-info[hidden] {
  display: none;
}

.place-info p {
  margin: 0 0 0.2rem;
}

/* Without JS: always show the hint and fade on narrow screens. */
@media (max-width: 639px) {
  .scroll-table:not(.js-scroll) .grid-hint {
    display: block;
  }

  .scroll-table:not(.js-scroll) .grid-frame::after {
    opacity: 1;
  }
}

/* With JS: only when the table really overflows, and not at the end. */
.scroll-table.is-overflowing .grid-hint {
  display: block;
}

.scroll-table.is-overflowing:not(.at-end) .grid-frame::after {
  opacity: 1;
}

.scroll-table.is-scrolled .grid-name {
  box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.18);
}

/* Host and guest page tables with more than TABLE_SCROLL_ROWS (6) body rows:
   the server adds .table-vscroll and data-rows, and the box scrolls
   vertically as well, showing about --vscroll-rows rows. The header row
   sticks to the top, the vote tables' Total row to the bottom, and the name
   column stays sticky. Works without JavaScript; app.js only shows the
   "Scroll to see all N guests" line and the bottom fade while there is more
   below. Admin tables never get the class.

   Height = header + rows x row height + footer, capped below the viewport
   so a phone always keeps page around the box to swipe on. Row height basis
   (measured at 16px): a vote row is 53px (1.75rem icon + 2 x 12px padding
   + 1px border), a Guest list row 47px (one line of 14px text + padding);
   longer names wrap and make a row taller, so "about" 6 rows show. */
.table-vscroll {
  --vscroll-rows: 6;
  --vscroll-row-h: 3.3rem;
  /* Vote tables: date header 90px (121px with a Confirmed badge), Total row 117px. */
  --vscroll-head: 6.65rem;
  --vscroll-foot: 7.3rem;
  --vscroll-cap: 70vh;
}

.table-vscroll.guest-vscroll {
  --vscroll-row-h: 2.95rem;
  /* Guest list: one header row of small capitals (57px), no Total row. */
  --vscroll-head: 3.6rem;
  --vscroll-foot: 0rem;
}

.table-vscroll .grid-scroll {
  max-height: min(calc(var(--vscroll-head) + var(--vscroll-rows) * var(--vscroll-row-h) + var(--vscroll-foot)), var(--vscroll-cap));
  overflow-y: auto;
  /* Sideways stays inside the box; up and down hand over to the page at the
     top and bottom of the table, so a swipe keeps scrolling the page. */
  overscroll-behavior-y: auto;
  /* Keyboard focus inside the table (the place address buttons) stops clear
     of the sticky rows and the sticky name column (app.js measures them;
     these are the estimates without it). */
  scroll-padding-top: var(--vscroll-head-px, var(--vscroll-head));
  scroll-padding-bottom: var(--vscroll-foot-px, var(--vscroll-foot));
  scroll-padding-left: var(--vscroll-name-px, 7.7rem);
}

@supports (height: 1svh) {
  .table-vscroll {
    --vscroll-cap: 70svh;
  }
}

.table-vscroll .grid-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.table-vscroll .grid-table tfoot th,
.table-vscroll .grid-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #fff;
}

/* Corners: the name column's header and Total cells stay above everything. */
.table-vscroll .grid-table thead th.grid-name,
.table-vscroll .grid-table tfoot th.grid-name {
  left: 0;
  z-index: 3;
}

/* Tinted columns: the header and Total cells paint the tint themselves
   (opaque, the same colours as the column). */
.table-vscroll .grid-table th.tint-leading,
.table-vscroll .grid-table td.tint-leading {
  background: var(--ok-soft);
}

.table-vscroll .grid-table th.tint-confirmed,
.table-vscroll .grid-table td.tint-confirmed {
  background: var(--accent-soft);
}

/* The focus ring goes around the whole box, never under a sticky row. */
.table-vscroll .grid-frame:has(.grid-scroll:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@supports selector(:has(a)) {
  .table-vscroll .grid-scroll:focus-visible {
    outline: none;
  }
}

/* Bottom fade while there are more rows below: over the last visible rows,
   just above the sticky Total row in the vote tables. */
.table-vscroll .grid-frame::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2rem;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
  opacity: 1;
  transition: opacity 0.2s;
}

.table-vscroll:not(.guest-vscroll) .grid-frame::before {
  bottom: var(--vscroll-foot-px, var(--vscroll-foot));
}

.table-vscroll.js-vscroll:not(.is-v-overflowing) .grid-frame::before,
.table-vscroll.at-v-end .grid-frame::before {
  opacity: 0;
}

/* "Scroll to see all N guests": below the box (the sideways hint is above
   it). Shown by app.js only while there is more below; it keeps its space
   when hidden at the end, so nothing under it jumps. */
.vscroll-hint {
  margin: 0.4rem 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

.table-vscroll:not(.is-v-overflowing) .vscroll-hint,
.table-vscroll.at-v-end .vscroll-hint {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .table-vscroll .grid-frame::before {
    transition: none;
  }
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  white-space: nowrap;
  background: var(--bg-soft);
}

.badge-accent {
  background: var(--accent);
  color: #fff;
}

.badge-yes {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-maybe {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-no {
  background: var(--bg-soft);
  color: var(--muted);
}

/* Event pages */
.event-layout {
  display: grid;
  gap: var(--space-5);
}

.event-layout > * {
  min-width: 0;
}

/* The side column holds gifts, the wish list and the food link. When the
   event has none, it is empty: take it out so it adds no gap below the last
   card (the grid's columns are fixed, so nothing else moves). */
.event-side:not(:has(> *)) {
  display: none;
}

/* Guest page cards: the same inner rhythm as the reply form and Details
   cards. A card ends at its padding (no stray bottom margin from its last
   paragraph), and a note under a card's controls sits 0.75rem below them. */
.event-page .card > :last-child {
  margin-bottom: 0;
}

.event-page .ride-card > .muted,
.event-page .share + .muted,
.event-page .travel-body > .hint {
  margin-top: var(--space-3);
}

/* Title card: Yes / Maybe / No (or the reply status) with the share button
   beside them. Phones: the three answers share one row (narrow side padding
   so "Maybe" fits at 320px). From 768px each keeps its own width, left-aligned
   with the title. They lead to the reply form (#reply, #respond-heading),
   which lands clear of the sticky header. */
.reply-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--btn-md);
  margin: var(--space-4) 0 0;
}

.reply-jump > .share-icon-btn,
.reply-jump > .share-note {
  flex: none;
  margin-left: 0;
}

.reply-quick {
  display: flex;
  flex: 1 1 0;
  gap: var(--space-2);
  min-width: 0;
}

.reply-quick > .btn {
  flex: 1 1 0;
  min-width: 0;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

.reply-status {
  display: flex;
  flex: 1 1 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-width: 0;
  margin: 0;
}

.reply-status-text {
  font-weight: var(--weight-semibold);
}

@media (min-width: 768px) {
  .reply-quick,
  .reply-status {
    flex: none;
  }

  .reply-quick > .btn {
    flex: none;
    min-width: calc(var(--btn-md) * 2);
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* An empty, zero-height block at the top of the reply form (#reply). */
.reply-anchor {
  display: block;
  scroll-margin-top: 6rem;
}

/* The reply form's fold (a native <details>). Open, with its summary hidden,
   it lays out exactly as the form on its own. "Reply as someone else" (guest
   link, this browser already replied) is a small underlined text link, a
   44px-high target; once open, the form follows it. */
.reply-fold-summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--text);
  font-size: var(--text-sm);
  text-decoration: underline;
  cursor: pointer;
  list-style: none;
}

.reply-fold-summary::-webkit-details-marker {
  display: none;
}

.reply-fold-summary[hidden] {
  display: none;
}

/* Personal reply link page: the title card's "Change" opens it, so folded
   it takes no room (and no gap in the column). */
.reply-fold-mine:not([open]) {
  display: none;
}

.reply-fold[open] > .reply-fold-summary:not([hidden]) {
  margin-bottom: var(--space-2);
}

.reply-recap {
  margin: var(--space-2) 0 0;
}

/* Edit page of an ended event, without JavaScript: the saved dates as text. */
.when-kept {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.when-kept li + li {
  margin-top: var(--space-4);
}

.reopen-hint {
  margin-top: var(--space-3);
}

/* The passed chips are flex rows, which drop the spaces at the edges of the
   ", " and " (passed)" parts; keep them on this page. */
[data-when-keep-passed] span.when-line-main .when-line-sep,
[data-when-keep-passed] span.when-line-main .when-tag {
  white-space: pre;
}

/* Ended event, personal reply link: the saved reply as read-only text. */
.reply-readonly-list {
  display: grid;
  gap: var(--space-4);
  margin: 0;
}

.reply-readonly-list dt {
  font-weight: var(--weight-semibold);
}

.reply-readonly-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.reply-readonly-votes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.reply-readonly-note {
  white-space: pre-line;
}

/* Guest page "Share this event": a 44px outlined icon button beside Reply
   (shown by app.js), a quiet text button under the reply confirmation, a
   short "Link copied" note, and a read-only field if copying is not possible. */
.share-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: var(--space-2);
  padding: 0;
  vertical-align: middle;
  border: 1.5px solid #c9c9c9;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.share-icon-btn[hidden],
.share-note[hidden] {
  display: none;
}

.share-note {
  margin-left: 0.5rem;
  color: var(--muted);
  font-size: var(--text-sm);
  vertical-align: middle;
}

.share-line {
  margin: 0 0 var(--space-5);
}

.alert + .share-line {
  margin-top: -0.5rem;
}

.share-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.share-icon {
  flex: none;
}

.share-fallback {
  margin-top: 0.5rem;
  max-width: 28rem;
}

.share-fallback-hint {
  font-weight: var(--weight-regular);
  color: var(--muted);
  font-size: var(--text-sm);
}

#respond-heading {
  scroll-margin-top: 6rem;
}

/* Host event page: one column below 1024 px, in reading order (no sidebar),
   centred with an 880px content width. Wide tables scroll inside their cards. */
.container.host-page {
  max-width: calc(880px + 2rem);
}

.host-stack > * {
  min-width: 0;
}

/* Host page from 720px wide (narrower screens are untouched). The page uses
   the header's 1120px container; the column inside it is set by variables:
     --host-column-max   the column's maximum width
     --host-column-left  its left margin
     --host-column-right its right margin
   Chosen: 740px, centred in the header container (left and right auto).
   Other options considered:
     780px from the header container's left edge, lined up with the logo:
       --host-column-max: 780px; --host-column-left: 0; --host-column-right: auto;
     the full header container width, logo to account menu:
       --host-column-max: none; --host-column-left: 0; --host-column-right: 0; */
@media (min-width: 720px) {
  .container.host-page {
    --host-column-max: 740px;
    --host-column-left: auto;
    --host-column-right: auto;
    max-width: 1120px;
  }

  .host-page > * {
    max-width: var(--host-column-max);
    margin-left: var(--host-column-left);
    margin-right: var(--host-column-right);
  }

  /* Title card: "Edit event" and "View guest page" at the top right of the
     card body, beside the type label and title; the rest runs full width
     below. Source order (and so reading and Tab order) is unchanged. */
  .host-stack > .event-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-6);
    align-items: start;
  }

  .host-stack > .event-header > * {
    grid-column: 1 / -1;
  }

  .host-stack > .event-header > .eyebrow {
    grid-column: 1;
    grid-row: 2;
  }

  .host-stack > .event-header > h1,
  .host-stack > .event-header > .h1 {
    grid-column: 1;
    grid-row: 3;
    overflow-wrap: anywhere;
  }

  /* 720-899px: the two buttons stacked (equal width), so a long title keeps
     more room; side by side from 900px. */
  .host-stack > .event-header > .button-row {
    grid-column: 2;
    grid-row: 2 / span 2;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  /* Summary: three tiles of up to 150px in one row. */
  .summary-card .stat-list {
    grid-template-columns: repeat(3, minmax(0, 150px));
  }
}

/* Wide enough for the title buttons side by side, and for the headcount and
   notes beside the tiles. */
@media (min-width: 900px) {
  .host-stack > .event-header > .button-row {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .summary-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--space-6);
    align-items: center;
  }

  .summary-card > * {
    grid-column: 1 / -1;
  }

  .summary-card > .stat-list {
    grid-column: 1;
    grid-row: 2 / span 3;
    margin-bottom: 0;
  }

  .summary-card > .stat-list ~ p {
    grid-column: 2;
    margin: 0 0 var(--space-1);
  }
}

/* Host page parts shown at one size only (views/events/host.ejs): the
   desktop-only copies (stat strip, sidebar confirm card or confirmed details,
   the guest list's dietary footer row) are taken out below 1024px, so the
   page there is exactly as before. */
@media not all and (min-width: 1024px) {
  .host-desktop-only {
    display: none;
  }
}

/* Host page from 1024px (desktop). Nothing here applies below 1024px.
   Header card: a shorter banner; the title, "Edit event", "View guest page"
   and the Refresh control on one row (the header is a subgrid of the page
   grid, so the Refresh bar - a separate element after it - sits in the
   header's third column). Then the stat strip across the full width, then
   two columns: main (Votes, Guest list) and a sidebar (Invite guests,
   Confirm the final details or the confirmed details, the edit link, More
   actions). Columns use grid-template-areas, so the markup order stays as
   it is below 1024px; reading-flow makes Tab follow the visual order. */
@media (min-width: 1024px) {
  .container.host-page {
    --host-column-max: none;
    max-width: var(--container-wide);
  }

  .host-mobile-only {
    display: none;
  }

  /* Votes card heading row: the title and "Export votes CSV" (the same
     button as the guest list's Export CSV), 16px to what follows. */
  .host-votes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .host-votes-head .card-title {
    margin: 0;
  }

  .host-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: var(--space-6);
  }

  .host-stack > * {
    grid-column: 1 / -1;
  }

  /* Rows: 1 banner, 2 eyebrow, 3 title, 4 message, 5 account line, 6 the
     card's bottom padding (an empty ::after keeps it when 4-5 are empty). */
  .host-stack > .event-header {
    grid-row: 1 / span 6;
    grid-template-columns: subgrid;
    grid-template-rows: subgrid;
    align-items: start;
  }

  .host-stack > .event-header::after {
    content: '';
    grid-column: 1 / -1;
    grid-row: 6;
  }

  .host-stack > .event-header > .banner-art {
    grid-row: 1;
    height: calc(var(--space-12) + var(--space-4));
    margin-bottom: var(--space-5);
  }

  .host-stack > .event-header > .button-row {
    align-self: center;
  }

  /* Without JavaScript the Refresh bar stays hidden: no third column, so no
     empty slot (or gap) beside the header buttons. */
  .host-stack:has(> .live-bar[hidden]) {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .host-stack > .live-bar {
    grid-column: 3;
    grid-row: 2 / span 2;
    align-self: center;
    flex-wrap: nowrap;
    margin: 0 var(--space-6) 0 0;
    white-space: nowrap;
  }

  .host-stack > .summary-card {
    display: none;
  }

  /* Stat strip: going, maybe, can't go, headcount. */
  .host-stack > .host-stats {
    margin-top: var(--gap-layout);
  }

  .host-stat-strip {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    /* The headcount tile is twice as wide, so its note fits on the line. */
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr);
    gap: var(--gap-layout);
  }

  /* Compact tiles: the number and its label on one line (the headcount
     note follows and wraps if it must). */
  .host-stat-strip > li,
  .host-stat-empty {
    margin: 0;
    padding: var(--space-3) var(--space-4);
  }

  .host-stat-strip > li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--space-2);
    color: var(--muted);
    font-size: var(--text-sm);
  }

  .host-stat-strip .stat-num {
    line-height: var(--lh-xl);
  }

  /* No replies yet: one full-width tile with Summary's line, as tall as a
     tile (the line is as tall as a tile's number). */
  .host-stat-empty {
    line-height: calc(var(--text-xl) * var(--lh-xl));
  }

  /* Two columns below the strip. */
  .host-stack > .host-layout {
    margin-top: var(--gap-layout);
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
    grid-template-areas: 'main side';
    column-gap: var(--gap-layout);
    align-items: start;
  }

  .host-layout > .host-main {
    grid-area: main;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'votes'
      'guests';
    /* Tab follows the visual order (Votes before the Guest list). Firefox
       and Safari don't support reading-flow yet and fall back to the
       underlying (mobile) order until the mobile pass. */
    reading-flow: grid-rows;
  }

  /* Cards are spaced by a bottom margin (the last area never has one), so
     an area with no card adds no space. */
  .host-main > *,
  .host-side > * {
    margin-top: 0;
    min-width: 0;
  }

  .host-main > .host-votes-card {
    grid-area: votes;
    margin-bottom: var(--gap-layout);
  }

  .host-main > [data-live-region='guests'] {
    grid-area: guests;
  }

  /* Sidebar: flows normally in its column (not sticky, no scroll of its own). */
  .host-layout > .host-side {
    grid-area: side;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'invite'
      'details'
      'edit'
      'more';
    /* Tab follows the visual order (More actions last). Firefox and Safari
       fall back to the underlying (mobile) order until the mobile pass. */
    reading-flow: grid-rows;
  }

  .host-side > .invite-card {
    grid-area: invite;
    margin-bottom: var(--gap-layout);
  }

  .host-side > .final-card,
  .host-side > .host-confirm-card {
    grid-area: details;
    margin-bottom: var(--gap-layout);
  }

  .host-side > .host-edit-link-card {
    grid-area: edit;
    margin-bottom: var(--gap-layout);
  }

  .host-side > .host-more {
    grid-area: more;
  }

  /* Confirmed details in the sidebar: When above Where, each full width
     (the map is behind "Show map", as on the guest page). */
  .host-side .final-list {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The confirm form as a card of its own (no divider above it). */
  .host-confirm-card > .confirm-form {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .host-confirm-card > .confirm-form > .card-title {
    margin-top: 0;
  }

  /* Vote tables: the main column's width, roomier cells, no inner vertical
     scroll (the page scrolls). */
  .host-main .vote-grid .grid-table th,
  .host-main .vote-grid .grid-table td {
    padding: var(--space-3) var(--space-4);
  }

  .host-main .table-vscroll .grid-scroll {
    max-height: none;
  }

  .host-main .table-vscroll .grid-frame::before,
  .host-main .vscroll-hint {
    display: none;
  }

  /* Guest list: full height, every column in view, the header row sticky
     below the site header. The box clips (rounded corners) without
     scrolling, so the header sticks to the window. */
  .host-main [data-live-region='guests'] .grid-frame {
    overflow: clip;
  }

  .host-main [data-live-region='guests'] .grid-scroll {
    overflow: visible;
    max-height: none;
  }

  .host-main [data-live-region='guests'] .grid-hint {
    display: none;
  }

  /* Narrow main column (1024px): cells wrap so every column fits. */
  .host-main .guest-table th,
  .host-main .guest-table td {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
    overflow-wrap: break-word;
  }

  .host-main .guest-table .gl-rsvp,
  .host-main .guest-table .gl-dietary {
    white-space: normal;
  }

  .host-main .guest-table .grid-name,
  .host-main .guest-table .gl-extra_guests,
  .host-main .guest-table .gl-allergies,
  .host-main .guest-table .gl-note {
    min-width: 0;
  }

  .host-main .guest-table thead th,
  .host-main .table-vscroll .guest-table thead th {
    position: sticky;
    top: calc(var(--space-12) + var(--space-4));
    z-index: 2;
    background: var(--bg-soft);
  }

  /* Compact rows (about 44px), as in the vote tables. */
  .host-main .guest-table tbody th,
  .host-main .guest-table tbody td {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }

  .host-main .guest-table tbody tr {
    height: var(--tap-min);
  }

  .host-main .guest-table thead th.grid-name {
    z-index: 3;
  }

  /* Dietary summary as the guest list's footer row. */
  .guest-dietary-foot th,
  .guest-dietary-foot td {
    border-top: thin solid var(--line);
    border-bottom: 0;
    background: var(--bg-soft);
  }

  .dietary-inline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
  }
}

/* Host page from 1024px: the ranked vote view with the full table behind
   "Show who voted what" (views/partials/vote-ranked.ejs), "Reopen voting"
   in the sidebar's confirmed card, and the guest list's filter chips and
   sortable headers (app.js, initGuestTables). Nothing here applies below
   1024px; those parts are not shown there. */
@media (min-width: 1024px) {
  /* Legend: a swatch and the answer, one small line above the bars. */
  .vr-legend {
    list-style: none;
    margin: var(--space-2) 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    font-size: var(--text-xs);
    color: var(--muted);
  }

  .vr-legend > li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
  }

  .vr-swatch {
    flex: none;
    width: var(--space-3);
    height: var(--space-3);
    border-radius: var(--radius-sm);
  }

  .vr-swatch-yes {
    background: var(--vote-yes);
  }

  .vr-swatch-maybe {
    background: var(--vote-maybe);
  }

  .vr-swatch-no {
    background: var(--vote-no);
  }

  /* Label, bar, count: one grid shared by every row (subgrid), so the bars
     line up whatever the length of the count. */
  .vote-ranked {
    list-style: none;
    margin: var(--space-3) 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto;
    column-gap: var(--space-4);
    row-gap: var(--space-3);
  }

  .vr-row {
    position: relative;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    align-items: center;
  }

  .vr-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    min-width: 0;
  }

  .vr-name {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .vr-row.is-leading .vr-name {
    font-weight: var(--weight-semibold);
  }

  .vr-bar {
    display: block;
    width: 100%;
    height: var(--space-3);
    border-radius: var(--radius-sm);
    overflow: hidden;
  }

  .vr-track {
    fill: var(--bg-soft);
  }

  .vr-yes {
    fill: var(--vote-yes);
  }

  .vr-maybe {
    fill: var(--vote-maybe);
  }

  .vr-no {
    fill: var(--vote-no);
  }

  /* A 2px card-coloured gap between segments, whatever the bar's scale. */
  .vr-sep {
    stroke: #fff;
    stroke-width: calc(var(--space-1) / 2);
    vector-effect: non-scaling-stroke;
  }

  .vr-count {
    min-width: var(--btn-lg);
    text-align: right;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .vote-none {
    margin: var(--space-2) 0 var(--space-1);
  }

  .vote-plain {
    margin: 0;
    padding-left: var(--space-5);
  }

  .vote-plain > li + li {
    margin-top: var(--space-1);
  }

  .vote-details {
    margin-top: var(--space-3);
  }

  .vote-details > summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: fit-content;
    min-height: var(--tap-min);
    cursor: pointer;
    list-style: none;
    font-weight: var(--weight-semibold);
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

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

  .vote-details[open] > summary .cal-caret {
    transform: rotate(180deg);
  }

  /* The table inside "Show who voted what" (vote-grid.ejs, desk): one-line
     headers and totals, compact rows (about 44px), the header row on a
     light neutral tint (tinted columns keep their own tint). */
  /* (Three classes: after, so it wins over the host page's roomier cells.) */
  .vote-grid.vg-desk .grid-table th,
  .vote-grid.vg-desk .grid-table td {
    padding: var(--space-2) var(--space-3);
  }

  .vg-desk .grid-table tbody tr {
    height: var(--tap-min);
  }

  .vg-desk .grid-table thead th,
  .vg-desk.table-vscroll .grid-table thead th {
    vertical-align: middle;
    background: var(--bg-soft);
    white-space: normal;
  }

  .vg-desk .grid-table thead th.tint-leading {
    background: var(--ok-soft);
  }

  .vg-desk .grid-table thead th.tint-confirmed {
    background: var(--accent-soft);
  }

  /* Names wrap only when longer than the column (at word breaks). */
  .vg-desk .grid-name {
    overflow-wrap: break-word;
  }

  .vg-desk .grid-opt,
  .vg-desk .grid-opt-place {
    min-width: 0;
  }

  /* Label, then the badge or map button on the same line; a header wraps
     only between its whole parts, when there is no room for one line. */
  .vg-desk .opt-head {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    column-gap: var(--space-1);
  }

  .vg-desk .dh-seg,
  .vg-desk .ph-name,
  .vg-desk .grid-badge {
    white-space: nowrap;
  }

  .vg-desk .dh-seg {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
  }

  /* No room for one line (app.js, is-stacked): the date, then the time
     without the "·", then the badge, each on its own line. */
  .vg-desk .is-stacked .opt-head {
    flex-direction: column;
  }

  .vg-desk .is-stacked .dh-sep {
    display: none;
  }

  .vg-desk .is-stacked .grid-badge {
    margin: var(--space-1) 0 0;
  }

  .vg-desk .dh-passed {
    font-weight: var(--weight-regular);
    color: var(--muted);
  }

  .vg-desk .ph-name {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
  }

  .vg-desk .grid-badge {
    display: inline-block;
    margin: 0 0 0 var(--space-1);
  }

  /* Map icon button: a 16px icon, padded to a 44px target; the negative
     margins keep the header row as low as the text. */
  .ph-map {
    flex: none;
    display: inline-grid;
    place-items: center;
    padding: calc((var(--tap-min) - var(--icon-sm)) / 2);
    margin: calc((var(--tap-min) - var(--icon-sm)) / -2) calc((var(--tap-min) - var(--icon-sm)) / -2) calc((var(--tap-min) - var(--icon-sm)) / -2) 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--muted);
    cursor: pointer;
  }

  .ph-map[hidden] {
    display: none;
  }

  .ph-map svg {
    display: block;
    width: var(--icon-sm);
    height: var(--icon-sm);
  }

  .ph-map[aria-expanded='true'] {
    color: var(--accent);
  }

  @media (hover: hover) and (pointer: fine) {
    .ph-map:hover {
      color: var(--text);
    }
  }

  /* Vote icons one step smaller (24px). */
  .vg-desk .vi {
    width: var(--icon-lg);
    height: var(--icon-lg);
    font-size: var(--text-sm);
  }

  /* Totals on one line: "✓ 2 · ? 0 · ✗ 0", then the badge. */
  /* The Totals row on the header row's tint (as the guest list's dietary
     row); the confirmed and leading columns keep their own tint there. */
  .vg-desk .grid-table tfoot th,
  .vg-desk .grid-table tfoot td,
  .vg-desk.table-vscroll .grid-table tfoot th,
  .vg-desk.table-vscroll .grid-table tfoot td {
    vertical-align: middle;
    background: var(--bg-soft);
  }

  .vg-desk .grid-table tfoot td.tint-leading {
    background: var(--ok-soft);
  }

  .vg-desk .grid-table tfoot td.tint-confirmed {
    background: var(--accent-soft);
  }

  .vg-desk .grid-total {
    white-space: normal;
  }

  .vg-desk .tot-line {
    white-space: nowrap;
  }

  .vg-desk .tot {
    display: inline;
    line-height: var(--lh-sm);
  }

  .vg-desk .tot-sep {
    color: var(--muted);
  }

  /* "Reopen voting" at the bottom of the sidebar's confirmed card. */
  .final-reopen {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: thin solid var(--divider);
  }

  .final-reopen > .hint {
    margin: 0;
  }

  /* Guest list filter chips (aria-pressed): the chosen one on a brand tint, bold. */
  .gl-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
  }

  .gl-chip {
    min-height: var(--tap-min);
    padding: 0 var(--space-4);
    border: thin solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    cursor: pointer;
  }

  .gl-chip[aria-pressed='true'] {
    border-color: var(--accent);
    background: var(--accent-soft);
    font-weight: var(--weight-bold);
  }

  .gl-chip-count {
    margin-left: var(--space-1);
    color: var(--muted);
  }

  .gl-chip[aria-pressed='true'] .gl-chip-count {
    color: var(--text);
  }

  /* Sortable headers: the button replaces the plain label once app.js runs. */
  .guest-table.js-sort .gl-th-text {
    display: none;
  }

  .gl-sort {
    display: inline-flex;
    /* Text on the same line as the other (bottom-aligned) headers. */
    align-items: flex-end;
    gap: var(--space-2);
    min-height: var(--tap-min);
    /* Part of the taller tap area sits in the cell's top padding. */
    margin-top: calc(var(--space-3) * -1);
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: left;
    cursor: pointer;
  }

  /* Up and down arrows as two marks with a small gap between them. */
  .gl-sort-icon {
    flex: none;
    display: inline-flex;
    flex-direction: column;
    gap: calc(var(--space-1) / 2);
    color: var(--muted);
  }

  .gl-sort-icon > svg {
    display: block;
    width: var(--icon-sm);
    height: calc(var(--icon-sm) / 2);
  }

  th[aria-sort] .gl-sort-icon {
    color: var(--text);
  }

  th[aria-sort='ascending'] .gl-sort-down,
  th[aria-sort='descending'] .gl-sort-up {
    visibility: hidden;
  }

  .guest-table tr.gl-filtered-out {
    display: none;
  }

  .gl-none {
    margin: var(--space-3) 0 0;
  }
}

/* Guest page parts shown at one size only (views/events/show.ejs): the side
   column's "Who's coming" and votes (event-aside) are taken out below
   1024px, so the page there is exactly as before. */
@media not all and (min-width: 1024px) {
  .guest-desktop-only {
    display: none;
  }
}

/* Guest page from 1024px (desktop). Nothing here applies below 1024px.
   The page container is --container-wide (centred), then two columns:
     main: the title card, the confirmed details or the place card, the
           reply form (or the read-only reply), the travel and ride cards
     side: Who's coming, the votes so far, then gifts, the wish list and
           the food link (event-side) when their features are on
   The side column flows with the page (not sticky). Markup order is the
   visual order (main, event-aside, event-side), so Tab follows it. */
@media (min-width: 1024px) {
  .guest-mobile-only {
    display: none;
  }

  .event-page .event-layout {
    grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
    /* Row 1 holds event-aside; row 2 takes whatever height the main column
       needs beyond it, so event-side follows event-aside without a gap. */
    grid-template-rows: auto 1fr;
    column-gap: var(--gap-layout);
    row-gap: 0;
  }

  .event-page .event-layout > .event-main {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .event-page .event-layout > .event-aside {
    grid-column: 2;
    grid-row: 1;
  }

  .event-page .event-layout > .event-side {
    grid-column: 2;
    grid-row: 2;
    position: static;
  }

  .event-aside > * + *,
  .event-aside + .event-side {
    margin-top: var(--gap-layout);
  }

  /* Nothing for the side column: the main column alone, centred. */
  .event-page .event-layout:not(:has(> .event-aside > *, > .event-side > *)) {
    grid-template-columns: minmax(0, calc(var(--container-wide) - var(--sidebar-w)));
    justify-content: center;
  }

  /* Who's coming: compact tiles (the number and its label on one line, as
     on the host page's stat strip), then the headcount line. The tiles
     share the row by their content; a tile that no longer fits (a very
     large count) moves to the next line whole. */
  .guest-stat-strip {
    list-style: none;
    margin: 0 0 var(--space-3);
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .guest-stat-strip > li {
    flex: 1 1 auto;
    display: flex;
    align-items: baseline;
    column-gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    white-space: nowrap;
    background: var(--bg-soft);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: var(--text-sm);
  }

  .guest-stat-strip .stat-num {
    display: inline;
    line-height: var(--lh-xl);
  }

  /* Votes so far: the host page's ranked view (vote-ranked.ejs), fitted to
     the side column: each option's name (and badge) on its own line, the
     bar and the count below it. */
  .event-aside .vote-ranked {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-3);
  }

  .event-aside .vr-row {
    row-gap: var(--space-1);
  }

  .event-aside .vr-label {
    grid-column: 1 / -1;
  }

  /* Reply form, Dates and Places: the choices sit right after the option
     text. Each group is a grid (option column as wide as its longest
     option, then the buttons), and each row uses it (subgrid); the empty
     last column keeps the lines between rows full width. */
  #respond .vote-group[data-vote-group] {
    display: grid;
    grid-template-columns: minmax(min-content, max-content) auto minmax(0, 1fr);
    column-gap: var(--space-6);
  }

  #respond .vote-group[data-vote-group] > * {
    grid-column: 1 / -1;
  }

  #respond .vote-group[data-vote-group] > .vote-row {
    display: grid;
    grid-template-columns: subgrid;
    column-gap: var(--space-6);
  }

  /* (A long place keeps its top alignment: the thumbs level with line one.) */
  #respond .vote-group[data-vote-group] > .vote-row:not(.place-vote-row-fold) {
    align-items: center;
  }

  #respond .vote-group[data-vote-group] .vote-label,
  #respond .vote-group[data-vote-group] .place-address-more {
    grid-column: 1;
  }

  #respond .vote-group[data-vote-group] .date-choices,
  #respond .vote-group[data-vote-group] .thumbs {
    grid-column: 2;
    margin-left: 0;
  }
}

/* "Share your invite link" (Summary with no replies) lands below the sticky header. */
.invite-anchor {
  scroll-margin-top: 6rem;
}

.event-side > * + * {
  margin-top: var(--space-5);
}

.event-message {
  white-space: pre-line;
  font-size: var(--text-base);
}

.final-card {
  border: 2px solid var(--accent);
}

.final-card-ended {
  border: 1px solid var(--line);
  box-shadow: none;
}

.final-list {
  margin: 0;
  display: grid;
  gap: var(--space-4);
}

/* WHEN on a soft tint, WHERE on the card; both padded alike so their text lines up. */
.final-block {
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
}

.final-when {
  background: var(--brand-info-tint);
}

.final-list dt {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  font-weight: var(--weight-semibold);
  color: var(--muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.final-icon {
  flex: none;
}

.final-list dd {
  margin: 0;
  font-size: var(--text-base);
  overflow-wrap: anywhere;
}

.final-card .place-map {
  margin-top: var(--space-3);
}

/* Two equal buttons in one row. "Add to calendar" is a <details>: it spans
   the row, its summary takes the left half and the list opens inline below;
   "Open in maps" sits in the right half of the first row. */
.final-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.final-actions .btn {
    padding-left: var(--space-3);
  padding-right: var(--space-3);
  white-space: nowrap;
}

.cal-menu {
  grid-column: 1 / -1;
  grid-row: 1;
}

.cal-menu > summary {
  width: calc(50% - 0.25rem);
  list-style: none;
}

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

.final-map-link {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.final-actions-single .final-map-link {
  grid-column: 1 / -1;
}

.cal-caret {
  flex: none;
  transition: transform 0.15s;
}

.cal-menu[open] > summary .cal-caret {
  transform: rotate(180deg);
}

.cal-list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: var(--space-1) 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.cal-list a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 var(--space-4);
  font-weight: var(--weight-semibold);
}

.cal-list li + li {
  border-top: 1px solid var(--line);
}

/* Both labels fit side by side, at equal width and on one line, from 349px
   (measured: "Open in maps" needs about 133px with 12px padding). Only below
   that do the two buttons stack. */
@media (max-width: 348px) {
  .final-actions {
    grid-template-columns: 1fr;
  }

  .cal-menu > summary {
    width: 100%;
  }

  .final-map-link {
    grid-column: 1;
    grid-row: 2;
  }
}

@media (min-width: 720px) {
  .final-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cal-caret {
    transition: none;
  }
}

.stat-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  text-align: center;
}

.stat-list li {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-2);
  color: var(--muted);
  font-size: var(--text-sm);
}

.stat-num {
  display: block;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text);
}

/* Summary card (host) and "Who's coming" (guest): the headcount figure and
   its "people" word stand out: bold, a little larger and in the brand colour
   (5.6:1 on white; the weight and size mean colour is never the only
   signal). The figure stays on one line; the bracket after it may wrap. */
.headcount-figure {
  color: var(--accent);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  white-space: nowrap;
}

.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plain-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--divider);
}

.plain-list li:first-child {
  border-top: 0;
}

/* A long name or answer without spaces wraps instead of widening the page. */
.plain-list li > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.share > * + * {
  margin-top: var(--space-4);
}

.copy-field {
  display: flex;
  gap: var(--space-2);
}

.copy-field {
  flex-wrap: wrap;
}

.copy-field input {
  flex: 1 1 11rem;
  min-width: 0;
  background: var(--bg-soft);
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.share-buttons .btn {
  flex: 1 1 auto;
}

/* "Send a reminder" (host Invite guests card): a full-width row under the
   sharing buttons, with a small bell. */
.share-buttons .share-reminder {
  flex-basis: 100%;
}

/* The recovery email box comes after the edit form (it is its own form), so it
   is outside the form's .stack: give it the same gap as the cards above it. */
.recovery-card {
  margin-top: var(--space-5);
}

.created-card {
  border: 2px solid var(--accent);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-lg);
}

.confirm-form {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}

/* Host Guest List: same scroll box as the vote tables, text left-aligned. */
.guest-table th,
.guest-table td {
  text-align: left;
  vertical-align: top;
}

.guest-table .grid-name {
  /* 5.5rem with 8px on the right before; 12px now. */
  min-width: 5.75rem;
  padding-left: var(--space-3);
}

.guest-table thead th {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: var(--lh-xs);
  color: var(--muted);
  vertical-align: bottom;
  white-space: normal;
}

.guest-table tbody th.grid-name {
  font-weight: var(--weight-semibold);
}

.gl-rsvp,
.gl-dietary {
  white-space: nowrap;
}

.gl-extra_guests {
  min-width: 4.5rem;
  text-align: center !important;
}

.gl-allergies {
  min-width: 8.5rem;
}

.gl-note {
  min-width: 9rem;
  white-space: pre-line;
}

.cell-empty {
  color: #8a8a8a;
}

.auth-card {
  max-width: 480px;
  margin: 0 auto;
}

.email-link-form,
.claim-form {
  margin-top: var(--space-4);
}

.event-list {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0;
  display: grid;
  gap: var(--space-5);
}

.event-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: box-shadow 0.15s;
}

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

.event-card-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--text);
  text-decoration: none;
}

.event-card-link:hover {
  color: var(--text);
}

.event-card-actions {
  display: flex;
  gap: var(--space-2);
  margin: 0 calc(-1 * var(--space-2)) calc(-1 * var(--space-2));
}

.event-card-past {
  background: var(--bg-soft);
  box-shadow: none;
}

/* The event's banner look as a small corner piece, cut diagonally, in the
   card's empty upper-right area (My events). Decorative only (aria-hidden),
   static (no animation), and kept clear of the text: the eyebrow and title
   leave room on the right for the widest part of the cut. */
.event-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 5.5rem;
  height: 4rem;
  border-top-right-radius: calc(var(--radius-lg) - 1px);
  clip-path: polygon(40% 0, 100% 0, 100% 100%);
  pointer-events: none;
}

.event-card .eyebrow,
.event-card-title {
  padding-right: 2.5rem;
}

/* Ended events: calm and muted. */
.event-card-past .event-corner {
  filter: grayscale(1);
  opacity: 0.4;
}

.section-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-lg);
  margin: var(--space-6) 0 var(--space-2);
}

.past-events {
  margin-top: var(--space-8);
  border-top: 1px solid var(--line);
}

.past-events summary {
  cursor: pointer;
  list-style: revert;
}

.past-events summary .section-subtitle {
  margin: var(--space-4) 0;
}

.count-pill {
  display: inline-block;
  min-width: 1.6rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: var(--text-xs);
  text-align: center;
}

.event-card-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

/* Very narrow phones: logo only, so the navigation fits on one line. */
@media (max-width: 400px) {
  .brand span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
}

/* Tablet */
@media (min-width: 640px) {
  /* Only the sides: the shorthand used to reset .section's top and bottom
     padding to 0 between 640px and 959px. */
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }

  .hide-sm {
    display: inline-block;
  }

  h1,
  .h1 {
  }

  .hero {
    padding: var(--space-12) 0 var(--space-8);
  }

  .hero-title {
  }

  .hero-actions,
  .form-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  /* 28px above and below (no token fits), 24px at the sides. */
  .card {
    --card-pad-y: 1.75rem;
    --card-pad-x: var(--space-6);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .event-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .option-row {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
  }

  .option-row > .field {
    grid-column: auto;
  }

  .option-row > [data-remove-row] {
    grid-column: 3;
    grid-row: 1;
    align-self: end;
  }

  .radio-grid {
    grid-template-columns: 1fr 1fr;
  }

  .vote-row {
    display: grid;
    grid-template-columns: 1fr 18rem;
    align-items: center;
    gap: var(--space-4);
  }

  .vote-label {
    margin: 0;
  }

  .footer-inner {
    grid-template-columns: 1fr 2fr;
    align-items: start;
  }

  .footer-inner > .small {
    grid-column: 1 / -1;
  }

  .footer-social {
    grid-column: 2;
  }

  .cta-card {
    --card-pad-y: var(--space-12);
  }
}

/* Desktop */
@media (min-width: 960px) {
  .section {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }

  .event-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }

  .event-side {
    position: sticky;
    top: 84px;
  }
}

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

/* Map preview (Maps Embed API, FEATURE_PLACES). */
.place-map {
  margin-top: var(--space-2);
}

.place-map iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 220px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

/* Guest page: the map behind a closed "Show map" disclosure (place-map.ejs);
   the label reads "Hide map" while it is open. */
.map-disclosure {
  margin-top: var(--space-4);
}

.map-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  min-height: 2.75rem;
  cursor: pointer;
  list-style: none;
  font-weight: var(--weight-semibold);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.map-disclosure > summary::-webkit-details-marker {
  display: none;
}

.map-disclosure[open] .map-label-show,
.map-disclosure:not([open]) .map-label-hide {
  display: none;
}

.map-disclosure[open] > summary .cal-caret {
  transform: rotate(180deg);
}

.map-disclosure .place-map {
  margin-top: var(--space-1);
}

.map-disclosure .place-map .hint {
  margin: 0;
}

/* Place search suggestions (FEATURE_PLACES). */
.option-row .field,
.where-editor .field {
  position: relative;
}

.places-popup {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.places-popup[hidden] {
  display: none;
}

.places-popup ul {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
}

.places-popup [role='option'] {
  display: flex;
  flex-direction: column;
  min-height: var(--tap);
  justify-content: center;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}

.places-popup [role='option']:hover,
.places-popup [role='option'][aria-selected='true'] {
  background: var(--accent-soft);
}

.places-main {
  font-weight: var(--weight-semibold);
}

.places-secondary {
  color: var(--muted);
  font-size: var(--text-sm);
}

.places-attribution {
  margin: 0;
  padding: 0.3rem 0.85rem 0.45rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
  text-align: right;
}

/* Travel time (FEATURE_TRAVEL_TIME). */
.travel-card[hidden] {
  display: none;
}

.travel-result {
  margin: 0.75rem 0 0;
  font-weight: var(--weight-semibold);
}

.travel-result:empty {
  display: none;
}

/* Admin list tools: filter links, export button, sortable headers. */
.admin-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.5rem 0 0.25rem;
}

.admin-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.admin-filter-label {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-right: 0.15rem;
}

.admin-filter-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: var(--text-sm);
  text-decoration: none;
}

.admin-filter-link:hover {
  border-color: var(--accent);
}

.admin-filter-link[aria-current='page'] {
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: var(--weight-semibold);
}

.admin-export {
  margin-left: auto;
}

.admin-scope {
  margin: 0.5rem 0 0;
  font-size: var(--text-sm);
}

.sort-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.sort-link:hover {
  text-decoration: underline;
}

.cell-num {
  font-variant-numeric: tabular-nums;
}

/* A second, smaller line in a number cell (admin: "Last opened <date>"). */
.cell-sub {
  display: block;
  white-space: nowrap;
}

/* Admin "Countries": the filter form (label above; the select and Show
   button on one row, wrapping on narrow screens), numbers right-aligned, and
   each day's "Day total" row in semibold. Tokens only. */
.countries-intro .hint {
  margin: 0 0 var(--space-1);
}

.countries-filter {
  margin: var(--space-3) 0 var(--space-2);
}

.countries-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.countries-filter-row select {
  width: auto;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
}

.grid-table.admin-table .cell-end {
  text-align: right;
}

.grid-table.admin-table tr.row-day-total > * {
  font-weight: var(--weight-semibold);
}

/* DT7: admin pages on desktop (from 1024px). Below 1024px nothing changes:
   the stat strip and the header Export button are desktop-only and hidden
   there. */
.admin .admin-stat-strip,
.admin .admin-export-head {
  display: none;
}

@media (min-width: 1024px) {
  .admin {
    /* Below the sticky site header (its height: logo row plus padding). */
    --admin-sticky-top: calc(var(--space-12) + var(--space-4));
  }

  /* Header: tabs and Log out on one row; the first tab's text and the Log
     out button line up with the content edges. */
  .admin-bar {
    flex-wrap: nowrap;
  }

  .admin-tabs > .admin-tab:first-child {
    padding-left: 0;
  }

  .admin-logout {
    margin: 0;
    flex: none;
  }

  /* Page title row: the title, and the list's Export CSV at the right. */
  .admin-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-5);
  }

  .admin-head {
    margin-bottom: var(--space-3);
  }

  .admin-head > h1 {
    margin-bottom: 0;
  }

  .admin .admin-export-head {
    display: inline-flex;
    flex: none;
  }

  .admin .admin-tools .admin-export {
    display: none;
  }

  .admin .admin-tools:not(:has(.admin-filter)) {
    display: none;
  }

  /* Overview: one compact stat strip instead of the six cards. */
  .admin [data-live-region='stats'].admin-stats {
    display: block;
  }

  .admin .stat-card,
  .admin [data-live-region='opens'] > .admin-stats {
    display: none;
  }

  .admin .admin-stat-strip {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
  }

  .admin-stat-tile {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-1) var(--space-5);
    color: var(--muted);
    font-size: var(--text-sm);
  }

  .admin-stat-label {
    flex-basis: 100%;
    font-weight: var(--weight-semibold);
  }

  .admin-stat-pair {
    white-space: nowrap;
  }

  .admin-stat-num {
    color: var(--text);
    font-size: var(--text-xl);
    line-height: var(--lh-xl);
    font-weight: var(--weight-bold);
    font-variant-numeric: tabular-nums;
  }

  /* Tables: full height (no inner scroll, fade or "Scroll to see all"), the
     header row sticks below the site header as the page scrolls. */
  .admin .scroll-table .grid-frame,
  .admin .scroll-table .grid-scroll,
  .admin .table-vscroll .grid-scroll {
    overflow: visible;
    max-height: none;
  }

  .admin .scroll-table .grid-frame::before,
  .admin .scroll-table .grid-frame::after,
  .admin .scroll-table .grid-hint,
  .admin .scroll-table .vscroll-hint {
    display: none;
  }

  .admin .grid-table.admin-table thead th {
    position: sticky;
    top: var(--admin-sticky-top);
    z-index: 3;
    background: #fff;
  }

  .admin .grid-table.admin-table thead th:first-child {
    border-top-left-radius: var(--radius);
  }

  .admin .grid-table.admin-table thead th:last-child {
    border-top-right-radius: var(--radius);
  }

  /* The frame no longer clips, so the corner cells follow its round corners. */
  .admin .grid-table.admin-table > :last-child > tr:last-child > :first-child {
    border-bottom-left-radius: var(--radius);
  }

  .admin .grid-table.admin-table > :last-child > tr:last-child > :last-child {
    border-bottom-right-radius: var(--radius);
  }

  .admin .table-vscroll .grid-table tfoot th,
  .admin .table-vscroll .grid-table tfoot td {
    position: static;
  }

  .admin .grid-table.admin-table tbody .grid-name {
    position: static;
    max-width: 20rem;
  }

  .admin .scroll-table.is-scrolled .grid-name {
    box-shadow: none;
  }

  /* Numbers right-aligned (cells and their headers). */
  .admin .grid-table.admin-table .col-num {
    text-align: right;
  }

  /* Long values wrap rather than widen the page. */
  .admin .grid-table.admin-table .cell-wrap,
  .admin .grid-table.admin-table tbody .grid-name {
    overflow-wrap: anywhere;
  }

  .admin .grid-table.admin-table td.cell-actions,
  .admin .grid-table.admin-table .cell-sub,
  .admin .grid-table.admin-table .text-link-sm,
  .admin .grid-table.admin-table thead th {
    white-space: normal;
  }

  /* Feature flags: the flag name stays on one line. */
  .admin .grid-table.admin-table [data-flag] > th {
    max-width: none;
    white-space: nowrap;
  }
}

/* DT7: from 1280px the admin table headers have room to stay on one line. */
@media (min-width: 1280px) {
  .admin .grid-table.admin-table thead th {
    white-space: nowrap;
  }
}

/* Gift and wishlist links: destination host and affiliate disclosure. */
.gift-list .link-host {
  display: block;
}

.link-host {
  margin: 0.4rem 0 0;
}

.affiliate-note {
  margin: 0.75rem 0 0;
}

/* Analytics consent (FEATURE_ANALYTICS). */
.link-button {
  background: none;
  border: 0;
  padding: 0.4rem 0;
  color: var(--text);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.link-button[hidden] {
  display: none;
}

/* The banner is a card floating 8px above the bottom of the screen (and
   above the safe area), clearly apart from the page: rounded, a border and a
   soft shadow. No backdrop and no scroll lock; while it is open, analytics.js
   pads the page by the space it takes, so nothing is ever left under it.
   Taller content (the Choose panel) scrolls inside it, up to 85% of the
   screen. */
.consent-banner {
  position: fixed;
  z-index: 50;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  max-width: 960px;
  margin: 0 auto;
  max-height: calc(85vh - 16px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid #cfcfcf;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 0.625rem 0.875rem;
}

.consent-banner[hidden] {
  display: none;
}

.consent-banner .consent-inner {
  display: grid;
  gap: 0.5rem;
  max-width: none;
  padding: 0;
}

.consent-title {
  font-size: var(--text-base);
  line-height: 1.25;
  margin: 0 0 0.125rem;
}

.consent-text p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.consent-text p + p {
  margin-top: 0.25rem;
}

.consent-text p:empty {
  display: none;
}

/* Accept and Decline: the same size, style and weight, side by side; Choose
   after them. */
.consent-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.consent-actions [data-consent-accept],
.consent-actions [data-consent-decline] {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--tap);
}

@media (min-width: 720px) {
  .consent-banner .consent-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 1.25rem;
  }

  .consent-actions [data-consent-accept],
  .consent-actions [data-consent-decline] {
    flex: 0 0 7.5rem;
  }
}

/* Error pages. */
.error-mark {
  display: block;
  margin: 0 auto var(--space-3);
}

.error-help {
  max-width: 32rem;
  margin: 0 auto var(--space-4);
  padding-left: 1.2rem;
  text-align: left;
}

.error-actions {
  justify-content: center;
}

.error-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* Skip-link target: focusable for older browsers, no visible ring on the region itself. */
.site-main:focus {
  outline: none;
}

/* Show/hide password: a button inside the field (44px tap target). */
.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 3.25rem;
}

.pw-toggle {
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.pw-toggle[hidden] {
  display: none;
}

.pw-toggle:active {
  background: var(--accent-soft);
}

.pw-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

@media (hover: hover) {
  .pw-toggle:hover {
    color: var(--text);
  }
}

.pw-toggle .pw-icon-hide,
.pw-toggle[aria-pressed='true'] .pw-icon-show {
  display: none;
}

.pw-toggle[aria-pressed='true'] .pw-icon-hide {
  display: block;
}

/* Feedback on the part of a form being used: only a very light shadow
   around it while focus is inside (keyboard, tap or click), and the same on
   hover with a real mouse. The border keeps its colour and the background
   never changes, so there is no tint flash on touch and a finger scrolling
   over a card shows nothing (no :active styles). The browser's grey tap
   flash is off here: the shadow is the feedback. Nothing here changes
   layout: .ia-section (a group inside the reply form) draws its frame on a
   pseudo-element outside its box. */
.ia-card {
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s ease;
}

.ia-card:focus-within {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.ia-section {
  position: relative;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

/* A fieldset's legend sits above the box the frame is positioned in, so the
   frame reaches up by the legend's height (one line at 1.02rem, line-height
   1.55, plus its 0.25rem margin) to take in the group's heading too. */
fieldset.vote-group.ia-section::before {
  top: calc(-0.6rem - 1.02rem * 1.55 - 0.25rem);
}

.ia-section::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -0.6rem -0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  pointer-events: none;
  transition: box-shadow 0.15s ease;
}

.ia-section:focus-within::before {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

/* A real mouse only (iPhone and most touch screens report hover: none). */
@media (hover: hover) and (pointer: fine) {
  .ia-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  }

  .ia-section:hover::before {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ia-card,
  .ia-section::before {
    transition: none;
  }
}

.form-card .vote-group + .reply-details {
  margin-top: var(--space-6);
}

.form-card .reply-details + .btn {
  margin-top: var(--space-4);
}

/* "Refresh" bar (host page, admin pages): the button and when it last updated. */
.live-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.live-bar[hidden] {
  display: none;
}

.live-bar [aria-busy='true'] {
  opacity: 0.7;
  cursor: progress;
}

.admin .live-bar {
  margin: 0.25rem 0 1rem;
}

/* Two-purpose consent banner (FEATURE_AD_MEASUREMENT): both purposes in the
   same style, Accept / Decline identical, "Choose" opens two switches. */
/* Inside "Choose": what the choice means, then the two switches. */
.consent-notes {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.consent-notes li + li {
  margin-top: 0.2rem;
}

.consent-actions .consent-choose {
  flex: none;
  min-height: var(--tap);
  padding: 0 0.5rem;
}

.consent-choices {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.consent-choices[hidden] {
  display: none;
}

.consent-choices-title {
  font-weight: var(--weight-semibold);
  margin: 0 0 0.5rem;
}

.consent-switch {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.consent-switch label {
  font-weight: var(--weight-semibold);
  min-height: var(--tap);
  display: flex;
  align-items: center;
  cursor: pointer;
}

.consent-switch .hint {
  grid-column: 2;
  margin-top: 0;
}

/* A native checkbox drawn as a switch (still a checkbox for keyboards and
   screen readers, announced as a switch). Off by default. */
.consent-switch input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  width: 2.75rem;
  height: 1.6rem;
  margin: 0;
  border-radius: 999px;
  border: 2px solid var(--muted);
  background: var(--bg-soft);
  position: relative;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.consent-switch input[type='checkbox']::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.consent-switch input[type='checkbox']:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.consent-switch input[type='checkbox']:checked::after {
  background: #fff;
  transform: translateX(1.15rem);
}

.consent-switch input[type='checkbox']:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .consent-switch input[type='checkbox'],
  .consent-switch input[type='checkbox']::after {
    transition: none;
  }
}

/* Admin: second filter row (recovery email) and the "Send new edit link" action. */
.admin-filter-second {
  margin: 0.5rem 0;
}

.text-link-sm {
  margin-left: 0.5rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

/* Banner looks (config/banners.js; colours per look in banners.css, from the
   --brand-banner-* and --brand-panel-* variables). The artwork is decorative
   and takes its colours by inheritance: fill = colour 1, currentColor =
   colour 2, stroke = colour 3 (only on shapes that set a stroke width). */
.banner-art {
  display: block;
  overflow: hidden;
  background: var(--look-bg, var(--bg-soft));
  fill: var(--look-1, var(--accent));
  color: var(--look-2, var(--accent-soft));
  stroke: var(--look-3, var(--text));
  stroke-width: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.banner-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* The event header: artwork across the top, then the title and details on a
   solid panel (contrast checked for every look). */
.banner-card {
  background: var(--look-panel, #fff);
  padding-top: 0;
  overflow: hidden;
}

.banner-card > .banner-art {
  height: 104px;
  margin: 0 calc(-1 * var(--card-pad-x)) var(--space-5);
  border-bottom: 1px solid var(--line);
}

.banner-card > .banner-art svg {
  animation: banner-in 0.6s ease-out both;
}

@keyframes banner-in {
  from {
    transform: translateY(6px);
    opacity: 0.4;
  }
}

/* "Change look" on the create and edit forms, first in "The basics": the
   current look as a strip across the top of the card, flush with its top and
   side edges (the card padding is taken back) and clipped to its rounded
   corners. The artwork is the event page's own, cropped to the middle by its
   "slice" aspect ratio (never stretched). "Change look" is a pill in the
   strip's bottom-right corner; the picker opens below the strip. */
.basics-card {
  --basics-banner-h: 50px;
}

.look-field {
  position: relative;
  margin: calc(-1 * var(--card-pad-y)) calc(-1 * var(--card-pad-x)) var(--card-pad-y);
}

.basics-banner {
  height: var(--basics-banner-h);
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

.look-details {
  padding: 0 var(--card-pad-x);
}

/* The pill: dark on a light look, light on a dark one (the look's tone in
   config/banners.js; at least 4.5:1 on every look). */
.look-field {
  --look-pill-bg: rgba(255, 255, 255, 0.85);
  --look-pill-fg: #1a1a1a;
}

.look-field[data-look-tone='dark'] {
  --look-pill-bg: rgba(17, 17, 17, 0.62);
  --look-pill-fg: #fff;
}

.look-details > summary.look-summary {
  position: absolute;
  top: calc(var(--basics-banner-h) - 47px);
  right: 3px;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 3px;
  cursor: pointer;
}

.look-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 30px;
  padding: 0 0.65rem;
  border-radius: 999px;
  background: var(--look-pill-bg);
  color: var(--look-pill-fg);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  white-space: nowrap;
}

.look-pill-icon {
  flex: none;
  width: var(--icon-sm);
  height: var(--icon-sm);
}

/* The usual focus ring on the 44px target, with a white edge on the pill
   so it shows on light and dark looks alike. */
.look-summary:focus-visible .look-pill {
  box-shadow: 0 0 0 2px #fff;
}

.look-details > summary {
  list-style: none;
}

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

.look-group {
  border: 0;
  padding: 0;
  margin: var(--space-4) 0 0;
  min-width: 0;
}

.look-legend {
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.look-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.look-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0.5rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: var(--text-base);
  line-height: var(--lh-base);
  font-weight: var(--weight-regular);
  cursor: pointer;
  min-height: var(--tap);
}

/* The radio stays a real, focusable control; the whole card shows its state. */
.look-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.look-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.look-option:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.look-swatch {
  height: 3.25rem;
  border-radius: var(--radius-sm);
}

.look-name {
  font-size: var(--text-sm);
  line-height: 1.3;
}

.look-default {
  font-weight: var(--weight-regular);
  color: var(--muted);
}

.look-suggest {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--info-soft);
}

.look-suggest p {
  margin: 0 0 0.5rem;
}

@media (min-width: 640px) {
  .banner-card > .banner-art {
    height: 136px;
    margin-bottom: var(--space-6);
  }

  .look-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .banner-card > .banner-art svg {
    animation: none;
  }
}

/* Guest reply form (views/events/show.ejs). Layout and styling only. */

/* "Are you attending?": the chosen answer gets a light tint of its own
   colour (as the guest-list pills), a stronger border and a check icon, so
   colour is never the only signal. Plain :checked, no script. */
.attend-choices .seg span {
  gap: 0.35rem;
}

.choice-check {
  display: none;
  flex: none;
}

.attend-choices input:checked + span {
  border-width: 2px;
}

.attend-choices input:checked + span .choice-check {
  display: block;
}

.attend-choices .seg-yes input:checked + span {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
}

.attend-choices .seg-maybe input:checked + span {
  background: var(--warn-soft);
  border-color: var(--warn);
  color: var(--warn);
}

.attend-choices .seg-no input:checked + span {
  background: var(--bg-soft);
  border-color: var(--muted);
  color: var(--muted);
}

/* A light press on touch screens (no hover there). */
@media (hover: none) {
  .attend-choices .seg:active span {
    background: var(--bg-soft);
  }
}

/* "How many people are you bringing?": one row, the label on the left and
   a compact stepper (minus, value, plus; each 44px) on the right. Without
   JavaScript the stepper is the plain number field. */
.field-stepper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-3);
}

.field-stepper > label {
  margin: 0;
}

.field-stepper > .field-error {
  grid-column: 1 / -1;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stepper .stepper-input {
  width: 5rem;
  text-align: center;
}

.stepper.js-stepper .stepper-input {
  width: 3.25rem;
  min-height: 2.75rem;
  height: 2.75rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  -moz-appearance: textfield;
}

.stepper.js-stepper .stepper-input::-webkit-inner-spin-button,
.stepper.js-stepper .stepper-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1.5px solid #b8b8b8;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.stepper-btn[aria-disabled='true'] {
  color: #8a8a8a;
  border-color: var(--line);
  cursor: default;
}

@media (hover: hover) {
  .stepper-btn:not([aria-disabled='true']):hover {
    border-color: var(--text);
  }
}

@media (hover: none) {
  .stepper-btn:not([aria-disabled='true']):active {
    background: var(--bg-soft);
  }
}

/* Food preferences and a note: one closed <details> in the style of "More
   actions" (native caret, 44px summary). */
.reply-extras {
  margin-top: var(--space-4);
}

.reply-extras > summary {
  cursor: pointer;
  list-style: revert;
  min-height: 2.75rem;
  padding: 0.6rem 0;
  font-weight: var(--weight-bold);
}

.reply-extras-body > * + * {
  margin-top: var(--space-4);
}

.reply-extras-body {
  margin-top: var(--space-2);
}

/* Dietary choices: two rows of two, styled like the attending answers
   (radios; the chosen one gets a tint, a stronger border and a check). */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.choice {
  position: relative;
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--lh-base);
  font-weight: var(--weight-semibold);
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.5rem;
  border: 1.5px solid #c9c9c9;
  border-radius: var(--radius-sm);
  background: #fff;
  text-align: center;
  line-height: 1.25;
}

.choice input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.choice input:checked + span {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.choice input:checked + span .choice-check {
  display: block;
}

@media (hover: none) {
  .choice:active span {
    background: var(--bg-soft);
  }
}

/* Reply form, attendance panel: the answer and "How many people are you
   bringing?" together right under Name, on a soft tint of the brand colour
   with a border, so it reads as its own important step. The panel itself
   gives the focus and hover feedback (like the cards); the options keep
   their own focus ring. */
#respond .attendance-block {
  padding: var(--space-4);
  border: 1px solid var(--brand-attend-border);
  border-radius: var(--radius);
  background: var(--brand-attend-tint);
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s ease;
}

#respond .attendance-block:focus-within {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

@media (hover: hover) and (pointer: fine) {
  #respond .attendance-block:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  }
}

@media (prefers-reduced-motion: reduce) {
  #respond .attendance-block {
    transition: none;
  }
}

/* The question starts at the panel's padding (no group margin inside it). */
#respond .attendance-block > .vote-group {
  margin-top: 0;
}

/* "5 slots remaining" under "Are you coming?" (only with a guest
   limit): the number styled like the headcount figure (brand colour, 5.6:1,
   bold and larger, so colour is never the only signal), a small people icon. */
.slots-line {
  margin: 0 0 var(--space-2);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.slots-figure {
  color: var(--accent);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.slots-icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
  margin-right: var(--space-2);
  color: var(--muted);
  vertical-align: -0.15em;
}

#respond .attendance-block > .field-stepper {
  margin-top: var(--form-group-gap);
}

/* "No worries, thanks for letting the host know." (after a No): one group
   gap under the panel. */
#respond > .hint.vote-no-note {
  margin-top: var(--form-group-gap);
}

/* The Food and note group is now the first thing in its wrapper. */
#respond .reply-details > .reply-extras:first-child {
  margin-top: 0;
}

/* Create, edit and duplicate (views/events/form.ejs): the side column's
   summary card is desktop-only; below 1024px it is taken out and the two
   layout wrappers are plain blocks, so the page is exactly as before. */
@media not all and (min-width: 1024px) {
  .form-desktop-only {
    display: none;
  }
}

/* Create, edit and duplicate from 1024px (desktop). Nothing here applies
   below 1024px. The page container is --container-wide (centred); the back
   link, the title and the intro stay above two columns:
     form column: the error summary or notices, then the form (The basics,
                  When, Where, Guests); its own privacy line and buttons are
                  replaced by the side column's
     side column (--sidebar-w, sticky): the summary card with the submit
                  button (the same form), then on edit the recovery email
                  box (its own form)
   Inside the cards, Guests: the guest limit left, the checkboxes right
   (When and Where go side by side from 1200px, below). */
@media (min-width: 1024px) {
  .container.narrow.event-form-page {
    max-width: var(--container-wide);
  }

  .form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
    column-gap: var(--gap-layout);
    align-items: start;
  }

  /* Below the sticky site header (as the host page's sticky table head). */
  .form-side {
    position: sticky;
    top: calc(var(--space-12) + var(--space-4) + var(--gap-layout));
  }

  .form-side > .recovery-card {
    margin-top: var(--gap-layout);
  }

  .event-form-page [data-event-form] > .privacy-note,
  .event-form-page [data-event-form] > .form-actions {
    display: none;
  }

  /* Summary card. */
  .form-summary-body > .card-title {
    margin-bottom: var(--space-2);
  }

  .form-summary-name {
    margin: 0 0 var(--space-3);
    font-size: var(--text-lg);
    line-height: var(--lh-lg);
    font-weight: var(--weight-semibold);
    overflow-wrap: anywhere;
  }

  .form-summary-name.is-empty {
    color: var(--muted);
    font-weight: var(--weight-regular);
  }

  .form-summary-list,
  .form-summary-options {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .form-summary-list > li + li {
    margin-top: var(--space-1);
  }

  .form-summary-options {
    margin-top: var(--space-4);
  }

  .form-summary-options > li {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    color: var(--muted);
    font-size: var(--text-sm);
    line-height: var(--lh-sm);
  }

  .form-summary-options > li + li {
    margin-top: var(--space-1);
  }

  .form-summary-options strong {
    color: var(--text);
    font-weight: var(--weight-semibold);
  }

  .form-summary-body:not([hidden]) + .form-summary-privacy,
  .form-summary-body:not([hidden]) ~ .form-summary-actions {
    margin-top: var(--space-4);
  }

  .form-summary-privacy {
    margin-bottom: 0;
    font-size: var(--text-sm);
    line-height: var(--lh-sm);
  }

  .form-summary-privacy + .form-summary-actions {
    margin-top: var(--space-4);
  }

  .form-summary-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  .form-summary-actions .btn {
    width: 100%;
  }

  /* Where: "No place added yet." while no place is added (the When card's
     "No date chosen yet" note, which when.js shows, has its look). From
     1024px to 1199px it sits under the place fields, as the dates' note
     sits under the calendar. */
  .where-note {
    margin: var(--when-gap) 0 0;
    padding: 0 var(--space-1);
    color: var(--muted);
    font-size: var(--text-sm);
  }

  .where-list:not([hidden]) ~ .where-note {
    display: none;
  }

  /* Guests: the guest limit on the left, the checkboxes on the right, then
     the food-order link (and the wish list) across the full width. Rows:
     1 heading, 2-4 the checkboxes ("Guests must vote on dates and places"
     in 4, empty while it is hidden), 5 a flexible row that takes whatever
     height the guest limit needs beyond the checkboxes (so their rows keep
     their own heights), 6 the food-order link, 7 the wish list. */
  .guests-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto 1fr auto;
    column-gap: var(--space-6);
    align-items: start;
  }

  .guests-card > * {
    grid-column: 1 / -1;
  }

  .guests-card > .field:has(#capacity) {
    grid-column: 1;
    grid-row: 2 / span 4;
  }

  .guests-card > .check,
  .guests-card > .votes-toggle {
    grid-column: 2;
  }

  .guests-card > .check:has([name='plus_ones']) {
    grid-row: 2;
  }

  .guests-card > .check:has([name='ask_dietary']) {
    grid-row: 3;
  }

  .guests-card > .votes-toggle {
    grid-row: 4;
  }

  .guests-card > .field:has(#food_link) {
    grid-row: 6;
  }

  .guests-card > .field:has(#wishlist_link) {
    grid-row: 7;
  }

  .guests-card > .field + .check {
    margin-top: 0;
  }
}

/* Create, edit and duplicate from 1200px. Nothing here applies below
   1200px: from 1024px to 1199px the When and Where cards keep their parts
   stacked at full width (as below 1024px), so the calendar's days are never
   narrower than on a 390px phone. From 1200px the two parts sit side by
   side (each calendar day is then at least as wide as at 390px).
   When: the calendar (no wider than the side column, so its days are not
   stretched) on the left; the chosen dates, the "No date chosen yet" note
   and the dates message on the right. Where: the place fields and Add on
   the left; the added places, or "No place added yet.", on the right. Tab
   keeps the markup order (the list first), as below 1200px. */
@media (min-width: 1200px) {
  .when-card .when {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto 1fr;
    column-gap: var(--space-6);
    row-gap: var(--when-gap);
    align-items: start;
  }

  .when-card .when > * {
    grid-column: 2;
    margin-top: 0;
  }

  .when-card .when > .when-cal {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 100%;
    max-width: var(--sidebar-w);
    background: none;
  }

  .where-card .where {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-6);
    align-items: start;
  }

  .where-card .where > .where-editor {
    grid-column: 1;
    grid-row: 1;
  }

  .where-card .where > .where-list,
  .where-card .where > .where-note {
    grid-column: 2;
    grid-row: 1;
  }

  .where-list:not([hidden]) + .where-editor,
  .where-card .where > .where-note {
    margin-top: 0;
  }
}

/* Reply form, Dates group: one compact row per date, the short date on the
   left (it may wrap to two lines) and small Yes / Maybe / No buttons on the
   right. A thin line between dates (12px above and below each row); one line
   below the group when Places follow. */
#respond .vote-group-dates .legend-icon {
  width: var(--icon-md);
  height: var(--icon-md);
  margin-right: var(--space-2);
  vertical-align: -0.125em;
  color: var(--muted);
}

#respond .vote-group-dates .date-vote-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-top: 0;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--divider);
}

#respond .vote-group-dates .vote-row.date-vote-row:first-of-type {
  margin-top: 0;
  padding-top: var(--form-label-gap);
  border-top: 0;
}

#respond .vote-group-dates .date-vote-row .vote-label {
  flex: 1 1 0;
  /* Never narrower than its longest chunk: if a (longer, non-English) date
     cannot fit beside the buttons, the buttons drop below it instead. */
  min-width: min-content;
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.35;
}

/* The date and the time each stay on one line; a narrow row wraps between
   them ("Wed, Nov 11, 2026," / "8:02 PM – 10:15 PM"). */
#respond .vote-group-dates .ds-date,
#respond .vote-group-dates .ds-time {
  white-space: nowrap;
}

#respond .vote-group-dates .date-choices {
  display: flex;
  flex: none;
  gap: var(--space-1);
  margin-left: auto;
}

/* Below 375px the widest English date ("Wed, May 26, 2027,", 144px) and the
   three buttons (152px) no longer fit side by side (the row is the screen
   width minus 74px of page and card padding), so on narrower screens every
   date row puts its buttons below the date. */
@media (max-width: 374.98px) {
  #respond .vote-group-dates .date-vote-row .vote-label {
    flex-basis: 100%;
  }

  #respond .vote-group-dates .date-choices {
    margin-left: 0;
  }
}

#respond .vote-group-dates .date-choices .seg span {
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.3rem;
  font-size: var(--text-sm);
}

/* Not chosen: outlined in the colour the button takes when chosen, dark
   text (borders 3:1 or more on white; the words stay, so colour is never the
   only signal). Chosen: unchanged (filled, white text). */
#respond .vote-group-dates .seg input:not(:checked) + span {
  color: var(--text);
  background: #fff;
}

#respond .vote-group-dates .seg-yes input:not(:checked) + span {
  border-color: var(--ok);
}

#respond .vote-group-dates .seg-maybe input:not(:checked) + span {
  border-color: #7a5b00;
}

#respond .vote-group-dates .seg-no input:not(:checked) + span {
  border-color: #4a4a4a;
}

#respond .vote-group-dates-before-places {
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--line);
}

/* Spacing inside the reply form: one rhythm, set by three variables.
   --form-group-gap   between groups (a field, a question, the stepper row,
                      the Food and note summary, "Send reply"); a hint or
                      error at the end of a group is part of the group, so
                      it never adds space of its own.
   --form-label-gap   from a label or question to its control.
   --form-hint-gap    from a control to its hint or error.
   The heading sits 16px above the first group, as in the other cards; the
   sections (the votes, the Food and note group) are 24px apart. */
#respond {
  --form-group-gap: var(--space-4);
  --form-label-gap: var(--space-2);
  --form-hint-gap: var(--space-1);
}

#respond > * + * {
  margin-top: var(--form-group-gap);
}

/* The heading is the first thing shown (the honeypot before it is hidden). */
#respond > .card-title {
  margin-top: 0;
  margin-bottom: 0;
}

#respond > .card-title + :not([hidden]),
#respond > .card-title + [hidden] + * {
  margin-top: var(--space-4);
}

/* Sections: the votes and the Food and note group start 24px below what is
   above them. */
#respond > :is(.vote-group, .reply-details) {
  margin-top: var(--space-6);
}

#respond label,
#respond legend {
  margin-bottom: var(--form-label-gap);
}

#respond legend + .hint {
  margin-top: 0;
}

#respond .hint,
#respond .field-error {
  margin-top: var(--form-hint-gap);
}

/* "Your name shows next to your votes.": opens the voting section, one group
   gap below what is above it, and reads as the section's lead-in: the first
   group follows one label gap below. Together the form grows by just this
   line. */
#respond > .vote-name-note {
  margin-top: var(--form-group-gap);
}

#respond > .vote-name-note + .vote-group {
  margin-top: var(--form-label-gap);
}

/* Date and place rows: the first starts one label gap below the question's
   hint, and the last adds no padding below its buttons. */
#respond .vote-group .vote-row:first-of-type {
  padding-top: var(--form-label-gap);
}

#respond .vote-group .vote-row:last-of-type {
  padding-bottom: 0;
}


#respond legend + .choice-grid {
  margin-top: 0;
}

/* Inside the groups that hold several fields. */
#respond .reply-extras,
#respond .reply-extras-body > * + * {
  margin-top: var(--form-group-gap);
}

/* The summary is a 44px target with 0.6rem padding; its content starts one
   group gap below the summary's text. */
#respond .reply-extras-body {
  margin-top: calc(var(--form-group-gap) - 0.6rem);
}

/* Reply form, Places group: one row per place, a map pin and the name and
   address on the left (wrapping), thumbs-up and thumbs-down on the right
   (44px tap areas). A thin line between places (12px above and below each
   row). Not chosen:
   hollow icon, outline in the button's colour. Chosen: filled icon, a thicker
   outline in the same colour and a light tint (shape and fill, never colour
   alone). Without JavaScript the thumbs are radios with a small "No vote"
   radio below them; app.js swaps them for toggle buttons. */
#respond .place-vote-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 0;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--divider);
}

#respond .vote-group .place-vote-row:first-of-type {
  margin-top: 0;
  padding-top: var(--form-label-gap);
  border-top: 0;
}

#respond .place-vote-label {
  display: flex;
  flex: 1 1 0;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#respond .place-vote-pin {
  flex: none;
  width: var(--icon-sm);
  height: var(--icon-sm);
  margin-top: 0.15em;
  color: var(--muted);
}

/* A long name and address: the name on its own line, then at most two lines
   of the address, with a small "Show full address" toggle below (a native
   <details>; open, the whole address shows).
   The row becomes a grid so the toggle sits under the text and the thumbs
   stay at the top, level with the first line (the text starts half the
   difference between a thumb and a line lower, as a centred one-line row). */
#respond .place-vote-row-fold {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-2);
  align-items: start;
}

#respond .place-vote-row-fold > .place-vote-label {
  grid-column: 1;
  grid-row: 1;
  padding-top: calc((var(--tap-min) - 1.35em) / 2);
}

#respond .place-vote-row-fold > .thumbs {
  grid-column: 2;
  grid-row: 1 / span 2;
}

#respond .place-vote-row-fold .place-vote-name {
  display: block;
}

#respond .place-vote-row-fold [data-place-fold-text] {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

#respond .place-vote-row-fold:has(> .place-address-more[open]) [data-place-fold-text] {
  display: block;
  overflow: visible;
  -webkit-line-clamp: none;
  line-clamp: none;
}

/* The toggle: small text under the address (after the pin), a 44px-high tap
   area that takes no extra height (negative margins). */
#respond .place-address-more {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  margin: 0;
  padding-left: calc(var(--icon-sm) + var(--space-2));
}

#respond .place-address-more > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  margin: calc((var(--tap-min) - var(--lh-sm) * var(--text-sm)) / -2) 0;
  color: var(--accent);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  font-weight: var(--weight-semibold);
  list-style: none;
  cursor: pointer;
}

#respond .place-address-more > summary::-webkit-details-marker {
  display: none;
}

#respond .place-address-more[open] .place-address-show,
#respond .place-address-more:not([open]) .place-address-hide {
  display: none;
}

#respond .thumbs {
  display: grid;
  flex: none;
  grid-template-columns: repeat(2, 44px);
  gap: var(--space-2);
  align-items: center;
}

#respond .thumb {
  position: relative;
  display: block;
  margin: 0;
}

#respond .thumb-yes {
  color: var(--ok);
}

#respond .thumb-no {
  color: #4a4a4a;
}

#respond .thumb input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

#respond .thumb-face,
#respond .thumb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  cursor: pointer;
}

#respond .thumb-icon {
  width: var(--icon-lg);
  height: var(--icon-lg);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#respond .thumb input:checked + .thumb-face,
#respond .thumb-btn[aria-pressed='true'] {
  border-width: 2.5px;
}

#respond .thumb-yes input:checked + .thumb-face,
#respond .thumb-yes.thumb-btn[aria-pressed='true'] {
  background: var(--ok-soft);
}

#respond .thumb-no input:checked + .thumb-face,
#respond .thumb-no.thumb-btn[aria-pressed='true'] {
  background: #ececec;
}

#respond .thumb input:checked + .thumb-face .thumb-icon,
#respond .thumb-btn[aria-pressed='true'] .thumb-icon {
  fill: currentColor;
}

#respond .thumb input:focus-visible + .thumb-face,
#respond .thumb-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Without JavaScript only: "No vote" under the thumbs. */
#respond .thumb-clear {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2rem;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  cursor: pointer;
}

#respond .thumb-clear input {
  margin: 0;
}

/* BEGIN banner looks: built by scripts/make-banners.js from config/banners.js. Do not edit by hand.
   Colours come from the --brand-banner-* and --brand-panel-* variables in brand.css. */
.look-celebration-confetti { --look-bg: var(--brand-banner-blush); --look-1: var(--brand-banner-berry); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-teal); --look-panel: var(--brand-panel-white); }
.look-celebration-balloons { --look-bg: var(--brand-banner-sky); --look-1: var(--brand-banner-berry); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-ocean); --look-panel: var(--brand-panel-white); }
.look-celebration-starry { --look-bg: var(--brand-banner-night); --look-1: var(--brand-banner-sun); --look-2: var(--brand-banner-rose); --look-3: var(--brand-banner-snow); --look-panel: var(--brand-panel-white); }
.look-celebration-shapes { --look-bg: var(--brand-banner-cream); --look-1: var(--brand-banner-coral); --look-2: var(--brand-banner-teal); --look-3: var(--brand-banner-indigo); --look-panel: var(--brand-panel-cream); }
.look-celebration-bunting { --look-bg: var(--brand-banner-mint); --look-1: var(--brand-banner-berry); --look-2: var(--brand-banner-amber); --look-3: var(--brand-banner-ocean); --look-panel: var(--brand-panel-mint); }
.look-romance-hearts { --look-bg: var(--brand-banner-blush); --look-1: var(--brand-banner-berry); --look-2: var(--brand-banner-rose); --look-3: var(--brand-banner-gold); --look-panel: var(--brand-panel-blush); }
.look-romance-petals { --look-bg: var(--brand-banner-lilac); --look-1: var(--brand-banner-plum); --look-2: var(--brand-banner-rose); --look-3: var(--brand-banner-snow); --look-panel: var(--brand-panel-lilac); }
.look-romance-sparkle { --look-bg: var(--brand-banner-plum); --look-1: var(--brand-banner-gold); --look-2: var(--brand-banner-blush); --look-3: var(--brand-banner-snow); --look-panel: var(--brand-panel-white); }
.look-romance-golden { --look-bg: var(--brand-banner-sand); --look-1: var(--brand-banner-gold); --look-2: var(--brand-banner-rose); --look-3: var(--brand-banner-plum); --look-panel: var(--brand-panel-cream); }
.look-romance-glow { --look-bg: var(--brand-banner-night); --look-1: var(--brand-banner-gold); --look-2: var(--brand-banner-blush); --look-3: var(--brand-banner-rose); --look-panel: var(--brand-panel-white); }
.look-new-year-fireworks { --look-bg: var(--brand-banner-night); --look-1: var(--brand-banner-gold); --look-2: var(--brand-banner-rose); --look-3: var(--brand-banner-sky); --look-panel: var(--brand-panel-white); }
.look-new-year-midnight { --look-bg: var(--brand-banner-indigo); --look-1: var(--brand-banner-gold); --look-2: var(--brand-banner-snow); --look-3: var(--brand-banner-sky); --look-panel: var(--brand-panel-fog); }
.look-new-year-confetti { --look-bg: var(--brand-banner-night); --look-1: var(--brand-banner-gold); --look-2: var(--brand-banner-snow); --look-3: var(--brand-banner-rose); --look-panel: var(--brand-panel-white); }
.look-new-year-balloons { --look-bg: var(--brand-banner-plum); --look-1: var(--brand-banner-gold); --look-2: var(--brand-banner-snow); --look-3: var(--brand-banner-rose); --look-panel: var(--brand-panel-lilac); }
.look-new-year-streamers { --look-bg: var(--brand-banner-ocean); --look-1: var(--brand-banner-gold); --look-2: var(--brand-banner-snow); --look-3: var(--brand-banner-coral); --look-panel: var(--brand-panel-sky); }
.look-winter-snowfall { --look-bg: var(--brand-banner-ocean); --look-1: var(--brand-banner-snow); --look-2: var(--brand-banner-sky); --look-3: var(--brand-banner-snow); --look-panel: var(--brand-panel-sky); }
.look-winter-lights { --look-bg: var(--brand-banner-night); --look-1: var(--brand-banner-amber); --look-2: var(--brand-banner-berry); --look-3: var(--brand-banner-mint); --look-panel: var(--brand-panel-white); }
.look-winter-gifts { --look-bg: var(--brand-banner-blush); --look-1: var(--brand-banner-berry); --look-2: var(--brand-banner-forest); --look-3: var(--brand-banner-gold); --look-panel: var(--brand-panel-white); }
.look-winter-frost { --look-bg: var(--brand-banner-sky); --look-1: var(--brand-banner-snow); --look-2: var(--brand-banner-ocean); --look-3: var(--brand-banner-snow); --look-panel: var(--brand-panel-white); }
.look-winter-parcels { --look-bg: var(--brand-banner-forest); --look-1: var(--brand-banner-berry); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-snow); --look-panel: var(--brand-panel-mint); }
.look-halloween-moonlit { --look-bg: var(--brand-banner-indigo); --look-1: var(--brand-banner-night); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-snow); --look-panel: var(--brand-panel-fog); }
.look-halloween-pumpkins { --look-bg: var(--brand-banner-plum); --look-1: var(--brand-banner-pumpkin); --look-2: var(--brand-banner-forest); --look-3: var(--brand-banner-sun); --look-panel: var(--brand-panel-cream); }
.look-halloween-web { --look-bg: var(--brand-banner-slate); --look-1: var(--brand-banner-pumpkin); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-snow); --look-panel: var(--brand-panel-fog); }
.look-halloween-starry { --look-bg: var(--brand-banner-night); --look-1: var(--brand-banner-pumpkin); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-lilac); --look-panel: var(--brand-panel-white); }
.look-halloween-shapes { --look-bg: var(--brand-banner-pumpkin); --look-1: var(--brand-banner-night); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-plum); --look-panel: var(--brand-panel-cream); }
.look-casual-shapes { --look-bg: var(--brand-banner-mint); --look-1: var(--brand-banner-teal); --look-2: var(--brand-banner-coral); --look-3: var(--brand-banner-sun); --look-panel: var(--brand-panel-white); }
.look-casual-lights { --look-bg: var(--brand-banner-night); --look-1: var(--brand-banner-sun); --look-2: var(--brand-banner-coral); --look-3: var(--brand-banner-mint); --look-panel: var(--brand-panel-white); }
.look-casual-confetti { --look-bg: var(--brand-banner-sky); --look-1: var(--brand-banner-ocean); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-coral); --look-panel: var(--brand-panel-sky); }
.look-casual-waves { --look-bg: var(--brand-banner-sky); --look-1: var(--brand-banner-snow); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-ocean); --look-panel: var(--brand-panel-white); }
.look-casual-bunting { --look-bg: var(--brand-banner-cream); --look-1: var(--brand-banner-teal); --look-2: var(--brand-banner-coral); --look-3: var(--brand-banner-indigo); --look-panel: var(--brand-panel-cream); }
.look-dining-table { --look-bg: var(--brand-banner-cream); --look-1: var(--brand-banner-snow); --look-2: var(--brand-banner-coral); --look-3: var(--brand-banner-sage); --look-panel: var(--brand-panel-cream); }
.look-dining-lights { --look-bg: var(--brand-banner-forest); --look-1: var(--brand-banner-sun); --look-2: var(--brand-banner-amber); --look-3: var(--brand-banner-cream); --look-panel: var(--brand-panel-white); }
.look-dining-shapes { --look-bg: var(--brand-banner-sand); --look-1: var(--brand-banner-forest); --look-2: var(--brand-banner-coral); --look-3: var(--brand-banner-amber); --look-panel: var(--brand-panel-white); }
.look-dining-bunting { --look-bg: var(--brand-banner-sage); --look-1: var(--brand-banner-coral); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-forest); --look-panel: var(--brand-panel-mint); }
.look-work-shapes { --look-bg: var(--brand-banner-sky); --look-1: var(--brand-banner-indigo); --look-2: var(--brand-banner-teal); --look-3: var(--brand-banner-sun); --look-panel: var(--brand-panel-white); }
.look-work-charts { --look-bg: var(--brand-banner-indigo); --look-1: var(--brand-banner-sky); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-mint); --look-panel: var(--brand-panel-fog); }
.look-work-confetti { --look-bg: var(--brand-banner-cream); --look-1: var(--brand-banner-indigo); --look-2: var(--brand-banner-coral); --look-3: var(--brand-banner-teal); --look-panel: var(--brand-panel-white); }
.look-work-stars { --look-bg: var(--brand-banner-slate); --look-1: var(--brand-banner-sun); --look-2: var(--brand-banner-sky); --look-3: var(--brand-banner-snow); --look-panel: var(--brand-panel-fog); }
.look-baby-home-house { --look-bg: var(--brand-banner-mint); --look-1: var(--brand-banner-sun); --look-2: var(--brand-banner-coral); --look-3: var(--brand-banner-teal); --look-panel: var(--brand-panel-mint); }
.look-baby-home-clouds { --look-bg: var(--brand-banner-sky); --look-1: var(--brand-banner-snow); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-rose); --look-panel: var(--brand-panel-sky); }
.look-baby-home-stars { --look-bg: var(--brand-banner-lilac); --look-1: var(--brand-banner-snow); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-plum); --look-panel: var(--brand-panel-lilac); }
.look-baby-home-confetti { --look-bg: var(--brand-banner-cream); --look-1: var(--brand-banner-rose); --look-2: var(--brand-banner-mint); --look-3: var(--brand-banner-sky); --look-panel: var(--brand-panel-cream); }
.look-baby-home-shapes { --look-bg: var(--brand-banner-blush); --look-1: var(--brand-banner-rose); --look-2: var(--brand-banner-teal); --look-3: var(--brand-banner-sun); --look-panel: var(--brand-panel-blush); }
.look-festival-bunting { --look-bg: var(--brand-banner-sun); --look-1: var(--brand-banner-berry); --look-2: var(--brand-banner-teal); --look-3: var(--brand-banner-indigo); --look-panel: var(--brand-panel-cream); }
.look-festival-lights { --look-bg: var(--brand-banner-plum); --look-1: var(--brand-banner-sun); --look-2: var(--brand-banner-mint); --look-3: var(--brand-banner-coral); --look-panel: var(--brand-panel-white); }
.look-festival-confetti { --look-bg: var(--brand-banner-teal); --look-1: var(--brand-banner-sun); --look-2: var(--brand-banner-snow); --look-3: var(--brand-banner-coral); --look-panel: var(--brand-panel-mint); }
.look-festival-shapes { --look-bg: var(--brand-banner-coral); --look-1: var(--brand-banner-sun); --look-2: var(--brand-banner-indigo); --look-3: var(--brand-banner-snow); --look-panel: var(--brand-panel-cream); }
.look-festival-sparkle { --look-bg: var(--brand-banner-indigo); --look-1: var(--brand-banner-sun); --look-2: var(--brand-banner-coral); --look-3: var(--brand-banner-mint); --look-panel: var(--brand-panel-fog); }
.look-other-confetti { --look-bg: var(--brand-banner-blush); --look-1: var(--brand-banner-berry); --look-2: var(--brand-banner-sun); --look-3: var(--brand-banner-teal); --look-panel: var(--brand-panel-white); }
.look-other-shapes { --look-bg: var(--brand-banner-cream); --look-1: var(--brand-banner-teal); --look-2: var(--brand-banner-coral); --look-3: var(--brand-banner-indigo); --look-panel: var(--brand-panel-cream); }
.look-other-stars { --look-bg: var(--brand-banner-night); --look-1: var(--brand-banner-sun); --look-2: var(--brand-banner-snow); --look-3: var(--brand-banner-rose); --look-panel: var(--brand-panel-white); }
.look-other-lights { --look-bg: var(--brand-banner-indigo); --look-1: var(--brand-banner-sun); --look-2: var(--brand-banner-rose); --look-3: var(--brand-banner-mint); --look-panel: var(--brand-panel-white); }
/* END banner looks */
