/*
 * Bookings Analytics — WOW presentation layer (in-place refactor).
 *
 * Scope: every selector is rooted at .analytics-root (production) or
 * .analytics-review (static frame). Tokens and shell scroll-owner are preserved.
 * This file is sectioned by component; no append-only override pile.
 */

.analytics-review,
.analytics-root {
  --an-bg: #fdfcfa;
  --an-surface: #ffffff;
  --an-surface-soft: #fff8f7;
  --an-stone-950: #1c1917;
  --an-stone-900: #292524;
  --an-stone-800: #292524;
  --an-stone-700: #44403c;
  --an-stone-600: #57534e;
  --an-stone-500: #78716c;
  --an-stone-400: #a8a29e;
  --an-stone-300: #d6d3d1;
  --an-stone-200: #e7e5e4;
  --an-stone-100: #f5f5f4;
  --an-stone-50: #fafaf9;
  --an-rose-700: #be123c;
  --an-rose-600: #e11d48;
  --an-rose-500: #f43f5e;
  --an-rose-400: #fb7185;
  --an-rose-300: #fda4af;
  --an-rose-200: #fecdd3;
  --an-rose-100: #ffe4e6;
  --an-rose-50: #fff1f2;
  --an-teal-700: #0f766e;
  --an-teal-500: #14b8a6;
  --an-teal-100: #ccfbf1;
  --an-amber-700: #b45309;
  --an-amber-500: #f59e0b;
  --an-amber-100: #fef3c7;
  --an-plum-700: #6b21a8;
  --an-plum-500: #9333ea;
  --an-plum-100: #f3e8ff;
  --an-emerald-600: #059669;
  --an-emerald-100: #d1fae5;
  --an-font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --an-font-serif: "Playfair Display", ui-serif, Georgia, "Times New Roman", serif;
  --an-radius-sm: 10px;
  --an-radius-md: 16px;
  --an-radius-lg: 22px;
  --an-radius-xl: 28px;
  --an-shadow-sm: 0 1px 1px rgba(28, 25, 23, 0.03), 0 4px 16px -12px rgba(28, 25, 23, 0.12);
  --an-shadow-md: 0 1px 1px rgba(28, 25, 23, 0.04), 0 12px 32px -20px rgba(28, 25, 23, 0.16);
  --an-focus: 0 0 0 3px #ffffff, 0 0 0 6px rgba(225, 29, 72, 0.42);
  --an-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color: var(--an-stone-800);
  background: var(--an-bg);
  font-family: var(--an-font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.analytics-review *,
.analytics-review *::before,
.analytics-review *::after,
.analytics-root *,
.analytics-root *::before,
.analytics-root *::after {
  box-sizing: border-box;
}

.analytics-review { margin: 0; min-height: 100vh; overflow-x: clip; }
.analytics-review ::selection, .analytics-root ::selection { color: var(--an-stone-950); background: var(--an-rose-100); }
.analytics-review :focus-visible, .analytics-root :focus-visible { outline: none; box-shadow: var(--an-focus); }

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

/* --------------------------------------------------------------------------
   Uniform workspace — ONE constant header + tabs at SAME y for all 3 views
   Header stays visible in Analytics (no disappearing root nav jump). Tabs stay
   visible when public nav true; Back pill inside mast hides only when 3 tabs
   available. List filters hidden only when not List view. No global date coupling.
   -------------------------------------------------------------------------- */
.booking-main:has(#bookings-container[data-ba-view="analytics"]):not(:has(.booking-shell-view-switch [data-ba-analytics-nav])) .booking-shell-view-switch {
  display: none;
}
.booking-main:has(#bookings-container[data-ba-view="analytics"]) #booking-list-filters {
  display: none;
}
/* Keep legacy hook selectors present for contract guard (used via parent hide above) */
.booking-shell-header__title { /* operational title hook */ }
.booking-shell-header__actions { /* operational actions hook */ }

/* Back pill redundant when 3 tabs (public nav) — keep for private fallback */
.booking-main:has(.booking-shell-view-switch [data-ba-analytics-nav]) .analytics-mast__back {
  display: none;
}

/* --------------------------------------------------------------------------
   Uniform control family — scoped to actual existing fragments, no Slots deploy
   Targets: List #booking-list-filters, Tables #table-timeline, Analytics period
   Height 40–44px, 14px font, same border/radius/padding/labels. No global input.
   -------------------------------------------------------------------------- */
.booking-main #booking-list-filters input[type="date"],
.booking-main #booking-list-filters input[type="text"],
.booking-main #booking-list-filters select,
.booking-main #booking-list-filters button,
#table-timeline .controls input[type="date"],
#table-timeline .controls select,
#table-timeline .actions > button,
#table-timeline .actions > .button,
.analytics-period .analytics-pill,
.analytics-period .analytics-select,
.analytics-period .analytics-input,
.analytics-custom-dates summary,
#analytics-filters .analytics-select,
#analytics-filters .analytics-input {
  min-height: 42px;
  font-size: 14px;
}
.booking-main #booking-list-filters input[type="date"],
.booking-main #booking-list-filters input[type="text"],
#table-timeline .controls input[type="date"],
#table-timeline .controls select,
.analytics-period .analytics-input,
#analytics-filters .analytics-input {
  border: 1px solid #e7e5e4;
  border-radius: 9999px;
  padding: 0 12px;
  background: #fff;
}
.booking-main #booking-list-filters button,
#table-timeline .actions > button,
#table-timeline .actions > .button,
.analytics-period .analytics-pill,
.analytics-period .analytics-button {
  border-radius: 9999px;
  padding: 0 14px;
}

/* --------------------------------------------------------------------------
   Masthead — welcoming, one header
   -------------------------------------------------------------------------- */
.analytics-mast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 0 14px;
}
.analytics-mast__context {
  margin: 0 0 7px;
  color: #9f1239;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.analytics-mast__title {
  margin: 0;
  font-family: var(--an-font-serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 2vw, 1.6rem);
  letter-spacing: -0.5px;
  line-height: 1.2;
  color: var(--an-stone-950);
}
.analytics-mast__title em {
  font-weight: 400;
  font-style: italic;
  color: var(--an-rose-700);
  background: linear-gradient(transparent 83%, #fcd34d 83%, #fcd34d 92%, transparent 92%);
}
.analytics-mast__range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 10px 0 0;
  color: var(--an-stone-500);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.analytics-mast__range-strong { color: var(--an-stone-800); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.analytics-mast__range-strong::before {
  content: "";
  width: 13px; height: 13px; border-radius: 4px;
  border: 1px solid var(--an-rose-200);
  background:
    linear-gradient(var(--an-rose-300), var(--an-rose-300)) 2px 3px / 8px 1px no-repeat,
    linear-gradient(var(--an-rose-300), var(--an-rose-300)) 2px 5.5px / 8px 1px no-repeat,
    linear-gradient(var(--an-rose-300), var(--an-rose-300)) 2px 8px / 8px 1px no-repeat,
    var(--an-rose-50);
}
.analytics-mast__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--an-stone-300); display: inline-block; }
.analytics-mast__back {
  background-color: white;
  color: #57534e;
  font-weight: 500;
  font-size: 16px;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e7e5e4;
  transition: all 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
}
.analytics-mast__back:hover {
  background-color: #fafaf9;
  color: #292524;
  border-color: #d6d3d1;
}
.analytics-mast__back:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--an-rose-600);
}
.analytics-mast__meta {
  margin: 8px 0 0;
  color: var(--an-stone-600);
  font-size: 12px;
  line-height: 1.5;
}
.analytics-preview-notice {
  margin: 8px 0 0;
  max-width: 66ch;
  width: 100%;
  color: var(--an-stone-700);
  background: var(--an-rose-50);
  border: 1px solid var(--an-rose-100);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  box-sizing: border-box;
}
.analytics-preview-notice__text { flex: 1 1 auto; min-width: 0; }
.analytics-preview-notice strong { font-weight: 600; color: var(--an-stone-900); }
.analytics-preview-notice__link {
  color: var(--an-rose-700);
  font-weight: 600;
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-color: var(--an-rose-200);
}
.analytics-preview-notice__link:hover {
  text-decoration-color: var(--an-rose-600);
}

/* --------------------------------------------------------------------------
   Period strip — nonsticky, nearby native tray
   -------------------------------------------------------------------------- */
.analytics-period {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0 12px;
  border-bottom: 1px solid #e7e0d9;
  margin-bottom: 14px;
}
.analytics-period-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.analytics-pill {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--an-stone-200);
  background: var(--an-surface);
  color: var(--an-stone-700);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.analytics-pill:hover { border-color: var(--an-stone-300); background: var(--an-stone-50); color: var(--an-stone-700); }
.analytics-pill--active {
  background: var(--an-rose-700);
  border-color: var(--an-rose-700);
  color: #fff;
}
.analytics-pill.analytics-pill--active:hover,
.analytics-pill.analytics-pill--active:focus-visible {
  background: var(--an-rose-700);
  border-color: var(--an-rose-700);
  color: #fff;
}
.analytics-control-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--an-stone-600);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 2px;
}
.analytics-custom-dates { position: relative; }
.analytics-custom-dates summary {
  cursor: pointer;
  border: 1px solid var(--an-stone-200);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  list-style: none;
  background: var(--an-surface);
}
.analytics-custom-dates[open] { width: 100%; }
.analytics-custom-dates[open] summary { width: max-content; margin-bottom: 10px; }
.analytics-date-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  min-width: 0;
  max-width: 100%;
}
.analytics-date-form .analytics-input { width: min(148px, 100%); min-width: 0; max-width: 148px; flex: 1 1 120px; }
.analytics-custom-dates:not([open]) .analytics-date-form { display: none; }
.analytics-period__compare { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: var(--an-stone-500); }
.analytics-period__label { font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 11px; }
.analytics-period__value { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Canvas — hero
   -------------------------------------------------------------------------- */
.analytics-canvas {
  margin-top: 18px;
  background: linear-gradient(155deg, #fff6f6, white 65%);
  border: 1px solid #eed8dd;
  border-radius: 24px;
  /* Tooltip is a chart child and must escape the rounded card; card radius is
     preserved by the card's own background/border, not by clipping the plot. */
  overflow: visible;
  box-shadow: 0 6px 22px rgba(89,66,43,0.04);
}
.analytics-canvas__top {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 26px;
  padding: 20px 24px 14px;
  align-items: center;
}
.analytics-hero-figure {
  position: relative;
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
}
.analytics-hero-figure--rose {
  background: #ffe8ed;
  border-radius: 20px 20px 28px 8px;
  padding: 16px 20px;
  color: #9f1239;
  overflow: hidden;
}
.analytics-hero-figure__label { font-size: 14px; margin: 0; color: inherit; }
.analytics-hero-figure--rose .analytics-hero-figure__label { color: #9f1239; }
.analytics-hero-figure__number {
  margin: 2px 0 0;
  font-size: 76px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -4px;
  font-variant-numeric: tabular-nums;
  color: inherit;
}
.analytics-hero-figure--rose .analytics-hero-figure__number { color: #be123c; }
.analytics-hero-figure__qualifier { font-size: 12px; color: var(--an-stone-500); margin: 6px 0 0; max-width: 190px; }
.analytics-hero-figure--rose .analytics-hero-figure__qualifier { color: #77444f; }
.analytics-hero-figure__delta { display: block; margin: 6px 0 0; font-size: 12px; color: #635c56; }
.analytics-hero-figure--rose .analytics-hero-figure__delta { color: #77444f; }
.analytics-hero-figure__view { display: block; margin-top: 10px; font-size: 13px; color: var(--an-rose-700); font-weight: 600; }
.analytics-hero-ticket {
  position: absolute; right: 14px; top: 12px;
  width: 59px; height: 59px; transform: rotate(9deg); opacity: 0.95;
}
.analytics-canvas__observation {
  align-self: center;
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  color: #633a44;
  border-left: 0;
  padding-left: 12px;
}
.analytics-canvas__observation small {
  display: block;
  margin-top: 9px;
  font-size: 12px;
  color: var(--an-stone-500);
  line-height: 1.5;
}
.analytics-canvas__chart { padding: 12px 28px 14px; }
.analytics-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.analytics-canvas__chart .analytics-panel__title { font-size: 16px; }
.analytics-canvas__chart .analytics-panel__subtitle { font-size: 12px; }

/* Metric strip — compact ledger */
.analytics-metric-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #fff5f2;
  border-top: 1px solid #e7e0d9;
}
.analytics-metric-strip__item {
  display: block;
  padding: 16px 25px;
  color: var(--an-stone-800);
  text-decoration: none;
  border-right: 1px solid #e7e0d9;
}
.analytics-metric-strip__item:last-child { border-right: 0; }
.analytics-metric-strip__item b { font-size: 22px; font-weight: 500; margin-right: 8px; font-variant-numeric: tabular-nums; }
.analytics-metric-strip__item span { font-size: 13px; }
.analytics-metric-strip__item small { display: block; color: var(--an-stone-500); font-size: 12px; margin-top: 3px; line-height: 1.4; }
.analytics-metric-strip__arrow { color: var(--an-rose-700); float: right; font-size: 17px; }

/* --------------------------------------------------------------------------
   Buttons / selects / inputs / segmented (kept in-place, not duplicated)
   -------------------------------------------------------------------------- */
.analytics-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 39px; padding: 8px 15px;
  border: 1px solid var(--an-stone-200); border-radius: 999px;
  color: var(--an-stone-700); background: var(--an-surface);
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1.2;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 160ms var(--an-ease), border-color 160ms var(--an-ease), color 160ms var(--an-ease), transform 160ms var(--an-ease);
}
.analytics-button:hover { color: var(--an-stone-950); background: var(--an-stone-50); border-color: var(--an-stone-300); }
.analytics-button:active { transform: translateY(1px); }
.analytics-button--primary { color: #fff; background: var(--an-rose-600); border-color: var(--an-rose-600); box-shadow: 0 8px 18px -12px rgba(225,29,72,0.8); }
.analytics-button--primary:hover { color: #fff; background: var(--an-rose-700); border-color: var(--an-rose-700); }
.analytics-button--quiet { border-color: transparent; background: transparent; }
.analytics-button--quiet:hover { background: var(--an-stone-100); border-color: transparent; }
.analytics-button--sm { min-height: 32px; padding: 6px 11px; font-size: 12px; }
.analytics-button__count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; color: #fff; background: var(--an-rose-600);
  font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.analytics-select {
  min-height: 42px; max-width: 100%; padding: 9px 36px 9px 14px;
  color: var(--an-stone-800); background-color: var(--an-surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--an-stone-500) 50%), linear-gradient(135deg, var(--an-stone-500) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-repeat: no-repeat; background-size: 5px 5px, 5px 5px;
  border: 1px solid var(--an-stone-200); border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1.2; cursor: pointer; appearance: none;
  transition: border-color 160ms var(--an-ease), background-color 160ms var(--an-ease);
}
.analytics-select:hover { border-color: var(--an-stone-300); }
.analytics-input {
  width: 100%; min-height: 36px; padding: 7px 11px;
  border: 1px solid var(--an-stone-200); border-radius: 9px;
  color: var(--an-stone-800); background: var(--an-surface);
  font: inherit; font-size: 13px;
}
.analytics-field__label { display: block; margin-bottom: 5px; color: var(--an-stone-500); font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.analytics-segmented {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--an-stone-100); border-radius: 999px; background: var(--an-stone-50);
}
.analytics-segmented__option {
  min-height: 28px; padding: 5px 11px; border: 0; border-radius: 999px;
  color: var(--an-stone-500); background: transparent;
  font: inherit; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background-color 150ms var(--an-ease), color 150ms var(--an-ease), box-shadow 150ms var(--an-ease);
}
.analytics-segmented__option:hover { color: var(--an-stone-800); }
.analytics-segmented__option[aria-pressed="true"] { color: var(--an-stone-950); background: var(--an-surface); box-shadow: 0 1px 2px rgba(28,25,23,0.08); }

.analytics-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px;
  color: var(--an-stone-600); background: var(--an-stone-100);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.2; white-space: nowrap;
}
.analytics-badge--rose { color: var(--an-rose-700); background: var(--an-rose-50); }
.analytics-badge--amber { color: var(--an-amber-700); background: var(--an-amber-100); }
.analytics-badge--teal { color: var(--an-teal-700); background: var(--an-teal-100); }
.analytics-badge--plum { color: var(--an-plum-700); background: var(--an-plum-100); }
.analytics-link { color: var(--an-rose-700); font-size: 13px; font-weight: 600; text-decoration: none; text-underline-offset: 3px; }
.analytics-link:hover { text-decoration: underline; }
.analytics-link--muted { color: var(--an-stone-600); }

/* --------------------------------------------------------------------------
   Panel shell
   -------------------------------------------------------------------------- */
.analytics-panel {
  display: flex; flex-direction: column; min-width: 0;
  padding: clamp(18px, 1.8vw, 24px);
  background: var(--an-surface);
  border: 1px solid #f5f3f1;
  border-radius: var(--an-radius-lg);
  box-shadow: 0 1px 1px rgba(28,25,23,0.03), 0 6px 20px -14px rgba(28,25,23,0.10);
}
.analytics-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; min-width: 0; margin-bottom: 18px; }
.analytics-panel__heading { min-width: 0; }
.analytics-panel__eyebrow { display: none !important; }
.analytics-panel__title {
  margin: 0; font-family: var(--an-font-serif);
  font-size: clamp(1.32rem, 1.55vw, 1.55rem); font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.15; color: var(--an-stone-900);
}
.analytics-panel__subtitle { max-width: 640px; margin: 6px 0 0; color: var(--an-stone-500); font-size: 13px; line-height: 1.55; }
.analytics-panel__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.analytics-panel__footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; margin-top: 16px; padding-top: 13px; border-top: 1px solid #f5f5f4; }
.analytics-observation {
  display: flex; align-items: flex-start; gap: 8px; min-width: 0; margin: 0;
  color: var(--an-stone-600); font-size: 12px; line-height: 1.5;
}
.analytics-observation::before { content: ""; flex: 0 0 auto; width: 4px; height: 4px; margin-top: 7px; border-radius: 50%; background: var(--an-rose-300); }
.analytics-meta { color: var(--an-stone-600); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.analytics-panel-note { margin: 8px 0 0; color: var(--an-stone-500); font-size: 12px; line-height: 1.5; }

/* --------------------------------------------------------------------------
   Trend chart — bars
   -------------------------------------------------------------------------- */
.analytics-chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.analytics-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 15px; margin: 0; padding: 0; list-style: none; color: var(--an-stone-500); font-size: 11px; font-weight: 500; }
.analytics-legend__item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.analytics-legend__swatch { width: 15px; height: 8px; border-radius: 3px; background: var(--an-rose-600); display: inline-block; }
.analytics-legend__swatch--compare { height: 0; border-top: 2px dashed var(--an-stone-500); background: transparent; border-radius: 0; width: 17px; }
.analytics-chart-wrap { position: relative; min-width: 0; overflow: visible; }
.analytics-chart-stage { position: relative; height: 280px; min-height: 220px; }
.analytics-chart-stage .analytics-chart { height: 100%; min-height: 0; }
.analytics-chart { display: block; width: 100%; height: auto; min-height: 220px; overflow: visible; }
.analytics-chart text { fill: var(--an-stone-400); font-family: var(--an-font-sans); font-size: 11px; font-variant-numeric: tabular-nums; }
.analytics-chart__grid-line { stroke: var(--an-stone-100); stroke-width: 1; shape-rendering: crispEdges; }
.analytics-chart__baseline { stroke: var(--an-stone-200); stroke-width: 1; shape-rendering: crispEdges; }
.analytics-chart__line--compare { stroke: #635c56; stroke-width: 1.8; stroke-dasharray: 5 5; fill: none; }
.analytics-chart__bar { fill: var(--an-rose-600); transition: fill 150ms var(--an-ease); }
.analytics-chart__bar--peak { fill: var(--an-rose-600); stroke: #fcd34d; stroke-width: 2.2; }
.analytics-chart__hit { cursor: pointer; outline: none; }
.analytics-chart__hitbox { fill: transparent; }
.analytics-chart__focus-rect { fill: transparent; stroke: transparent; stroke-width: 2; rx: 8; }
.analytics-chart__hit:focus-visible .analytics-chart__focus-rect { stroke: #292524; }
.analytics-chart__hit:hover .analytics-chart__bar { fill: #9f1239; }
.analytics-chart-tooltip {
  position: absolute; z-index: 6; top: 6%; left: 61%; width: 176px;
  padding: 11px 13px; border: 1px solid var(--an-stone-100); border-radius: 13px;
  background: rgba(255,255,255,0.96); box-shadow: 0 12px 38px -20px rgba(28,25,23,0.38);
  backdrop-filter: blur(8px); pointer-events: none; max-width: calc(100vw - 32px);
}
.analytics-chart-tooltip__date { margin: 0 0 7px; color: var(--an-stone-950); font-size: 11px; font-weight: 600; }
.analytics-chart-tooltip__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--an-stone-500); font-size: 11px; line-height: 1.7; }
.analytics-chart-tooltip__row strong { color: var(--an-stone-800); font-weight: 600; font-variant-numeric: tabular-nums; }
.analytics-chart-tooltip__row--compare strong { color: var(--an-rose-400); font-weight: 500; }
.analytics-chart-tooltip__delta { margin: 7px 0 0; padding-top: 7px; border-top: 1px solid var(--an-stone-100); color: var(--an-stone-500); font-size: 11px; }
.analytics-chart-tooltip__delta strong { color: var(--an-rose-700); font-weight: 600; }
.analytics-chart-meta { margin: 0 0 8px; }
.analytics-chart-meta__grain { margin: 0; color: var(--an-stone-900); font-size: 14px; font-weight: 600; }
.analytics-chart-meta__explain { margin: 4px 0 0; color: var(--an-stone-600); font-size: 12px; line-height: 1.5; }
.analytics-chart-html-axis { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; min-width: 0; }
.analytics-html-axis__label { color: var(--an-stone-600); font-size: 12px; font-variant-numeric: tabular-nums; white-space: normal; word-break: break-word; line-height: 1.25; text-align: center; }
.analytics-y-label { color: var(--an-stone-600); font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1; }
.analytics-bar-value { fill: var(--an-stone-700); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.analytics-bar-value-html { color: var(--an-stone-700); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; background: rgba(255,255,255,0.92); padding: 1px 4px; border-radius: 4px; line-height: 1; }
.analytics-chart-compare-note { margin: 8px 0 0; color: var(--an-stone-600); font-size: 12px; line-height: 1.5; }

/* --------------------------------------------------------------------------
   Preview grid — weekday + party
   -------------------------------------------------------------------------- */
.analytics-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 18px; }
.analytics-preview {
  padding: 24px; border-radius: 22px; min-width: 0;
  border: 1px solid #eddfe1; background: #fff;
}
.analytics-preview--weekday { background: #ffeef0; border-color: #f3dce0; border-radius: 22px 22px 8px 22px; }
.analytics-preview__kicker { font-size: 11px; color: #9f1239; letter-spacing: 0.08em; font-weight: 600; text-transform: uppercase; margin: 0; }
.analytics-preview__title { font: 500 22px/1.25 var(--an-font-serif); letter-spacing: -0.4px; margin: 8px 0; color: var(--an-stone-900); }
.analytics-preview__subtitle { font-size: 13px; color: #65505a; margin: 6px 0 0; line-height: 1.5; }
.analytics-weekday-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 22px; }
.analytics-weekday-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: #77444f; min-width: 0; }
.analytics-weekday-cell__label { font-size: 11px; font-weight: 600; }
.analytics-weekday-cell__track {
  height: 112px; width: 24px; display: flex; align-items: flex-end;
  border-radius: 12px; background: #f9dbe1; overflow: hidden;
}
.analytics-weekday-cell__fill { display: block; width: 100%; background: #e11d48; border-radius: 12px; min-height: 2px; }
.analytics-weekday-cell__empty { display: grid; place-items: center; width: 100%; height: 100%; color: var(--an-stone-400); font-size: 11px; }
.analytics-weekday-cell__value { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--an-stone-800); }
.analytics-weekday-cell__occurrences { font-size: 11px; color: var(--an-stone-400); }

.analytics-party-summary {
  display: flex; align-items: center; gap: 18px; margin: 16px 0 14px;
}
.analytics-party-summary strong { font: 500 30px/1 var(--an-font-sans); letter-spacing: -1px; color: #9f1239; }
.analytics-party-summary strong small { display: block; font-size: 11px; font-weight: 400; letter-spacing: 0; color: #65505a; margin-top: 6px; }
.analytics-party-summary span { font-size: 13px; color: #65505a; }
.analytics-seats-motif { width: 68px; height: 60px; margin-left: auto; flex: none; }

/* --------------------------------------------------------------------------
   Outcomes — labelled, emerald/correct palette, 3-column rates
   -------------------------------------------------------------------------- */
.analytics-outcome-bar { display: flex; width: 100%; height: 19px; margin: 8px 0 16px; overflow: hidden; border-radius: 7px; background: var(--an-stone-100); }
.analytics-outcome-bar__segment { display: block; height: 100%; min-width: 2px; }
.analytics-outcome-bar__segment--arrived { background: var(--an-emerald-600); }
.analytics-outcome-bar__segment--cancelled { background: var(--an-amber-500); }
.analytics-outcome-bar__segment--noshow { background: #7c3c78; }
.analytics-outcome-bar__segment--unresolved { background-color: var(--an-stone-200); background-image: repeating-linear-gradient(135deg, transparent 0 4px, var(--an-stone-300) 4px 5px); }
.analytics-outcome-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.analytics-outcome-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 37px; padding: 7px 0; border-bottom: 1px solid var(--an-stone-100); }
.analytics-outcome-row:last-child { border-bottom: 0; }
.analytics-outcome-row__label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--an-stone-700); font-size: 13px; }
.analytics-outcome-row__dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--an-emerald-600); }
.analytics-outcome-row__dot--arrived { background: var(--an-emerald-600); }
.analytics-outcome-row__dot--cancelled { background: var(--an-amber-500); }
.analytics-outcome-row__dot--noshow { background: #7c3c78; }
.analytics-outcome-row__dot--unresolved { border-radius: 2px; background-color: var(--an-stone-200); background-image: repeating-linear-gradient(135deg, transparent 0 2px, var(--an-stone-400) 2px 3px); }
.analytics-outcome-row__value { display: inline-flex; align-items: baseline; gap: 7px; color: var(--an-stone-950); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.analytics-outcome-row__rate { color: var(--an-stone-600); font-size: 12px; font-weight: 500; }
.analytics-rate-callout { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.analytics-rate { padding: 12px; border-radius: 12px; background: var(--an-stone-50); }
.analytics-rate__value { margin: 0; color: var(--an-stone-950); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; line-height: 1; }
.analytics-rate__label { display: block; margin-top: 3px; color: var(--an-stone-600); font-size: 11px; line-height: 1.3; }

/* --------------------------------------------------------------------------
   Heatmap
   -------------------------------------------------------------------------- */
.analytics-heatmap__hint { margin: 10px 0 6px; color: var(--an-stone-500); font-size: 12px; }
.analytics-heatmap-region {
  width: 100%; min-width: 0;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--an-stone-300) transparent;
  border-radius: 12px; outline-offset: 2px;
}
.analytics-heatmap-scroll { min-width: 0; max-width: 100%; width: 100%; overflow-x: auto; padding-bottom: 4px; }
.analytics-heatmap { min-width: 760px; padding-top: 3px; }
.analytics-heatmap__hours, .analytics-heatmap__row { display: grid; gap: 3px; align-items: center; }
.analytics-heatmap__hours { margin-bottom: 4px; }
.analytics-heatmap__hour { grid-column: span 2; color: var(--an-stone-400); font-size: 10px; font-variant-numeric: tabular-nums; text-align: left; }
.analytics-heatmap__rows { display: grid; gap: 3px; }
.analytics-heatmap__day {
  padding-right: 8px; color: var(--an-stone-500); font-size: 11px; font-weight: 500;
  position: sticky; left: 0; background: var(--an-surface); z-index: 1;
}
.analytics-heat-cell {
  display: block; width: 100%; height: 24px; min-width: 0; padding: 0; border: 0; border-radius: 4px;
  background: var(--an-stone-100); cursor: pointer; transition: transform 130ms var(--an-ease), box-shadow 130ms var(--an-ease);
}
.analytics-heat-cell:hover { position: relative; z-index: 2; transform: scale(1.06); box-shadow: 0 0 0 1px var(--an-stone-400); }
.analytics-heat-cell[data-level="0"] { background: var(--an-stone-100); }
.analytics-heat-cell[data-level="1"] { background: #fbe9ed; }
.analytics-heat-cell[data-level="2"] { background: #f7cdd7; }
.analytics-heat-cell[data-level="3"] { background: #f2a3b5; }
.analytics-heat-cell[data-level="4"] { background: #e7688a; }
.analytics-heat-cell[data-level="5"] { background: #c81e4b; }
.analytics-heat-cell--unrecorded { background: var(--an-stone-50); box-shadow: inset 0 0 0 1px var(--an-stone-200); }
.analytics-heatmap__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; margin-top: 15px; color: var(--an-stone-400); font-size: 11px; }
.analytics-heatmap__legend-scale { display: inline-flex; align-items: center; gap: 3px; }
.analytics-heatmap__legend-swatch { width: 12px; height: 10px; border-radius: 2px; background: var(--an-stone-100); }
.analytics-heatmap__legend-swatch[data-level="1"] { background: #fbe9ed; }
.analytics-heatmap__legend-swatch[data-level="2"] { background: #f7cdd7; }
.analytics-heatmap__legend-swatch[data-level="3"] { background: #f2a3b5; }
.analytics-heatmap__legend-swatch[data-level="4"] { background: #e7688a; }
.analytics-heatmap__legend-swatch[data-level="5"] { background: #c81e4b; }
.analytics-heatmap__legend-item { display: inline-flex; align-items: center; gap: 5px; }
.analytics-heatmap__legend-pattern { width: 12px; height: 10px; border-radius: 2px; background-color: var(--an-stone-50); background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--an-stone-200) 3px 4px); }

/* --------------------------------------------------------------------------
   Party-size bars
   -------------------------------------------------------------------------- */
.analytics-mini-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px;
  margin-bottom: 18px; padding: 11px 12px; border-radius: var(--an-radius-md); background: var(--an-stone-50);
}
.analytics-mini-stat { min-width: 0; }
.analytics-mini-stat + .analytics-mini-stat { padding-left: 11px; border-left: 1px solid var(--an-stone-200); }
.analytics-mini-stat__value { margin: 0; color: var(--an-stone-950); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; line-height: 1.1; }
.analytics-mini-stat__label { display: block; margin-top: 2px; color: var(--an-stone-400); font-size: 10px; font-weight: 500; letter-spacing: 0.05em; line-height: 1.2; text-transform: uppercase; }
.analytics-party-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.analytics-party-row { display: grid; grid-template-columns: 32px minmax(0,1fr) 40px 54px; align-items: center; gap: 9px; min-width: 0; }
.analytics-party-row__label { color: var(--an-stone-800); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.analytics-party-row__track { position: relative; min-width: 0; height: 14px; border-radius: 999px; background: var(--an-stone-100); }
.analytics-party-row__fill { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--an-rose-600); transition: width 400ms var(--an-ease); }
.analytics-party-row__compare { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 1.5px dashed var(--an-stone-500); }
.analytics-party-row__count { color: var(--an-stone-600); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.analytics-party-row__share { color: var(--an-stone-500); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.analytics-party-row--peak .analytics-party-row__label { color: var(--an-rose-700); }
.analytics-party-scale { display: flex; justify-content: space-between; margin: 10px 0 0 41px; padding-right: 94px; color: var(--an-stone-300); font-size: 10px; font-variant-numeric: tabular-nums; }
.analytics-party-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; color: var(--an-stone-500); font-size: 11px; }
.analytics-party-legend__item { display: inline-flex; align-items: center; gap: 5px; }
.analytics-party-legend__bar { width: 14px; height: 6px; border-radius: 999px; background: var(--an-rose-500); }
.analytics-party-legend__marker { width: 0; height: 10px; border-left: 1.5px dashed var(--an-stone-500); }

/* Party motif handled in .analytics-party-summary */
#analytics-party-title { display: inline-flex; align-items: center; gap: 7px; }

/* --------------------------------------------------------------------------
   Table use / coverage / metrics
   -------------------------------------------------------------------------- */
.analytics-metric-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px;
  overflow: hidden; border: 1px solid var(--an-stone-100); border-radius: var(--an-radius-md); background: var(--an-stone-100);
}
.analytics-metric { min-width: 0; padding: 15px 16px; background: var(--an-surface); }
.analytics-metric__label { margin: 0; color: var(--an-stone-500); font-size: 10px; font-weight: 600; letter-spacing: 0.07em; line-height: 1.3; text-transform: uppercase; }
.analytics-metric__value { margin: 7px 0 0; color: var(--an-stone-950); font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.05em; line-height: 1; }
.analytics-metric__note { display: block; margin-top: 4px; color: var(--an-stone-500); font-size: 11px; line-height: 1.35; }
.analytics-coverage {
  margin-top: 14px; padding: 13px 14px; border: 1px solid var(--an-stone-100); border-radius: var(--an-radius-md); background: var(--an-stone-50);
}
.analytics-coverage__note {
  margin: 8px 0 0; color: var(--an-stone-600); font-size: 12px; line-height: 1.5;
}
.analytics-tableuse { margin-top: 18px; }
.analytics-tableuse--empty {
  /* compact full-width context row, not forced-height twin */
  width: 100%;
  align-self: stretch;
}
.analytics-tableuse__message {
  margin: 12px 0; max-width: 62ch;
  color: var(--an-stone-600); font-size: 14px; line-height: 1.6;
}
.analytics-tableuse .analytics-coverage__note { font-size: 12px; }
.analytics-area-list { display: grid; gap: 12px; margin-top: 14px; }
.analytics-area-row { display: grid; grid-template-columns: minmax(0,1fr) 74px; align-items: center; gap: 12px; }
.analytics-area-row__name { margin: 0 0 5px; color: var(--an-stone-700); font-size: 12px; font-weight: 500; }
.analytics-area-row__track { height: 4px; overflow: hidden; border-radius: 999px; background: var(--an-stone-100); }
.analytics-area-row__fill { display: block; height: 100%; border-radius: inherit; background: var(--an-rose-400); }
.analytics-area-row__value { color: var(--an-stone-600); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.analytics-outcomes-section { margin-top: 18px; }
/* Restore the standard panel rhythm between Outcomes and the Heatmap panel. */
.analytics-outcomes-section + .analytics-panel { margin-top: 18px; }
.analytics-table-section { margin-top: 18px; }

/* --------------------------------------------------------------------------
   Filter panel + definitions (moved top, not footer jump)
   -------------------------------------------------------------------------- */
.analytics-filter-panel { min-width: 0; padding: 18px; background: var(--an-surface); border: 1px solid #f5f3f1; border-radius: var(--an-radius-lg); box-shadow: 0 1px 1px rgba(28,25,23,0.03), 0 6px 20px -14px rgba(28,25,23,0.10); }
#analytics-filters:not([open]) {
  padding: 0 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  box-shadow: none;
  border-radius: 999px;
  background: var(--an-surface);
}
#analytics-filters:not([open]) > summary.analytics-filter-panel__head {
  list-style: revert;
  display: flex;
  width: 100%;
}
#analytics-filters:not([open]) > summary::-webkit-details-marker { display: inline-block; }
#analytics-filters:not([open]) > summary.analytics-filter-panel__head::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--an-stone-500);
  transform: translateY(-50%);
  pointer-events: none;
}
.analytics-filter-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 0; list-style: none; cursor: pointer; }
#analytics-filters:not([open]) .analytics-filter-panel__head { list-style: revert; }
.analytics-filter-panel__title { margin: 0; font-family: var(--an-font-sans); font-size: 14px; font-weight: 600; color: var(--an-stone-800); }
.analytics-filter-panel__subtitle { margin: 2px 0 0; color: var(--an-stone-500); font-size: 12px; }
.analytics-filter-details > summary.analytics-filter-panel__head { position: relative; padding-right: 76px; }
.analytics-filter-details > summary.analytics-filter-panel__head > span:first-child { display: inline-flex; align-items: baseline; gap: 8px; }
.analytics-filter-details > summary.analytics-filter-panel__head > span:first-child .analytics-filter-panel__subtitle::before {
  content: "·";
  margin-right: 8px;
  color: var(--an-stone-400);
}
.analytics-filter-details[open] .analytics-filter-panel__head { margin-bottom: 16px; }
.analytics-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; min-width: 0; max-width: 100%; }
.analytics-filter-details:not([open]) .analytics-filter-grid { display: none; }
.analytics-field { min-width: 0; }
.analytics-field--wide { grid-column: 1 / -1; }
.analytics-filter-panel__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--an-stone-100); }
.analytics-filter-panel__actions { display: flex; gap: 7px; }

.analytics-definitions {
  margin-top: 18px; padding: 16px 20px;
  border: 1px solid var(--an-stone-200); border-radius: 16px; background: var(--an-surface);
}
.analytics-definitions summary { cursor: pointer; color: var(--an-stone-800); font-size: 14px; font-weight: 600; }
.analytics-definitions__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin: 14px 0 0; }
.analytics-definitions dt { font-weight: 600; font-size: 13px; color: var(--an-stone-800); }
.analytics-definitions dd { margin: 4px 0 0; color: var(--an-stone-600); font-size: 13px; line-height: 1.5; }

/* --------------------------------------------------------------------------
   Footer / misc
   -------------------------------------------------------------------------- */
.analytics-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--an-stone-200);
}
.analytics-footer__note { margin: 0; color: var(--an-stone-500); font-size: 12px; }
.analytics-state-stack { display: grid; gap: 16px; min-width: 0; }
.analytics-empty { display: flex; flex-direction: column; align-items: flex-start; min-height: 120px; padding: 18px; border: 1px dashed var(--an-stone-300); border-radius: var(--an-radius-md); background: var(--an-stone-50); }
.analytics-empty__title { margin: 0; font-family: var(--an-font-serif); font-size: 16px; font-weight: 600; color: var(--an-stone-800); }
.analytics-empty__text { margin: 4px 0 12px; color: var(--an-stone-600); font-size: 12px; line-height: 1.5; }

/* Drawer / dialog */
.analytics-drawer { position: relative; overflow: hidden; padding: 22px; background: var(--an-surface); border: 1px solid #f5f3f1; border-radius: var(--an-radius-lg); }
.analytics-drawer::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--an-rose-400); }
.analytics-detail-dialog { border: 0; padding: 22px; color: var(--an-stone-800); background: var(--an-surface); box-shadow: 0 30px 90px -30px rgba(28,25,23,0.45); }
.analytics-detail-dialog::backdrop { background: rgba(28,25,23,0.5); }
.analytics-texttable { width: 100%; border-collapse: collapse; color: var(--an-stone-700); font-size: 12px; font-variant-numeric: tabular-nums; }
.analytics-texttable caption { margin-bottom: 8px; color: var(--an-stone-600); font-size: 12px; text-align: left; }
.analytics-texttable th, .analytics-texttable td { padding: 8px 10px; border-bottom: 1px solid var(--an-stone-100); text-align: left; vertical-align: top; }
.analytics-texttable thead th { color: var(--an-stone-500); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

/* --------------------------------------------------------------------------
   Responsive — 1024 floor preserved; stack gracefully below
   -------------------------------------------------------------------------- */
@media (max-width: 1150px) {
  .analytics-mast__title { font-size: 32px; }
  .analytics-canvas__top { grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px; }
  .analytics-canvas__observation { grid-column: 1 / -1; }
  .analytics-hero-figure__number { font-size: 64px; }
  .analytics-preview-grid { gap: 16px; }
  .analytics-preview { padding: 18px; }
  .analytics-preview__title { font-size: 20px; }
  .analytics-weekday-grid { gap: 5px; }
  .analytics-weekday-cell__track { width: 20px; height: 100px; }
  .analytics-rate-callout { gap: 8px; }
  .analytics-heatmap__hint { font-size: 11px; }
}
@media (max-width: 1023px) {
  .analytics-preview-grid { grid-template-columns: 1fr; }
  .analytics-canvas__top { grid-template-columns: 1fr; }
  .analytics-metric-strip { grid-template-columns: 1fr; }
  .analytics-metric-strip__item { border-right: 0; border-bottom: 1px solid #e7e0d9; }
  .analytics-metric-strip__item:last-child { border-bottom: 0; }
  .analytics-definitions__grid { grid-template-columns: 1fr; }
  .analytics-chart-tooltip { display: none; }
}
@media (max-width: 680px) {
  .analytics-mast { flex-direction: column; align-items: flex-start; }
  .analytics-period { flex-direction: column; align-items: flex-start; }
  .analytics-filter-grid { grid-template-columns: 1fr; }
  .analytics-rate-callout { grid-template-columns: 1fr; }
  .analytics-party-row { grid-template-columns: 32px minmax(0,1fr) 38px; }
  .analytics-party-row__share { display: none; }
  .analytics-party-scale { padding-right: 0; }
}

/* --------------------------------------------------------------------------
   Shell scroll owner (do not remove)
   -------------------------------------------------------------------------- */
.booking-main { min-height: 0; overscroll-behavior: contain; }
.flex.h-screen:has(.booking-main) { overflow: hidden; }

/* --------------------------------------------------------------------------
   Accessibility — reduced motion / forced colors / focus
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .analytics-review *, .analytics-root * { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .analytics-heat-cell:hover, .analytics-button:active { transform: none; }
}
/* --------------------------------------------------------------------------
   Restored critical selectors — drawer / states / coverage / table grid
   (baseline blocks preserved for SSR states + analytics-css-contract guard;
   tokens mapped to current palette; no old pile duplication)
   -------------------------------------------------------------------------- */
.analytics-drawer__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding-bottom: 15px; border-bottom: 1px solid var(--an-stone-100);
}
.analytics-drawer__body { min-width: 0; }
.analytics-drawer__eyebrow {
  margin: 0 0 4px; color: var(--an-rose-700); font-size: 9px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.analytics-drawer__title {
  margin: 0; font-family: var(--an-font-serif); font-size: 20px; font-weight: 600;
  letter-spacing: -0.025em; color: var(--an-stone-950);
}
.analytics-drawer__close {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--an-stone-200); border-radius: 50%;
  color: var(--an-stone-500); background: var(--an-surface);
  font: inherit; font-size: 15px; line-height: 1; cursor: pointer;
}
.analytics-drawer__close:hover { color: var(--an-stone-950); background: var(--an-stone-50); }
.analytics-drawer__context {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px;
  margin: 12px 0 15px; color: var(--an-stone-600); font-size: 12px; font-variant-numeric: tabular-nums;
}
.analytics-drawer__context strong { color: var(--an-stone-600); font-weight: 600; }
.analytics-drawer__list { margin: 0; padding: 0; list-style: none; }
.analytics-drawer__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px;
  align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--an-stone-100);
}
.analytics-drawer__row:last-child { border-bottom: 0; }
.analytics-drawer__guest { margin: 0; color: var(--an-stone-800); font-size: 13px; font-weight: 600; }
.analytics-drawer__details { margin: 0; color: var(--an-stone-600); font-size: 12px; font-variant-numeric: tabular-nums; }
.analytics-drawer__status { grid-column: 2; grid-row: 1 / span 2; align-self: center; justify-self: end; }
.analytics-drawer__assets {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--an-stone-100);
}
.analytics-drawer__total { color: var(--an-stone-500); font-size: 12px; font-variant-numeric: tabular-nums; }
.analytics-drawer__total strong { display: block; margin-top: 1px; color: var(--an-stone-950); font-size: 16px; font-weight: 500; letter-spacing: -0.03em; }
.analytics-pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--an-stone-100);
  color: var(--an-stone-400); font-size: 11px;
}
.analytics-pagination a { color: var(--an-rose-700); font-weight: 600; text-decoration: none; }
.analytics-pagination a:hover { text-decoration: underline; }
.analytics-pagination span { color: var(--an-stone-400); }

.analytics-state-stack { display: grid; gap: 16px; min-width: 0; }
.analytics-state-card {
  min-width: 0; padding: 20px; background: var(--an-surface);
  border: 1px solid #f5f3f1; border-radius: var(--an-radius-lg);
  box-shadow: 0 1px 1px rgba(28,25,23,0.03), 0 6px 20px -14px rgba(28,25,23,0.10);
}
.analytics-state-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.analytics-state-card__title { margin: 0; color: var(--an-stone-800); font-size: 13px; font-weight: 600; }
.analytics-incomplete {
  padding: 13px 14px; border: 1px solid var(--an-amber-100); border-radius: var(--an-radius-md); background: #fffbf2;
}
.analytics-incomplete__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.analytics-incomplete__label { color: var(--an-amber-700); font-size: 11px; font-weight: 600; }
.analytics-incomplete__value { color: var(--an-stone-700); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.analytics-incomplete__text { margin: 8px 0 0; color: var(--an-stone-500); font-size: 12px; line-height: 1.5; }

.analytics-coverage__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.analytics-coverage__label { color: var(--an-stone-600); font-size: 11px; font-weight: 500; }
.analytics-coverage__value { color: var(--an-stone-800); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.analytics-coverage__track { height: 5px; overflow: hidden; border-radius: 999px; background: var(--an-stone-200); }
.analytics-coverage__fill { display: block; height: 100%; border-radius: inherit; background: var(--an-teal-500); }
.analytics-coverage__fill--amber { background: var(--an-amber-500); }

.analytics-tableuse-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px;
}
.analytics-stat { min-width: 0; padding: 12px 14px; border: 1px solid var(--an-stone-100); border-radius: 12px; background: var(--an-surface-soft); }
.analytics-stat-label { margin: 0; color: var(--an-stone-500); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.analytics-stat-value { margin: 4px 0 0; color: var(--an-stone-900); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .analytics-tableuse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.analytics-page-header {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px; padding: 18px 0 16px;
}
.analytics-page-title {
  margin: 0; font-family: var(--an-font-serif); font-size: 1.4rem; font-weight: 600;
  letter-spacing: -0.02em; color: var(--an-stone-950);
}
.analytics-page-subtitle { margin: 6px 0 0; color: var(--an-stone-500); font-size: 13px; line-height: 1.5; }
.analytics-range-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin: 14px 0 0; color: var(--an-stone-500); font-size: 12px; font-variant-numeric: tabular-nums;
}
.analytics-kicker {
  display: flex; align-items: center; gap: 9px; margin: 0 0 10px;
  color: var(--an-rose-600); font-size: 11px; font-weight: 500; letter-spacing: 0.11em; text-transform: uppercase;
}
.analytics-kicker::before { content: ""; width: 18px; height: 1px; background: var(--an-rose-200); }

.analytics-axis-label { fill: var(--an-stone-600); font-family: var(--an-font-sans); font-size: 12px; font-variant-numeric: tabular-nums; }
.analytics-chart__line { fill: none; stroke: var(--an-rose-600); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.analytics-chart__line.analytics-chart__line--compare { stroke: #57534e; stroke-width: 1.8; stroke-dasharray: 5 5; fill: none; }

@media (forced-colors: active) {
  .analytics-canvas, .analytics-panel, .analytics-preview, .analytics-filter-panel { border: 1px solid CanvasText; }
  .analytics-chart__bar { fill: CanvasText; }
  .analytics-chart__line--compare { stroke: CanvasText; }
}
