:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --background: #f5f5f7;
  --surface: #ffffff;
  --surface-alt: #f0f1f2;
  --teal: #075b56;
  --teal-soft: #e4efed;
  --rose: #8e3446;
  --line: rgba(29, 29, 31, 0.1);
  --shadow: 0 18px 45px rgba(29, 29, 31, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--background);
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* <picture> is a transparent wrapper; let its <img> drive layout as before. */
picture {
  display: contents;
}

.preview-banner {
  /* Static on purpose: a sticky banner at top:0 would overlap the sticky
     topbar (also top:0) as soon as the page scrolls. */
  position: relative;
  padding: 0.5rem 1rem;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 650;
  text-align: center;
  letter-spacing: 0.01em;
  background: var(--rose);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  height: calc(62px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 1rem 0;
  background: rgba(245, 245, 247, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.6rem;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 1.04rem;
  font-weight: 650;
}

.brand small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

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

.admin-viewsite {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.admin-viewsite:hover {
  color: var(--ink);
}

.topbar-bookings {
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.5rem 0.95rem;
  white-space: nowrap;
}

.language-switcher {
  display: inline-flex;
  padding: 3px;
  background: #e9e9ed;
  border-radius: 8px;
}

.language-button {
  min-width: 40px;
  height: 38px;
  padding: 0 0.4rem;
  color: #515154;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 600;
}

.language-button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(29, 29, 31, 0.11);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--teal);
  background: var(--teal-soft);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.35rem;
  font-weight: 500;
}

.app-page {
  min-height: calc(100vh - 62px);
}

.hero {
  position: relative;
  display: flex;
  align-items: end;
  min-height: min(67svh, 610px);
  overflow: hidden;
  color: white;
  background: #121113;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgba(12, 13, 15, 0.84), rgba(12, 13, 15, 0.12) 62%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1220px;
  padding: 2rem 1.1rem 1.65rem;
}

.kicker {
  margin: 0 0 0.55rem;
  color: var(--rose);
  font-size: 0.77rem;
  font-weight: 650;
  text-transform: uppercase;
}

.hero .kicker {
  color: rgba(255, 255, 255, 0.78);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: 2.55rem;
  font-weight: 650;
}

h2 {
  font-size: 1.72rem;
  font-weight: 650;
}

.hero-copy > p:not(.kicker) {
  max-width: 29rem;
  margin: 0.85rem 0 1.4rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  line-height: 1.5;
}

.hero-actions,
.info-actions,
.event-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.button,
.tab {
  border: 0;
  cursor: pointer;
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1.05rem;
  border-radius: 8px;
  transition: background 150ms ease, opacity 150ms ease;
}

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

.secondary {
  color: var(--teal);
  background: var(--teal-soft);
}

.glass {
  color: white;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
}

.danger {
  color: #a1283d;
  background: #f8e8eb;
}

.ghost {
  color: var(--teal);
  background: transparent;
  border: 1px solid var(--line);
}

.button:hover,
.tab:hover,
.asset-tile:hover,
.admin-event:hover {
  opacity: 0.82;
}

.calendar-shell {
  padding: 1.45rem 1rem 2.25rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.05rem;
}

.section-heading .kicker {
  margin-bottom: 0.35rem;
}

.feed-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  min-height: 40px;
  color: var(--teal);
  font-size: 0.94rem;
  font-weight: 600;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 3px;
  margin-bottom: 0.6rem;
  background: #e9e9ed;
  border-radius: 8px;
}

.tab {
  min-height: 40px;
  padding: 0.6rem 0.7rem;
  color: #515154;
  background: transparent;
  border-radius: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(29, 29, 31, 0.1);
}

/* Archive month navigation */
.archive-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.archive-month-label {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.archive-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: opacity 150ms ease;
  flex-shrink: 0;
}

.archive-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.archive-nav-btn:not(:disabled):hover {
  opacity: 0.75;
}

.status {
  color: var(--muted);
  line-height: 1.5;
}

.event-grid {
  display: grid;
  gap: 0.75rem;
}

.event-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  overflow: hidden;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.event-open {
  display: block;
  align-self: start;
  aspect-ratio: 1;
  background: #111214;
}

.event-image {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.event-body {
  min-width: 0;
  padding: 0.78rem;
}

.event-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
  color: var(--rose);
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
}

.event-title-link {
  display: block;
}

.event-title {
  font-size: 1.16rem;
  font-weight: 650;
}

.event-announcement {
  display: -webkit-box;
  margin: 0.48rem 0 0.7rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.event-card .event-facts {
  display: none;
}

.event-card .button {
  min-height: 36px;
  padding: 0.48rem 0.65rem;
  font-size: 0.78rem;
}

.event-facts {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.event-facts div {
  min-width: 0;
  padding: 0.76rem;
  background: var(--surface-alt);
  border-radius: 8px;
}

.event-facts dt {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.event-facts dd {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.3;
}

.info-band {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 2.25rem 1rem calc(2.25rem + env(safe-area-inset-bottom));
  color: white;
  background: #153633;
}

.info-band h2 {
  font-size: 1.6rem;
}

.info-band p:not(.kicker) {
  margin: 0.55rem 0 0;
  color: rgba(255, 255, 255, 0.7);
}

.info-band .kicker {
  color: rgba(255, 255, 255, 0.64);
}

.info-band .secondary {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.info-actions {
  gap: 0.7rem;
}

.info-actions .cta {
  position: relative;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0 1.5rem;
  border-radius: 999px;
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 220ms cubic-bezier(0.2, 0.7, 0.2, 1),
    background-color 220ms ease;
}

.info-actions .cta .cta-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  opacity: 0.95;
}

.info-actions .cta.primary {
  color: white;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 58%),
    var(--teal);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 10px 28px rgba(7, 91, 86, 0.42),
    0 2px 6px rgba(0, 0, 0, 0.2);
}

.info-actions .cta.secondary {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 22px rgba(0, 0, 0, 0.2);
}

.info-actions .cta:hover {
  transform: translateY(-1px);
  opacity: 1;
}

.info-actions .cta.primary:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 58%),
    var(--teal);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 14px 34px rgba(7, 91, 86, 0.5),
    0 3px 8px rgba(0, 0, 0, 0.24);
}

.info-actions .cta.secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 12px 30px rgba(0, 0, 0, 0.24);
}

.info-actions .cta:active {
  transform: translateY(0);
  transition-duration: 100ms;
}

.info-actions .cta:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .info-actions .cta {
    transition: none;
  }
  .info-actions .cta:hover {
    transform: none;
  }
}

.page-nav {
  max-width: 1120px;
  padding: 0.85rem 1rem 0;
  margin: 0 auto;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 44px;
  padding: 0 0.2rem 0 0;
  color: var(--teal);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 550;
}

.back-button span:first-child {
  font-size: 2rem;
  line-height: 1;
}

.event-detail {
  display: grid;
  gap: 1.1rem;
  max-width: 1120px;
  padding: 0.25rem 1rem calc(2.5rem + env(safe-area-inset-bottom));
  margin: 0 auto;
}

.detail-poster {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #121315;
  border-radius: 8px;
}

.detail-copy {
  min-width: 0;
}

.detail-copy h1 {
  margin-bottom: 0.9rem;
  font-size: 1.85rem;
}

.detail-announcement {
  margin: 0 0 1.2rem;
  color: #424245;
  font-size: 1rem;
  line-height: 1.58;
}

.detail-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.detail-actions .button {
  flex: 1 1 135px;
}

.event-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  color: var(--teal);
  background: var(--teal-soft);
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.77rem;
  font-weight: 650;
  white-space: nowrap;
  transition: opacity 150ms ease;
}

.event-action-link::after {
  content: none;
}

.event-action-link:hover {
  opacity: 0.78;
  text-decoration: none;
}

.event-action-link svg {
  flex-shrink: 0;
}

/* Card booking action: filled when bookable, soft-green when already reserved. */
.event-action-link.book-event {
  color: #fff;
  background: var(--teal);
}
.event-action-link.book-event.is-reserved {
  color: #1a7a4a;
  background: #e6f7ee;
}

.share-event,
.share-detail {
  appearance: none;
}

.detail-status {
  padding: 3rem 0;
}

.install-page {
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
}

.install-content {
  max-width: 720px;
  padding: 1.35rem 1rem;
  margin: 0 auto;
}

.install-content h2 {
  margin-bottom: 0.9rem;
  font-size: 2rem;
}

.install-intro {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.install-prompt-action {
  width: 100%;
  margin-bottom: 1.5rem;
}

.install-options {
  border-top: 1px solid var(--line);
}

.install-options section {
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--line);
}

.install-options h2 {
  margin-bottom: 0.45rem;
  font-size: 1.2rem;
}

.install-options p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-page {
  background: var(--background);
}

.admin-console {
  max-width: 1480px;
  padding: 1rem;
  margin: 0 auto;
}

.admin-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1.25rem;
  margin-bottom: 0.9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.admin-hero-copy {
  min-width: 0;
}

.admin-hero h1 {
  margin: 0.1rem 0 0;
  font-size: 1.7rem;
  line-height: 1.1;
}

.admin-hero-sub {
  margin: 0.35rem 0 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.admin-hero-new {
  flex-shrink: 0;
  gap: 0.4rem;
  min-height: 46px;
  padding: 0.6rem 1.25rem;
  font-size: 0.98rem;
}

.storage-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.45rem 0.65rem;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
}

.admin-list-controls {
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem;
  margin-bottom: 0.75rem;
  background: var(--surface-alt);
  border-radius: 8px;
}

.admin-list-controls label {
  gap: 0.28rem;
}

.toggle-filter {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.45rem;
  min-height: 34px;
}

.toggle-filter input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--teal);
}

.admin-workspace {
  display: grid;
  gap: 0.75rem;
}

.admin-system-footer {
  padding: 0.95rem 0 calc(0.2rem + env(safe-area-inset-bottom));
}

.technical-status {
  padding: 0.9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.technical-status summary {
  width: max-content;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}

.technical-status .storage-modes {
  padding-top: 0.65rem;
}

.cloud-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
  padding-top: 0.8rem;
}

.cloud-status-card {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.72rem;
  background: var(--surface-alt);
  border-radius: 8px;
}

.cloud-status-card strong {
  font-size: 0.77rem;
  font-weight: 650;
}

.cloud-status-card span {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.cloud-status-reason {
  margin: 0.72rem 0 0;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}

.cloud-status-reason.is-warning {
  color: var(--rose);
}

.cloud-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.7rem;
}

.cloud-links a {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 650;
}

.admin-editor,
.admin-list {
  min-width: 0;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-margin-top: calc(112px + env(safe-area-inset-top));
}

.admin-editor h2,
.admin-list h2 {
  font-size: 1.22rem;
}

.compact-heading {
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

/* Let the title keep its own row and push the action button below it on
   narrow screens, instead of squeezing the heading until it breaks mid-word. */
.compact-heading > div {
  flex: 1 1 auto;
}

.compact-heading h2 {
  overflow-wrap: normal;
}

.compact-heading .kicker {
  margin-bottom: 0.3rem;
}

.compact-heading .button {
  min-height: 38px;
  padding: 0.5rem 0.8rem;
}

.edit-state {
  padding: 0.4rem 0.55rem;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
}

.editor-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.event-form,
.form-grid {
  display: grid;
  gap: 0.78rem;
}

.template-picker {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.8rem;
  margin: 0;
  background: var(--surface-alt);
  border: 0;
  border-radius: 8px;
}

.template-picker legend {
  padding: 0;
  color: #515154;
  font-size: 0.8rem;
  font-weight: 600;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.template-option {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  min-height: 58px;
  padding: 0.58rem 0.62rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.template-option strong,
.template-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-option strong {
  font-size: 0.82rem;
  font-weight: 650;
}

.template-option span {
  color: var(--muted);
  font-size: 0.7rem;
}

.time-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label,
.field-title {
  display: grid;
  gap: 0.35rem;
  color: #515154;
  font-size: 0.8rem;
  font-weight: 550;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  padding: 0.72rem 0.75rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  outline: none;
}

/* Admin form controls inherit `font: inherit` from their 0.8rem <label>, so
   every field computed to 12.8px and made iOS Safari auto-zoom on focus. The
   CMS is used on phones — force the 16px no-zoom threshold. */
.admin-page input,
.admin-page textarea,
.admin-page select {
  font-size: 1rem;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(7, 91, 86, 0.12);
}

.poster-picker {
  display: grid;
  gap: 0.72rem;
  min-width: 0;
  padding: 0.8rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.poster-picker legend {
  padding: 0 0.3rem;
  color: #515154;
  font-size: 0.8rem;
  font-weight: 600;
}

.poster-picker .poster-selection {
  margin: 0;
}

.poster-picker .poster-selection img {
  max-height: 270px;
  aspect-ratio: 1;
  object-fit: cover;
}

.poster-picker .upload-field {
  margin: 0;
}

/* Upload button (styled label) + library button side-by-side */
.poster-actions {
  display: flex;
  gap: 0.5rem;
}

.poster-actions .button,
.poster-actions .upload-label {
  flex: 1;
  justify-content: center;
  cursor: pointer;
}

/* Hide the actual file input; the label click opens the picker */
.upload-label input[type="file"] {
  display: none;
}

/* Poster library dialog — wider than the confirm dialog */
.poster-library-dialog {
  width: min(calc(100% - 2rem), 720px);
  max-height: 85vh;
  overflow-y: auto;
}

.poster-library-content {
  display: grid;
  gap: 0.85rem;
  padding: 1.15rem;
}

.poster-library-content h2 {
  margin: 0;
  font-size: 1.2rem;
}

.poster-library-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.poster-library-dialog .asset-grid {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.55rem;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.45;
}

.fixed-venue {
  display: grid;
  gap: 0.3rem;
  padding: 0.78rem;
  background: var(--surface-alt);
  border-radius: 8px;
}

.field-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.fixed-venue .field-title {
  margin: 0;
}

.fixed-venue strong {
  font-size: 0.92rem;
}

.fixed-venue > span:not(.fixed-chip) {
  color: var(--muted);
  font-size: 0.82rem;
}

.fixed-chip,
.optional-chip {
  padding: 0.25rem 0.45rem;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
}

.optional-field small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
}

/* Publication + bookings sit side by side on wide screens, stacked on phones. */
.editor-settings-grid {
  display: grid;
  gap: 0.7rem;
}

.publication-panel,
.reservations-panel {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  padding: 0.85rem;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.reservations-panel .field-title { margin: 0; }
.reservations-toggle { align-items: center; }
.reservation-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
}
.reservation-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.reservation-links .button { flex: 1 1 auto; min-height: 40px; }
.staff-copy-link { width: 100%; min-height: 40px; }

.publication-panel .field-title {
  margin: 0;
}

.publication-badge {
  display: inline-flex;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.form-actions .unpublish {
  color: var(--rose);
  background: #f8e8eb;
}

.form-actions {
  padding: 0.7rem 0 0;
  align-items: center;
}

.form-actions .button {
  flex: 1 1 130px;
}

/* On phones the editor is a long single column, so keep Save/Publish reachable
   by pinning the action row to the bottom of the viewport while editing. */
@media (max-width: 899px) {
  .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 6;
    margin-inline: -0.9rem;
    padding: 0.7rem 0.9rem calc(0.7rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--line);
  }
}

/* Auto-save indicator chip */
.auto-save-chip {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.25rem 0.55rem;
  border-radius: 20px;
  flex-shrink: 0;
  transition: opacity 250ms ease;
}
.auto-save-chip.is-pending {
  color: var(--muted);
  background: var(--surface-alt);
}
.auto-save-chip.is-saved {
  color: #1a7a4a;
  background: #e6f7ee;
}
.auto-save-chip.is-error {
  color: var(--rose);
  background: #f8e8eb;
}

/* ── Translations panel ──────────────────────────────────────────────────── */

.translations-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.78rem;
  background: var(--surface-alt);
  border-radius: 8px;
}

.translations-panel .field-title {
  margin: 0;
}

.translation-block {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
}

.translation-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  user-select: none;
  gap: 0.5rem;
}

.translation-block-header::-webkit-details-marker { display: none; }

.translation-block[open] .translation-block-header {
  border-bottom: 1px solid var(--line);
}

.translation-block-header::before {
  content: '›';
  display: inline-block;
  font-size: 1rem;
  color: var(--muted);
  transition: transform 150ms ease;
  flex-shrink: 0;
}
.translation-block[open] > .translation-block-header::before {
  transform: rotate(90deg);
}

.translation-state {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.42rem;
  border-radius: 20px;
  flex-shrink: 0;
  margin-left: auto;
}
.translation-state.is-ready  { color: #1a7a4a; background: #e6f7ee; }
.translation-state.is-partial { color: #8a5d00; background: #fff3cc; }
.translation-state.is-missing { color: var(--muted); background: var(--surface-alt); }

.translation-fields {
  display: grid;
  gap: 0.6rem;
  padding: 0.75rem;
}

.translation-fields label {
  display: grid;
  gap: 0.28rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.translation-fields input,
.translation-fields textarea {
  /* 16px: anything smaller makes iOS Safari auto-zoom on focus. The admin is
     used on phones, so the translation fields must not trigger it either. */
  font-size: 1rem;
}

.translation-fields textarea {
  min-height: 80px;
  resize: vertical;
}

.draft-management {
  display: grid;
  gap: 0.42rem;
  padding-top: 1.05rem;
  margin-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.draft-management .field-title {
  margin: 0;
}

.delete-draft-button {
  justify-self: start;
  min-height: 36px;
  padding: 0;
  margin-top: 0.15rem;
  color: var(--rose);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

.delete-draft-button:disabled {
  opacity: 0.42;
  cursor: default;
}

.confirm-dialog {
  width: min(calc(100% - 2rem), 390px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(29, 29, 31, 0.2);
}

.template-dialog {
  width: min(calc(100% - 2rem), 560px);
}

.confirm-dialog::backdrop {
  background: rgba(29, 29, 31, 0.28);
  backdrop-filter: blur(5px);
}

.confirm-dialog-content {
  display: grid;
  gap: 0.75rem;
  padding: 1.15rem;
}

.confirm-dialog-content h2 {
  margin: 0;
  font-size: 1.2rem;
}

.confirm-dialog-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.48;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-heading .kicker {
  margin: 0 0 0.22rem;
}

.icon-close-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  color: var(--muted);
  background: var(--surface-alt);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-top: 0.3rem;
}

.confirm-dialog-actions .button {
  min-height: 42px;
  padding-block: 0.55rem;
}

.admin-events {
  display: grid;
  gap: 0.5rem;
}

.admin-event {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.35rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.admin-event.active {
  background: var(--teal-soft);
  border-color: rgba(7, 91, 86, 0.22);
}

.admin-event img {
  width: 58px;
  aspect-ratio: 1;
  object-fit: cover;
  background: #151519;
  border-radius: 6px;
}

.admin-event strong,
.admin-event small {
  display: block;
}

.admin-event strong {
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-event small {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.event-row-copy em {
  display: inline-flex;
  padding: 0.16rem 0.38rem;
  margin-top: 0.32rem;
  border-radius: 5px;
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
}

.is-published {
  color: var(--teal);
  background: rgba(7, 91, 86, 0.12);
}

.is-draft {
  color: var(--rose);
  background: rgba(142, 52, 70, 0.1);
}

.poster-selection {
  margin: 0 0 0.85rem;
}

.poster-selection img {
  width: 100%;
  max-height: 310px;
  aspect-ratio: 1;
  object-fit: cover;
  background: #151519;
  border-radius: 8px;
}

.poster-selection figcaption {
  padding-top: 0.42rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-field {
  margin-bottom: 0.85rem;
}

.asset-window {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.asset-tile {
  min-width: 0;
  padding: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.asset-thumb {
  position: relative;
  display: block;
}

.asset-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #151519;
  border-radius: 6px;
}

/* Usage badge in the top-right corner of each poster thumbnail. */
.asset-uses {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  padding: 0.1rem 0.4rem;
  border-radius: 20px;
  background: rgba(7, 91, 86, 0.92);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;
}

.asset-tile > span:last-child,
.asset-empty {
  display: block;
  margin-top: 0.3rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 620px) {
  .topbar {
    padding-inline: 1.5rem;
  }

  .hero-copy,
  .calendar-shell,
  .info-band {
    padding-inline: clamp(1.5rem, 6vw, 4rem);
  }

  .hero-copy {
    padding-bottom: 2.6rem;
  }

  h1 {
    font-size: 3.35rem;
  }

  /* Keep the calendar narrow and centered on wide screens. */
  .calendar-shell {
    max-width: 880px;
    margin-inline: auto;
  }

  /* Horizontal cards like mobile: square poster on the left, info on the right. */
  .event-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
  }

  .event-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: stretch;
  }

  .event-open {
    align-self: start;
    aspect-ratio: 1;
    min-height: 0;
  }

  .event-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: contain;
  }

  .event-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1rem 1.15rem;
  }

  .event-announcement {
    -webkit-line-clamp: 3;
  }

  .event-card .event-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 0 0.9rem;
  }

  .event-actions {
    margin-top: auto;
  }

  .info-band {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .event-detail {
    grid-template-columns: minmax(270px, 46%) minmax(280px, 1fr);
    align-items: start;
    gap: clamp(1.5rem, 4vw, 3.2rem);
    padding-top: 0.55rem;
  }

  .detail-poster {
    position: sticky;
    top: calc(78px + env(safe-area-inset-top));
    max-height: none;
  }

  .detail-copy {
    padding-top: 0.35rem;
  }

  .detail-copy h1 {
    font-size: 2.2rem;
  }

  .install-content {
    padding-top: 2rem;
  }

  .admin-console {
    padding: 1.2rem;
  }
}

@media (min-width: 900px) {
  .topbar {
    padding-inline: clamp(2rem, 5vw, 4rem);
  }

  .admin-page .topbar {
    height: calc(72px + env(safe-area-inset-top));
  }

  .hero {
    min-height: min(66svh, 620px);
  }

  .hero-copy {
    padding-bottom: 3.1rem;
  }

  h1 {
    font-size: 4rem;
  }

  .calendar-shell {
    max-width: 1320px;
    margin: 0 auto;
    padding-block: 2.4rem 3.1rem;
  }

  .info-band {
    padding-block: 3rem;
  }

  .admin-console {
    max-width: 1680px;
    padding: 1.5rem clamp(1.5rem, 3vw, 3rem) 1rem;
  }

  .admin-hero {
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
  }

  .admin-hero h1 {
    font-size: 2rem;
  }

  .admin-workspace {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 1.25rem;
  }

  .editor-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: start;
  }

  .admin-editor,
  .admin-list {
    padding: 1.15rem;
  }

  .admin-list {
    position: sticky;
    top: calc(88px + env(safe-area-inset-top));
  }

  .admin-list-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .poster-picker {
    grid-template-columns: 230px minmax(0, 1fr);
    align-items: start;
    column-gap: 0.9rem;
  }

  .poster-picker .poster-selection {
    grid-row: span 2;
  }

  .poster-picker .poster-selection img {
    height: 250px;
  }
}

@media (max-width: 460px) {
  .topbar {
    gap: 0.35rem;
    padding-inline: 0.7rem;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: 0.96rem;
  }

  .brand small {
    display: none;
  }

  /* The brand logo already links home, so drop the secondary text link here. */
  .admin-viewsite {
    display: none;
  }

  .topbar-bookings span {
    display: none;
  }

  .topbar-bookings {
    padding: 0.5rem 0.7rem;
  }

  .language-button {
    min-width: 36px;
    padding-inline: 0.25rem;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 400px) {
  .topbar {
    height: auto;
    min-height: calc(62px + env(safe-area-inset-top));
    flex-wrap: wrap;
    padding-bottom: 0.65rem;
  }

  .topbar-tools {
    margin-left: auto;
  }

  .hero {
    min-height: 62svh;
  }

  h1 {
    font-size: 2.25rem;
  }

  .event-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .event-body {
    padding: 0.68rem;
  }

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

/* ── Book a table (event detail CTA) ─────────────────────────────────────── */
.book-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0 1rem;
  width: 100%;
  max-width: 320px;
}

/* "You're reserved" note shown instead of the Book button once booked. */
.reservation-note {
  margin: 0.2rem 0 1rem;
  padding: 0.85rem 1rem;
  max-width: 360px;
  background: var(--teal-soft);
  border: 1px solid rgba(7, 91, 86, 0.25);
  border-radius: 12px;
}
.reservation-note-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.35rem;
  color: var(--teal);
  font-weight: 700;
}
.reservation-note-seats { margin: 0 0 0.25rem; color: var(--ink); font-weight: 600; }
.reservation-note-ref { margin: 0; color: var(--muted); font-size: 0.88rem; }
.reservation-note-ref strong { color: var(--ink); letter-spacing: 0.5px; }
.reservation-note-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--teal);
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Booking page ────────────────────────────────────────────────────────── */
.booking-body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
}

.booking-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem clamp(0.8rem, 4vw, 1.6rem);
  padding-top: calc(0.6rem + env(safe-area-inset-top));
  background: rgba(245, 245, 247, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.booking-main {
  max-width: 900px;
  margin-inline: auto;
  padding: 1rem clamp(0.8rem, 4vw, 1.6rem) 6rem;
}

.booking-head h1 {
  margin: 0.6rem 0 0.2rem;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.booking-when {
  margin: 0 0 0.3rem;
  color: var(--teal);
  font-weight: 600;
}

.booking-instructions {
  margin: 0 0 0.6rem;
  color: var(--muted);
}

.booking-status {
  margin: 0.5rem 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-weight: 600;
}

.booking-status.is-warn {
  color: var(--rose);
  background: #f8e8eb;
}

.plan-wrap {
  position: relative;
  margin-top: 0.6rem;
}

.plan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
}
.swatch-open { background: var(--teal-soft); }
.swatch-partial { background: #ffe7b3; border-color: #d99a16; }
.swatch-full { background: #d2d2d7; border-color: #adadb3; }
.swatch-selected { background: var(--teal); border-color: var(--teal); }
.swatch-arrived { background: #1a7a4a; border-color: #11623a; }
.swatch-single { background: var(--teal-soft); border-style: dashed; }
.swatch-bar { background: #e2e0fb; border-color: #6c63d8; }

.plan-zoom-controls {
  /* Anchored inside .plan-viewport (position: relative), so the buttons stay
     in the plan's corner no matter how many rows the legend wraps to. */
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.plan-zoom-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(29, 29, 31, 0.12);
}
.plan-zoom-controls button:hover { background: var(--surface-alt); }

.plan-viewport {
  position: relative;
  height: clamp(380px, 64vh, 680px);
  overflow: hidden;
  background: linear-gradient(180deg, #fbfbfc, #f1f2f4);
  border: 1px solid var(--line);
  border-radius: 14px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.plan-viewport:active { cursor: grabbing; }

.plan-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* SVG decoration */
.decor { fill: #e9e9ee; stroke: #d4d4da; stroke-width: 1.5; }
.decor-bar { fill: #e7e7ec; }
.decor-dj { fill: #efe7f5; stroke: #c9b6dd; }
.decor-room { fill: #eef1f0; }
.decor-label { fill: #6e6e73; font-size: 16px; font-weight: 700; letter-spacing: 2px; }
.decor-text { fill: #8e8e93; font-size: 13px; font-weight: 600; letter-spacing: 1px; }

/* Tables — body is clickable to take the whole table */
.table-shape { fill: #ffffff; stroke: #b7b7c0; stroke-width: 2; cursor: pointer; transition: fill 120ms ease; }
.table-shape.table-open { fill: #ffffff; }
.table-shape.table-partial { fill: #fff4e0; stroke: #e6b75e; }
.table-shape.table-full { fill: #e6e6ea; stroke: #bdbdc4; cursor: not-allowed; }
.table-shape.table-selected { fill: #cfe8e3; stroke: var(--teal); stroke-width: 2.5; }
.table-shape:focus { outline: none; }
.table-shape:focus-visible { stroke: var(--teal); stroke-width: 3; }
.table-num { fill: #1d1d1f; font-size: 22px; font-weight: 700; }

/* Seats (chairs) */
.seat { stroke-width: 2; cursor: pointer; transition: fill 120ms ease, transform 120ms ease; }
/* Invisible tap halo under each chair — catches near-miss taps on phones. */
.seat-hit { fill: transparent; stroke: none; pointer-events: all; cursor: pointer; }
.seat-free { fill: var(--teal-soft); stroke: var(--teal); }
.seat-booked { fill: #c8c8ce; stroke: #97979e; cursor: pointer; }
.seat-arrived { fill: #1a7a4a; stroke: #11623a; cursor: pointer; }
.seat-arrived + .seat-label { fill: #ffffff; }
.seat-selected { fill: var(--teal); stroke: #053f3b; }
/* Free-standing single chairs: dashed ring so they read as loose chairs. */
.seat-single { stroke-dasharray: 3 2.5; }
.seat-free:hover { fill: #bfe0db; }
.seat:focus { outline: none; }
.seat:focus-visible { stroke: var(--teal); stroke-width: 3.5; }
/* Bar stools — distinct indigo accent so they read as bar, not table chairs */
.seat-bar.seat-free { fill: #e2e0fb; stroke: #6c63d8; }
.seat-bar.seat-free:hover { fill: #d3d0f6; }
.seat-label { font-size: 11px; font-weight: 700; fill: #3a3a40; }
.seat-selected + .seat-label { fill: #ffffff; }

/* Bottom sheet */
.booking-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  margin-inline: auto;
  max-width: 520px;
  /* Short viewports (phone landscape): scroll inside the sheet instead of
     pushing the seats summary and Name field off-screen. */
  max-height: calc(100dvh - 0.75rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 40px rgba(29, 29, 31, 0.22);
  padding: 0.6rem clamp(1rem, 4vw, 1.4rem) calc(1.1rem + env(safe-area-inset-bottom));
  animation: sheet-up 180ms ease;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.booking-sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #d2d2d7;
  margin: 0.1rem auto 0.7rem;
}

.booking-sheet-seats {
  margin: 0 0 0.7rem;
  font-weight: 700;
  color: var(--teal);
}

.booking-form { display: grid; gap: 0.7rem; }

.booking-form-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.2rem;
}
.booking-form-actions .button { flex: 1; }

.booking-form-error {
  margin: 0.1rem 0 0;
  color: var(--rose);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Confirmation overlay */
.booking-confirm {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(29, 29, 31, 0.4);
  backdrop-filter: blur(5px);
}

.booking-confirm-card {
  width: min(100%, 380px);
  background: var(--surface);
  border-radius: 16px;
  padding: 1.6rem 1.4rem;
  text-align: center;
  box-shadow: 0 24px 70px rgba(29, 29, 31, 0.28);
}

.confirm-check {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e6f7ee;
  color: #1a7a4a;
  font-size: 1.8rem;
  font-weight: 800;
}

.booking-confirm-card h2 { margin: 0 0 0.5rem; font-size: 1.3rem; }
.confirm-seats { margin: 0.2rem 0; font-weight: 600; }
.confirm-ref { margin: 0.4rem 0; color: var(--muted); }
.confirm-ref strong { color: var(--ink); letter-spacing: 1px; }
.confirm-email { margin: 0.3rem 0 0.9rem; color: #1a7a4a; font-size: 0.9rem; }
.booking-confirm-card .button { width: 100%; margin-top: 0.4rem; }

@media (min-width: 620px) {
  .plan-viewport { height: clamp(440px, 68vh, 720px); }
}

/* ── Staff reservations ──────────────────────────────────────────────────── */
.staff-body { margin: 0; min-height: 100vh; background: var(--background); color: var(--ink); }

/* 16px inputs: anything smaller makes iOS Safari auto-zoom on focus and stay
   zoomed — disorienting mid-reservation. Applies to booking too. */
.staff-body input,
.staff-body textarea,
.booking-body input,
.booking-body textarea {
  font-size: 1rem;
}

.staff-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.7rem clamp(0.9rem, 4vw, 1.8rem);
  padding-top: calc(0.7rem + env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.staff-gate {
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  min-height: 70vh;
}

.staff-gate-card {
  width: min(100%, 380px);
  display: grid;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.staff-gate-card h1 { margin: 0; font-size: 1.4rem; }
.staff-gate-card p { margin: 0; color: var(--muted); }
.staff-error { color: var(--rose); font-weight: 600; }

.staff-main {
  max-width: 960px;
  margin-inline: auto;
  padding: 1.2rem clamp(0.9rem, 4vw, 1.8rem) 4rem;
}

.staff-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.staff-head h1 { margin: 0.2rem 0; font-size: 1.5rem; }
.staff-when { margin: 0; color: var(--teal); font-weight: 600; }

.staff-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.staff-count { color: var(--muted); font-size: 0.9rem; }
.staff-count strong { color: var(--ink); }

.staff-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.staff-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.92rem;
}
.staff-table th, .staff-table td {
  padding: 0.6rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.staff-table th { background: var(--surface-alt); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.staff-table td.num { font-weight: 700; text-align: center; width: 3.2rem; }
.staff-table td.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); white-space: nowrap; }
.staff-table tr:last-child td { border-bottom: 0; }

.staff-empty { color: var(--muted); padding: 1.5rem 0; }

.staff-section-title {
  margin: 1.2rem 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.staff-event-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.staff-event-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.staff-event-list a:hover { background: var(--surface-alt); }
.staff-event-main { display: grid; gap: 0.15rem; min-width: 0; }
.staff-event-main strong { color: var(--ink); }
.staff-event-main span { color: var(--muted); font-size: 0.9rem; }
.staff-event-count {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 0.22rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}
.staff-event-count.is-empty { color: var(--muted); background: var(--surface-alt); font-weight: 600; }

@media print {
  .staff-topbar, .staff-actions, .staff-signout { display: none !important; }
  .staff-main { padding: 0; max-width: none; }
  .staff-table { border: 1px solid #999; font-size: 11pt; }
  .staff-table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
}

/* ── Dark theme for booking + staff pages (follows the device preference) ──── */
@media (prefers-color-scheme: dark) {
  .booking-body,
  .staff-body {
    --ink: #e9e9ee;
    --muted: #a3a7b0;
    --background: #131419;
    --surface: #1e2026;
    --surface-alt: #2a2d35;
    --line: rgba(255, 255, 255, 0.14);
    --teal-soft: #173f3b;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
    color: var(--ink);
    background: var(--background);
  }

  .booking-topbar { background: rgba(19, 20, 25, 0.9); }

  /* Inputs need an explicit dark surface (global rules assume light). */
  .booking-body input, .booking-body textarea,
  .staff-body input, .staff-body textarea {
    background: #15171c;
    color: var(--ink);
    border-color: #3a3e48;
  }
  .booking-body input:focus, .booking-body textarea:focus,
  .staff-body input:focus, .staff-body textarea:focus {
    border-color: #3fcabb;
    box-shadow: 0 0 0 3px rgba(63, 202, 187, 0.22);
  }

  /* Secondary buttons: lighten text so it isn't teal-on-dark. */
  .booking-body .button.secondary,
  .staff-body .button.secondary { color: #66d8cb; background: #173f3b; }

  /* Teal text: --teal stays #075b56 (it is also the primary-button background),
     so every var(--teal)-colored text needs the light variant in dark mode. */
  .booking-body .booking-when,
  .booking-body .booking-sheet-seats,
  .staff-body .staff-when,
  .staff-body .staff-occupants-title,
  .staff-body .staff-reserve-seats,
  .staff-body .staff-event-count:not(.is-empty),
  .staff-body .staff-sort-btn.active { color: #66d8cb; }
  .staff-body .staff-sort-btn.active { border-color: #46cdbe; }
  .staff-body .staff-reserve-msg.is-ok { color: #8fe7b8; }
  .booking-body .swatch-single { border-color: #46cdbe; }

  /* --rose (#8e3446) is never redefined for dark mode, so error/danger text
     (wrong code, failed save, the destructive Cancel) was dark-wine-on-dark
     ~2:1 — exactly the moments staff most need to read it. Lighten it. */
  .booking-body .booking-form-error,
  .staff-body .staff-error,
  .staff-body .staff-reserve-msg.is-error,
  .staff-body .staff-menu-item.is-danger { color: #f08a9b; }

  /* Plan surface + controls */
  .plan-viewport { background: linear-gradient(180deg, #1b1d23, #23262e); }
  .plan-zoom-controls button { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }

  /* SVG decoration */
  .decor { fill: #2b2e36; stroke: #3c4049; }
  .decor-bar { fill: #2e313a; }
  .decor-dj { fill: #322c47; stroke: #534c79; }
  .decor-room { fill: #2a2e34; }
  .decor-label { fill: #c4c8d2; }
  .decor-text { fill: #9aa0ab; }

  /* Tables */
  .table-shape { fill: #2a2d35; stroke: #5a5f6b; }
  .table-shape.table-open { fill: #2a2d35; }
  .table-shape.table-partial { fill: #473813; stroke: #caa341; }
  .table-shape.table-full { fill: #20222899; stroke: #3a3d45; }
  .table-shape.table-selected { fill: #0f4f49; stroke: #46cdbe; }
  .table-num { fill: #f1f1f5; }

  /* Seats */
  .seat-free { fill: #1d4f4a; stroke: #46cdbe; }
  .seat-free:hover { fill: #266860; }
  .seat-booked { fill: #3a3d45; stroke: #5a5f69; }
  .seat-arrived { fill: #2f9e63; stroke: #8fe0b3; }
  .seat-arrived + .seat-label { fill: #04240f; }
  .seat-selected { fill: #33c2b4; stroke: #bdeee8; }
  .seat-bar.seat-free { fill: #2b2766; stroke: #8f86f2; }
  .seat-bar.seat-free:hover { fill: #373081; }
  .seat-label { fill: #d6d8e0; }
  .seat-selected + .seat-label { fill: #062f2c; }

  /* Legend chips */
  .swatch-open { background: #1d4f4a; border-color: #46cdbe; }
  .swatch-partial { background: #473813; border-color: #caa341; }
  .swatch-full { background: #3a3d45; border-color: #5a5f69; }
  .swatch-selected { background: #33c2b4; border-color: #33c2b4; }
  .swatch-arrived { background: #2f9e63; border-color: #2f9e63; }
  .swatch-bar { background: #2b2766; border-color: #8f86f2; }

  .booking-status.is-warn { color: #ffb4c0; background: #3a1f25; }
  .confirm-email { color: #6fe0a8; }
}

/* ── Staff reservations: one screen (plan + list) ────────────────────────── */
.staff-toolbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.6rem 0 1rem; }
.staff-subtabs { display: inline-flex; gap: 0.3rem; padding: 3px; background: var(--surface-alt); border-radius: 10px; }
.staff-subtab {
  min-height: 44px; padding: 0.3rem 0.95rem;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-weight: 650; cursor: pointer;
}
.staff-subtab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.staff-toolbar .staff-count { margin-left: auto; }

.staff-occupants {
  margin-top: 0.8rem; padding: 0.85rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.staff-occupants-title { margin: 0 0 0.4rem; font-weight: 700; color: var(--teal); }
.staff-occupants-row { margin: 0.2rem 0; font-size: 0.92rem; line-height: 1.45; }

/* Highlight a seat selected from the list. */
.seat-highlight { stroke: #e6960f !important; stroke-width: 4 !important; }

/* Inline reservation panel (appears under the plan when free seats are picked) */
.staff-reserve-form {
  display: grid; gap: 0.7rem; padding: 1rem; margin-top: 0.8rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.staff-reserve-fields { display: grid; gap: 0.6rem; }
@media (min-width: 720px) { .staff-reserve-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.staff-reserve-form label { display: grid; gap: 0.3rem; font-size: 0.84rem; font-weight: 600; color: var(--muted); }
.staff-reserve-seats { margin: 0; font-weight: 650; color: var(--teal); }
.staff-reserve-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.staff-reserve-actions .button { min-height: 42px; }
.staff-reserve-msg { margin: 0.2rem 0 0; font-weight: 600; font-size: 0.9rem; }
.staff-reserve-msg.is-ok { color: #1a7a4a; }
.staff-reserve-msg.is-error { color: var(--rose); }

/* Sort bar (list view) */
.staff-sortbar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.staff-sort-label { color: var(--muted); font-size: 0.82rem; font-weight: 650; }
.staff-sort-btn {
  min-height: 40px; padding: 0.25rem 0.8rem;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); color: var(--ink);
  font-weight: 600; cursor: pointer;
}
.staff-sort-btn.active { background: var(--teal-soft); color: var(--teal); border-color: var(--teal); }
.staff-sort-hint { margin-left: auto; color: var(--muted); font-size: 0.78rem; }

/* Clickable rows + arrival badges */
.staff-table tbody tr { cursor: pointer; }
.staff-table tbody tr:hover { background: var(--surface-alt); }
.staff-table tr.row-arrived { background: rgba(26, 122, 74, 0.1); }
.staff-badge-arrived { display: inline-block; padding: 0.12rem 0.5rem; border-radius: 20px; font-size: 0.72rem; font-weight: 700; color: #1a7a4a; background: #e6f7ee; white-space: nowrap; }
.staff-badge-booked { display: inline-block; padding: 0.12rem 0.5rem; border-radius: 20px; font-size: 0.72rem; font-weight: 650; color: var(--muted); background: var(--surface-alt); }

/* Context menu popover (booked seat / list row) */
.staff-menu {
  position: fixed; z-index: 60; min-width: 220px; max-width: 280px;
  padding: 0.4rem; display: grid; gap: 0.15rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}
.staff-menu-head { display: grid; gap: 0.12rem; padding: 0.4rem 0.55rem 0.5rem; border-bottom: 1px solid var(--line); margin-bottom: 0.2rem; }
.staff-menu-head strong { font-size: 0.95rem; }
.staff-menu-head span { color: var(--muted); font-size: 0.8rem; }
.staff-menu-head .staff-menu-comment { font-style: italic; }
.staff-menu-item {
  display: block; width: 100%; text-align: left; min-height: 44px;
  padding: 0.6rem 0.55rem; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.staff-menu-item:hover { background: var(--surface-alt); }
.staff-menu-item.is-danger { color: var(--rose); }
.staff-menu-item.is-danger:hover { background: rgba(142, 52, 70, 0.12); }

@media print {
  .staff-toolbar, .staff-subtabs, .staff-sortbar, .staff-menu, .staff-reserve-form, #planPane, .plan-wrap { display: none !important; }
  #listPane { display: block !important; }
}

/* Cancelled history */
.staff-cancelled { margin-top: 1.1rem; }
.staff-cancelled summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 0.3rem 0; }
.staff-table-cancelled td { color: var(--muted); text-decoration: line-through; }

/* Dark variants for the new staff elements (defined after the main dark block,
   so they win on source order). */
@media (prefers-color-scheme: dark) {
  .staff-body .staff-badge-arrived { color: #8fe7b8; background: #163a29; }
  .staff-body .staff-table tr.row-arrived { background: rgba(47, 158, 99, 0.16); }
  .staff-body .staff-menu { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }
}
