:root {
  --bo-navy: var(--lqd-color-primary, #0B054B);
  --bo-green: var(--lqd-color-britishodyssey, #487937);
  --bo-green-dark: #365d28;
  --bo-yellow: var(--lqd-color-secondary, #FEFE43);
  --bo-coral: var(--lqd-color-accent, #EB7556);
  --bo-slate: var(--lqd-color-slate-700, #233040);
  --bo-text: var(--lqd-color-text, #4E4F62);
  --bo-muted: #587685;
  --bo-bg: var(--lqd-color-gray-100, #f5f5f7);
  --bo-card: #ffffff;
  --bo-border: #dce2dc;
  --bo-error: #d93025;
  --bo-error-bg: #fce8e6;
  --bo-success: #188038;
  --bo-success-bg: #e6f4ea;
  --bo-warning: #b06000;
  --bo-warning-bg: #fef7e0;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-sm: 0 2px 8px rgba(11, 5, 75, 0.06);
  --shadow-md: 0 10px 28px rgba(11, 5, 75, 0.10);
  --target-size: 24px;
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

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

/* Form-factor adaptation: keep media inside its column & wrap long strings */
img, video {
  max-inline-size: 100%;
  block-size: auto;
}

body {
  margin: 0;
  font-family: var(--lqd-body-font-family, 'FuturaBT-LightCondensed', system-ui, sans-serif);
  font-size: var(--lqd-body-font-size, 18px);
  background-color: var(--bo-bg);
  color: var(--bo-text);
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

/* Minimum touch/pointer target sizing (modern-web-guidance: form-factor-adaptation) */
:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], nav a, label:has(input[type="checkbox"], input[type="radio"])) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
}

:where([role="button"], nav a, label:has(input[type="checkbox"], input[type="radio"])) {
  display: inline-flex;
  align-items: center;
}

:where(.toolbar > :not(button, input, select, textarea, a, [role="button"], label)) {
  min-inline-size: 0;
}

:where(nav, nav ul, .toolbar) {
  flex-wrap: wrap;
}

h1, h2, .card-title, .brand-name {
  font-family: var(--lqd-heading-font-family, "Wakerobin-Bold", sans-serif);
  letter-spacing: -0.3px;
}

/* Balance short headings and prettify body copy (modern-web-guidance: form-factor-adaptation) */
h1, h2, h3, .card-title {
  text-wrap: balance;
}

p, li, .dish-desc {
  text-wrap: pretty;
}

/* Visually hidden utility for live region announcer */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Header matching BritishOdyssey.com + Adaptive Popover Navbar (modern-web-guidance: navbar) */
.site-header {
  background: linear-gradient(135deg, var(--bo-slate) 0%, #16222f 55%, #233d1b 100%);
  color: #fff;
  border-bottom: 4px solid var(--bo-green);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  padding-top: env(safe-area-inset-top, 0px);
}

.site-header.is-measuring,
.site-header.is-measuring * {
  transition: none !important;
}

.header-inner {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0.65rem max(1rem, env(safe-area-inset-right, 0px)) 0.65rem max(1rem, env(safe-area-inset-left, 0px));
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.header-inner > * {
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
  min-inline-size: 0;
  flex-shrink: 1;
}

.brand-logo {
  height: 40px;
  width: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-titles {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
}

.brand-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--bo-yellow);
  font-weight: 700;
  white-space: normal;
}

.brand-name {
  font-size: clamp(0.95rem, 0.8rem + 0.9vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -0.3px;
  white-space: normal;
  line-height: 1.15;
}

@media (max-width: 640px) {
  .brand-eyebrow {
    display: none;
  }
  .brand-logo {
    height: 32px;
  }
  .brand-name {
    font-size: 0.9rem;
    line-height: 1.1;
  }
  .menu-button-label {
    display: none;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  margin-inline-start: auto;
}

.site-header .menu-button {
  anchor-name: --menu-button;
  padding: 0.4rem 0.75rem;
  font-size: 0.84rem;
}

/* Collapsed popover navigation (default when narrow or without JS) */
.site-header .site-menu {
  position: fixed;
  inset: auto;
  /* Fallback offset before anchor() for browsers without CSS Anchor Positioning */
  inset-block-start: 4.25rem;
  inset-block-start: anchor(--menu-button bottom);
  inset-inline-end: 0.85rem;
  inline-size: min(82dvw, 20rem);
  max-inline-size: calc(100dvw - 1.7rem);
  block-size: fit-content;
  max-block-size: calc(100dvh - 5.5rem);
  margin: 0.45rem 0 0 0;
  padding: 0.5rem;
  list-style: none;
  background: var(--bo-slate);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: auto;
}

.site-header .site-menu:not(:is(:popover-open, .\:popover-open)) {
  display: none;
}

.site-header .site-menu:is(:popover-open, .\:popover-open) {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-menu li {
  margin: 0;
  padding: 0;
}

.site-menu a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.7px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-menu a:hover,
.site-menu a:focus-visible {
  color: var(--bo-yellow);
  background: rgba(255, 255, 255, 0.08);
}

.site-menu a[aria-current="page"] {
  color: var(--bo-yellow);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

/* Wide inline navigation when all items fit on one row */
.site-header.is-wide .menu-button {
  display: none;
}

.site-header.is-wide .site-menu {
  position: static;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  inline-size: auto;
  max-inline-size: none;
  block-size: auto;
  max-block-size: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.site-header.is-wide .site-menu::backdrop {
  display: none;
}

.site-header.is-wide .site-menu a {
  width: auto;
  padding: 0.35rem 0.55rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-actions[hidden] {
  display: none !important;
}

.header-user-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  line-height: 1.15;
}

.header-user-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
}

.header-dietary-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0.1rem 0;
  margin: 0;
  min-block-size: 0;
  min-inline-size: 0;
  color: var(--bo-yellow);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.header-dietary-link:hover,
.header-dietary-link:focus-visible {
  color: #fff;
}

.header-dietary-link[hidden] {
  display: none !important;
}

/* Main Container */
.main-container {
  max-width: 1250px;
  margin: 0 auto;
  padding: clamp(0.9rem, 2vw, 1.75rem) max(0.85rem, env(safe-area-inset-right, 0px)) 5.5rem max(0.85rem, env(safe-area-inset-left, 0px));
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.btn-block {
  width: 100%;
  padding: 0.8rem 1.2rem;
}

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

.btn-primary:hover {
  background-color: var(--bo-green-dark);
}

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

.btn-accent:hover {
  background-color: #d96142;
}

.btn-navy {
  background-color: var(--bo-navy);
  color: #fff;
}

.btn-navy:hover {
  background-color: #19106e;
}

.btn-outline {
  background-color: #fff;
  color: var(--bo-slate);
  border-color: #c2cbc2;
}

.btn-outline:hover {
  background-color: #f0f4f0;
  border-color: var(--bo-green);
}

.btn-ghost-light {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  padding: 0.42rem 0.8rem;
  font-size: 0.84rem;
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-sm {
  padding: 0.4rem 0.78rem;
  font-size: 0.84rem;
}

/* Sign-in Layout */
.login-grid {
  display: grid;
  grid-template-columns: minmax(min(100%, 280px), 440px);
  justify-content: center;
  gap: 1.5rem;
  align-items: start;
  margin-top: clamp(0.5rem, 2vw, 1.25rem);
}

.card {
  background: var(--bo-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bo-border);
  box-shadow: var(--shadow-sm);
  padding: clamp(1rem, 2.5vw, 1.75rem);
}

.menu-card {
  container: menu-card / inline-size;
}

.card-title {
  margin: 0 0 0.25rem 0;
  font-size: clamp(1.2rem, 1rem + 1.1vw, 1.45rem);
  color: var(--bo-slate);
  font-weight: 800;
}

.card-subtitle {
  margin: 0 0 1.1rem 0;
  color: var(--bo-muted);
  font-size: 0.92rem;
}

/* Forms & Validation (modern-web-guidance: validate-input-after-interaction & autofill-sign-in-form) */
.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--bo-slate);
  margin-bottom: 0.25rem;
}

.hint {
  display: block;
  color: var(--bo-muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.field input:not([type="checkbox"], [type="radio"]),
.field select,
.field textarea {
  width: 100%;
  padding: 0.68rem 0.85rem;
  /* Prevent iOS Safari auto-zoom on focus by keeping font-size >= 16px (1rem) */
  font-size: max(16px, 0.95rem);
  border: 1.5px solid #c4ccc4;
  border-radius: 8px;
  background-color: #fff;
  color: var(--bo-slate);
  font-family: inherit;
}

.code-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: max(16px, 0.84rem) !important;
  line-height: 1.4;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--bo-green);
  outline-offset: 1px;
  border-color: var(--bo-green);
}

.password-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.password-row input {
  flex: 1;
  min-inline-size: 0;
}

.error-msg {
  display: none;
  color: var(--bo-error);
  font-size: 0.85rem;
  margin-top: 0.3rem;
  font-weight: 600;
}

/* Validate only after interaction */
:is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--bo-error) !important;
  background-color: var(--bo-error-bg) !important;
}

:is(:user-invalid, .user-invalid-fallback) + .error-msg,
.password-row:has(:is(:user-invalid, .user-invalid-fallback)) + .error-msg {
  display: block;
}

:is(:user-valid, .user-valid-fallback) {
  border-color: var(--bo-success);
}

/* Rally Banner using BritishOdyssey.com banner5.jpg */
.rally-banner {
  container: banner / inline-size;
  background: linear-gradient(120deg, rgba(35, 48, 64, 0.9) 0%, rgba(45, 76, 35, 0.84) 100%), url('./assets/images/banner5.jpg') center/cover no-repeat;
  color: #fff;
  padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1rem, 3vw, 1.85rem);
  border-radius: var(--radius-lg);
  margin-bottom: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.rally-banner-copy {
  min-inline-size: 0;
  flex: 1 1 16rem;
}

.rally-banner h1 {
  margin: 0 0 0.2rem 0;
  font-size: clamp(1.2rem, 0.95rem + 1.4vw, 1.65rem);
  color: #fff;
  line-height: 1.2;
}

.rally-banner p {
  margin: 0;
  opacity: 0.92;
  font-size: clamp(0.84rem, 0.8rem + 0.3vw, 0.94rem);
}

.rally-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

@container banner (inline-size < 34rem) {
  .rally-banner-actions {
    width: 100%;
  }
  .rally-banner-actions .btn {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* Day / Hotel Selector Tabs — Centered Swipe Carousel on Mobile, Grid on Desktop */
.hotel-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.15rem;
}

.hotel-tab {
  background: #fff;
  border: 2px solid var(--bo-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
}

.hotel-tab:hover {
  border-color: var(--bo-green);
}

.hotel-tab.active {
  border-color: var(--bo-green);
  background: #eff7ed;
  box-shadow: 0 4px 12px rgba(72, 121, 55, 0.16);
}

.hotel-tab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--bo-green);
}

.hotel-tab-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hotel-tab-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--bo-slate);
  line-height: 1.22;
  flex: 1;
  min-inline-size: 0;
}

#admin-rest-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.pdf-menu-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #fdf2f0;
  border: 1px solid #f2b8b5;
  color: #b3261e;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.pdf-menu-badge:hover,
.pdf-menu-badge:focus-visible {
  background: #fce8e6;
  color: #8c1d18;
  transform: translateY(-1px);
}

.hotel-tab-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.65rem;
  margin-top: 0.1rem;
  padding-top: 0.35rem;
  border-top: 1px dashed #d8e2d8;
}

.hotel-tab-loc {
  font-size: 0.8rem;
  color: var(--bo-muted);
  font-weight: 600;
}

.hotel-tab-deadline {
  font-size: 0.76rem;
  color: var(--bo-slate);
  font-weight: 700;
}

@media (max-width: 760px) {
  .hotel-tabs {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.65rem;
    padding: 0.25rem 9dvw 0.4rem 9dvw;
    margin: 0 -0.85rem 0.85rem -0.85rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .hotel-tabs::-webkit-scrollbar {
    display: none;
  }
  .hotel-tab {
    flex: 0 0 82dvw;
    max-width: 360px;
    scroll-snap-align: center;
    padding: 0.85rem 1.05rem;
    opacity: 0.68;
    transform: scale(0.95);
  }
  .hotel-tab.active {
    opacity: 1;
    transform: scale(1);
  }
  .hotel-tab-name {
    font-size: 1.15rem;
  }
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip.done {
  background: var(--bo-success-bg);
  color: var(--bo-success);
}

.status-chip.pending {
  background: var(--bo-warning-bg);
  color: var(--bo-warning);
}

.status-chip.locked {
  background: #fce8e6;
  color: #b3261e;
}

.status-chip.external {
  background: #e8f0fe;
  color: #174ea6;
}

.status-chip.partial {
  background: #e8f5e9;
  color: #2e6b30;
  border: 1px solid #a5d6a7;
}

/* External Hotel Pre-Order Panel (e.g. ResDiary) */
.external-order-panel {
  text-align: center;
  padding: clamp(1.35rem, 3vw, 2rem);
}

.external-order-panel .person-header {
  justify-content: space-between;
  text-align: left;
  border-bottom: 2px solid var(--bo-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.external-order-desc {
  margin: 0 auto 1.25rem auto;
  max-width: 58ch;
  color: var(--bo-text);
  font-size: 0.96rem;
  line-height: 1.55;
}

.external-order-cta-wrap {
  display: flex;
  justify-content: center;
}

.external-order-btn {
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  font-size: 0.98rem;
}

/* Restaurant Card Header (Container-Query Responsive) */
.rest-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  border-bottom: 1px solid var(--bo-border);
  padding-bottom: 1rem;
  margin-bottom: 1.1rem;
}

.rest-card-title-group {
  min-inline-size: 0;
  flex: 1 1 16rem;
}

.rest-card-title-group .card-subtitle {
  margin-bottom: 0;
}

.rest-day-eyebrow {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--bo-green);
  margin-bottom: 0.15rem;
}

.rest-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.rest-deadline-text {
  font-size: 0.8rem;
  color: var(--bo-muted);
}

@container menu-card (inline-size < 36rem) {
  .rest-card-meta {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.25rem;
  }
}

/* Mobile Diner Switcher (Driver / Navigator / Optional Guest) */
.diner-switcher {
  display: none;
}

.diner-switcher[hidden],
.team-save-bar[hidden] {
  display: none !important;
}

@media (max-width: 680px) {
  .diner-switcher:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 0.4rem;
    background: #eef3ee;
    padding: 0.3rem;
    border-radius: 10px;
    border: 1px solid var(--bo-border);
    margin-bottom: 0.85rem;
  }

  .diner-tab {
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.86rem;
    color: var(--bo-slate);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    line-height: 1.15;
  }

  .diner-tab.active {
    background: #fff;
    border-color: var(--bo-green);
    color: var(--bo-green-dark);
    box-shadow: 0 2px 6px rgba(11, 5, 75, 0.08);
  }

  .diner-tab-progress {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--bo-muted);
  }

  .diner-tab.complete .diner-tab-progress {
    color: var(--bo-success);
  }

  /* On mobile, show only the selected diner's panel and avoid repeating the Driver/Navigator header */
  .person-panel[data-diner-active="false"] {
    display: none;
  }

  .person-panel:not(.external-order-panel) .person-header > div {
    display: none;
  }

  .person-panel:not(.external-order-panel) .person-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0.65rem;
    justify-content: flex-end;
  }
}

/* Two- or Three-Column Crew Menu Selection Grid (Driver / Navigator / Optional Guest) */
.crew-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 1.25rem;
}

.dir-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eef4ee;
  border: 1px solid #c9d8c9;
  color: var(--bo-slate);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.76rem;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
}

.person-panel {
  background: #fafcfa;
  border: 1.5px solid var(--bo-border);
  border-radius: var(--radius-md);
  padding: clamp(0.9rem, 2vw, 1.25rem);
}

.person-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 2px solid var(--bo-border);
  padding-bottom: 0.7rem;
  margin-bottom: 0.95rem;
}

.person-role-tag {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  color: var(--bo-green);
}

.person-name-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--bo-slate);
  margin: 0.1rem 0 0 0;
}

.dietary-badge {
  background: #fff3e0;
  color: #b05000;
  border: 1px solid #ffd8a8;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
}

.course-group {
  margin-bottom: 1.15rem;
}

.course-title {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--bo-navy);
  font-weight: 800;
  margin: 0 0 0.5rem 0;
}

.dish-option {
  display: flex !important;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid #dce2dc;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dish-option:hover {
  border-color: var(--bo-green);
}

.dish-option:has(input:checked) {
  border-color: var(--bo-green);
  background: #f0f8ee;
  box-shadow: 0 0 0 1px var(--bo-green);
}

.dish-option input[type="radio"] {
  margin-top: 0.22rem;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  accent-color: var(--bo-green);
}

.dish-info {
  flex: 1;
  min-inline-size: 0;
}

.dish-name {
  font-weight: 700;
  color: var(--bo-slate);
  font-size: 0.95rem;
  line-height: 1.3;
}

.dish-desc {
  font-size: 0.82rem;
  color: var(--bo-muted);
  margin-top: 0.18rem;
  line-height: 1.35;
}

.diet-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.08rem 0.38rem;
  border-radius: 4px;
  background: #e8f0fe;
  color: #1967d2;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.next-diner-row {
  display: none;
}

@media (max-width: 680px) {
  .next-diner-row {
    display: flex;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--bo-border);
  }
  .next-diner-row .btn {
    width: 100%;
  }
}

/* Team Save Bar — Sticky bottom bar on mobile with safe-area-inset-bottom */
.team-save-bar {
  margin-top: 1.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.save-bar-status {
  font-size: 0.85rem;
  color: var(--bo-muted);
}

.save-order-btn {
  padding: 0.75rem 1.65rem;
  font-size: 0.98rem;
}

@media (max-width: 680px) {
  .team-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    margin: 1.15rem -1rem -1rem -1rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) 1rem;
    border-top: 1px solid var(--bo-border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 -4px 16px rgba(11, 5, 75, 0.08);
  }
  .save-bar-status {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
  }
  .save-order-btn {
    width: 100%;
  }
}

/* Admin View Layout & Responsive Action Toolbar */
.admin-dir-bar {
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.admin-dir-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.admin-dir-hint {
  font-size: 0.82rem;
  color: var(--bo-muted);
}

.admin-day-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@container menu-card (inline-size < 42rem) {
  .admin-toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-toolbar .admin-csv-btn {
    grid-column: 1 / -1;
  }
}

@container menu-card (inline-size < 24rem) {
  .admin-toolbar {
    grid-template-columns: 1fr;
  }
}

.section-heading {
  margin: 0 0 0.75rem 0;
  font-size: 1.02rem;
  color: var(--bo-slate);
}

.section-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.completion-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--bo-green);
}

/* Admin Kitchen Tally Cards */
.tally-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.tally-card {
  background: #fafcfa;
  border: 1px solid var(--bo-border);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
}

.tally-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed #e2e8e2;
  font-size: 0.9rem;
}

.tally-row:last-child {
  border-bottom: none;
}

.tally-count {
  background: var(--bo-slate);
  color: #fff;
  font-weight: 800;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  min-width: 2.2rem;
  text-align: center;
  flex-shrink: 0;
}

.tally-count.zero {
  background: #e0e4e0;
  color: #666;
}

/* Responsive Data Table (modern-web-guidance: responsive-table) */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(560px, 78dvh);
  container-type: inline-size;
  border: 1px solid var(--bo-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.table-wrapper table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.table-wrapper caption {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 800;
  color: var(--bo-slate);
  background: #f7faf7;
  border-bottom: 1px solid var(--bo-border);
}

.table-wrapper thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

.table-wrapper thead th {
  background: var(--bo-slate);
  color: #fff;
  font-weight: 700;
  text-align: left;
  padding: 0.7rem 0.85rem;
  white-space: nowrap;
}

.table-wrapper tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: #fff;
  font-weight: 700;
  color: var(--bo-slate);
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #edf1ed;
  border-right: 1px solid #edf1ed;
  white-space: nowrap;
}

.table-wrapper tbody td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #edf1ed;
  vertical-align: top;
}

.table-wrapper tbody tr:hover td,
.table-wrapper tbody tr:hover th {
  background-color: #f4f9f3;
}

@container (width < 640px) {
  .table-wrapper {
    border: none;
    background: transparent;
    max-block-size: none;
  }

  .table-wrapper caption {
    border: 1px solid var(--bo-border);
    border-radius: 8px;
    margin-block-end: 0.65rem;
  }

  .table-wrapper table,
  .table-wrapper thead,
  .table-wrapper tbody,
  .table-wrapper tr,
  .table-wrapper th,
  .table-wrapper td {
    display: block;
  }

  .table-wrapper thead {
    display: none;
  }

  .table-wrapper tr {
    margin-block-end: 0.85rem;
    border: 1px solid var(--bo-border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(11, 5, 75, 0.04);
  }

  .table-wrapper tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: #eef4ee;
    border-right: none;
    white-space: normal;
    font-size: 0.94rem;
  }

  .table-wrapper tbody td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    text-align: right;
  }

  .table-wrapper tbody td::before {
    text-align: left;
    color: var(--bo-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  .table-wrapper td:nth-child(2)::before {
    content: var(--label-2, "Class & Role") ": ";
    font-weight: 700;
  }
  .table-wrapper td:nth-child(3)::before {
    content: var(--label-3, "Dietary / Allergies") ": ";
    font-weight: 700;
  }
  .table-wrapper td:nth-child(4)::before {
    content: var(--label-4, "Starter") ": ";
    font-weight: 700;
  }
  .table-wrapper td:nth-child(5)::before {
    content: var(--label-5, "Main Course") ": ";
    font-weight: 700;
  }
  .table-wrapper td:nth-child(6)::before {
    content: var(--label-6, "Dessert") ": ";
    font-weight: 700;
  }
  .table-wrapper td:nth-child(7)::before {
    content: var(--label-7, "Special Note") ": ";
    font-weight: 700;
  }
}

/* Native Modal Dialogs (modern-web-guidance: light-dismiss-a-dialog & responsive-design) */
dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 780px;
  width: min(94dvw, 780px);
  box-shadow: var(--shadow-md);
  color: var(--bo-text);
}

dialog::backdrop {
  background-color: rgba(11, 5, 75, 0.55);
  backdrop-filter: blur(2px);
}

.dialog-inner {
  padding: clamp(1.1rem, 3vw, 1.5rem) clamp(1.1rem, 3vw, 1.75rem) calc(clamp(1.1rem, 3vw, 1.5rem) + env(safe-area-inset-bottom, 0px));
  max-height: 86dvh;
  overflow-y: auto;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--bo-border);
  padding-bottom: 0.85rem;
  margin-bottom: 1.1rem;
}

.dialog-header h2 {
  margin: 0;
  font-size: clamp(1.05rem, 0.95rem + 0.8vw, 1.25rem);
  color: var(--bo-slate);
  flex: 1;
  min-inline-size: 0;
}

.dialog-header .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1rem;
}

.dialog-actions-split {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.dialog-actions-right {
  display: flex;
  gap: 0.65rem;
  margin-left: auto;
}

.btn-danger-outline {
  background: #fff5f5;
  color: var(--bo-error);
  border: 1.5px solid #f2b8b5;
}

.btn-danger-outline:hover,
.btn-danger-outline:focus-visible {
  background: #fce8e6;
  border-color: var(--bo-error);
  color: #8c1d18;
}

.btn-danger-outline[hidden] {
  display: none !important;
}

.menu-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.9rem;
  background: #f8fbf8;
  border: 1px solid var(--bo-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.menu-meta-grid .field {
  margin-bottom: 0;
}

.menu-meta-grid .field-span-full {
  grid-column: 1 / -1;
}

.guest-toggle-box {
  background: #f0f8ee;
  border: 1px solid #c5dec0;
  padding: 0.75rem 0.95rem;
  border-radius: 8px;
}

.guest-toggle-label {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  margin: 0 !important;
  cursor: pointer;
}

.guest-toggle-label input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
  accent-color: var(--bo-green);
}

@media (max-width: 640px) {
  dialog {
    width: 100dvw;
    max-width: 100dvw;
    margin: auto 0 0 0;
    border-radius: 18px 18px 0 0;
  }
  .dialog-inner {
    max-height: 90dvh;
  }
  .menu-meta-grid {
    grid-template-columns: 1fr;
  }
  .dialog-actions,
  .dialog-actions-right {
    flex-direction: column-reverse;
    width: 100%;
  }
  .dialog-actions .btn {
    width: 100%;
  }
}

/* Toast Notification (safe-area aware) */
.toast-banner {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  left: auto;
  max-inline-size: min(26rem, calc(100dvw - 2rem));
  background: var(--bo-slate);
  color: #fff;
  padding: 0.8rem 1.15rem;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  border-left: 5px solid var(--bo-green);
  font-weight: 600;
  z-index: 50;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (max-width: 640px) {
  .toast-banner {
    left: max(0.85rem, env(safe-area-inset-left, 0px));
    right: max(0.85rem, env(safe-area-inset-right, 0px));
    max-inline-size: none;
  }
}

.toast-banner.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

/* Upload Dropzone */
.upload-box {
  border: 2px dashed var(--bo-green);
  background: #f4faf2;
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.1rem;
}

/* Print View for Horst's Kitchen Sheet */
@media print {
  .site-header,
  .no-print,
  .hotel-tabs,
  dialog {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .main-container {
    padding: 0;
    max-width: 100%;
  }
  .card {
    box-shadow: none;
    border: none;
    padding: 0;
  }
  .table-wrapper {
    max-block-size: none;
    overflow: visible;
  }
}
