:root {
  --guide-bg: #f6f7f1;
  --guide-ink: #172554;
  --guide-muted: #64748b;
  --guide-surface: #ffffff;
  --guide-border: #d9dccf;
  --guide-accent: #0f766e;
  --guide-accent-dark: #115e59;
  --guide-warm: #f59e0b;
  --guide-soft: #eef6f2;
  --chart-daily-start: #93c5fd;
  --chart-daily-end: #2563eb;
  --chart-sales-start: #fdba74;
  --chart-sales-end: #ea580c;
  --chart-visits-start: #93c5fd;
  --chart-visits-end: #2563eb;
  --chart-commission-start: #fde68a;
  --chart-commission-end: #f59e0b;
  --chart-rank-start: #a7f3d0;
  --chart-rank-end: #10b981;
  color-scheme: light;
}

body {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 32rem),
    radial-gradient(circle at 85% 18%, rgba(245, 158, 11, 0.16), transparent 20rem),
    var(--guide-bg);
  color: var(--guide-ink);
  color-scheme: light;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--guide-ink);
  letter-spacing: 0;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  background-color: #fff !important;
  border-color: #b8c0ad !important;
  color: var(--guide-ink) !important;
  color-scheme: light;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--guide-accent) !important;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16) !important;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--guide-accent);
  appearance: auto !important;
  -webkit-appearance: auto !important;
  border-color: #8fa091 !important;
  color-scheme: light;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: var(--guide-accent) !important;
  border-color: var(--guide-accent) !important;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16) !important;
}

label {
  color: var(--guide-ink);
}

details > summary {
  list-style: none;
  list-style-type: none;
}

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

details > summary::marker {
  content: "";
}

.topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--guide-border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 4.25rem;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  position: sticky;
  top: 0;
  z-index: 30;
}

body.nav-open .topbar {
  background: #fff;
}

.brand,
.topnav {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.brand {
  color: var(--guide-ink);
  font-weight: 700;
  text-decoration: none;
  z-index: 2;
}

.brand-mark {
  align-items: center;
  background: var(--guide-accent);
  color: #fff;
  display: inline-flex;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.nav-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid var(--guide-border);
  border-radius: 0.55rem;
  color: var(--guide-ink);
  cursor: pointer;
  display: none;
  flex: 0 0 auto;
  height: 2.6rem;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: 2.6rem;
  z-index: 2;
}

.nav-toggle:hover,
.nav-toggle:focus {
  background: var(--guide-soft);
}

.nav-toggle__icon--close {
  display: none;
}

body.nav-open .nav-toggle__icon--open {
  display: none;
}

body.nav-open .nav-toggle__icon--close {
  display: block;
}

.nav-backdrop {
  background: rgba(15, 23, 42, 0.42);
  border: 0;
  /* Sit under the topbar so logo + menu button stay crisp white */
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 0;
  position: fixed;
  right: 0;
  top: 4.25rem;
  z-index: 28;
}

.topnav a,
.link-button,
.text-link {
  align-items: center;
  color: var(--guide-ink);
  display: inline-flex;
  font-size: 0.95rem;
  line-height: 1;
  min-height: 2.25rem;
  text-decoration: none;
}

.topnav a {
  border-radius: 0.5rem;
  padding: 0.4rem 0.55rem;
}

.topnav a:hover,
.topnav a:focus-visible {
  background: var(--guide-soft);
  color: var(--guide-accent-dark);
}

.topnav__link {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  position: relative;
}

.topnav a.topnav__icon-link,
.topnav .topnav__icon-button {
  align-items: center;
  background: var(--guide-soft);
  border-radius: 0.5rem;
  color: var(--guide-ink);
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.35rem;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0;
  position: relative;
  width: 2.35rem;
}

.topnav .topnav__icon-button {
  background: var(--guide-soft);
  border: 0;
  cursor: pointer;
  margin: 0;
}

.topnav a.topnav__icon-link:hover,
.topnav a.topnav__icon-link:focus-visible,
.topnav .topnav__icon-button:hover,
.topnav .topnav__icon-button:focus-visible {
  background: var(--guide-soft);
  color: var(--guide-accent-dark);
}

.topnav__icon-link .nav-alert-dot {
  position: absolute;
  right: 0.45rem;
  top: 0.45rem;
}

/* Guide topbar primary action (QR check-in) */
.topnav a.topnav__cta,
.topnav__cta {
  align-items: center;
  background: var(--guide-accent);
  border: 1px solid var(--guide-accent);
  border-radius: 999px;
  color: #fff !important;
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 700;
  gap: 0.25rem;
  line-height: 1.2;
  margin: 0;
  min-height: 2.2rem;
  padding: 0.35rem 0.85rem;
  text-decoration: none;
  width: auto;
}

.topnav a.topnav__cta:hover,
.topnav a.topnav__cta:focus-visible,
.topnav__cta:hover,
.topnav__cta:focus-visible {
  background: #0d5c56;
  border-color: #0d5c56;
  color: #fff !important;
}

.nav-alert-dot {
  background: #dc2626;
  border: none;
  border-radius: 999px;
  flex: 0 0 auto;
  height: 0.5rem;
  margin-left: 0.05rem;
  width: 0.5rem;
}

.topnav a[aria-current="page"] {
  background: var(--guide-soft);
  box-shadow: inset 0 -2px 0 var(--guide-accent);
  color: var(--guide-accent-dark);
  font-weight: 700;
}

.topnav form {
  align-items: center;
  display: inline-flex;
  margin: 0;
}

.topnav form.topnav__icon-form {
  flex: 0 0 auto;
}

body.nav-open {
  overflow: hidden;
}

.impersonation-banner {
  align-items: center;
  background: #fffbeb;
  border-bottom: 1px solid #f59e0b;
  color: #78350f;
  display: flex;
  gap: 0.65rem 1rem;
  justify-content: space-between;
  padding: 0.55rem clamp(0.85rem, 3vw, 2rem);
  position: sticky;
  top: 4.25rem;
  z-index: 9;
}

.impersonation-banner__copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.impersonation-banner__copy span {
  font-size: 0.88rem;
  opacity: 0.9;
}

.impersonation-banner__form {
  flex: 0 0 auto;
  margin: 0;
}

.impersonation-banner form,
.inline-form {
  margin: 0;
}

.impersonation-exit,
button.impersonation-exit {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.88rem;
  font-weight: 600;
  gap: 0.35rem;
  line-height: 1;
  margin: 0;
  min-height: 2.2rem;
  padding: 0.4rem 0.7rem;
  white-space: nowrap;
  width: auto;
}

.impersonation-exit .icon-tabler {
  flex: 0 0 auto;
}

.impersonation-exit__label {
  display: none;
}

.impersonation-exit__label-full {
  display: inline;
}

.link-button {
  background: transparent;
  border: 0;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.link-button svg {
  display: block;
  flex: 0 0 auto;
}

.text-link {
  color: var(--guide-accent-dark);
  font-weight: 700;
  text-decoration-color: rgba(17, 94, 89, 0.32);
  text-underline-offset: 0.18em;
}

button.text-link,
.data-table button.text-link,
.table-wrap button.text-link,
.table-actions button.text-link {
  --background-color: transparent;
  --border-color: transparent;
  --color: var(--guide-accent-dark);
  appearance: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--guide-accent-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  margin: 0;
  min-height: 0;
  padding: 0;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(17, 94, 89, 0.32);
  text-underline-offset: 0.18em;
  width: auto;
}

.shell {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-inline: auto;
  max-width: min(1600px, 100%);
  padding: clamp(1rem, 3vw, 2rem);
  width: 100%;
}

/* Staff list / dashboard pages: use more horizontal space on large monitors */
.shell--wide {
  max-width: min(1600px, 100%);
}

/* Auth / focused single-column flows */
.shell--narrow {
  max-width: 720px;
}

/* Vertical rhythm: direct sections/surfaces inside main */
.shell > .page-heading {
  margin-bottom: 0;
}

.shell > .kpi-grid,
.shell > .two-column,
.shell > .surface,
.shell > .info-card-grid,
.shell > .monthly-sales-chart,
.shell > .messages,
.shell > form.surface,
.shell > .auth-panel {
  margin-block: 0;
}

.shell > .two-column {
  margin-top: 0;
}

.surface > h2:first-child,
.surface > header:first-child {
  margin-top: 0;
}

.surface > h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  margin-bottom: 0.85rem;
}

.surface + .surface {
  /* gap on .shell handles spacing */
}

/* Section labels inside forms */
.form-section-label {
  color: var(--guide-muted);
  font-size: 0.78rem;
  font-weight: 700;
  grid-column: 1 / -1;
  letter-spacing: 0.06em;
  margin: 0.35rem 0 0;
  text-transform: uppercase;
}

.form-section-hint {
  color: var(--guide-muted);
  font-size: 0.92rem;
  grid-column: 1 / -1;
  margin: 0;
}

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

.status-badge--pending,
.status-badge--invited,
.status-badge--open,
.status-badge--partially_paid {
  background: #fef3c7;
  color: #92400e;
}

.status-badge--approved,
.status-badge--active,
.status-badge--paid {
  background: #dcfce7;
  color: #166534;
}

.status-badge--rejected,
.status-badge--removed,
.status-badge--inactive,
.status-badge--declined,
.status-badge--cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge--not_joined {
  background: #f1f5f9;
  color: var(--guide-muted);
}

.inbox-list li {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
}

.inbox-list__copy {
  flex: 1 1 12rem;
  min-width: 0;
}

.inbox-list .badge {
  flex: 0 0 auto;
}

.inbox-list a.text-link,
.inbox-list > li > strong {
  flex: 0 0 auto;
  font-weight: 700;
  margin-left: auto;
}

.notification-list .notification-list__item {
  border-radius: 0.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.notification-list .notification-list__item--unread {
  background: var(--guide-soft);
  box-shadow: inset 3px 0 0 var(--guide-accent);
}

.invite-notice-panel {
  border-left: 4px solid var(--guide-accent);
}

.invite-notice-list {
  margin: 0.9rem 0 0;
}

.invite-message {
  display: block;
  margin-top: 0.5rem;
}

.guides-table__invite-message {
  font-size: 0.9rem;
  margin: 0.15rem 0;
  min-height: 4rem;
  min-width: min(18rem, 100%);
  width: 100%;
}

.auth-panel,
.page-heading,
.two-column,
.kpi-grid {
  display: grid;
  gap: 1rem;
}

.shell--auth {
  gap: 0;
  max-width: 1100px;
  padding-block: clamp(0.75rem, 2vw, 1.5rem);
}

.auth-panel {
  align-items: center;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 430px);
  min-height: calc(100vh - 6rem);
  padding-block: clamp(1.5rem, 5vh, 3.5rem);
}

.auth-copy {
  align-self: stretch;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(238, 246, 242, 0.62)),
    repeating-linear-gradient(135deg, rgba(23, 37, 84, 0.04) 0 1px, transparent 1px 14px);
  border: 1px solid var(--guide-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 430px;
  padding: clamp(1.4rem, 4vw, 2.5rem);
  min-width: 0;
}

.auth-copy h1 {
  font-size: clamp(3.4rem, 5.8vw, 5.2rem);
  line-height: 0.92;
  margin: 0.8rem 0 1rem;
  max-width: 11ch;
  overflow-wrap: normal;
  word-break: keep-all;
}

.auth-copy h1.auth-copy__brand {
  max-width: none;
  white-space: nowrap;
}

.auth-copy h1 span {
  display: block;
  white-space: nowrap;
}

.auth-copy__tagline {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin: 0;
  max-width: 22ch;
}

/* Login: details/summary wrapper (mobile collapses form; desktop is always “open”) */
.auth-sign-in {
  align-self: center;
  margin: 0;
  min-width: 0;
  width: 100%;
}

.auth-sign-in__summary {
  cursor: pointer;
  margin: 0;
}

.auth-sign-in__summary::before,
.auth-sign-in__summary::after {
  content: none !important;
  display: none !important;
}

.auth-sign-in__cta {
  background: var(--guide-accent);
  border: 1px solid var(--guide-accent-dark);
  border-radius: 8px;
  color: #fff;
  display: none;
  font-size: 1.05rem;
  font-weight: 700;
  justify-content: center;
  margin: 0;
  min-height: 2.85rem;
  padding: 0.65rem 1rem;
  text-align: center;
  width: 100%;
}

.auth-sign-in[open] .auth-sign-in__cta {
  display: none;
}

.login-form {
  border-top: 5px solid var(--guide-accent);
  padding: clamp(1.4rem, 4vw, 2rem);
  align-self: center;
}

.login-form__title,
.login-form h2 {
  font-size: 2rem;
  margin-bottom: 1.2rem;
}

/* Desktop/tablet wide: form always visible, no summary CTA */
@media (min-width: 821px) {
  .auth-sign-in {
    display: contents;
  }

  .auth-sign-in__summary {
    display: none;
  }

  .auth-sign-in .login-form {
    display: block;
  }
}

.form-footer-link {
  margin: 0.8rem 0 0;
  text-align: center;
}

.resend-form {
  margin: 0.9rem 0 0;
}

.page-heading {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 1.25rem;
}

.page-heading > a[role="button"] {
  margin: 0;
}

.page-back-link {
  align-items: center;
  color: var(--guide-muted);
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 800;
  gap: 0.35rem;
  margin: 0 0 1rem;
  text-decoration: none;
}

.page-back-link svg {
  flex: 0 0 auto;
  height: 1.1rem;
  width: 1.1rem;
}

.page-back-link:hover,
.page-back-link:focus {
  color: var(--guide-accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.check-in-review-heading {
  margin-bottom: 0.75rem;
}

.check-in-review-heading .page-back-link {
  margin-bottom: 0.7rem;
}

.check-in-review-heading__title {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  margin-bottom: 0.35rem;
}

.check-in-review-heading__place,
.check-in-review-heading__separator {
  color: var(--guide-muted);
}

.check-in-review-heading__place {
  font-weight: 700;
}

.two-column {
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  margin: 1rem 0;
}

.two-column--leaderboards {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}

.two-column--leaderboards > .leaderboard-panel {
  min-width: 0;
  align-self: start;
  align-content: start;
  height: auto;
}

.kpi-grid {
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.surface,
.kpi {
  background: var(--guide-surface);
  border: 1px solid var(--guide-border);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(23, 37, 84, 0.06);
  overflow: hidden; /* clip zebra/row backgrounds to card radius */
}

.surface {
  padding: 1.25rem;
}

/* KPI tiles: label left, value right — modest density (not ultra-tight) */
.kpi {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.65rem 0.85rem;
  justify-content: space-between;
  min-width: 0;
  padding: 0.8rem 0.95rem;
}

/* In-table links are text actions, not topnav tap targets */
.data-table .text-link,
.table-wrap .text-link,
.inbox-table__actions .text-link,
.table-actions .text-link {
  display: inline;
  min-height: 0;
  line-height: 1.35;
  padding: 0;
  white-space: nowrap;
}

.text-link--danger,
.data-table .text-link--danger,
.table-wrap .text-link--danger,
button.text-link--danger,
.data-table button.text-link--danger,
.table-wrap button.text-link--danger,
.table-actions button.text-link--danger {
  --color: #b91c1c;
  color: #b91c1c;
  text-decoration-color: rgba(185, 28, 28, 0.34);
}

.text-link--danger:hover,
.text-link--danger:focus,
button.text-link--danger:hover,
button.text-link--danger:focus {
  --color: #991b1b;
  color: #991b1b;
}

.kpi span,
.eyebrow {
  color: var(--guide-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.kpi > span {
  flex: 1 1 auto;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  line-height: 1.3;
  min-width: 0;
}

.kpi > span .muted,
.kpi > span small {
  display: inline;
  font-size: 0.68rem;
  letter-spacing: 0;
  text-transform: none;
}

.kpi strong {
  display: block;
  flex: 0 0 auto;
  font-size: clamp(1.25rem, 2.8vw, 1.65rem);
  line-height: 1.2;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

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

.auth-copy .muted {
  color: #44546f;
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 42rem;
}

.actions-group {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.period-control {
  flex-wrap: wrap;
}

.actions-group > .inline-form,
.actions-group > form {
  display: flex;
  margin: 0;
}

.actions-group a,
.actions-group button,
.actions-group a[role="button"],
.form-actions a,
.form-actions button,
.form-actions a[role="button"] {
  align-items: center;
  border-radius: 0.55rem;
  box-sizing: border-box;
  display: inline-flex;
  gap: 0.4rem;
  height: 100%;
  justify-content: center;
  line-height: 1.2;
  margin-bottom: 0;
}

.actions-group > a,
.actions-group > .inline-form > button,
.actions-group > form > button {
  margin-bottom: 0;
}

/* Pico styles <button> and <a role="button"> slightly differently; normalize action chips */
.actions-group a[role="button"],
.actions-group button {
  border-style: solid;
  border-width: 1px;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
}

/* Wallet pass: split-style dropdown (Apple / Google).
   Fully self-contained — do not rely on Pico .secondary / link colours
   (those fight us in dark-scheme and when summary/a cascade wins). */
.wallet-pass-menu {
  --wallet-trigger-bg: #475569;
  --wallet-trigger-bg-hover: #3f4f63;
  --wallet-trigger-border: #334155;
  --wallet-trigger-fg: #ffffff;
  --wallet-panel-bg: #ffffff;
  --wallet-panel-border: #d9dccf;
  --wallet-item-fg: #172554;
  --wallet-item-muted: #64748b;
  --wallet-item-hover-bg: color-mix(in srgb, #0f766e 10%, #ffffff);
  --wallet-item-icon: #64748b;
  --wallet-item-icon-hover: #115e59;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  flex: 0 0 auto;
  align-self: stretch;
  width: auto;
  max-width: max-content;
  color-scheme: light;
}

.wallet-pass-menu > summary,
.wallet-pass-menu > summary.wallet-pass-menu__trigger {
  list-style: none !important;
}

.wallet-pass-menu > summary::-webkit-details-marker,
.wallet-pass-menu > summary::marker {
  display: none !important;
  content: "" !important;
}

/* Kill Pico/details disclosure affixes (second chevron/caret). */
.wallet-pass-menu > summary::before,
.wallet-pass-menu > summary::after,
.wallet-pass-menu > summary.secondary::before,
.wallet-pass-menu > summary.secondary::after,
.wallet-pass-menu > summary[role="button"]::before,
.wallet-pass-menu > summary[role="button"]::after {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
}

/* Trigger: slate chip, always white label/icons — beat Pico summary/secondary/a. */
details.wallet-pass-menu > summary.wallet-pass-menu__trigger,
details.wallet-pass-menu > summary.secondary.wallet-pass-menu__trigger,
.wallet-pass-menu > summary.wallet-pass-menu__trigger {
  align-items: center;
  appearance: none;
  -webkit-appearance: none;
  background: var(--wallet-trigger-bg) !important;
  background-color: var(--wallet-trigger-bg) !important;
  background-image: none !important;
  border: 1px solid var(--wallet-trigger-border) !important;
  border-radius: 0.55rem;
  box-shadow: none !important;
  box-sizing: border-box;
  color: var(--wallet-trigger-fg) !important;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.95rem;
  font-weight: 600;
  gap: 0.45rem;
  height: 2.75rem;
  justify-content: center;
  line-height: 1.2;
  margin: 0;
  max-height: 2.75rem;
  min-height: 2.75rem;
  min-width: 0;
  opacity: 1 !important;
  padding: 0 1rem;
  text-decoration: none !important;
  user-select: none;
  white-space: nowrap;
  outline-offset: 0;
  width: auto;
}

details.wallet-pass-menu > summary.wallet-pass-menu__trigger:hover,
details.wallet-pass-menu > summary.wallet-pass-menu__trigger:focus,
details.wallet-pass-menu > summary.wallet-pass-menu__trigger:focus-visible,
details.wallet-pass-menu[open] > summary.wallet-pass-menu__trigger,
details.wallet-pass-menu > summary.secondary.wallet-pass-menu__trigger:hover,
details.wallet-pass-menu > summary.secondary.wallet-pass-menu__trigger:focus,
details.wallet-pass-menu[open] > summary.secondary.wallet-pass-menu__trigger {
  background: var(--wallet-trigger-bg-hover) !important;
  background-color: var(--wallet-trigger-bg-hover) !important;
  border-color: var(--wallet-trigger-border) !important;
  box-shadow: none !important;
  color: var(--wallet-trigger-fg) !important;
  filter: none !important;
  height: 2.75rem;
  max-height: 2.75rem;
  min-height: 2.75rem;
  opacity: 1 !important;
  padding: 0 1rem;
  transform: none;
}

.wallet-pass-menu__label,
.wallet-pass-menu__label * {
  color: var(--wallet-trigger-fg) !important;
}

.wallet-pass-menu__label {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
}

details.wallet-pass-menu > summary.wallet-pass-menu__trigger svg,
.wallet-pass-menu__label svg,
.wallet-pass-menu__chevron {
  color: var(--wallet-trigger-fg) !important;
  fill: none !important;
  flex-shrink: 0;
  opacity: 1 !important;
  stroke: var(--wallet-trigger-fg) !important;
}

.wallet-pass-menu__chevron {
  height: 16px;
  margin-left: 0.05rem;
  opacity: 0.95 !important;
  transition: transform 0.15s ease;
  width: 16px;
}

.wallet-pass-menu[open] .wallet-pass-menu__chevron {
  transform: rotate(180deg);
}

/* Panel: fixed content width, right-aligned under trigger (never stretch to page/actions). */
.wallet-pass-menu__panel {
  background: var(--wallet-panel-bg) !important;
  border: 1px solid var(--wallet-panel-border) !important;
  border-radius: 0.65rem;
  box-shadow: 0 10px 28px rgba(23, 37, 84, 0.14);
  box-sizing: border-box;
  color: var(--wallet-item-fg) !important;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  inset-inline-end: 0;
  left: auto;
  margin: 0;
  max-width: 16rem;
  min-width: 13.25rem;
  padding: 0.3rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  width: max-content;
  z-index: 40;
}

/* Menu links: beat Pico `a` / `.muted` / visited / dark-scheme link colours. */
a.wallet-pass-menu__item,
a.wallet-pass-menu__item:link,
a.wallet-pass-menu__item:visited,
a.wallet-pass-menu__item:any-link,
.wallet-pass-menu__panel > a.wallet-pass-menu__item {
  align-items: center;
  background: transparent !important;
  border-radius: 0.5rem;
  color: var(--wallet-item-fg) !important;
  display: flex;
  gap: 0.6rem;
  opacity: 1 !important;
  padding: 0.5rem 0.6rem;
  text-decoration: none !important;
}

a.wallet-pass-menu__item svg,
.wallet-pass-menu__panel > a.wallet-pass-menu__item svg {
  color: var(--wallet-item-icon) !important;
  flex-shrink: 0;
  stroke: var(--wallet-item-icon) !important;
}

a.wallet-pass-menu__item:hover,
a.wallet-pass-menu__item:focus,
a.wallet-pass-menu__item:focus-visible,
.wallet-pass-menu__panel > a.wallet-pass-menu__item:hover,
.wallet-pass-menu__panel > a.wallet-pass-menu__item:focus-visible {
  background: var(--wallet-item-hover-bg) !important;
  color: var(--wallet-item-fg) !important;
  outline: none;
}

a.wallet-pass-menu__item:hover svg,
a.wallet-pass-menu__item:focus-visible svg {
  color: var(--wallet-item-icon-hover) !important;
  stroke: var(--wallet-item-icon-hover) !important;
}

.wallet-pass-menu__item > span {
  color: var(--wallet-item-fg) !important;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  line-height: 1.25;
  min-width: 0;
}

a.wallet-pass-menu__item strong,
.wallet-pass-menu__item strong {
  color: var(--wallet-item-fg) !important;
  font-size: 0.9rem;
  font-weight: 650;
  opacity: 1 !important;
}

a.wallet-pass-menu__item .muted,
a.wallet-pass-menu__item .wallet-pass-menu__hint,
.wallet-pass-menu__hint,
span.wallet-pass-menu__hint.muted {
  color: var(--wallet-item-muted) !important;
  font-size: 0.76rem;
  font-weight: 500;
  opacity: 1 !important;
}

.actions-group > .wallet-pass-menu {
  align-self: stretch;
  flex: 0 0 auto;
  max-width: max-content;
}

.actions-group > .wallet-pass-menu > .wallet-pass-menu__trigger {
  height: 100%;
  min-height: 2.75rem;
}

.guide-detail-actions a[role="button"],
.guide-detail-actions button {
  border-radius: 0.55rem;
}

.guide-actions-menu {
  position: relative;
}

.guide-actions-menu > summary.guide-action {
  cursor: pointer;
  margin: 0;
}

.guide-actions-menu[open] > summary.guide-action {
  background: #3f4f63;
  border-color: #334155;
  color: #fff;
}

.guide-actions-menu__panel {
  background: #fff;
  border: 1px solid var(--guide-border);
  border-radius: 0.55rem;
  box-shadow: 0 18px 45px rgba(23, 37, 84, 0.14);
  display: grid;
  gap: 0.45rem;
  min-width: 14rem;
  padding: 0.65rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 5;
}

.guide-actions-menu__panel .text-link {
  justify-self: stretch;
  min-height: 2.25rem;
  text-align: left;
  white-space: nowrap;
}

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

.compact-button {
  font-size: 0.82rem;
  margin: 0;
  padding: 0.42rem 0.7rem;
  width: auto;
}

/* Action column: normal table cell (flex on <td> caused overflow / misalignment) */
.table-actions {
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
}

.guides-table tbody td {
  vertical-align: top;
}

.guides-table--compact tbody tr {
  vertical-align: middle;
}

.guides-table--compact tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.02);
}

.guides-table--compact tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.55);
}

.guides-table--compact tbody tr:hover {
  background: rgba(15, 118, 110, 0.07);
}

.guides-table--compact td,
.guides-table--compact th {
  white-space: nowrap;
}

/* Sortable data tables: header row always tinted / accent-colored (not only on hover/active) */
.data-table thead th,
.table-wrap > table.data-table thead th {
  background: rgba(15, 118, 110, 0.08);
  border-bottom: 1px solid rgba(15, 118, 110, 0.18);
  color: var(--guide-accent-dark, #0f4c5c);
}

/* Zebra striping — required on all .data-table bodies (odd/even always differ) */
.data-table tbody tr:nth-child(odd) td,
.table-wrap > table.data-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.92);
}

.data-table tbody tr:nth-child(even) td,
.table-wrap > table.data-table tbody tr:nth-child(even) td {
  background: rgba(15, 118, 110, 0.045);
}

.data-table tbody tr:hover td,
.table-wrap > table.data-table tbody tr:hover td {
  background: rgba(15, 118, 110, 0.09);
}

/* Single-cell empty-state rows: neutral, no zebra emphasis */
.data-table tbody tr:has(td[colspan]) td,
.table-wrap > table.data-table tbody tr:has(td[colspan]) td {
  background: transparent;
}

.data-table__th {
  padding: 0 !important;
  vertical-align: middle;
}

.data-table__sort {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--guide-accent-dark, #0f4c5c);
  font: inherit;
  font-weight: 700;
  text-align: inherit;
  cursor: pointer;
  line-height: 1.2;
  min-height: 0;
}

.guides-table .data-table__sort {
  white-space: nowrap;
}

.data-table__th.numeric .data-table__sort {
  justify-content: flex-end;
}

/* Non-sortable header label — same box as .data-table__sort so columns line up */
.data-table__th-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.75rem;
  color: var(--guide-muted, #64748b);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.data-table__th--actions {
  width: 6.5rem;
  text-align: right;
}

.data-table__sort:hover,
.data-table__sort:focus {
  background: rgba(15, 118, 110, 0.12);
  color: var(--guide-accent-dark, #0f4c5c);
}

/* Active sort column: stronger tint + solid arrow (inactive columns keep ↕ via JS) */
.data-table__sort.is-active {
  background: rgba(15, 118, 110, 0.16);
  color: var(--guide-accent-dark, #0f4c5c);
  box-shadow: inset 0 -2px 0 rgba(15, 118, 110, 0.55);
}

.data-table__sort-ind {
  font-size: 0.65rem;
  opacity: 0.45;
  min-width: 0.85rem;
  color: var(--guide-accent-dark, #0f4c5c);
}

.data-table__sort-ind.is-active,
.data-table__sort.is-active .data-table__sort-ind {
  opacity: 1;
  font-weight: 800;
}

/* Check-ins inbox: keep multi-line guide rows aligned with actions/status */
.inbox-table td {
  vertical-align: middle;
}

.inbox-table__status {
  white-space: nowrap;
}

.inbox-table__actions,
.inbox-table td.table-actions {
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

.inbox-table__actions .text-link,
.inbox-table td.table-actions .text-link {
  display: inline-block;
  line-height: 1.2;
}

.guides-table__guide {
  min-width: 10rem;
  max-width: 22rem;
}

.guides-table__name-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem;
  max-width: 100%;
}

.guides-table__name {
  color: var(--guide-ink);
  display: inline;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  white-space: normal;
}

.guides-table__name:hover,
.guides-table__name:focus {
  color: var(--guide-accent-dark);
  text-decoration: underline;
}

.guides-table__name--static:hover,
.guides-table__name--static:focus {
  color: var(--guide-ink);
  text-decoration: none;
}

.guides-table__icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.guides-table__icon-form {
  display: inline-flex;
  margin: 0;
}

.guides-table__icon-form button.guides-table__icon-link {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  box-shadow: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
  font: inherit;
  line-height: 1;
  min-width: 0;
  min-height: 0;
  width: 2rem;
  height: 2rem;
}

.guides-table__icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  color: var(--guide-muted, #64748b);
  text-decoration: none;
}

.guides-table__icon-link:hover,
.guides-table__icon-link:focus {
  color: var(--guide-accent-dark);
  background: rgba(15, 118, 110, 0.1);
}

.guides-table__icon-link .icon {
  display: block;
}

.guides-table__meta {
  display: block;
  font-size: 0.86rem;
  line-height: 1.35;
  margin-top: 0.15rem;
}

.places-table__place {
  min-width: 12rem;
  max-width: 24rem;
}

.place-summary {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  min-width: 0;
}

.place-summary__body {
  min-width: 0;
}

.places-table__name {
  display: block;
  line-height: 1.25;
}

.places-table tbody td {
  vertical-align: top;
}

.places-table__meta,
.places-table__basis {
  display: block;
  font-size: 0.86rem;
  line-height: 1.35;
  margin-top: 0.15rem;
}

.place-thumbnail {
  background: var(--guide-soft);
  border: 1px solid var(--guide-border);
  display: block;
  object-fit: cover;
}

.place-thumbnail--table {
  border-radius: 8px;
  flex: 0 0 4.5rem;
  height: 4.5rem;
  width: 4.5rem;
}

.place-thumbnail--card,
.place-thumbnail--catalog {
  border-radius: 8px;
  height: 11rem;
  margin-bottom: 0.85rem;
  width: 100%;
}

.place-thumbnail--lookup {
  border-radius: 8px;
  flex: 0 0 5rem;
  height: 5rem;
  width: 5rem;
}

.place-tags {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.place-tag {
  background: #eef7f4;
  border: 1px solid rgba(13, 126, 113, 0.22);
  color: var(--guide-accent-dark);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.22rem 0.5rem;
}

.places-table__reps {
  min-width: 11rem;
  max-width: 18rem;
}

.places-table__rep {
  margin-bottom: 0.65rem;
}

.places-table__rep:last-child {
  margin-bottom: 0;
}

.guides-table__invite-form {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  margin: 0;
  max-width: 20rem;
}

.guides-table__invite-form select {
  font-size: 0.88rem;
  margin: 0;
  min-height: 2rem;
  min-width: 8rem;
  padding: 0.25rem 0.45rem;
  width: auto;
}

.guides-table__invite-cell {
  min-width: 12rem;
}

.guides-table--relationships td,
.guides-table--relationships th {
  white-space: normal;
}

.guides-table--relationships .guides-table__guide {
  width: 28%;
}

.guides-table--relationships .guides-table__last-active,
.guides-table--relationships .guides-table__last-active-header,
.guides-table--relationships td.numeric {
  white-space: nowrap;
  width: 1%;
}

.guides-table--relationships .guides-table__last-active,
.guides-table--relationships .guides-table__last-active-header {
  min-width: 8.75rem;
}

.guides-table--relationships .guide-place-status-list {
  min-width: 12rem;
}

.guides-table--relationships .guide-place-status-list li {
  align-items: flex-start;
  border-bottom: 1px solid rgba(15, 118, 110, 0.14);
  display: grid;
  gap: 0.2rem;
  padding: 0.15rem 0 0.45rem;
}

.guides-table--relationships .guide-place-status-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.guide-place-actions-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  min-width: 11rem;
  text-align: left;
}

.guide-place-actions-list.clean-list li {
  align-items: center;
  display: grid;
  gap: 0.2rem;
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
  padding: 0.15rem 0 0.45rem;
}

.guide-place-actions-list__place {
  color: var(--guide-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  max-width: 16rem;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guides-table--relationships .guides-table__invite-cell {
  min-width: 12rem;
  white-space: normal;
}

.guides-table--relationships .guides-table__invite-form {
  justify-content: flex-end;
}

.places-table__rep-name-row {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
}

.places-table__rep-name {
  display: block;
  font-weight: 600;
  line-height: 1.25;
}

.places-table__view-as-form {
  margin-top: 0.2rem;
}

.places-table__view-as {
  color: var(--guide-muted);
  font-size: 0.88rem;
  min-height: auto;
  padding: 0;
}

.places-table__view-as:hover,
.places-table__view-as:focus {
  color: var(--guide-accent-dark);
}

.data-cards__footer--stack {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.45rem;
}

.place-scope-select-wrap {
  margin: 0 0 1.25rem;
  max-width: 22rem;
}

.place-scope-select-wrap label {
  display: grid;
  gap: 0.35rem;
}

.place-scope-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.place-scope-nav__item {
  background: var(--guide-soft);
  border: 1px solid var(--guide-border);
  border-radius: 999px;
  color: var(--guide-ink);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  text-decoration: none;
}

.place-scope-nav__item:hover,
.place-scope-nav__item:focus {
  border-color: var(--guide-accent);
  color: var(--guide-accent-dark);
}

.place-scope-nav__item.is-active {
  background: var(--guide-accent);
  border-color: var(--guide-accent);
  color: #fff;
}

.place-scope-nav__item--muted {
  background: transparent;
  border-style: dashed;
  font-weight: 500;
}

.memberships-list__item {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.85rem;
}

.memberships-list__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  flex-wrap: wrap;
}

.memberships-list__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.membership-place-summary {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  min-width: min(100%, 18rem);
}

.membership-place-summary__body {
  min-width: 0;
}

.membership-place-summary__image-link {
  border-radius: 8px;
  flex: 0 0 auto;
}

.membership-place-summary__image-link:hover .place-thumbnail,
.membership-place-summary__image-link:focus-visible .place-thumbnail {
  border-color: var(--guide-accent);
}

.membership-place-summary__title {
  display: block;
}

.membership-place-summary__address {
  margin: 0.4rem 0 0;
}

.membership-leave-button {
  min-height: 2.35rem;
  min-width: 0;
  padding: 0.45rem 0.8rem;
}

.memberships-list__terms {
  width: 100%;
  margin: 0;
}

.terms-modal {
  border: none;
  border-radius: 1rem;
  padding: 0;
  max-width: min(40rem, calc(100vw - 2rem));
  width: 100%;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
}

.terms-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.terms-modal__inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 1.15rem 1.25rem 1.25rem;
  max-height: min(85vh, 42rem);
}

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

.terms-modal__header h2 {
  margin: 0.15rem 0 0;
  font-size: 1.2rem;
  line-height: 1.3;
}

.terms-modal__close {
  flex-shrink: 0;
}

.terms-modal__hint {
  margin: 0;
  font-size: 0.9rem;
}

.terms-modal__scroll {
  flex: 1 1 auto;
  min-height: 10rem;
  max-height: min(48vh, 22rem);
  overflow: auto;
  border: 1px solid var(--guide-border, rgba(15, 23, 42, 0.12));
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  background: rgba(15, 23, 42, 0.02);
  line-height: 1.55;
}

.terms-modal__body {
  white-space: normal;
}

.terms-modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.terms-modal__footer button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin: 0 0 1.15rem;
}

.catalog-toolbar__side {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 0.35rem;
  justify-content: flex-end;
  margin-left: auto;
}

.inbox-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin: 0 0 0.85rem;
}

.inbox-filters__field {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  min-width: min(100%, 12.5rem);
  flex: 0 1 14rem;
}

.inbox-filters__label {
  color: var(--guide-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inbox-filters__field select {
  margin-bottom: 0;
}

.inbox-filters__count {
  margin: 0 0 1rem;
}

.catalog-view-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--guide-border);
  border-radius: 0.7rem;
  margin: 0;
  padding: 0.2rem;
  width: fit-content;
}

.catalog-view-toggle a[role="button"] {
  border-radius: 0.5rem;
  font-size: 0.92rem;
  margin: 0;
  min-height: 2.15rem;
  min-width: 5.25rem;
  padding: 0.35rem 0.8rem;
  width: auto;
}

.catalog-toolbar__meta {
  margin: 0;
  font-size: 0.92rem;
}

.catalog-filters {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 32rem;
  gap: 0.65rem 0.85rem;
  margin: 0;
  min-width: 0;
}

.catalog-filters__field {
  display: grid;
  flex: 0 1 14rem;
  gap: 0.22rem;
  margin: 0;
  min-width: min(100%, 11rem);
}

.catalog-filters__label {
  color: var(--guide-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.catalog-filters__field select {
  margin: 0;
  min-height: 2.35rem;
}

.catalog-filters__reset {
  align-items: center;
  color: var(--guide-accent-dark);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 800;
  min-height: 2.35rem;
  text-decoration: underline;
  text-decoration-color: rgba(17, 94, 89, 0.32);
  text-underline-offset: 0.18em;
}

.places-map-panel {
  padding: 1rem 1.1rem 1.15rem;
}

.payment-callout {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

.payment-callout h2 {
  font-size: 1.2rem;
  margin: 0;
}

.payment-callout p {
  margin-bottom: 0;
}

.payment-callout form {
  margin: 0;
}

.payment-callout__list {
  display: grid;
  flex: 1 1 100%;
  gap: 0.6rem;
  margin: 0;
}

.payment-callout__list li {
  align-items: center;
  border-top: 1px solid var(--guide-border);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding-top: 0.6rem;
}

.payment-callout__list small {
  display: block;
}

.payment-callout button {
  margin: 0;
  white-space: nowrap;
}

.places-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
}

.places-map-toolbar__hint {
  margin: 0;
  font-size: 0.9rem;
}

.places-catalog-map {
  width: 100%;
  height: min(68vh, 34rem);
  min-height: 18rem;
  border-radius: 0.85rem;
  border: 1px solid var(--guide-border, rgba(15, 23, 42, 0.12));
  z-index: 0;
  background: #e8eef2;
  /* Isolate from Pico / global form button resets */
  font-size: 12px;
  line-height: 1.2;
  /* Contain Leaflet absolute panes; avoid parent transform creating a second containing block. */
  position: relative;
  overflow: hidden;
  isolation: isolate;
  /* Preserve crisp marker/tile positioning on HiDPI */
  -webkit-font-smoothing: antialiased;
}

/* Leaflet panes must not inherit site transforms/filters (breaks latLng projection vs pixels). */
.places-catalog-map .leaflet-pane,
.places-catalog-map .leaflet-map-pane,
.places-catalog-map .leaflet-tile-pane,
.places-catalog-map .leaflet-overlay-pane,
.places-catalog-map .leaflet-marker-pane,
.places-catalog-map .leaflet-tooltip-pane,
.places-catalog-map .leaflet-popup-pane,
.places-catalog-map .leaflet-shadow-pane {
  transform-origin: 0 0;
}

.places-catalog-map .leaflet-container {
  width: 100%;
  height: 100%;
  font: inherit;
  background: #e8eef2;
}

/* Tiles: prevent site img { max-width } from shrinking tiles at any zoom. */
.places-catalog-map .leaflet-tile-container img,
.places-catalog-map img.leaflet-tile {
  max-width: none !important;
  max-height: none !important;
  width: 256px !important;
  height: 256px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  filter: grayscale(0.82) saturate(0.42) contrast(0.92) brightness(1.06);
  image-rendering: auto;
  opacity: 0.92;
}

/* Leaflet controls: Pico styles buttons site-wide and breaks +/- zoom. */
.places-catalog-map .leaflet-control-zoom {
  border: 1px solid rgba(15, 23, 42, 0.18) !important;
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}

.places-catalog-map .leaflet-control-zoom a,
.places-catalog-map .leaflet-bar a {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  background: #fff !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.places-catalog-map .leaflet-control-zoom a:hover,
.places-catalog-map .leaflet-bar a:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.places-catalog-map .leaflet-control-zoom-in {
  border-bottom: 1px solid rgba(15, 23, 42, 0.12) !important;
}

.places-catalog-map .leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  max-width: 70%;
}

.places-catalog-map .leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.places-catalog-map .leaflet-popup-content {
  margin: 0.75rem 0.9rem;
  line-height: 1.4;
}

/*
 * Place pins: L.icon <img> only. Do NOT override width/height/margin here —
 * Leaflet sets margin-left/top = -iconAnchor and inline size from iconSize.
 * Overriding those (or max-width:100% on site imgs) shifts pins by a constant
 * pixel offset that becomes large in geographic degrees at low zoom.
 */
.places-catalog-map .leaflet-marker-icon.places-map-pin,
.places-catalog-map img.leaflet-marker-icon.places-map-pin {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-width: none !important;
  max-height: none !important;
  line-height: 0 !important;
  /* Let Leaflet own width/height/margin via inline styles */
  display: block !important;
  pointer-events: auto;
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.28));
}

/* Shadow element unused; keep default icon shadow from interfering if added later. */
.places-catalog-map .leaflet-marker-shadow {
  max-width: none !important;
}

.places-map-empty {
  margin: 0.75rem 0 0;
}

.places-map-popup strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.places-map-popup__thumb {
  border: 1px solid var(--guide-border);
  border-radius: 8px;
  display: block;
  height: 8rem;
  margin-bottom: 0.65rem;
  object-fit: cover;
  width: 100%;
}

.places-map-popup__summary {
  margin: 0.35rem 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.places-map-popup .badge {
  font-size: 0.75rem;
}

.places-map-popup p {
  margin: 0.25rem 0;
}

.tier-panel-hint {
  margin: 0 0 1rem;
}

.places-breakdown-table tbody td {
  vertical-align: top;
}

.guides-table th:last-child,
.guides-table td:last-child {
  width: 1%;
}

.tag-chip,
.badge {
  background: var(--guide-soft);
  border: 1px solid var(--guide-border);
  color: var(--guide-accent-dark);
  display: inline-flex;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

.badge--muted {
  background: #f1f5f9;
  color: var(--guide-muted);
}

.badge.status-badge--pending,
.badge.status-badge--invited,
.badge.status-badge--open,
.badge.status-badge--partially_paid {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.badge.status-badge--approved,
.badge.status-badge--active,
.badge.status-badge--paid {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.badge.status-badge--rejected,
.badge.status-badge--removed,
.badge.status-badge--inactive,
.badge.status-badge--declined,
.badge.status-badge--cancelled {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.payout-record-cell {
  position: relative;
}

.row-disclosure {
  display: inline-block;
  position: relative;
}

.row-disclosure summary {
  align-items: center;
  background: var(--guide-soft);
  border: 1px solid var(--guide-border);
  border-radius: 999px;
  color: var(--guide-accent-dark);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 800;
  gap: 0.35rem;
  justify-content: center;
  line-height: 1;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
}

.row-disclosure summary::after {
  content: "+";
  font-size: 1rem;
  line-height: 1;
}

.row-disclosure[open] summary::after {
  content: "−";
}

.payout-record__form {
  background: var(--guide-surface);
  border: 1px solid var(--guide-border);
  border-radius: 0.5rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  margin-top: 0.45rem;
  min-width: 15rem;
  padding: 0.75rem;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 20;
}

.payout-record__form button {
  margin-bottom: 0;
}

.payout-record--card {
  width: 100%;
}

.payout-record--card .payout-record__form {
  position: static;
  width: 100%;
}

.pass-tag {
  background: #172554;
  color: #fff;
  font-size: clamp(2rem, 8vw, 4.5rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  padding: 1.25rem;
}

.tier-panel {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.tier-panel h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  margin: 0.25rem 0 0.3rem;
}

.tier-panel__summary {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.36fr);
}

.tier-panel__next {
  background: var(--guide-soft);
  border: 1px solid var(--guide-border);
  border-radius: 8px;
  padding: 1rem;
}

.tier-panel__next span {
  color: var(--guide-muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tier-panel__next strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  margin: 0.35rem 0;
}

.tier-panel__next p {
  color: var(--guide-muted);
  margin: 0;
}

.tier-progress {
  background: #e2e8f0;
  border-radius: 999px;
  height: 0.7rem;
  overflow: hidden;
}

.tier-progress span {
  background: linear-gradient(90deg, var(--guide-accent), #2dd4bf);
  display: block;
  height: 100%;
  min-width: 0.35rem;
}

.tier-ladder {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.tier-ladder li {
  border: 1px solid var(--guide-border);
  border-radius: 8px;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.7rem 0.8rem;
}

.tier-ladder li.is-active {
  background: #172554;
  border-color: #172554;
  color: #fff;
}

.tier-ladder span,
.tier-ladder strong {
  min-width: 0;
}

.leaderboard-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
  justify-items: stretch;
}

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

.leaderboard-panel__header h2 {
  margin: 0.2rem 0 0;
}

.leaderboard-panel__header h2 a {
  color: inherit;
  text-decoration: none;
}

.leaderboard-panel__header .muted {
  margin: 0;
  text-align: right;
}

.leaderboard-list {
  display: grid;
  gap: 0.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-content: start;
  align-self: start;
}

.leaderboard-row {
  align-items: center;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 2rem minmax(8rem, 12rem) minmax(10rem, 1fr) auto;
  min-width: 0;
}

.leaderboard-rank {
  align-items: center;
  background: var(--guide-soft);
  border: 1px solid var(--guide-border);
  border-radius: 999px;
  color: var(--guide-accent-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  height: 1.8rem;
  justify-content: center;
  width: 1.8rem;
}

.leaderboard-guide {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.leaderboard-guide strong,
.leaderboard-guide small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-guide a {
  color: inherit;
  text-decoration: none;
}

.leaderboard-guide small {
  color: var(--guide-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.leaderboard-meter {
  background: #edf3ef;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 999px;
  display: block;
  height: 0.72rem;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.leaderboard-meter__fill {
  background: linear-gradient(90deg, var(--chart-rank-start), var(--chart-rank-end));
  border-radius: inherit;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.18);
  display: block;
  height: 100%;
  min-width: 0.35rem;
  width: calc(var(--leader-size, 0) * 100%);
}

.leaderboard-total {
  color: var(--guide-ink);
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.leaderboard-row--empty {
  color: var(--guide-muted);
  display: block;
}

.leaderboard-page {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.leaderboard-page__header {
  align-items: flex-start;
  border-bottom: 1px solid var(--guide-border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-bottom: 1rem;
}

.leaderboard-page__header h2 {
  margin: 0.2rem 0 0;
}

.leaderboard-list--full {
  gap: 0.65rem;
}

.leaderboard-row--full {
  background: linear-gradient(180deg, rgba(238, 246, 242, 0.72), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(217, 220, 207, 0.86);
  border-radius: 8px;
  grid-template-columns: 2rem minmax(11rem, 18rem) minmax(10rem, 1fr) 5.5rem 7.5rem 7.5rem;
  padding: 0.72rem 0.85rem;
}

.leaderboard-row--full.is-inactive {
  opacity: 0.72;
}

.leaderboard-stat {
  display: grid;
  gap: 0.08rem;
  justify-items: end;
  min-width: 0;
}

.leaderboard-stat small {
  color: var(--guide-muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.leaderboard-stat strong {
  color: var(--guide-ink);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.guide-admin-form {
  display: grid;
  gap: 1.35rem;
}

.form-section {
  display: grid;
  gap: 1rem;
}

.form-accordion {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--guide-border);
  border-radius: 0.5rem;
  overflow: hidden;
  padding: 0;
}

.form-accordion summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 0.15rem 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 1rem;
}

.form-accordion summary:focus {
  outline: none;
}

.form-accordion summary:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.form-accordion summary::after {
  content: none !important;
  display: none !important;
}

.accordion-icon {
  align-items: center;
  color: var(--guide-accent);
  display: inline-flex;
  grid-column: 2;
  grid-row: 1 / span 2;
  height: 2rem;
  justify-self: end;
  transition: transform 160ms ease;
  width: 2rem;
}

.form-accordion summary .eyebrow,
.form-accordion summary h2 {
  grid-column: 1;
}

.form-accordion[open] summary {
  border-bottom: 1px solid var(--guide-border);
}

.form-accordion[open] .accordion-icon {
  transform: rotate(180deg);
}

.form-section-body {
  padding: 1rem;
}

.company-assignment-list {
  display: grid;
  gap: 1rem;
}

.company-assignment-row {
  align-items: end;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.company-assignment-row--required {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.company-assignment-row[hidden] {
  display: none;
}

.assignment-remove {
  align-items: center;
  display: flex;
  min-height: 4.2rem;
}

.assignment-remove input[type="checkbox"] {
  display: none;
}

.assignment-row-error {
  grid-column: 1 / -1;
}

.add-row-button {
  justify-self: start;
  margin: 0;
}

.danger-outline {
  background: transparent;
  border-color: #b91c1c;
  color: #b91c1c;
  margin: 0;
}

.danger-outline:hover,
.danger-outline:focus {
  background: #fee2e2;
  border-color: #991b1b;
  color: #991b1b;
}

.form-grid label:has(textarea),
.checkbox-group,
.form-section-heading,
.form-section-title,
.form-actions {
  grid-column: 1 / -1;
}

.form-section-heading h2,
.form-section-title h2 {
  margin: 0.2rem 0 0;
}

.company-plan-form {
  display: grid;
  gap: 1rem;
}

.detail-stack {
  align-content: start;
  display: grid;
  gap: 1.25rem;
}

.detail-stack h2 {
  margin: 0.2rem 0 0.35rem;
}

.info-card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

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

.info-card h2 {
  margin: 0.2rem 0 0.35rem;
  overflow-wrap: anywhere;
}

.info-card-meta {
  margin: 0.65rem 0 0;
}

.info-card-list {
  margin-top: 0.5rem;
}

.place-photo-card {
  align-self: start;
  padding: 1rem;
}

.place-photo-card__image {
  border: 1px solid var(--guide-border);
  border-radius: 8px;
  height: clamp(8rem, 13vw, 12rem);
  object-fit: cover;
  width: 100%;
}

.place-hours-list--compact {
  display: grid;
  font-size: 0.92rem;
  grid-template-columns: 1fr;
}

.place-demand-panel {
  margin-top: 1rem;
}

.place-demand-panel__header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.place-demand-panel__header h2 {
  margin: 0 0 0.25rem;
}

.place-demand-panel__average {
  border: 1px solid var(--guide-border);
  border-radius: 8px;
  min-width: 9rem;
  padding: 0.75rem 0.9rem;
  text-align: right;
}

.place-demand-panel__average span {
  color: var(--guide-muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.place-demand-panel__average strong {
  display: block;
  font-size: 1.35rem;
  margin-top: 0.2rem;
}

.place-demand-list {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
}

.place-demand-list li + li {
  margin-top: 0.35rem;
}

.guide-action__short {
  display: none;
}

.guide-action .icon-tabler {
  flex: 0 0 auto;
}

/* Name + edit/view icons on one line (icons sit immediately after the name) */
.guide-detail-heading__copy {
  min-width: 0;
}

.guide-detail-heading__title {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin: 0;
  max-width: 100%;
  min-width: 0;
}

/* min-width:0 on this span was collapsing the flex item to ~1ch (letters stacked vertically). */
.guide-detail-heading__name {
  flex: 0 1 auto;
  min-width: min-content;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.guide-detail-heading__icon-actions {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.1rem;
  line-height: 0;
  margin-top: 0.15em;
  white-space: nowrap;
}

.guide-impersonate-form {
  flex: 0 0 auto;
  line-height: 0;
}

/* Plain icon controls beside the name — no Pico button chrome */
.icon-button,
.guide-edit-button,
.guide-impersonate-button,
a.icon-button,
a.guide-edit-button,
button.icon-button,
button.guide-impersonate-button {
  align-items: center;
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0.35rem;
  box-shadow: none !important;
  color: var(--guide-muted);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: auto;
  justify-content: center;
  line-height: 0;
  margin: 0;
  min-height: 0;
  min-width: 0;
  outline-offset: 3px;
  padding: 0.2rem !important;
  text-decoration: none;
  width: auto;
}

.icon-button:hover,
.icon-button:focus,
.guide-edit-button:hover,
.guide-edit-button:focus,
.guide-impersonate-button:hover,
.guide-impersonate-button:focus {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--guide-accent-dark);
}

.icon-button:focus-visible,
.guide-edit-button:focus-visible,
.guide-impersonate-button:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.45);
}

.guide-detail-heading__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
}

.guide-detail-heading__sep {
  opacity: 0.55;
}

.manual-entry-details {
  margin: 0;
}

.manual-entry-details > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.manual-entry-details > summary::before,
.manual-entry-details > summary::after {
  content: none !important;
  display: none !important;
}

.manual-entry-details > summary h2 {
  margin: 0.15rem 0 0;
}

.manual-entry-details[open] > summary {
  margin-bottom: 0.75rem;
}

.manual-entry-help {
  margin: 0 0 1rem;
}

.guide-detail-manual {
  margin-top: 1rem;
}

.checkbox-field {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  min-height: 2.75rem;
  width: fit-content;
}

.checkbox-field input[type="checkbox"] {
  flex: 0 0 auto;
  height: 1.1rem;
  margin: 0;
  min-width: 0;
  padding: 0;
  width: 1.1rem;
}

.checkbox-field small {
  flex: 0 0 100%;
  margin-left: 1.75rem;
}

.checkbox-field--compact {
  gap: 0.4rem;
  min-height: 0;
}

.checkbox-group {
  border: 0;
  margin: 0;
  padding: 0;
}

.checkbox-group legend {
  color: var(--guide-ink);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

.checkbox-grid .checkbox-field {
  border: 1px solid var(--guide-border);
  border-radius: 0.5rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.65rem;
}

.checkbox-grid--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.checkbox-grid--hours {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.inline-tier-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.inline-tier-list li {
  background: var(--guide-soft);
  border: 1px solid var(--guide-border);
  border-radius: 999px;
  color: var(--guide-accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
}

.tier-editor {
  display: grid;
  gap: 1rem;
}

.tier-editor header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.tier-editor header h2 {
  margin: 0.2rem 0 0;
}

.tier-editor header .muted {
  margin: 0;
  text-align: right;
}

.tier-editor input {
  margin-bottom: 0;
}

.manual-entry-panel {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.manual-entry-panel > header,
.manual-sales-editor > div:first-child {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.manual-entry-panel h2,
.manual-sales-editor h3 {
  margin: 0.2rem 0 0;
}

.manual-entry-panel header .muted {
  margin: 0;
  text-align: right;
}

.manual-entry-form,
.manual-sales-editor {
  display: grid;
  gap: 1rem;
}

.manual-sales-editor input {
  margin-bottom: 0;
}

.form-actions {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-start;
  margin-top: 0.75rem;
}

.form-actions button,
.form-actions a {
  flex: 0 0 auto;
  margin: 0;
  min-height: 3.25rem;
  min-width: 11rem;
  width: auto;
}

.form-actions .danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.form-actions .danger:hover,
.form-actions .danger:focus {
  background: #991b1b;
  border-color: #991b1b;
}

.form-error {
  color: #b91c1c;
}

.table-wrap {
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* Tables fill their card/shell on desktop; scroll horizontally only when needed */
.table-wrap > table {
  margin: 0;
  min-width: 100%;
  width: 100%;
}

/* Table-only cards: no padding, no negative-margin bleed (bleed was overflowing past the border) */
.surface.surface--table {
  padding: 0;
}

.surface.surface--table > .form-section-title {
  margin: 0 0 0.75rem;
  padding: 1rem 1rem 0;
}

.surface.surface--table > .form-section-title + p.muted {
  margin: 0;
  padding: 0 1rem 1rem;
}

.surface.surface--table > .table-wrap {
  margin: 0;
  width: 100%;
}

.surface > .table-wrap {
  margin: 0;
  max-width: 100%;
  width: 100%;
}

.surface > .table-wrap > table,
.surface.surface--table > .table-wrap > table {
  border-radius: 0;
  max-width: 100%;
}

/* Keep action cells inside the table box */
.data-table {
  border-collapse: collapse;
  table-layout: auto;
}

.data-table td,
.inbox-table td,
.places-table tbody td,
.leaderboard-table tbody td {
  box-sizing: border-box;
}

.inbox-table__actions,
.data-table td.table-actions,
.places-table td.table-actions,
.leaderboard-table td.table-actions {
  display: table-cell;
  padding-inline: 0.75rem;
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
  width: 1%;
}

/* Kill flex-on-td from older .table-actions rule when combined */
td.table-actions.table-actions {
  align-items: unset;
  display: table-cell;
  flex-wrap: unset;
  gap: unset;
  justify-content: unset;
}

.surface > h2 + .table-wrap,
.surface > header + .table-wrap {
  margin-top: 0.35rem;
}

.table-wrap thead th {
  background: var(--guide-surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table-wrap tbody tr:hover td {
  background: rgba(15, 118, 110, 0.04);
}

.table-wrap th,
.table-wrap td {
  vertical-align: middle;
}

.table-wrap th.numeric,
.table-wrap td.numeric {
  white-space: nowrap;
}

/* Hide low-priority columns on mid/small widths (mark cells with these classes in templates) */
.hide-md {
  /* shown by default; hidden below in media queries */
}

.data-cards {
  display: none;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.data-cards > li {
  background: var(--guide-soft);
  border: 1px solid var(--guide-border);
  border-radius: 0.65rem;
  display: grid;
  gap: 0.45rem;
  list-style: none;
  padding: 0.85rem 1rem;
}

.data-cards__title {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  justify-content: space-between;
}

.data-cards__meta {
  color: var(--guide-muted);
  font-size: 0.88rem;
}

.data-cards__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 0.15rem 0 0;
}

.data-cards__stats span {
  color: var(--guide-muted);
  font-size: 0.82rem;
}

.data-cards__stats strong {
  color: var(--guide-ink);
  display: block;
  font-size: 1rem;
}

.data-cards__footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  justify-content: space-between;
  margin-top: 0.15rem;
}

.numeric {
  text-align: right;
}

/* Page heading secondary actions: keep primary CTA prominent on small screens */
.actions-group--stack-sm {
  /* class hook; styles in mobile section */
}

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

.clean-list li {
  align-items: center;
  border-bottom: 1px solid var(--guide-border);
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.charts-css {
  --color: var(--guide-accent);
  min-height: 240px;
}

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

.monthly-sales-chart {
  --monthly-chart-height: 18rem;
  --monthly-chart-axis-width: 4rem;
  --monthly-chart-column-gap: 0.42rem;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.06) 0%, rgba(245, 158, 11, 0.04) 100%),
    var(--guide-surface);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
  min-height: 120px;
  overflow: visible;
  padding-bottom: 1rem;
}

.monthly-sales-chart__header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.monthly-sales-chart__header h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  margin: 0.2rem 0 0;
}

.monthly-sales-chart__header .muted {
  margin: 0;
  text-align: right;
}

.monthly-sales-chart__header-meta {
  display: grid;
  gap: 0.45rem;
  justify-items: end;
  text-align: right;
}

.monthly-sales-chart__legend {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  justify-content: flex-end;
  margin: 0;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid var(--guide-border, rgba(15, 23, 42, 0.1));
}

.monthly-sales-chart__legend-toggle {
  appearance: none;
  -webkit-appearance: none;
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 999px;
  box-shadow: none;
  color: var(--guide-muted);
  cursor: pointer;
  display: inline-flex;
  flex: 1 1 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  gap: 0.4rem;
  justify-content: center;
  line-height: 1.2;
  margin: 0;
  min-height: 0;
  /* Equal pill widths across Sales/Visits/Commission labels */
  min-width: 7.25rem;
  padding: 0.35rem 0.65rem;
  width: 7.25rem;
}

.monthly-sales-chart__legend-toggle::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 0.2rem;
  background: currentColor;
  opacity: 0.35;
  flex-shrink: 0;
}

.monthly-sales-chart__legend-toggle--sales.is-active {
  color: var(--chart-sales-end, #ea580c);
  background: rgba(234, 88, 12, 0.12);
}

.monthly-sales-chart__legend-toggle--sales.is-active::before {
  background: linear-gradient(180deg, var(--chart-sales-start) 0%, var(--chart-sales-end) 100%);
  opacity: 1;
}

.monthly-sales-chart__legend-toggle--visits.is-active {
  color: var(--chart-visits-end, #2563eb);
  background: rgba(37, 99, 235, 0.12);
}

.monthly-sales-chart__legend-toggle--visits.is-active::before {
  background: linear-gradient(180deg, var(--chart-visits-start) 0%, var(--chart-visits-end) 100%);
  opacity: 1;
}

.monthly-sales-chart__legend-toggle--commission.is-active {
  color: var(--chart-commission-end, #f59e0b);
  background: rgba(245, 158, 11, 0.16);
}

.monthly-sales-chart__legend-toggle--commission.is-active::before {
  background: linear-gradient(180deg, var(--chart-commission-start) 0%, var(--chart-commission-end) 100%);
  opacity: 1;
}

.monthly-sales-chart__legend-toggle[aria-pressed="false"] {
  opacity: 0.72;
}

.monthly-sales-chart__legend-toggle.is-locked,
.monthly-sales-chart__legend-toggle[aria-disabled="true"] {
  cursor: default;
  opacity: 1;
}

.monthly-sales-chart__series[hidden] {
  display: none !important;
}

.monthly-sales-chart__wrapper {
  flex: 1;
  overflow: visible;
  padding-top: 0.85rem;
  width: 100%;
}

.monthly-sales-chart__plot {
  align-items: start;
  column-gap: 0.75rem;
  display: grid;
  grid-template-areas:
    "y-axis plot"
    ". x-axis";
  grid-template-columns: var(--monthly-chart-axis-width) minmax(0, 1fr);
  min-width: 0;
  row-gap: 0.75rem;
}

.monthly-sales-chart__y-axis {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  grid-area: y-axis;
  height: var(--monthly-chart-height);
  justify-content: space-between;
  pointer-events: none;
  position: relative;
  z-index: 0;
}

.monthly-sales-chart__y-axis-tick {
  min-height: 1px;
}

.monthly-sales-chart__y-axis-label {
  color: var(--guide-muted);
  display: block;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 100%;
}

.monthly-sales-chart__plot-body {
  grid-area: plot;
  min-width: 0;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.monthly-sales-chart__guide-lines {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.monthly-sales-chart__guide-line {
  border-top: 1px solid rgba(23, 37, 84, 0.1);
  bottom: calc(var(--tick-ratio, 0) * 100%);
  left: 0;
  position: absolute;
  right: 0;
}

.monthly-sales-chart__table {
  border-collapse: separate;
  height: var(--monthly-chart-height);
  min-width: 0;
  overflow: visible;
  position: relative;
  width: 100%;
  z-index: 1;
}

.monthly-sales-chart__table caption,
.monthly-sales-chart__table thead {
  display: none;
}

.monthly-sales-chart__table tbody {
  align-items: stretch;
  display: flex;
  gap: var(--monthly-chart-column-gap);
  height: var(--monthly-chart-height);
  margin: 0;
  padding: 0;
}

.monthly-sales-chart__table tbody tr {
  align-items: stretch;
  display: flex;
  flex: 1 1 0;
  height: 100%;
  min-width: 0;
  position: relative;
}

.monthly-sales-chart__table tbody tr th {
  display: none;
}

.monthly-sales-chart .visually-hidden {
  display: none;
}

.monthly-sales-chart__table tbody tr td.monthly-sales-chart__bar {
  background: transparent;
  border: 0;
  display: block;
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;
  padding: 0;
  position: relative;
  vertical-align: bottom;
}

.monthly-sales-chart__bar-group {
  align-items: flex-end;
  display: flex;
  gap: 0.22rem;
  inset: 0;
  justify-content: center;
  position: absolute;
}

.monthly-sales-chart__bar-group--paired {
  gap: 0.22rem;
}

.monthly-sales-chart__series {
  align-items: flex-end;
  display: flex;
  flex: 1 1 0;
  height: 100%;
  justify-content: center;
  min-width: 0;
  position: relative;
}

.monthly-sales-chart__bar-fill {
  background: linear-gradient(180deg, var(--chart-daily-start) 0%, var(--chart-daily-end) 100%);
  border-radius: 0.65rem 0.65rem 0 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  display: block;
  height: calc(var(--sales-size, 0) * 100%);
  min-height: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  width: 100%;
}

.monthly-sales-chart__bar-fill--sales {
  background: linear-gradient(180deg, var(--chart-sales-start, #fdba74) 0%, var(--chart-sales-end, #ea580c) 100%);
  height: calc(var(--sales-size, 0) * 100%);
}

.monthly-sales-chart__bar-fill--visits {
  background: linear-gradient(180deg, var(--chart-visits-start, #93c5fd) 0%, var(--chart-visits-end, #2563eb) 100%);
  height: calc(var(--visits-size, 0) * 100%);
}

.monthly-sales-chart__bar-fill--commission {
  background: linear-gradient(180deg, var(--chart-commission-start) 0%, var(--chart-commission-end) 100%);
  height: calc(var(--commission-size, 0) * 100%);
}

.monthly-sales-chart__series--visits .monthly-sales-chart__bar-caption {
  bottom: calc((var(--visits-size, 0) * 100%) + 0.45rem);
}

.monthly-sales-chart__bar-caption {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 220, 207, 0.9);
  border-radius: 999px;
  bottom: calc((var(--sales-size, 0) * 100%) + 0.45rem);
  box-shadow: 0 6px 16px rgba(23, 37, 84, 0.12);
  color: var(--guide-ink);
  display: none;
  font-size: 0.62rem;
  font-weight: 700;
  left: 50%;
  line-height: 1;
  opacity: 0;
  padding: 0.24rem 0.34rem;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, 0.18rem);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
  z-index: 5;
}

.monthly-sales-chart__bar-caption--empty {
  display: none;
}

.monthly-sales-chart__bar-caption--sales {
  bottom: calc((var(--sales-size, 0) * 100%) + 0.45rem);
}

.monthly-sales-chart__bar-caption--commission {
  bottom: calc((var(--commission-size, 0) * 100%) + 0.45rem);
}

.monthly-sales-chart__series:hover .monthly-sales-chart__bar-caption {
  display: block;
  opacity: 1;
  transform: translate(-50%, -0.18rem);
}

.monthly-sales-chart__x-axis {
  display: flex;
  gap: var(--monthly-chart-column-gap);
  grid-area: x-axis;
  list-style: none;
  margin: 0;
  padding: 0;
}

.monthly-sales-chart__x-axis-label {
  align-items: center;
  color: var(--guide-muted);
  display: flex;
  flex: 1 1 0;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  justify-content: center;
  min-height: 1.5rem;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

.monthly-sales-chart__x-axis-year {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.chart-legend {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.chart-legend__item {
  align-items: center;
  color: var(--guide-muted);
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 700;
  gap: 0.35rem;
}

.chart-legend__item::before {
  border-radius: 999px;
  content: "";
  height: 0.75rem;
  width: 0.75rem;
}

.chart-legend__item--sales::before {
  background: var(--chart-sales-end);
}

.chart-legend__item--commission::before {
  background: var(--chart-commission-end);
}

.message {
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
}

.message--success {
  background: #dcfce7;
  color: #166534;
}

.message--error {
  background: #fee2e2;
  color: #991b1b;
}

.message--warning {
  background: #fef3c7;
  color: #92400e;
}

.pass-tag--compact {
  font-size: clamp(1.8rem, 5vw, 3rem);
}

@media (max-width: 1100px) {
  .hide-md {
    display: none !important;
  }
}

@media (max-width: 980px) {
  .info-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 820px) {
  .auth-panel,
  .page-heading,
  .two-column,
  .tier-panel__summary,
  .tier-ladder,
  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile landing: short hero + optional sign-in (collapsed by default) */
  .shell--auth {
    min-height: calc(100dvh - 4.25rem);
    padding-block: 0.65rem 1rem;
  }

  .auth-panel {
    align-content: start;
    gap: 0.85rem;
    min-height: 0;
    padding-block: 0;
  }

  .auth-copy {
    justify-content: flex-end;
    min-height: 0;
    padding: 1.1rem 1.15rem 1rem;
  }

  .auth-copy h1,
  .auth-copy h1.auth-copy__brand {
    font-size: clamp(2.1rem, 10vw, 2.75rem);
    line-height: 1.05;
    margin: 0 0 0.35rem;
  }

  .auth-copy__tagline,
  .auth-copy .muted {
    font-size: 0.95rem !important;
    line-height: 1.35;
    max-width: none;
  }

  .auth-sign-in:not([open]) .auth-sign-in__cta {
    display: flex;
  }

  .auth-sign-in:not([open]) .login-form {
    display: none;
  }

  .auth-sign-in[open] .auth-sign-in__summary {
    display: none;
  }

  .login-form {
    padding: 1rem 1rem 1.1rem;
  }

  .login-form__title,
  .login-form h2 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
  }

  .login-form label {
    margin-bottom: 0.55rem;
  }

  .login-form button[type="submit"] {
    margin-top: 0.25rem;
  }

  .page-heading {
    align-items: stretch;
  }

  .page-heading .actions-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  .page-heading .actions-group > a[role="button"],
  .page-heading .actions-group > button {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 2.75rem;
  }

  /* On small screens, optional: de-emphasize secondary header links via class on secondary buttons only */
  .page-heading .actions-group > a[role="button"].secondary.hide-sm-action {
    display: none;
  }

  .surface > .table-wrap,
  .surface.surface--table > .table-wrap {
    margin: 0;
    width: 100%;
  }

  .table-wrap th,
  .table-wrap td {
    font-size: 0.92rem;
    padding-inline: 0.65rem;
  }

  .guide-detail-heading .actions-group,
  .guide-detail-actions {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .guide-detail-actions > .inline-form,
  .guide-detail-actions > form,
  .guide-detail-actions > a {
    display: flex;
    min-width: 0;
    width: 100%;
  }

  .guide-detail-actions a,
  .guide-detail-actions a[role="button"],
  .guide-detail-actions button {
    border-radius: 0.55rem;
    flex: 1 1 auto;
    min-height: 2.75rem;
    padding: 0.65rem 0.65rem;
    width: 100%;
  }

  .guide-detail-actions .guide-action__full {
    display: none;
  }

  .guide-detail-actions .guide-action__short {
    display: inline;
  }

  .guide-detail-kpis,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi {
    padding: 0.7rem 0.8rem;
  }

  .kpi > span {
    font-size: 0.7rem;
  }

  .kpi strong {
    font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  }

  .info-card-grid {
    grid-template-columns: 1fr;
  }

  .place-photo-card__image {
    height: 10rem;
  }

  .place-demand-panel__header {
    flex-direction: column;
  }

  .place-demand-panel__average {
    text-align: left;
    width: 100%;
  }

  .manual-entry-details > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .manual-entry-details__hint {
    font-size: 0.85rem;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .form-actions a,
  .form-actions button {
    flex: 1 1 auto;
    min-width: min(100%, 10rem);
  }

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

  .company-assignment-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .assignment-remove {
    min-height: 0;
  }

  .monthly-sales-chart__header {
    flex-direction: column;
  }

  .monthly-sales-chart__header .muted,
  .leaderboard-panel__header .muted,
  .tier-editor header .muted,
  .manual-entry-panel header .muted {
    text-align: left;
  }

  .leaderboard-panel__header,
  .tier-editor header,
  .manual-entry-panel > header,
  .manual-sales-editor > div:first-child {
    flex-direction: column;
  }

  .leaderboard-page__header {
    flex-direction: column;
  }

  .leaderboard-row {
    grid-template-columns: 2rem minmax(0, 1fr) auto;
  }

  .leaderboard-meter {
    grid-column: 2 / -1;
  }

  .leaderboard-row--full {
    grid-template-columns: 2rem minmax(0, 1fr) repeat(3, minmax(4.5rem, auto));
  }

  .leaderboard-row--full .leaderboard-meter {
    grid-column: 2 / -1;
  }

  .monthly-sales-chart {
    --monthly-chart-axis-width: 3rem;
    --monthly-chart-column-gap: 0.24rem;
  }

  .monthly-sales-chart__x-axis-label {
    font-size: 0.55rem;
  }
}

/* Hamburger / slide-down nav on phones & small tablets */
@media (max-width: 720px) {
  /* Card-style list alternative for primary staff tables */
  .table-wrap--has-cards {
    display: none;
  }

  .data-cards {
    display: grid;
  }

  .surface:has(> .data-cards) > .table-wrap--has-cards {
    display: none;
  }

  .surface:has(> .data-cards) {
    padding-bottom: 0.85rem;
  }

  .clean-list li {
    align-items: flex-start;
    gap: 0.75rem;
    min-height: 3rem;
  }

  .clean-list li .text-link {
    flex: 0 0 auto;
    min-height: 2.5rem;
    padding: 0.35rem 0;
  }

  /* Check-in review: keep approve/reject reachable */
  .form-actions--sticky-mobile {
    background: linear-gradient(180deg, rgba(246, 247, 241, 0), var(--guide-bg) 28%);
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-inline: -0.85rem;
    padding: 0.85rem;
    position: sticky;
    z-index: 12;
  }

  .form-actions--sticky-mobile a,
  .form-actions--sticky-mobile button {
    flex: 1 1 calc(50% - 0.55rem);
    min-height: 2.85rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-backdrop[hidden] {
    display: none !important;
  }

  .topnav {
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid var(--guide-border);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
    display: none;
    flex-direction: column;
    gap: 0.15rem;
    inset: 4.25rem 0 auto 0;
    max-height: calc(100vh - 4.25rem);
    overflow-y: auto;
    padding: 0.65rem 0.85rem 1rem;
    position: fixed;
    z-index: 29;
  }

  body.nav-open .topnav {
    display: flex;
  }

  .topnav a,
  .topnav .link-button {
    border-radius: 0.55rem;
    font-size: 1rem;
    font-weight: 600;
    justify-content: flex-start;
    min-height: 2.85rem;
    padding: 0.7rem 0.85rem;
    width: 100%;
  }

  .topnav a.topnav__icon-link,
  .topnav .link-button.topnav__icon-button {
    justify-content: center;
    min-height: 2.85rem;
    padding: 0.7rem;
    width: 2.85rem;
  }

  .topnav a:hover,
  .topnav a:focus,
  .topnav .link-button:hover,
  .topnav .link-button:focus {
    background: var(--guide-soft);
  }

  .topnav form {
    border-top: 1px solid var(--guide-border);
    display: block;
    margin-top: 0.45rem;
    padding-top: 0.55rem;
    width: 100%;
  }

  .topnav form.topnav__icon-form {
    border-top: 0;
    display: inline-flex;
    margin-top: 0;
    padding-top: 0;
    width: auto;
  }

  .topnav form .link-button {
    background: transparent;
    border: 0;
    color: var(--guide-ink);
    cursor: pointer;
    margin: 0;
    width: 100%;
  }

  .impersonation-banner {
    align-items: center;
    gap: 0.5rem;
    top: 4.25rem;
  }

  .impersonation-banner__copy strong {
    font-size: 0.92rem;
  }

  .impersonation-banner__copy span {
    display: none;
  }

  .impersonation-exit,
  button.impersonation-exit {
    min-height: 2rem;
    padding: 0.35rem 0.55rem;
  }

  .impersonation-exit__label {
    display: inline;
  }

  .impersonation-exit__label-full {
    display: none;
  }
}

@media (max-width: 520px) {
  .guide-detail-heading h1,
  .guide-detail-heading__title {
    font-size: clamp(1.65rem, 8vw, 2.1rem);
  }

  .guide-detail-heading__title {
    flex-wrap: wrap;
  }

  .guide-detail-heading__name {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .shell,
  .shell--wide,
  .shell--narrow {
    padding-inline: 0.85rem;
  }

  .surface > .table-wrap,
  .surface.surface--table > .table-wrap {
    margin: 0;
    width: 100%;
  }

  .surface {
    padding: 0.9rem;
  }

  .surface.surface--table {
    padding: 0;
  }

  .kpi {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.65rem 0.75rem;
  }

  .kpi > span {
    width: 100%;
  }

  .kpi strong {
    text-align: left;
  }

  .clean-list li {
    gap: 0.65rem;
  }

  .leaderboard-row--full {
    grid-template-columns: 2rem minmax(0, 1fr);
  }

  .leaderboard-row--full .leaderboard-meter,
  .leaderboard-stat {
    grid-column: 1 / -1;
  }

  .leaderboard-stat {
    align-items: center;
    display: flex;
    justify-content: space-between;
  }
}

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

label.span-full {
  grid-column: 1 / -1;
}

/* Membership invite: terms preview before accept */
.membership-invite-card__header {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.membership-invite-card__header h2 {
  margin: 0.2rem 0 0;
}

.membership-invite-card__actions {
  margin-top: 1rem;
}

.membership-invite-card + .membership-invite-card,
.membership-invite-card + .surface {
  margin-top: 1rem;
}

.terms-preview {
  border: 1px solid var(--border, rgba(15, 23, 42, 0.12));
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  background: rgba(15, 23, 42, 0.02);
}

.terms-preview h3 {
  margin: 0.25rem 0 0.75rem;
  font-size: 1.05rem;
}

.terms-preview__body {
  max-height: 14rem;
  overflow: auto;
  line-height: 1.55;
  font-size: 0.95rem;
  white-space: normal;
}

.place-card__image-link {
  display: block;
  border-radius: 8px;
}

.place-card__image-link:hover .place-thumbnail,
.place-card__image-link:focus-visible .place-thumbnail {
  border-color: var(--guide-accent);
}

.place-card__header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.place-card__city {
  line-height: 1.1;
  margin: 0;
}

.place-card__title {
  font-size: 1.25rem;
  margin: 0 0 0.65rem;
  overflow-wrap: anywhere;
}

.place-card__badges {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 0.35rem;
}

.place-card__avg-badge {
  align-items: center;
  font-size: 0.72rem;
  line-height: 1;
  min-height: 0;
  padding: 0 0.35rem;
}

.place-card .place-tags {
  margin: 0 0 0.65rem;
}

.place-card__needs {
  color: var(--guide-muted);
  margin-top: 0.65rem;
}

.place-card__needs strong {
  color: var(--guide-muted);
}

.place-card__needs ul {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
}

.place-card__needs li + li {
  margin-top: 0.25rem;
}

.place-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.partnership-request-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
  max-width: 32rem;
}

.place-lookup {
  background: rgba(238, 247, 244, 0.52);
  border: 1px solid var(--guide-border);
  padding: 1rem;
}

.place-lookup__header,
.place-lookup-result {
  align-items: flex-start;
  display: flex;
  gap: 0.85rem;
  justify-content: space-between;
}

.place-lookup__header h3,
.place-lookup-result h4 {
  margin: 0;
}

.place-lookup__status {
  margin: 0.65rem 0 0;
}

.place-lookup__results {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.place-lookup-result {
  background: var(--guide-surface);
  border: 1px solid var(--guide-border);
  padding: 0.75rem;
}

.place-lookup-result__body {
  flex: 1 1 auto;
  min-width: 0;
}

.place-lookup-result__body p,
.place-lookup-result__meta {
  margin: 0.25rem 0 0;
}

@media (max-width: 720px) {
  .place-lookup__header,
  .place-lookup-result {
    align-items: stretch;
    flex-direction: column;
  }

  .place-lookup__header button,
  .place-lookup-result button {
    width: 100%;
  }

  .place-thumbnail--lookup {
    flex: 0 0 auto;
    height: 9rem;
    width: 100%;
  }
}

.place-catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

.place-hours-editor {
  display: grid;
  gap: 0;
  margin-top: 0.85rem;
}

.place-hours-day {
  border-top: 1px solid var(--guide-border);
  display: grid;
  gap: 0.85rem;
  padding: 1rem 0;
}

.place-hours-day:first-child {
  border-top: 0;
  padding-top: 0;
}

.place-hours-day__header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.place-hours-day__header h3 {
  color: var(--guide-navy);
  font-size: clamp(1.15rem, 1.4vw, 1.45rem);
  margin: 0;
}

.place-hours-day__body {
  align-items: start;
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: minmax(16rem, 0.75fr) minmax(22rem, 1.25fr);
}

.place-hours-day__hours,
.place-hours-day__demand {
  display: grid;
  gap: 0.65rem;
}

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

.place-hours-day__hours input[type="time"],
.place-demand-window input[type="time"] {
  margin: 0;
  min-width: 0;
}

.place-hours-day__label {
  color: var(--guide-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.place-demand-window {
  align-items: end;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 5.5rem repeat(2, minmax(0, 1fr));
}

.place-demand-window__index {
  color: var(--guide-muted);
  font-size: 0.9rem;
  font-weight: 800;
  padding-bottom: 0.75rem;
}

.place-hours-list li {
  border-bottom: 1px solid var(--guide-border);
  justify-content: flex-start;
}

.place-hours-list--compact li {
  padding-block: 0.25rem;
}

@media (max-width: 820px) {
  .place-hours-day__body,
  .place-hours-day__hours,
  .place-demand-window {
    grid-template-columns: 1fr;
  }

  .place-demand-window {
    align-items: stretch;
  }

  .place-demand-window__index {
    padding-bottom: 0;
  }
}

.form-section-title.span-full {
  grid-column: 1 / -1;
}

/* --- Portal filters (global sticky bar) + dense list pages --- */
/* Full-bleed bar; inner row matches .shell / .shell--wide column (centered). */
.portal-filters {
  --portal-filters-shell-max: min(1600px, 100%);
  --portal-filters-shell-pad: clamp(1rem, 3vw, 2rem);
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--guide-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  justify-content: space-between;
  padding-block: 0.4rem;
  /* Side inset = shell side margin + shell horizontal padding */
  padding-inline: max(
    var(--portal-filters-shell-pad),
    calc((100% - var(--portal-filters-shell-max)) / 2 + var(--portal-filters-shell-pad))
  );
  position: sticky;
  top: 4.25rem;
  z-index: 8;
  width: 100%;
}

body:has(.impersonation-banner) .portal-filters {
  top: calc(4.25rem + 3.1rem);
}

.portal-filters__controls {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  min-width: 0;
}

.portal-filters__field {
  display: grid;
  gap: 0.12rem;
  margin: 0;
  min-width: 0;
}

.portal-filters__label {
  color: var(--guide-muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.portal-filters select {
  font-size: 0.92rem;
  margin: 0;
  min-height: 2.2rem;
  min-width: 8.5rem;
  padding: 0.28rem 0.55rem;
  width: auto;
}

.portal-filters__meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  margin-left: auto;
}

.portal-filters__reset {
  font-size: 0.82rem;
  margin: 0;
  min-height: 2.2rem;
  padding: 0.28rem 0.7rem;
  width: auto;
}

.shell--dense {
  gap: 0.7rem;
  padding-block: clamp(0.65rem, 2vw, 1.1rem);
}

.shell--dense > .page-heading,
.page-heading--compact {
  gap: 0.45rem;
  margin-bottom: 0;
}

.page-heading--compact h1 {
  font-size: clamp(1.45rem, 2.8vw, 1.85rem);
  line-height: 1.15;
  margin: 0;
}

.page-heading__meta {
  font-size: 0.92rem;
  margin: 0.15rem 0 0;
}

.surface--compact {
  padding: 0.75rem;
}

.surface--compact > .table-wrap {
  margin: 0;
}

@media (max-width: 720px) {
  .catalog-toolbar {
    align-items: stretch;
  }

  .catalog-toolbar__side {
    justify-items: start;
    margin-left: 0;
    width: 100%;
  }

  .catalog-view-toggle {
    width: fit-content;
  }

  .portal-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-filters__controls {
    width: 100%;
  }

  .portal-filters__field {
    flex: 1 1 8rem;
  }

  .portal-filters select {
    min-width: 0;
    width: 100%;
  }

  .portal-filters__meta {
    margin-left: 0;
    width: 100%;
  }
}

/* App modal (Add guide visit, etc.) — keep height tight so no inner scroll */
.app-modal {
  border: none;
  border-radius: 10px;
  max-width: min(34rem, calc(100vw - 2rem));
  padding: 0;
  width: 100%;
}

.app-modal::backdrop {
  background: rgba(23, 37, 84, 0.45);
}

.app-modal__panel {
  background: var(--guide-surface);
  border: 1px solid var(--guide-border);
  border-radius: 10px;
  max-height: min(92vh, 36rem);
  overflow: auto;
}

.app-modal__header {
  align-items: center;
  border-bottom: 1px solid var(--guide-border);
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
}

.app-modal__title {
  font-size: 1.05rem;
  margin: 0;
}

.app-modal__close {
  font-size: 0.85rem;
  margin: 0;
  min-height: 2rem;
  padding: 0.25rem 0.6rem;
  width: auto;
}

.app-modal__body {
  padding: 0.65rem 0.85rem 0.75rem;
}

.membership-invite-modal__form {
  margin: 0;
}

.membership-invite-modal__body {
  display: grid;
  gap: 0.75rem;
}

.membership-invite-modal__body label,
.membership-invite-modal__body select,
.membership-invite-modal__body textarea,
.membership-invite-modal__body p {
  margin-bottom: 0;
}

/* Compact visit form inside modal */
.manual-entry-form--modal {
  gap: 0.55rem;
}

.manual-entry-form--modal .form-grid--manual-visit,
.form-grid--manual-visit {
  gap: 0.55rem 0.75rem;
}

.manual-entry-form--modal .form-grid--manual-visit label {
  display: grid;
  gap: 0.2rem;
  margin: 0;
}

.manual-entry-form--modal .form-grid--manual-visit label.span-full {
  grid-column: 1 / -1;
}

.manual-entry-form--modal .form-grid--manual-visit input,
.manual-entry-form--modal .form-grid--manual-visit select,
.manual-entry-form--modal .form-grid--manual-visit textarea {
  font-size: 0.92rem;
  margin: 0;
  min-height: 2.25rem;
  padding: 0.35rem 0.55rem;
}

.manual-entry-form--modal .form-grid--manual-visit textarea {
  line-height: 1.35;
  min-height: 3rem;
  resize: vertical;
}

.manual-entry-form--modal .form-actions--compact,
.form-actions--compact {
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.manual-entry-form--modal .form-actions--compact button,
.manual-entry-form--modal .form-actions--compact a,
.form-actions--compact button,
.form-actions--compact a {
  flex: 0 0 auto;
  font-size: 0.88rem;
  min-height: 2.35rem;
  min-width: 0;
  padding: 0.4rem 0.85rem;
  width: auto;
}

.form-section-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.form-section-heading h2 {
  margin: 0.15rem 0 0;
}

/* Place admin: consistent vertical rhythm across Details / Plan / Reps / Visits / Terms */
.shell--place-admin {
  gap: 0;
  padding-block: clamp(1rem, 2.5vw, 1.5rem);
}

.shell--place-admin > .place-admin-heading {
  margin-bottom: 0.85rem;
}

/* Tab bar (segmented / underline tabs, not pill buttons) */
.place-tabs {
  border-bottom: 1px solid var(--guide-border);
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  justify-content: flex-start;
  margin: 0 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.place-tabs__tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  color: var(--guide-muted);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  justify-content: center;
  line-height: 1.2;
  margin: 0 0 -1px;
  min-width: 0;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
  transition: color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
  width: auto;
}

button.place-tabs__tab {
  --pico-background-color: transparent;
  --pico-border-color: transparent;
  --pico-box-shadow: none;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--guide-muted);
  flex: 0 0 auto !important;
  padding: 0.55rem 0.85rem !important;
  width: auto !important;
}

.place-tabs__tab:hover,
.place-tabs__tab:focus-visible {
  color: var(--guide-ink);
  outline: none;
}

.place-tabs__tab.is-active,
.place-tabs__tab[aria-selected="true"] {
  border-bottom-color: var(--guide-accent) !important;
  color: var(--guide-accent);
}

.place-admin-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.place-admin-panel > .company-plan-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Legacy class kept if any stray markup remains */
.place-admin-nav {
  display: none;
}

.guide-scope-tabs {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  justify-content: flex-start;
  margin: -0.25rem 0 0.75rem;
  width: fit-content;
}

.guide-scope-tabs a {
  margin: 0;
}

.guide-detail-tabs {
  margin-top: -0.15rem;
}

.section-header--inline {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header--inline h2 {
  margin: 0;
}

.status-filter-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.status-filter-links a {
  color: var(--guide-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.status-filter-links a.is-active {
  color: var(--guide-ink);
  text-decoration-thickness: 0.14em;
}

.guide-place-status-list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.guide-place-status-list li,
.guide-place-status-list__card-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-line {
  margin-bottom: 1rem;
}

.filter-line__form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-line__form label {
  margin: 0;
  max-width: 18rem;
}

.filter-line__form select {
  margin: 0;
}

.terms-diff {
  background: var(--guide-soft);
  border: 1px solid var(--guide-border);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.85rem;
}

.terms-diff h3 {
  font-size: 1rem;
  margin: 0 0 0.55rem;
}

.terms-diff__list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.terms-diff__item {
  display: grid;
  gap: 0.15rem;
}

.terms-diff__item strong {
  color: var(--guide-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.terms-diff__item--added span {
  color: #166534;
}

.terms-diff__item--removed span {
  color: #b91c1c;
  text-decoration: line-through;
}

/* EasyMDE — align with GuideUs / Pico forms */
.EasyMDEContainer {
  margin-bottom: 0.25rem;
}

.EasyMDEContainer .CodeMirror {
  background: #fff !important;
  border: 1px solid #b8c0ad !important;
  border-radius: 0 0 0.55rem 0.55rem !important;
  color: var(--guide-ink) !important;
  font-size: 0.95rem;
  min-height: 100px;
}

.EasyMDEContainer .CodeMirror-focused {
  border-color: var(--guide-accent) !important;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16) !important;
}

.editor-toolbar {
  background: color-mix(in srgb, var(--guide-bg, #f6f7f1) 80%, #fff) !important;
  border: 1px solid #b8c0ad !important;
  border-bottom: none !important;
  border-radius: 0.55rem 0.55rem 0 0 !important;
  opacity: 1 !important;
}

.editor-toolbar button {
  color: var(--guide-ink) !important;
}

.editor-toolbar button:hover,
.editor-toolbar button.active {
  background: color-mix(in srgb, var(--guide-accent, #0f766e) 14%, #fff) !important;
  border-color: transparent !important;
}

.editor-preview,
.editor-preview-side {
  background: #fff !important;
  color: var(--guide-ink);
}

.md-field-wrap label,
label:has(.EasyMDEContainer) {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* QR check-in session (guide present screen) */
.check-in-session-present {
  text-align: center;
}

.check-in-session-present__qr {
  margin: 1rem auto;
}

.check-in-session-present__qr img {
  display: block;
  margin: 0 auto;
  max-width: min(280px, 100%);
  height: auto;
  border-radius: var(--radius-md, 0.5rem);
  background: #fff;
  padding: 0.5rem;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.check-in-session-present__url {
  word-break: break-all;
  font-size: 0.85rem;
  margin: 0.75rem 0 1rem;
}

.check-in-session-present__timer {
  margin-bottom: 0.5rem;
}

/* Rendered Markdown (read views) */
.md-content {
  color: var(--guide-ink);
  font-size: 0.95rem;
  line-height: 1.55;
}

.md-content--compact {
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.md-content p:first-child {
  margin-top: 0;
}

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

.md-content ul,
.md-content ol {
  margin: 0.35rem 0 0.35rem 1.2rem;
}

.md-content a {
  color: var(--guide-accent);
}

.info-card .md-content h1,
.info-card .md-content h2,
.info-card .md-content h3 {
  font-size: 1rem;
  margin: 0.5rem 0 0.25rem;
}
