/* HGT BI design system — tokens first (Claude Design handoff). Legacy --bg/--lime
   names are bridged inside hgt-bi-tokens.css so existing call sites keep working. */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

/* ---- Motion system (HGT redesign, HANDOFF.md #7) — apply .hgt-anim to reveal-on-mount elements
   and .hgt-growx to bar/pipeline/tile fills; both are inert under prefers-reduced-motion. ---- */

@keyframes hgtFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes hgtGrowX {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes hgtFadeScale {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: none; }
}
.hgt-anim {
  opacity: 0;
  animation: hgtFadeUp 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.hgt-growx {
  transform-origin: left center;
  animation: hgtGrowX 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.hgt-fadescale {
  opacity: 0;
  animation: hgtFadeScale 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@media (prefers-reduced-motion: reduce) {
  .hgt-anim, .hgt-growx, .hgt-fadescale {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .skeleton { animation: none !important; background: #1c1c1f !important; }
}

/* ---- Skeleton loading state (HANDOFF.md #8) — shown in #tab-root while a Shopify pull is in flight ---- */
@keyframes hgtShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.skeleton {
  background: linear-gradient(90deg, #1c1c1f 25%, #1c1c1f 37%, #1c1c1f 63%);
  background-size: 400% 100%;
  animation: hgtShimmer 1.4s ease infinite;
  border-radius: 16px;
}
.skeleton-hero {
  height: 180px;
  margin-bottom: 22px;
}
.skeleton-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.skeleton-kpi {
  height: 108px;
  border-radius: 14px;
}
.skeleton-section {
  height: 220px;
  margin-bottom: 18px;
}

/* ---- Dashboard shell (index.html) ---- */

/* App shell additions (Unit 2) — dropdown + sync status; components own the rest */
.hgt-sync .warn { color: var(--hgt-text-secondary, #C9C6D0); }
.hgt-sync .muted { color: var(--hgt-text-subtle, #8B8792); }
.hgt-sync-refreshing { font-size: var(--hgt-fs-caption); color: var(--hgt-text-subtle); margin-top: 4px; display: block; }

button.hgt-account-row {
  background: none;
  border: 0;
  width: 100%;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
button.hgt-account-row[aria-expanded="true"] .hgt-switcher-caret { transform: rotate(180deg); }
.hgt-account { position: relative; }
.hgt-account-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  background: var(--hgt-surface-2, var(--panel-2));
  border: 1px solid var(--hgt-border, var(--border));
  border-radius: var(--hgt-r-md, 10px);
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 20;
}
.hgt-account-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--hgt-r-sm, 8px);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--hgt-text, var(--text));
  cursor: pointer;
}
.hgt-account-menu-item:hover { background: rgba(198, 242, 78, 0.1); color: var(--hgt-lime, var(--lime)); }
.hgt-account-menu-item--danger:hover { background: rgba(229, 72, 77, 0.12); color: #E5484D; }
.hgt-account-role.is-admin { color: var(--hgt-lime, var(--lime)); }

body.hgt {
  background:
    radial-gradient(1100px 620px at 82% -10%, rgba(198, 242, 78, 0.06) 0%, transparent 60%),
    var(--hgt-bg, var(--bg));
}






.date-filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.date-filter-group > button {
  background: var(--panel-2);
  color: var(--text-mute);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  transition: all 0.15s ease;
}

.date-filter-group > button:hover {
  border-color: var(--lovilin-navy);
}

.date-filter-group > button.active {
  background: var(--lovilin-navy);
  color: var(--on-lime);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.date-range-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding-left: 12px;
  border-left: 1px solid #232326;
}

.date-range-inline input[type="date"] {
  border: 1px solid #232326;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: var(--panel-2);
}

.date-range-inline input[type="date"]:focus {
  outline: none;
  border-color: var(--lovilin-navy);
}

.date-range-arrow {
  color: #4a4a52;
  font-size: 12px;
}

.apply-range-btn {
  background: var(--lovilin-mint);
  color: var(--lime);
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
}

.apply-range-btn:hover {
  filter: brightness(0.96);
}

/* Total/Net segmented control */
/* Metric Mode toggle — lives in the (navy) sidebar footer, Favelin-style segmented control. */
.metric-mode {
  margin-bottom: 14px;
}
.metric-mode-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 6px;
  font-weight: 600;
}

/* Topbar mode indicator pill */




/* A section is ONE unified card — header + content share the same background/border/shadow,
   the way every Favelin panel does. Never nest another boxed panel inside it. */
.section {
  margin-bottom: 20px;
  background: var(--panel);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #232326;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  opacity: 1;
  font-weight: 700;
  margin: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid #232326;
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-label {
  font-size: 12px;
  color: #8a8a92;
  margin-bottom: 4px;
}

.card-value {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
}

.card-note {
  font-size: 11px;
  color: #7d7d86;
  margin-top: 6px;
}

.card.approx {
  border-color: var(--lovilin-cream-border);
  background: var(--lovilin-cream);
}

/* ---- End-of-period projection (Favelin parity, 04-compute.js + 09-pages.js renderProjection) ---- */
.proj-card { padding: 4px 2px; }
.proj-lead-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.proj-lead-pct { font-size: 28px; font-weight: 800; color: var(--text); }
.proj-lead-sub { font-size: 12px; color: #8a8a92; }
.proj-progress-bar { height: 8px; background: #232326; border-radius: 999px; overflow: hidden; box-sizing: border-box; }
.proj-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #C6F24E, var(--lime)); transition: width 0.4s ease; }
.proj-meta { font-size: 12px; color: #8a8a92; margin-top: 10px; }
.proj-note { font-size: 11px; color: #8a8a92; margin-top: 4px; }

.approx-tag {
  font-size: 10px;
  background: var(--panel);
  color: #C9C6D0;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
}

.card.blocked {
  border-color: var(--lovilin-pink-border);
  background: var(--lovilin-pink);
}

.card-flag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #E5484D;
  background: var(--panel);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.reasons {
  margin: 0;
  padding-left: 18px;
  font-size: 11px;
  color: #c3c3c9;
}

.reasons li {
  margin-bottom: 4px;
}

.blocked-banner {
  border: 1px solid var(--lovilin-pink-border);
  background: var(--lovilin-pink);
  border-radius: 14px;
  padding: 18px;
  max-width: 640px;
}

.blocked-banner p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #c3c3c9;
}

.status-note {
  font-size: 12px;
  color: #C9C6D0;
  background: var(--lovilin-cream);
  border: 1px solid var(--lovilin-cream-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  max-width: 640px;
}

/* Generic column grid for tables without a named hgt-cols--* template yet. */
.hgt-cols--fit { grid-template-columns: repeat(var(--hgt-cols, 1), minmax(0, 1fr)); }

.series-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 130px;
  padding: 8px 4px 0;
  border-bottom: 2px solid #1c1c1f;
}

.series-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  height: 100%;
  position: relative;
}

.series-bar-wrap:hover .series-bar {
  background: var(--lovilin-navy-dark);
}

.series-bar-value {
  font-size: 9.5px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 3px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.series-bar-wrap:hover .series-bar-value {
  opacity: 1;
}

.series-bar {
  width: 100%;
  max-width: 26px;
  background: linear-gradient(180deg, #c6f24e 0%, var(--lovilin-navy) 100%);
  border-radius: 6px 6px 0 0;
  transition: background 0.15s ease;
}

.series-tick {
  font-size: 9.5px;
  color: #8a8a92;
  margin-top: 6px;
}

/* ---- Modal (used for City → Area drill-down) ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-box {
  background: var(--panel);
  border-radius: 16px;
  padding: 24px 26px;
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal-box h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 17px;
}

.modal-subtitle {
  font-size: 12px;
  color: #8a8a92;
  margin-bottom: 16px;
}

.modal-close {
  float: right;
  background: var(--lovilin-lavender);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  color: var(--lovilin-navy);
  cursor: pointer;
}

/* ---- Meta Ads campaign → ads expand ---- */

.camp-caret {
  display: inline-block;
  width: 12px;
  margin-right: 6px;
  color: #8a8a92;
  transition: transform 0.15s ease;
}

.camp-caret.open {
  transform: rotate(90deg);
  color: var(--lovilin-navy);
}

.camp-caret.disabled {
  visibility: hidden;
}

tr.camp-ads-row > td {
  padding: 0;
  background: #1c1c1f;
}

.ads-subtable {
  box-shadow: none;
  border-radius: 0;
  margin: 0;
}

.ads-subtable td {
  padding-left: 34px;
  border-bottom: 1px solid #232326;
}

.ads-subtable tr:last-child td {
  border-bottom: none;
}

.ad-name-cell {
  color: #8a8a92;
}

.card-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  color: inherit;
  font-size: 9px;
  font-style: italic;
  cursor: help;
  margin-left: 4px;
  flex: none;
}


/* KPI card helpers (Unit 3) — delta + spark caption; card chrome lives in hgt-bi-components.css */
.hgt-kpi-figure .hgt-delta { margin-left: 8px; vertical-align: middle; }
.hgt-spark-wrap { display: flex; flex-direction: column; gap: 5px; }
.hgt-spark-caption {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--hgt-fs-micro, 10.5px); color: var(--hgt-text-subtle, #8B8792); white-space: nowrap;
}
.hgt-spark-caption b { color: var(--hgt-text, #EDEAEF); font-weight: 600; }
.hgt-spark-sep { color: var(--hgt-text-disabled, #4a4a52); }
.hgt-spark-days { margin-left: auto; }

/* ---- Elevated component system (KPI cards, donuts, bar-lists, methodology banners) ---- */


.tab-subtitle {
  font-size: 13px;
  color: #8a8a92;
  font-weight: 400;
}

/* ---- Executive Overview period/compare controls ---- */
.eo-period-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.eo-custom-range {
  display: inline-flex;
  gap: 6px;
  margin-left: 6px;
}
.eo-custom-range input[type="date"] {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: "Poppins", sans-serif;
}

/* ---- Campaign table upgrade: Health Score badges + Saved Views (Performance Analytics Phase 1) ---- */
.health-score-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.health-score-badge.excellent { background: rgba(198, 242, 78, 0.16); color: var(--lime); }
.health-score-badge.good { background: rgba(79, 224, 138, 0.16); color: #C6F24E; }
.health-score-badge.needs-attention { background: rgba(240, 180, 41, 0.16); color: #C9C6D0; }
.health-score-badge.critical { background: rgba(224, 85, 69, 0.16); color: #e05545; }

.saved-views-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -6px 0 14px;
}
.saved-view-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  font-size: 11.5px;
  color: var(--text);
  cursor: pointer;
}
.saved-view-pill:hover {
  border-color: var(--lime);
}
.saved-view-delete {
  background: none;
  border: none;
  color: var(--text-mute);
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
}
.saved-view-delete:hover {
  color: #e05545;
}

.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .split-row {
    grid-template-columns: 1fr;
  }
}

.chart-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}

.chart-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.chart-panel-subtitle {
  font-size: 11px;
  color: #8a8a92;
  margin-bottom: 14px;
}

.donut-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.donut-svg {
  flex: 0 0 auto;
}

.donut-svg svg {
  max-width: 100%;
  height: auto;
}

.donut-legend {
  flex: 1 1 160px;
  min-width: 140px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 5px 0;
  border-bottom: 1px solid #232326;
}

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

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.legend-label {
  flex: 1;
  color: #c3c3c9;
}

.legend-value {
  font-weight: 600;
  color: var(--lovilin-ink);
}

.legend-pct {
  color: #8a8a92;
  width: 44px;
  text-align: right;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.searchable {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid #232326;
  border-radius: 999px;
  font-size: 12.5px;
  font-family: "Poppins", sans-serif;
  max-width: 320px;
  background: var(--panel);
  /* Without this the input keeps the UA default text colour (black) on a dark panel, so whatever
     you type is invisible. Affects every search box in the app, not just one tab. */
  color: var(--text);
}

.search-input::placeholder {
  color: var(--text-faint);
}

.search-input:focus {
  outline: none;
  border-color: var(--lovilin-navy);
}

.mini-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-bar-track {
  width: 70px;
  height: 8px;
  background: #232326;
  border-radius: 999px;
  overflow: hidden;
  flex: none;
}

.mini-bar-fill {
  height: 100%;
  background: var(--lovilin-navy);
  border-radius: 999px;
}

.mini-bar span {
  font-size: 11.5px;
  color: #c3c3c9;
  white-space: nowrap;
}

.date-range-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
}

.date-range-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #8a8a92;
}

.date-range-form input[type="date"] {
  padding: 7px 10px;
  border: 1px solid #232326;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  font-size: 12.5px;
}

.date-range-form button {
  background: var(--lovilin-navy);
  color: var(--on-lime);
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-family: "Poppins", sans-serif;
  font-size: 12.5px;
  align-self: flex-end;
}

.date-range-form button.secondary-btn {
  background: transparent;
  color: var(--lime);
  border: 1px solid var(--lime);
}

/* ================= Interactive charts + polish (2026-07-18 UI pass) ================= */

.card-info-icon {
  background: rgba(255, 255, 255, 0.12);
}

/* Floating custom tooltip (JS-driven, shown for [data-tip]) */
.floating-tooltip {
  position: fixed;
  z-index: 200;
  max-width: 260px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.45;
  /* Honors "\n" in a data-tip so multi-line tooltips (the revenue-trend chart's per-day readout)
     render as separate lines. Inert for every existing single-line tooltip — pre-line still
     collapses runs of spaces exactly like the default. */
  white-space: pre-line;
  padding: 8px 11px;
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: opacity 0.1s ease;
}
.floating-tooltip[hidden] {
  display: none;
}
.floating-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 16px;
  border: 5px solid transparent;
  border-top-color: var(--panel-2);
}

/* Interactive column chart (Orders by Hour / Day of Week) */
.column-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 150px;
  padding: 22px 2px 0;
  position: relative;
}
.col-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  min-width: 0;
}
.col-bar {
  width: 100%;
  max-width: 28px;
  background: linear-gradient(180deg, #c6f24e 0%, var(--accent, var(--lovilin-navy)) 100%);
  border-radius: 6px 6px 3px 3px;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.col-bar.col-peak {
  background: linear-gradient(180deg, #6effa6 0%, #C6F24E 100%);
}
.col-wrap:hover .col-bar {
  filter: brightness(1.08);
}
.col-bubble {
  position: absolute;
  top: -2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.15s ease;
  pointer-events: none;
  white-space: nowrap;
}
.col-wrap:hover .col-bubble {
  opacity: 1;
  transform: translateY(0);
}
.col-tick {
  font-size: 9.5px;
  color: #8a8a92;
  margin-top: 7px;
  white-space: nowrap;
}

/* Sparkline hover */
.sparkline-svg {
  width: 100%;
  height: 40px;
  overflow: visible;
}
.spark-dot {
  cursor: pointer;
}
/* Points are faintly visible by default so the trend reads as a real line, and pop on hover. */
.spark-dot-visible {
  opacity: 0.5;
  transition: opacity 0.12s ease, r 0.12s ease;
}
.spark-dot:hover + .spark-dot-visible {
  opacity: 1;
}

/* Donut center label */
.donut-svg-el {
  width: 168px;
  max-width: 100%;
  height: auto;
}
.donut-center-value {
  font-size: 26px;
  font-weight: 700;
  fill: var(--text);
  font-family: "Poppins", sans-serif;
}
.donut-center-label {
  font-size: 10px;
  fill: #8a8a92;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: "Poppins", sans-serif;
}
.donut-arc {
  transition: opacity 0.15s ease;
  cursor: pointer;
}
.donut-wrap:hover .donut-arc {
  opacity: 0.55;
}
.donut-arc:hover {
  opacity: 1 !important;
}

/* Section header info icon spacing */
.section-header .hgt-info {
  margin-top: 1px;
}

/* Configuration auto-sync UI */
.sync-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--lovilin-lavender);
  border-radius: 12px;
  margin-bottom: 12px;
}
.sync-toggle-row .sync-desc {
  font-size: 12px;
  color: #8a8a92;
}
.sync-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.sync-status-pill.on {
  background: var(--lovilin-mint);
  color: #C6F24E;
}
.sync-status-pill.off {
  background: #3a1f2a;
  color: #E5484D;
}
.sync-status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.health-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.health-dot.green { background: #C6F24E; }
.health-dot.grey { background: #8a8a92; }

/* City drill-down affordance */
.city-name { font-weight: 600; color: var(--lovilin-navy); }
.city-caret { color: #4a4a52; font-size: 11px; margin-left: 2px; }
.hgt-tr--drill:hover .city-caret { color: var(--lovilin-navy); }

/* Mini toggle (auto-sync enable) */
.mini-toggle {
  display: inline-block;
  position: relative;
  width: 42px;
  height: 22px;
  background: #2a2a2e;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 4px;
}
.mini-toggle.on { background: #C6F24E; }
.mini-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.mini-toggle.on .mini-thumb { transform: translateX(20px); }

.cfg-select {
  margin-top: 6px;
  padding: 7px 10px;
  border: 1px solid #232326;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  font-size: 12.5px;
  color: var(--text);
  background: var(--panel-2);
  width: 100%;
}

/* ---- Drill-down: clickable insights (cards, bars, donut legends, KPIs, table rows, columns) ---- */
.drillable { cursor: pointer; }

.card.drillable { transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease; }
.card.drillable:hover {
  border-color: var(--lime);
  box-shadow: 0 12px 34px rgba(198, 242, 78, 0.2);
  transform: translateY(-4px) scale(1.03);
}
.legend-row.drillable:hover { background: var(--lovilin-lavender); border-radius: 6px; }
.legend-row.drillable:hover .legend-label { color: var(--lovilin-navy); font-weight: 600; }
tr.drillable:hover td { background: var(--lovilin-lavender); }
.col-wrap.drillable:hover .col-bar { filter: brightness(0.9); }

/* The little "›" affordance that marks something as clickable */
.drill-caret {
  color: #4a4a52;
  font-weight: 700;
  margin-left: auto;
  padding-left: 6px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.card.drillable .drill-caret,
.card.drillable:hover .drill-caret,
.legend-row.drillable:hover .drill-caret,
tr.drillable:hover .drill-caret { color: var(--lovilin-navy); transform: translateX(2px); }

/* Loss / At-Risk badges in Lost Order Recovery */
.loss-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 999px;
  vertical-align: middle;
}
.loss-badge.lost { background: #3a1f1f; color: #e05545; }
.loss-badge.at-risk { background: #3a3320; color: #C9C6D0; }

/* Wide modal + drill order table */
/* Widened from 960px when the drill table gained Full Address / Detected Area / Property — at 960
   the address column squeezed every other column to unreadable. */
.modal-box.wide { max-width: min(1400px, 96vw); }
/* The drill table is ~1850px at 17 columns, so it MUST scroll inside this box rather than widening
   the modal (and with it the page). max-width:100% + min-width:0 are the guards that keep a wide
   table from stretching its flex/grid parent — without them the overflow silently escapes. */
.drill-table-scroll { max-height: 58vh; overflow: auto; border-radius: 12px; max-width: 100%; min-width: 0; }
.drill-table { font-size: 12px; }
.drill-table .hgt-th {
  position: sticky;
  top: 0;
  background: #1c1c1f;
  z-index: 1;
  white-space: nowrap;
}
.drill-table .hgt-td { vertical-align: top; }
.drill-table .hgt-td.cap { text-transform: capitalize; }
.drill-table a { color: var(--lovilin-navy); font-weight: 600; text-decoration: none; }
.drill-table a:hover { text-decoration: underline; }
.drill-table .muted { color: #8a8a92; }
/* Full Address column. Egyptian addresses are long free text and often Arabic, so this is the one
   cell allowed to wrap — capped so it can't push the other 15 columns off screen, and left-aligned
   with `unicode-bidi: plaintext` so an Arabic line renders RTL inside an otherwise LTR table
   without dragging its leading house number to the wrong end. */
.drill-table .hgt-td.addr-cell {
  min-width: 210px;
  max-width: 300px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  text-align: left;
  unicode-bidi: plaintext;
}
/* Property cell: the structural reason sits under the label for untyped addresses. */
.drill-table .hgt-td.prop-cell { min-width: 150px; max-width: 260px; white-space: normal; }
.drill-table .prop-reason { margin-top: 3px; font-size: 10.5px; line-height: 1.35; color: #8a8a92; }
/* Match tier badge next to a Detected Area — only rendered when the match wasn't exact. */
.drill-table .addr-conf {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(245, 196, 81, 0.16);
  color: #C9C6D0;
}

/* Drill modal action bar — copy phones / export CSV (CS follow-up on At-Risk orders) */
.drill-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.drill-action-btn {
  background: var(--lovilin-navy);
  color: var(--on-lime);
  border: none;
  border-radius: 999px;
  padding: 8px 15px;
  font-family: "Poppins", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.drill-action-btn:hover { background: var(--lovilin-navy-dark); }
.drill-action-btn.secondary {
  background: transparent;
  color: var(--lime);
  border: 1px solid var(--lime);
}
.drill-action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.drill-action-hint {
  font-size: 12px;
  color: #C6F24E;
  font-weight: 600;
}

.drill-city-all {
  display: inline-block;
  margin-bottom: 12px;
  padding: 8px 14px;
  background: var(--lovilin-navy);
  color: var(--on-lime);
  border: none;
  border-radius: 999px;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.drill-city-all:hover { background: #dbff6f; }

/* ---- Commercial Insight cards ---- */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 14px;
}

/* ---- Strategic Action Plan (Favelin parity, 09-pages.js renderCommercial action-item) ---- */
.action-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.action-item {
  background: var(--panel);
  border: 1px solid #232326;
  border-left: 4px solid;
  border-radius: 10px;
  padding: 14px 16px;
}
.action-lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.action-txt {
  font-size: 13px;
  line-height: 1.5;
  color: #c3c3c9;
}

.insights-teaser-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--lovilin-navy);
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
}
.insights-teaser-link:hover {
  text-decoration: underline;
}
.insight-card {
  position: relative;
  background: var(--panel);
  border: 1px solid #232326;
  border-radius: 16px;
  padding: 16px 18px 18px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.16s ease, transform 0.16s ease;
  --tone: var(--lovilin-navy);
  --tone-bg: rgba(0, 0, 0, 0.05);
}
.insight-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--tone);
}
.insight-card.tone-good { --tone: #C6F24E; --tone-bg: rgba(79, 224, 138, 0.12); }
.insight-card.tone-warn { --tone: #E5484D; --tone-bg: rgba(255, 111, 111, 0.12); }
.insight-card.tone-opportunity { --tone: #C9C6D0; --tone-bg: rgba(240, 180, 41, 0.14); }
.insight-card.tone-info { --tone: #6E77F5; --tone-bg: rgba(84, 211, 230, 0.12); }
.insight-card.drillable:hover {
  box-shadow: 0 12px 34px rgba(198, 242, 78, 0.2);
  transform: translateY(-4px) scale(1.03);
}
.insight-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.insight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--tone-bg);
  font-size: 16px;
  flex: none;
}
.insight-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--tone);
}
.insight-head .drill-caret { margin-left: auto; }
.insight-headline {
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 7px;
}
.insight-body {
  font-size: 12.5px;
  line-height: 1.5;
  color: #8a8a92;
}

/* pipeline segment value label (inside hgt-stack) */
.hgt-stack .pipeline-seg-val {
  color: var(--on-lime);
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ---- Google Ads tab ---- */
.ga-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 4px 0 18px;
}
.ga-presets {
  display: inline-flex;
  gap: 6px;
}
.ga-presets button {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-mute);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
}
.ga-presets button:hover {
  border-color: var(--lovilin-navy);
}
.ga-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ga-range input[type="date"] {
  border: 1px solid #232326;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: var(--panel-2);
}
.ga-range input[type="date"]:focus {
  outline: none;
  border-color: var(--lovilin-navy);
}
.ga-sync-btn {
  background: var(--lovilin-navy);
  color: var(--on-lime);
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
}
.ga-sync-btn:hover {
  filter: brightness(1.12);
}
.ga-sync-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.ga-status {
  font-size: 11.5px;
  color: #8a8a92;
}
.ga-status.loading {
  color: var(--lovilin-navy);
  font-weight: 600;
}
.ga-status.error {
  color: #e05545;
  font-weight: 600;
}
.ga-camp-sort {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: #8a8a92;
  margin-bottom: 10px;
}
.camp-view-sep {
  margin-left: 10px;
}

/* ---- Ad Creative Gallery (Meta Ads tab, "View: Creative Gallery") ---- */
.creative-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.creative-filter-bar .cfg-select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: "Poppins", sans-serif;
}
.creative-filter-bar .search-input {
  flex: 1 1 200px;
  min-width: 160px;
}
.creative-campaign-group {
  margin-bottom: 22px;
}
.creative-campaign-group:last-child {
  margin-bottom: 0;
}
.creative-campaign-header {
  font-size: 12.5px;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.creative-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.creative-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}
.creative-card:hover {
  box-shadow: 0 12px 30px rgba(198, 242, 78, 0.18);
  transform: translateY(-3px);
}
.creative-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--panel-2);
  background-size: cover;
  background-position: center;
}
.creative-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: var(--text-faint);
}
.creative-card-body {
  padding: 12px 14px 14px;
}
.creative-ad-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
}
.creative-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.creative-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cm-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-mute);
  font-weight: 600;
}
.cm-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.ga-sort {
  background: #1c1c1f;
  border: 1px solid transparent;
  color: var(--text-mute);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
}
.ga-sort.active {
  background: var(--lovilin-navy);
  color: var(--on-lime);
}
.ga-roas {
  font-weight: 700;
}
.ga-roas.good {
  color: #C6F24E;
}
.ga-roas.ok {
  color: #C9C6D0;
}
.ga-roas.bad {
  color: #e05545;
}

/* Interactive bar+line daily chart (charts.js barLineChart) */
.bar-line-chart {
  width: 100%;
}
.blc-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}
.blc-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #8a8a92;
  font-weight: 600;
}
.blc-swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}
.blc-swatch.blc-line {
  height: 3px;
  border-radius: 2px;
}
.blc-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.blc-tick {
  font-size: 10px;
  fill: #8a8a92;
  font-family: "DM Mono", monospace;
}
.blc-hover {
  cursor: crosshair;
}
.blc-hover:hover {
  fill: rgba(255, 255, 255, 0.05);
}

/* ---- Automated Sync (Configuration tab) ---- */
.cfg-input {
  padding: 6px 9px;
  border: 1px solid #232326;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  font-size: 12.5px;
  color: var(--text);
  background: var(--panel-2);
}
.cfg-input:focus,
.cfg-select:focus {
  outline: none;
  border-color: var(--lovilin-navy);
}
.sync-sched-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #8a8a92;
}
/* Inline (in-table) selects shouldn't stretch full width like the standalone config ones. */
.sync-sched-cell .cfg-select,
.hgt-table .cfg-select {
  width: auto;
  margin-top: 0;
  padding: 6px 9px;
}
.hgt-table .muted {
  color: #8a8a92;
}
.hgt-table .mini-toggle {
  margin: 0;
}
.cfg-input.mono,
.mono {
  font-family: "DM Mono", monospace;
  font-size: 11.5px;
}
.sync-add-row {
  margin-bottom: 12px;
}
.sync-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.sync-del-btn {
  background: #3a1f1f;
  color: #e05545;
  border: 1px solid #5a2626;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.sync-del-btn:hover {
  background: #4a2222;
}
.sync-del-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.sync-builtin-tag {
  display: inline-block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a8a92;
  background: #1c1c1f;
  border-radius: 999px;
  padding: 1px 7px;
  vertical-align: middle;
}
/* Add/Edit modal form */
.sync-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sync-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--lovilin-navy);
}
.sync-form .cfg-input,
.sync-form .cfg-select {
  width: 100%;
  margin-top: 0;
}
.sync-form-check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.sync-form-check input {
  width: auto;
}
.sync-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.sync-form-err {
  color: #e05545;
  font-size: 12px;
  font-weight: 600;
}

/* ── SLA Targets & Working-Day Calendar (Customer Experience tab) ── */
.sla-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 640px;
}
.sla-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--lovilin-navy);
}
.sla-form input[type="text"],
.sla-form input[type="number"] {
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid #232326;
  border-radius: 8px;
  background: #1c1c1f;
}
.sla-form .muted {
  font-weight: 400;
  color: #8a8a92;
  font-size: 11px;
}
.sla-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.sla-wcal-toggle {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.sla-wcal-toggle input { width: auto; }
.sla-wd-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sla-wd-check {
  flex-direction: row !important;
  align-items: center;
  gap: 5px !important;
  font-weight: 500 !important;
}
.sla-wd-check input { width: auto; }
.sla-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.sla-save-msg {
  font-size: 12px;
  color: #8a8a92;
}

/* ── Product Financials (COGS) tab ── */
.pf-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px 16px;
  align-items: end;
}
.pf-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #8a8a92;
}
.pf-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.pf-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pf-file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.secondary-btn {
  background: transparent;
  color: var(--lime);
  border: 1px solid rgba(198, 242, 78, 0.35);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
}
.secondary-btn:hover {
  background: rgba(198, 242, 78, 0.1);
}
.pf-type {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  white-space: nowrap;
}
.pf-count {
  font-size: 11px;
  font-weight: 600;
  color: #8a8a92;
}
.pf-count-row {
  margin-bottom: 8px;
}
.pf-table td,
.pf-table th {
  vertical-align: middle;
}

/* ── Comparison table (Comparisons tab) ─────────────────────────────────── */
.cmp-table-wrap { overflow-x: auto; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.cmp-table thead th {
  text-align: left;
  padding: 0.5rem 0.85rem;
  border-bottom: 2px solid var(--border);
  color: var(--lime);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1.4;
}
.cmp-table tbody td { padding: 0.5rem 0.85rem; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-table tbody tr:hover td { background: var(--row-hover, rgba(0, 0, 0,0.03)); }
.cmp-label { font-weight: 500; }
.cmp-val { font-variant-numeric: tabular-nums; }
.cmp-prev { color: var(--text-muted, #8a8a92); }
.cmp-delta { white-space: nowrap; }

/* ============================================================================
   Mobile shell additions (Unit 8) — complements hgt-bi-components.css §14.
   Legacy drawer rules removed; fixed .hgt-mob-top / .hgt-mob-nav replace them.
   ========================================================================== */

/* Home-group marker while another group is expanded for browsing (MOBILE.md §3a). */
@media (max-width: 899px) {
  .hgt-mnav--group[aria-current="location"]::before {
    content: "◆";
    margin-right: 5px;
    font-size: 8px;
    vertical-align: middle;
  }
}

.hgt-scrim--sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--hgt-scrim);
  backdrop-filter: blur(3px);
}

.hgt-sheet-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--hgt-border-row);
  background: none;
  font-family: var(--hgt-font);
  font-size: var(--hgt-fs-body);
  color: var(--hgt-text-secondary);
  text-align: left;
  cursor: pointer;
}
.hgt-sheet-row.is-on { color: var(--hgt-lime); font-weight: var(--hgt-fw-semibold); }
.hgt-sheet-group + .hgt-sheet-group { margin-top: 18px; }
.hgt-sheet-custom { margin-top: 16px; }
.hgt-field { display: block; margin-top: 12px; }
.hgt-field span { display: block; font-size: var(--hgt-fs-caption); color: var(--hgt-text-muted); margin-bottom: 6px; }
.hgt-field--inline { display: inline-block; margin-top: 0; vertical-align: middle; }
.hgt-field--inline span { margin-bottom: 4px; }

.hgt-scroll-fade {
  flex: 1;
  min-width: 0;
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.hgt-filter-open { min-height: 44px; flex: none; }

.hgt-filter-sheet .hgt-sheet-head .hgt-clear-all { margin-left: auto; flex: none; min-height: 44px; }
.hgt-filter-group-title {
  font-size: var(--hgt-fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--hgt-text-subtle);
  font-weight: var(--hgt-fw-semibold);
  padding: 8px 0 4px;
  cursor: pointer;
}
.hgt-filter-field { border-bottom: 1px solid var(--hgt-border-row); }
.hgt-filter-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 0;
  list-style: none;
  cursor: pointer;
}
.hgt-filter-field-row::-webkit-details-marker { display: none; }
.hgt-filter-field-label { font-size: var(--hgt-fs-body); color: var(--hgt-text-secondary); flex: none; min-width: 108px; }
.hgt-filter-field-value {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-size: var(--hgt-fs-body);
  color: var(--hgt-text);
  font-weight: var(--hgt-fw-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hgt-filter-field-row.is-set .hgt-filter-field-value { color: var(--hgt-lime); }
.hgt-filter-field-clear {
  flex: none;
  background: none;
  border: 0;
  color: var(--hgt-text-muted);
  font-size: var(--hgt-fs-caption);
  font-family: var(--hgt-font);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  min-height: 44px;
  padding: 0 4px;
}
.hgt-filter-field-clear[hidden] { display: none; }
.hgt-filter-field-options .hgt-sheet-row { padding-left: 12px; justify-content: space-between; }
.hgt-filter-field-options .hgt-sheet-row.is-on::after { content: "✓"; margin-left: 8px; }

@media (max-width: 599px) {
  .hgt-filterbar.hgt-mobile-only .hgt-filterbar-row {
    flex-wrap: nowrap;
    align-items: center;
  }
  .hgt-filterbar.hgt-mobile-only .hgt-filterbar-end {
    margin-left: 0;
    width: auto;
    flex: none;
  }
  .hgt-filterbar.hgt-mobile-only .hgt-filterbar-chips {
    flex: 1;
    min-width: 0;
    width: auto;
  }
}

.hgt-tip-popover {
  position: fixed;
  z-index: 70;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: var(--hgt-r);
  background: var(--hgt-surface-2);
  border: 1px solid var(--hgt-border-strong);
  box-shadow: var(--hgt-shadow-modal);
  font-size: var(--hgt-fs-caption);
  color: var(--hgt-text);
  line-height: 1.5;
}

.hgt-pii-note { font-size: var(--hgt-fs-label); color: var(--hgt-text-subtle); }

@media (max-width: 599px) {
  .hgt-ledger-head { display: none; }
}

/* ---- Revenue over time (charts.js revenueTrendChart) — Executive Summary's full-size trend ----
   Colors are all existing palette tokens: lime = the Net Revenue accent used by its KPI card, so
   card and chart always agree; #E5484D = the same critical red already on Delivery Rate / Failed
   Delivery; #C9C6D0 = the existing amber. Nothing new invented. */
.revenue-trend-chart {
  --rtc-net: var(--lime);
  --rtc-loss: #E5484D;
  --rtc-peak: #C9C6D0;
  width: 100%;
}
.rtc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 10px;
}
.rtc-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-mute);
  letter-spacing: 0.01em;
}
.rtc-sw {
  width: 13px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
  flex: none;
}
.rtc-sw-net { background: var(--rtc-net); box-shadow: 0 0 8px rgba(198, 242, 78, 0.5); }
.rtc-sw-lost { background: var(--rtc-loss); opacity: 0.55; height: 9px; border-radius: 2px; }
.rtc-sw-prior { background: transparent; border-top: 2px dashed var(--text-faint); height: 0; }

/* The plot scrolls rather than shrinking on narrow screens — a viewBox scaled to phone width would
   render the axis labels illegibly small. */
.rtc-plot { overflow-x: auto; overflow-y: hidden; }
.rtc-svg {
  display: block;
  width: 100%;
  min-width: 520px;
  height: auto;
  overflow: visible;
}

.rtc-grid { stroke: rgba(255, 255, 255, 0.055); stroke-width: 1; }
.rtc-ylabel,
.rtc-xlabel {
  fill: var(--text-faint);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 10.5px;
}
.rtc-xlabel { fill: var(--text-mute); }

.rtc-loss-band { fill: var(--rtc-loss); opacity: 0.13; }
.rtc-total-line {
  fill: none;
  stroke: var(--rtc-loss);
  stroke-width: 1.25;
  stroke-dasharray: 3 3;
  opacity: 0.5;
}
.rtc-prior-line {
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1.75;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
  opacity: 0.85;
}
.rtc-net-line {
  fill: none;
  stroke: var(--rtc-net);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(198, 242, 78, 0.35));
}
.rtc-end-dot { fill: var(--rtc-net); }
.rtc-end-halo { fill: var(--rtc-net); opacity: 0.22; }
.rtc-peak-ring { fill: none; stroke: var(--rtc-peak); stroke-width: 2; opacity: 0.9; }
.rtc-peak-label {
  fill: var(--rtc-peak);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
}

/* Per-day hover: crosshair + dot, CSS-only (no chart JS to drift out of sync). */
.rtc-hit { fill: transparent; cursor: crosshair; }
.rtc-cross { opacity: 0; transition: opacity 0.12s ease; pointer-events: none; }
.rtc-slot:hover .rtc-cross { opacity: 1; }
line.rtc-cross { stroke: var(--text-mute); stroke-width: 1; stroke-dasharray: 3 3; }
.rtc-hover-dot { fill: var(--rtc-net); stroke: var(--bg); stroke-width: 2; }

.rtc-figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
}
.rtc-fig {
  background: var(--panel);
  padding: 12px 14px 11px;
  min-width: 0;
}
.rtc-fig-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rtc-fig-value {
  margin-top: 4px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.rtc-fig-value.rtc-accent { color: var(--lime); }
.rtc-fig-value.rtc-loss { color: #E5484D; }
.rtc-fig-sub {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-mute);
}

@media (max-width: 760px) {
  .rtc-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Intraday pace view (charts.js intradayTrendChart) — the single-day variant of the chart
   above. Shares every .rtc-* token; only the hour bars and the "now" marker are new. ---- */
.rtc-sw-hour { background: var(--lime); opacity: 0.3; height: 9px; border-radius: 2px; }
.itc-hour-bar { fill: var(--lime); opacity: 0.22; }
.itc-now-line {
  stroke: var(--text-mute);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  opacity: 0.7;
}
.itc-now-label {
  fill: var(--text-mute);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ---- Trend metric strip (app.js trendMetricStrip) — the Shopify-style selector above the chart.
   Glass: a translucent panel over the page's own background rather than a solid fill, so the
   ambient hero glow reads through it. Each card carries its metric's colour as --tms, used only
   for the active state's edge + glow — the resting state stays neutral so five cards in five
   colours don't turn the strip into a rainbow. ---- */
.tms {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.tms-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px 12px;
  text-align: left;
  font: inherit;
  color: var(--text);
  border-radius: 13px;
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
/* Sheen along the top edge — the thing that sells "glass" rather than "grey box". */
.tms-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  opacity: 0.6;
}
.tms-card:hover:not(.disabled) {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 8px 22px rgba(0, 0, 0, 0.34);
}
.tms-card:focus-visible {
  outline: 2px solid var(--tms, var(--lime));
  outline-offset: 2px;
}
.tms-card.active {
  background: rgba(255, 255, 255, 0.07);
  border-color: color-mix(in srgb, var(--tms) 55%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1),
              0 0 0 1px color-mix(in srgb, var(--tms) 22%, transparent),
              0 10px 26px color-mix(in srgb, var(--tms) 12%, rgba(0, 0, 0, 0.4));
}
/* Active gets a colour bar along the bottom — reads as "this is the series on the chart". */
.tms-card.active::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--tms);
  box-shadow: 0 0 12px var(--tms);
}
.tms-card.active .tms-value { color: var(--tms); }
.tms-card.disabled { cursor: not-allowed; opacity: 0.45; }

.tms-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tms-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  transition: color 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tms-sub {
  font-size: 11px;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cross-fade between metrics: out on the old series, in on the new. */
.rtc-swap {
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.rtc-swap.swapping {
  opacity: 0;
  transform: translateY(6px);
}
/* The hero line draws itself in. `pathLength="1"` on the polyline normalizes its length, so this
   is a plain 1 → 0 dashoffset no matter how many points are plotted. */
@keyframes rtcDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.rtc-draw {
  stroke-dasharray: 1;
  animation: rtcDraw 0.75s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}
@media (prefers-reduced-motion: reduce) {
  .rtc-swap { transition: none; }
  .rtc-draw { animation: none; stroke-dasharray: none; }
}

@media (max-width: 900px) {
  .tms { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .tms { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tms-value { font-size: 17px; }
}

/* ══ Logistics (ShipBlu) tab ══════════════════════════════════════════════════ */

/* Sub-heading inside a section, above a tile group or chart. Sits between the section
   header and the content without introducing a second nested panel. */
.sub-head {
  margin: 22px 0 10px;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.sub-head:first-child { margin-top: 4px; }

/* Global filter bar. Wraps to as many rows as it needs — there are 7 controls and this
   tab is used on laptops as often as on a wide monitor. */
.lg-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 4px 0 18px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.lg-filter {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.lg-filter select,
.lg-filter input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 7px 9px;
  font-family: inherit;
  font-size: 12.5px;
  min-width: 130px;
  text-transform: none;
  letter-spacing: 0;
}
.lg-filter select:focus,
.lg-filter input:focus {
  outline: none;
  border-color: var(--lime);
}
.lg-filters .drill-action-btn { align-self: flex-end; }

/* Status pill in the shipments table. Colour tracks the OUTCOME, not the raw status, so a
   scan down the column reads delivered/failed/in-flight at a glance across 14 statuses. */
.sb-status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.sb-status.sb-delivered { background: rgba(79, 224, 138, 0.14); color: #C6F24E; border-color: rgba(79, 224, 138, 0.3); }
.sb-status.sb-failed    { background: rgba(255, 111, 111, 0.14); color: #E5484D; border-color: rgba(255, 111, 111, 0.3); }
.sb-status.sb-active    { background: rgba(84, 211, 230, 0.14);  color: #6E77F5; border-color: rgba(84, 211, 230, 0.3); }
.sb-status.sb-cancelled { background: rgba(157, 139, 255, 0.14); color: #6E77F5; border-color: rgba(157, 139, 255, 0.3); }

/* The on-page shipments table shares the drill modal's scroll container, but on the page it
   needs its own max height so the table doesn't push every section off-screen. */
#lg-table-host .drill-table-scroll { max-height: 620px; }
#lg-table-host .search-input { flex: 1 1 320px; }

/* Regional performance heatmap. Cell background/foreground are set inline per-cell (the scale is
   data-dependent), so this only handles layout and legibility. */
.lg-heatmap td,
.lg-heatmap th { text-align: right; white-space: nowrap; }
.lg-heatmap td:first-child,
.lg-heatmap th:first-child { text-align: left; }
.lg-heat-cell {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 12.5px;
  font-weight: 600;
}
.lg-heat-cell.muted { color: var(--text-faint); }
.lg-heatmap .hgt-tr--drill:hover .lg-heat-cell { filter: brightness(1.25); }

/* ── One parcel's timeline (Logistics → Attempts cell) ──────────────────────────────────────
   Attempts and tracking events are two different things and are styled as two different things:
   an attempt is a card (it carries a reason, a note and a courier worth reading), a tracking event
   is a line on a rail (it's a state change, scanned not read). */
.sb-attempt-link {
  background: rgba(255, 143, 94, 0.12);
  border: 1px solid rgba(255, 143, 94, 0.32);
  color: #ff8f5e;
  border-radius: 999px;
  padding: 2px 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.sb-attempt-link:hover { background: rgba(255, 143, 94, 0.22); }
.sb-attempt-link .muted { color: inherit; opacity: 0.7; }

/* Same count, no timeline behind it yet — deliberately NOT button-shaped, so it can't be mistaken
   for a control that refuses to open. The dotted underline says "hover me", and the tooltip
   explains that this parcel's detail simply hasn't been synced yet. */
.sb-attempt-pending {
  color: var(--muted);
  border-bottom: 1px dotted rgba(255, 143, 94, 0.45);
  cursor: help;
  white-space: nowrap;
}
.sb-attempt-pending .muted { color: inherit; opacity: 0.7; }

/* Zero failed attempts, but the parcel still has a tracking trail worth opening. Deliberately the
   quietest of the three states — it must not compete with the orange failed-attempt badge, since
   on most rows it means "nothing went wrong here". */
.sb-trail-link {
  background: none;
  border: 0;
  padding: 2px 4px;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.75;
}
.sb-trail-link:hover { color: var(--text); opacity: 1; }

/* Header facts — the shipment's identity, so the attempt list below has something to hang on. */
.sb-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 18px;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.sb-fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sb-fact-k {
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.sb-fact-v { font-size: 13px; color: var(--text); overflow-wrap: anywhere; }

.sb-attempts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sb-attempt {
  background: var(--panel-2);
  border: 1px solid var(--border);
  /* Left edge in the failure colour: every entry in this list IS a failed attempt. */
  border-left: 3px solid #ff8f5e;
  border-radius: 10px;
  padding: 11px 14px;
}
.sb-attempt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.sb-attempt-n {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ff8f5e;
}
.sb-attempt-reason { font-size: 13.5px; font-weight: 600; color: var(--text); }
.sb-attempt-at { margin-left: auto; font-size: 12px; color: var(--text-mute); white-space: nowrap; }
/* The courier's raw note — often Arabic, so leave the direction to the browser and don't clip it:
   this line is frequently the only place the real reason is written down. */
.sb-attempt-note {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #c3c3c9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sb-attempt-meta { margin-top: 7px; font-size: 11.5px; color: var(--text-mute); }

.sb-timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 1px solid var(--border); }
.sb-timeline-ev { position: relative; padding: 0 0 16px 16px; }
.sb-timeline-ev::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--text-faint);
}
.sb-timeline-ev.sb-tl-delivered::before { border-color: #C6F24E; }
.sb-timeline-ev.sb-tl-failed::before    { border-color: #E5484D; }
.sb-timeline-ev.sb-tl-active::before    { border-color: #6E77F5; }
.sb-timeline-ev.sb-tl-cancelled::before { border-color: #6E77F5; }
.sb-tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.sb-tl-status { font-size: 13px; font-weight: 600; color: var(--text); }
.sb-tl-at { margin-left: auto; font-size: 11.5px; color: var(--text-mute); white-space: nowrap; }
.sb-tl-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #c3c3c9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sb-tl-meta { margin-top: 3px; font-size: 11px; color: var(--text-faint); }

/* The Shopify link in the timeline header is an <a>, not a <button>, so it needs the box back. */
a.drill-action-btn { display: inline-block; text-decoration: none; }
.status-note.error { color: #E5484D; border-color: rgba(255, 111, 111, 0.35); }

/* ─────────────────────────────────────────────────────────────────────────────
   Duplicate Orders Analysis (Customer Behavior tab)
   The group — not the order — is the unit here, so each one is a bordered block colour-keyed to its
   confidence band, with its member orders nested inside as a table.
   ───────────────────────────────────────────────────────────────────────────── */

.dup-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
}

.dup-group {
  border: 1px solid var(--border);
  /* The band colour reads as a spine down the left edge rather than a full tint — a page of
     red-washed panels stops meaning "urgent" after the third one. */
  border-left: 3px solid var(--dup-color, var(--border));
  border-radius: 10px;
  background: var(--panel-2);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.dup-group-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.dup-band {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
}

.dup-count { font-size: 12px; color: var(--text-mute); }
.dup-value { font-size: 11.5px; color: var(--text-dim); margin-left: auto; white-space: nowrap; }

.dup-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dup-pill.cod { background: rgba(245, 196, 81, 0.16); color: #C9C6D0; }
.dup-pill.act { background: rgba(198, 242, 78, 0.16); color: var(--lime); }

.dup-reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.dup-reason {
  padding: 2px 8px;
  border-radius: 5px;
  background: #232326;
  color: var(--text-mute);
  font-size: 11px;
}

.dup-detail-btn {
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-mute);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.dup-detail-btn:hover { color: var(--lime); border-color: var(--lime); background: transparent; }

/* Nine columns of order detail don't fit a phone, and shrinking the address to fit would defeat the
   comparison this table exists for — so it scrolls inside itself instead of squashing. */
.dup-table-scroll { overflow-x: auto; }
.dup-table { font-size: 12px; width: 100%; }
.dup-table th { white-space: nowrap; }
.dup-table td { vertical-align: top; }
.dup-table td.dup-nowrap { white-space: nowrap; }
.dup-table td.addr-cell {
  min-width: 200px;
  max-width: 300px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  text-align: left;
  unicode-bidi: plaintext;
}
.dup-table td.dup-products { min-width: 150px; max-width: 240px; white-space: normal; color: var(--text-mute); }
.dup-table a { color: var(--lovilin-navy); font-weight: 600; text-decoration: none; }
.dup-table a:hover { text-decoration: underline; }

.dup-pay { font-weight: 600; }
.dup-pay.cod { color: #C9C6D0; }
.dup-stoppable {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(198, 242, 78, 0.16);
  color: var(--lime);
}

/* ---- Group detail modal ---- */

.dup-order-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.dup-order-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 12px 14px;
}
.dup-order-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.dup-order-title a { color: var(--lovilin-navy); text-decoration: none; }
.dup-order-title a:hover { text-decoration: underline; }

.dup-kv { margin-bottom: 7px; font-size: 12px; }
.dup-kv > span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 1px;
}
.dup-kv > div { color: var(--text); line-height: 1.4; unicode-bidi: plaintext; }

.dup-subhead { font-size: 13px; margin: 0 0 10px; color: var(--text-mute); }

.dup-pair {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.dup-pair-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }

/* One row per signal, so the score is legible as "where the points came from" rather than a number
   to be taken on faith. Each bar is filled against that signal's own maximum weight. */
.dup-signal { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.dup-signal-label { flex: 0 0 92px; font-size: 11px; color: var(--text-mute); }
.dup-signal-track { flex: 1; height: 6px; border-radius: 3px; background: #232326; overflow: hidden; }
.dup-signal-fill { height: 100%; border-radius: 3px; background: var(--lime); }
.dup-signal-pts { flex: 0 0 64px; text-align: right; font-size: 11px; color: var(--text-dim); }

@media (max-width: 700px) {
  .dup-value { margin-left: 0; }
  .dup-signal-label { flex-basis: 70px; }
}

/* Shipments-table meta strip: result count on the left, pager on the right. Appears above the
   table and, when there's more than one page, again below it. */
.sb-table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 2px 0 8px;
  font-size: 12px;
  color: var(--text-mute);
}
.sb-table-meta strong { color: var(--text); font-weight: 600; }
.sb-table-meta-bottom { padding: 10px 0 0; justify-content: flex-end; }

.sb-pager {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.sb-page-btn {
  min-width: 30px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text-mute);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.sb-page-btn:hover:not(:disabled) { background: var(--border); color: var(--text); }
.sb-page-btn.active {
  background: var(--lime);
  border-color: var(--lime);
  color: #0a0a0b;
  font-weight: 600;
}
.sb-page-btn:disabled { opacity: 0.35; cursor: default; }
.sb-page-gap { color: var(--text-faint); padding: 0 2px; }

/* ── Customer Experience: order contact journey ────────────────────────────────
   The per-order timeline modal (openCxJourney) and the "Journey" button that opens it from any
   drill row. Deliberately reuses the panel/border tokens rather than inventing a palette — the only
   bespoke colour is the per-action dot, passed in as --dot from CX_ACTION_COLORS in app.js. */

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--lime);
  cursor: pointer;
  white-space: nowrap;
}
.link-btn:hover { color: var(--lime-hi); text-decoration: underline; }

.cx-tl-back { display: inline-block; margin-bottom: 12px; font-size: 12.5px; }

.cx-timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
}

.cx-tl-row {
  display: grid;
  /* dot | timestamp | everything else. The fixed timestamp column keeps labels aligned down the
     list, which is what makes the gaps between actions readable at a glance. */
  grid-template-columns: 16px 132px 1fr;
  align-items: start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}
.cx-tl-row:last-child { border-bottom: none; }

.cx-tl-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--dot, var(--text-faint));
  /* Ring rather than a bigger dot: keeps the visual weight even between lifecycle and agent rows. */
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, var(--text-faint)) 22%, transparent);
}

.cx-tl-when {
  font-size: 11.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.cx-tl-label { font-size: 13px; color: var(--text); }
.cx-tl-who { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }

/* The agent's own words, when the normalized label doesn't already say the same thing. Kept so a
   reader can always check the classification against what was actually typed. */
.cx-tl-raw {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 4px;
  font-style: italic;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .cx-tl-row { grid-template-columns: 16px 1fr; }
  .cx-tl-when { grid-column: 2; padding-top: 0; }
  .cx-tl-body { grid-column: 2; }
}

/* ══════════════════════════════════════════════════════════════════════════
   No Answer Analysis tab
   Built from the existing tokens only — no new colour values beyond the
   semantic risk ramp, which deliberately does NOT reuse --lime: lime is the
   brand accent everywhere else in this app, and a risk scale that shares it
   would read as branding rather than as severity.
   ══════════════════════════════════════════════════════════════════════════ */

.na-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.na-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.na-toolbar .na-chips { margin: 0; }
.na-search {
  flex: 1 1 220px;
  min-width: 180px;
}

.na-lede {
  color: var(--text-mute);
  font-size: 13.5px;
  line-height: 1.65;
  margin: 0 0 14px;
  max-width: 96ch;
}
.na-lede strong { color: var(--text); font-weight: 600; }

.na-footnote {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
  margin: 10px 0 0;
  max-width: 96ch;
}
.na-footnote strong { color: var(--text-mute); }

.na-subhead {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 22px 0 10px;
  letter-spacing: 0.01em;
}

/* ---- rate bar: volume-aware rate cell ---- */
.na-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 150px;
}
.na-bar-track {
  position: relative;
  flex: 1;
  height: 7px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}
.na-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--text-faint);
}
.na-bar-fill.hot  { background: #E5484D; }
.na-bar-fill.mid  { background: #C9C6D0; }
.na-bar-fill.cool { background: #C6F24E; }
/* baseline marker — the whole point of this cell is that a rate is only readable
   against the population it came from. */
.na-bar-base {
  position: absolute;
  top: -2px;
  width: 1px;
  height: 11px;
  background: var(--text-mute);
  opacity: 0.8;
}
.na-bar-val {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text);
  min-width: 46px;
  text-align: right;
}

.na-up   { color: #ff8f8f; font-weight: 600; }
.na-down { color: #C6F24E; font-weight: 600; }
.na-ci   { color: var(--text-dim); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.na-dim  { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin-right: 6px; }

/* ---- confidence chips ---- */
.na-verdict {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: help;
}
.na-v-confirmed  { background: rgba(255, 111, 111, 0.16); color: #ff8f8f; }
.na-v-suggestive { background: rgba(245, 196, 81, 0.16);  color: #C9C6D0; }
.na-v-ns         { background: var(--panel-2);            color: var(--text-dim); }
.na-v-thin       { background: var(--panel-2);            color: var(--text-faint); }

/* ---- risk tiers ---- */
.na-tier {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.na-t-low   { background: rgba(79, 224, 138, 0.15); color: #C6F24E; }
.na-t-med   { background: rgba(198, 242, 78, 0.14); color: #c6f24e; }
.na-t-high  { background: rgba(245, 196, 81, 0.16); color: #C9C6D0; }
.na-t-vhigh { background: rgba(255, 111, 111, 0.18); color: #ff8f8f; }

.na-status { font-size: 11.5px; font-weight: 600; }
.na-s-cancelled { color: #ff8f8f; }
.na-s-delivered { color: #C6F24E; }
.na-s-open      { color: #6E77F5; }
.na-s-fulfilled { color: var(--text-mute); }

.na-order { font-weight: 600; color: var(--text); }
.na-score { font-variant-numeric: tabular-nums; font-weight: 600; }
.na-lvl {
  font-size: 11px;
  font-weight: 600;
  color: #C9C6D0;
  background: rgba(245, 196, 81, 0.13);
  padding: 2px 7px;
  border-radius: 999px;
}
.na-lvl.none { color: var(--text-faint); background: transparent; }

.na-why {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-mute);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.na-why:hover { color: var(--text); border-color: var(--text-faint); }
.na-why:focus-visible { outline: 2px solid var(--lime); outline-offset: 1px; }

/* ---- actions ---- */
.na-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.na-action {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--lime);
  border-radius: 8px;
  padding: 14px 16px;
}
.na-action h5 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.na-action p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-mute);
}

/* ---- "why this score" modal ---- */
.na-why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 6px;
}
.na-why-grid .na-subhead { margin-top: 0; }
.na-reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.na-reasons li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 4px 10px;
  background: var(--panel-2);
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 12.5px;
}
.na-reasons strong { color: var(--text); font-weight: 600; }
.na-reasons .na-pts {
  grid-row: span 2;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  align-self: start;
}
.na-reasons.pos .na-pts { color: #ff8f8f; }
.na-reasons.neg .na-pts { color: #C6F24E; }
.na-reason-detail {
  grid-column: 2;
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .na-bar { min-width: 110px; }
  .na-toolbar { flex-direction: column; align-items: stretch; }
}

/* Inline drill target inside a table cell — used where the ROW opens one set and a single cell
   opens a narrower one (e.g. the first-contact table: the row is all orders in the bucket, the
   rate cell is the NA4 subset behind that percentage). */
.drillable-inline {
  cursor: pointer;
  border-bottom: 1px dotted var(--text-faint);
}
.drillable-inline:hover {
  color: var(--lime);
  border-bottom-color: var(--lime);
}

/* Trend metric switcher reuses .tms-card from the Logistics tab; only the strip spacing differs. */
.na-chips + .tms-strip { margin-top: 4px; }

/* No Answer tab — filter dropdowns + contact columns */
.na-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.na-filter select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-family: inherit;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  max-width: 240px;
}
.na-filter select:focus {
  outline: none;
  border-color: var(--lime);
}
/* Contact columns: readable but not allowed to blow the table width out. */
.na-contact {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.na-addr {
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Order number as a link into the Shopify admin */
a.na-order {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a.na-order:hover {
  color: var(--lime);
  border-bottom-color: var(--lime);
}
a.na-order:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.na-ext {
  font-size: 9px;
  color: var(--text-faint);
  margin-left: 3px;
  vertical-align: super;
}
a.na-order:hover .na-ext { color: var(--lime); }

.na-clear {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-mute);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-left: 6px;
}
.na-clear:hover { color: var(--text); border-color: var(--text-faint); }

/* Secondary line inside a table cell (Shopify's own status under the derived one, account name
   under a differing recipient name). Namespaced .na-sub rather than .sub — a bare .sub had no rule
   in this stylesheet at all, so the text rendered jammed against the label above it. */
.na-sub {
  display: block;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--text-faint);
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

/* â•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گ
   Accounts & user administration (2026-08-25 — real login system)
   â•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گ */


/* ---- change-password modal ---- */

.acc-form label { display: block; margin-bottom: 12px; }
.acc-form label span {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-mute);
  margin-bottom: 5px;
}
.acc-form input {
  width: 100%;
  padding: 9px 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
}
.acc-form input:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(198, 242, 78, 0.12);
}
.acc-hint { font-size: 11px; color: var(--text-faint); margin: -6px 0 12px; }
.acc-msg { font-size: 12px; min-height: 16px; margin-bottom: 10px; color: var(--text-mute); }
.acc-msg.is-err { color: #E5484D; }
.acc-msg.is-ok { color: #C6F24E; }
.acc-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---- Users tab ---- */

.ua-dim { color: var(--text-mute); }
.ua-error {
  padding: 14px 16px;
  background: rgba(255, 111, 111, 0.1);
  border: 1px solid #5a2626;
  border-radius: 10px;
  color: #E5484D;
  font-size: 13px;
}

.ua-stats { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ua-stat {
  flex: 1;
  min-width: 110px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.ua-stat-n { display: block; font-size: 24px; font-weight: 700; color: var(--lime); line-height: 1.1; }
.ua-stat-l {
  display: block;
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.ua-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 18px;
}
.ua-h3 { margin: 0 0 4px; font-size: 15px; color: var(--text); }
.ua-sub { margin: 0 0 16px; font-size: 12.5px; color: var(--text-mute); line-height: 1.5; }

.ua-form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.ua-form-row label { flex: 1; min-width: 150px; }
.ua-form-row label span {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-mute);
  margin-bottom: 5px;
}
.ua-form-row input,
.ua-form-row select {
  width: 100%;
  padding: 9px 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
}
.ua-form-row input:focus,
.ua-form-row select:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(198, 242, 78, 0.12);
}
.ua-form-msg { font-size: 12px; color: var(--text-mute); margin-top: 10px; min-height: 15px; }
.ua-form-msg.ua-form-err { color: #E5484D; }

.ua-btn {
  padding: 9px 13px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.ua-btn:hover { background: #26262b; border-color: #33333a; }
.ua-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ua-btn-primary {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
  font-weight: 700;
}
.ua-btn-primary:hover { background: var(--lime-hi); border-color: var(--lime-hi); }
.ua-btn-danger:hover { background: rgba(255, 111, 111, 0.12); border-color: #5a2626; color: #E5484D; }

/* one-time temporary-password hand-off banner */
.ua-handoff {
  background: linear-gradient(140deg, rgba(198, 242, 78, 0.1), rgba(198, 242, 78, 0.03));
  border: 1px solid rgba(198, 242, 78, 0.35);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
  animation: hgtFadeUp 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.ua-handoff-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ua-handoff-head strong { font-size: 14px; color: var(--lime); }
.ua-handoff-note { font-size: 12.5px; color: var(--text-mute); line-height: 1.55; margin: 8px 0 14px; }
.ua-handoff-note strong { color: var(--text); }
.ua-x {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.ua-x:hover { color: var(--text); }
.ua-cred { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ua-cred code {
  flex: 1;
  min-width: 180px;
  padding: 11px 14px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--lime);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.5px;
  user-select: all;
}
.ua-copy {
  padding: 11px 16px;
  background: var(--lime);
  border: none;
  border-radius: 9px;
  color: var(--on-lime);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.ua-copy:hover { background: var(--lime-hi); }

/* accounts table */
.ua-table-wrap { overflow-x: auto; }
.ua-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ua-table th {
  text-align: left;
  padding: 9px 12px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ua-table td { padding: 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.ua-table tr:last-child td { border-bottom: none; }
.ua-row-off { opacity: 0.5; }

.ua-person { display: flex; align-items: center; gap: 10px; }
.ua-avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--lime);
  font-size: 11px;
  font-weight: 700;
}
.ua-name { display: block; font-weight: 600; color: var(--text); }
.ua-username { display: block; font-size: 11.5px; color: var(--text-faint); }
.ua-you {
  font-size: 9.5px;
  font-weight: 700;
  background: var(--lime);
  color: var(--on-lime);
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ua-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.ua-badge-admin { background: rgba(198, 242, 78, 0.14); color: var(--lime); }
.ua-badge-viewer { background: var(--panel-2); color: var(--text-mute); }
.ua-badge-ok { background: rgba(79, 224, 138, 0.12); color: #C6F24E; }
.ua-badge-off { background: rgba(255, 111, 111, 0.12); color: #E5484D; }
.ua-badge-lock { background: rgba(240, 180, 41, 0.14); color: #C9C6D0; }
.ua-badge-temp { background: rgba(240, 180, 41, 0.14); color: #C9C6D0; }

.ua-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ua-actions .ua-btn { padding: 6px 10px; font-size: 11.5px; }
.ua-selfnote { font-size: 11.5px; font-style: italic; }

@media (max-width: 720px) {
  .ua-form-row { flex-direction: column; align-items: stretch; }
  .ua-form-row label { min-width: 0; }
  .ua-stats { gap: 8px; }
  .ua-stat { min-width: 90px; padding: 12px; }
}


/* â•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گ
   Scrollbars (2026-08-25)

   The OS default paints a light-grey slab against this dark theme — loudest on the
   sidebar, whose scrollbar sits directly beside the nav. Styled to recede: the track
   disappears into whatever surface it's on, and the thumb only becomes obvious when
   you're reaching for it.

   Both engines need covering. Firefox does not support ::-webkit-scrollbar at all and
   only honours scrollbar-width / scrollbar-color; Chromium/Safari honour the pseudo-
   elements. Neither property inherits, so the * selector is what actually reaches every
   scroll container (.sidebar, .content, .drill-table-scroll, .ua-table-wrap, …) rather
   than just the root.
   â•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گâ•گ */

* {
  scrollbar-width: thin;
  scrollbar-color: #33333a transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #33333a;
  border-radius: 999px;
  /* A transparent border clipped to the padding box keeps the VISIBLE rail thin while the
     grabbable hit area stays a comfortable 10px — styling the thumb thin directly would
     make it fiddly to catch with a mouse. */
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #45454f;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Lime only on the active drag — ties the control to the theme at the one moment it's
   deliberately the focus, without competing with the accent everywhere else. */
::-webkit-scrollbar-thumb:active {
  background: #c6f24e;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Where a horizontal and vertical bar meet (wide tables); left unpainted so it doesn't
   show up as a grey notch in the corner. */
::-webkit-scrollbar-corner {
  background: transparent;
}


/* ============================================================================
   HGT BI design-system primitives (Claude Design) — reusable architecture
   ========================================================================= */

body.hgt {
  font-family: var(--hgt-font, "Poppins", system-ui, sans-serif);
  background: var(--hgt-bg, var(--bg));
  color: var(--hgt-text, var(--text));
}

.hgt-screen { max-width: var(--hgt-content-max); margin: 0; display: flex; flex-direction: column; gap: var(--hgt-section-gap); }
.hgt-screen.is-wide { max-width: var(--hgt-content-max-wide); }
.hgt-screen.is-system { max-width: 1040px; }

.hgt-eyebrow {
  font-size: var(--hgt-fs-micro); font-weight: 600; letter-spacing: var(--hgt-ls-micro);
  text-transform: uppercase; color: var(--hgt-text-subtle); margin-bottom: 8px;
}
.hgt-qualifier { font-size: var(--hgt-fs-caption); color: var(--hgt-text-subtle); margin: 4px 0 0; line-height: 1.45; }
.hgt-section-head { margin-bottom: 12px; }

/* Ledger */
.hgt-ledger { background: var(--hgt-surface-1); border: 1px solid var(--hgt-border); border-radius: var(--hgt-r-lg); overflow: hidden; }
.hgt-ledger-head, .hgt-ledger-row {
  display: grid; grid-template-columns: minmax(160px, 1.6fr) repeat(3, minmax(88px, 1fr)) 84px 24px;
  gap: 8px; align-items: center; padding: 9px 18px; border-bottom: 1px solid var(--hgt-border-row);
}
.hgt-ledger-head { background: var(--hgt-surface-2); font-size: var(--hgt-fs-micro); font-weight: 600; text-transform: uppercase; letter-spacing: var(--hgt-ls-micro); color: var(--hgt-text-subtle); }
.hgt-ledger-group { padding: 12px 18px 6px; font-size: 9.5px; font-weight: 600; letter-spacing: var(--hgt-ls-group); text-transform: uppercase; color: var(--hgt-text-faint); }
.hgt-ledger-row:hover { background: var(--hgt-hover-fill); }
.hgt-ledger-row.is-total { background: var(--hgt-lime-row); font-weight: 600; }
.hgt-ledger-val, .hgt-ledger-prior, .hgt-ledger-change { text-align: right; font-variant-numeric: tabular-nums; }
.hgt-ledger-prior { color: var(--hgt-text-secondary); }
.hgt-ledger-metric { color: var(--hgt-text); display: flex; align-items: center; gap: 6px; min-width: 0; }
.hgt-ledger-go { text-align: right; color: var(--hgt-border-hover); }

/* Filter bar + chips */
.hgt-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.hgt-add-filter {
  border: 1px dashed var(--hgt-border-strong); background: transparent; color: var(--hgt-text-muted);
  border-radius: var(--hgt-r-md); padding: 7px 12px; font-size: 11.5px; cursor: pointer;
}
.hgt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hgt-chip {
  background: var(--hgt-blue-tint); border: 1px solid rgba(110,119,245,.34); color: var(--hgt-text-secondary);
  border-radius: var(--hgt-r-md); padding: 5px 10px; font-size: var(--hgt-fs-micro); font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
}
.hgt-chip-field { color: var(--hgt-blue-pale); }
.hgt-chip-x { margin-left: 4px; opacity: 0.7; }
.hgt-clear-filters, .hgt-filter-count { font-size: var(--hgt-fs-caption); color: var(--hgt-text-muted); background: none; border: none; cursor: pointer; }

/* Comparison */
.hgt-compare { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.hgt-compare-label { font-size: var(--hgt-fs-caption); color: var(--hgt-text-muted); }
.hgt-seg-track { display: inline-flex; padding: 2px; background: var(--hgt-surface-2); border: 1px solid var(--hgt-border); border-radius: var(--hgt-r-md); gap: 2px; }
.hgt-seg { border: none; background: transparent; color: var(--hgt-text-muted); border-radius: var(--hgt-r-sm); padding: 6px 12px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
/* Badges / dots / empty / change */
.hgt-dot-risk { background: var(--hgt-warning); }
.hgt-dot-info { background: var(--hgt-info); }
.hgt-dot-nodata { background: var(--hgt-unavailable); }
.hgt-badge { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; padding: 3px 9px; border-radius: var(--hgt-r-sm); text-transform: uppercase; }
.hgt-badge-healthy { background: var(--hgt-lime-tint); color: var(--hgt-lime); }
.hgt-badge-lost { background: var(--hgt-negative-tint); color: var(--hgt-negative); }
.hgt-badge-risk { background: var(--hgt-warning-tint); color: var(--hgt-warning); }
.hgt-badge-info { background: var(--hgt-info-tint); color: var(--hgt-info); }
.hgt-badge-nodata { background: rgba(87,84,94,.18); color: var(--hgt-unavailable); }
.hgt-empty { color: var(--hgt-text-faint); font-variant-numeric: tabular-nums; }
.hgt-change.is-good { color: var(--hgt-lime); }
.hgt-change.is-bad { color: var(--hgt-negative); }

/* Buttons */
.hgt-btn { border-radius: var(--hgt-r-md); padding: 9px 16px; font-weight: 600; font-size: 12.5px; cursor: pointer; border: 1px solid transparent; font-family: inherit; }
.hgt-btn-primary { background: var(--hgt-lime); color: var(--hgt-on-lime); }
.hgt-btn-primary:hover { background: var(--hgt-lime-hover); }
.hgt-btn-secondary { background: transparent; border-color: var(--hgt-border-strong); color: var(--hgt-text-secondary); }
.hgt-btn-secondary:hover { border-color: var(--hgt-border-hover); background: rgba(255,255,255,.02); }
.hgt-btn-danger { background: transparent; border-color: rgba(229,72,77,.34); color: var(--hgt-negative); }

/* States */
.hgt-blocked, .hgt-error { padding: var(--hgt-panel-pad); border: 1px solid var(--hgt-border); border-radius: var(--hgt-r-lg); background: var(--hgt-surface-1); }
.hgt-blocked-value { font-size: var(--hgt-fs-metric-lg); margin: 8px 0; }
.hgt-blocked-reason, .hgt-error p { color: var(--hgt-text-muted); font-size: var(--hgt-fs-body); }
.hgt-blocked-steps { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.hgt-blocked-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--hgt-fs-caption); color: var(--hgt-text-secondary); }
.hgt-step-n { width: 18px; height: 18px; border-radius: 50%; background: var(--hgt-surface-3); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.hgt-method { border-left: 2px solid var(--hgt-blue-light); padding: 8px 14px; margin: 12px 0; background: rgba(43,50,203,.06); border-radius: 0 var(--hgt-r) var(--hgt-r) 0; }
.hgt-method summary { cursor: pointer; font-size: var(--hgt-fs-caption); color: var(--hgt-text-secondary); font-weight: 600; }
.hgt-method-body { margin-top: 8px; font-size: var(--hgt-fs-caption); color: var(--hgt-text-muted); line-height: var(--hgt-lh-prose); }


/* Heatmap design-system restyle */
.lg-heatmap-wrap { overflow-x: auto; }
.lg-heatmap { min-width: 640px; width: 100%; border-collapse: collapse; }
.lg-heatmap th { background: var(--hgt-surface-2); font-size: var(--hgt-fs-micro); text-transform: uppercase; letter-spacing: var(--hgt-ls-micro); color: var(--hgt-text-subtle); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--hgt-border-row); }
.lg-heatmap td { padding: 8px 12px; border-bottom: 1px solid var(--hgt-border-row); font-variant-numeric: tabular-nums; }
.lg-heatmap .lg-unassigned td { color: var(--hgt-text-faint); font-style: italic; }
.lg-heat-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 0; font-size: var(--hgt-fs-caption); color: var(--hgt-text-muted); }
.lg-heat-legend i { display: inline-block; width: 28px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.hgt-heat-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-bottom: 12px; font-size: var(--hgt-fs-caption); color: var(--hgt-text-muted);
}
.hgt-heat-swatch { width: 36px; height: 10px; border-radius: 2px; display: inline-block; }
.hgt-heat-bad { background: hsl(0 62% 42% / 0.55); }
.hgt-heat-mid { background: hsl(65 50% 42% / 0.45); }
.hgt-heat-good { background: hsl(130 62% 42% / 0.55); }
.hgt-heat-legend-note { margin-left: 8px; color: var(--hgt-text-faint); }
.hgt-pending-ads {
  display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
  padding: 10px 14px; border: 1px solid var(--hgt-border-row); border-radius: var(--hgt-r-md);
  background: var(--hgt-surface-2); font-size: var(--hgt-fs-caption); color: var(--hgt-text-muted);
}


@media (max-width: 1199px) {
  .hgt-ledger-head, .hgt-ledger-row { grid-template-columns: minmax(120px, 1.4fr) minmax(72px, 1fr) minmax(72px, 1fr) 20px; }
  .hgt-ledger-head > :nth-child(3), .hgt-ledger-row .hgt-ledger-prior,
  .hgt-ledger-head > :nth-child(5), .hgt-ledger-row .hgt-ledger-trend { display: none; }
  .hgt-hero-figure { font-size: var(--hgt-fs-hero); }
  .hgt-topbar { margin: 0; }
}







.section, .panel, .card-panel {
  background: var(--hgt-surface-1) !important;
  border: 1px solid var(--hgt-border) !important;
  border-radius: var(--hgt-r-lg) !important;
  padding: var(--hgt-panel-pad, 20px 26px 22px) !important;
  box-shadow: none !important;
  margin-bottom: 18px;
}
.section h3, .section-header h3, .section-title {
  font-size: var(--hgt-fs-h2, 13.5px) !important;
  font-weight: 600 !important;
  color: var(--hgt-text) !important;
}

.drill-table .hgt-td,
.cmp-table .hgt-td {
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

.date-filter-group button {
  border-radius: var(--hgt-r-md) !important;
  border: 1px solid var(--hgt-border) !important;
  background: var(--hgt-surface-2) !important;
  color: var(--hgt-text-muted) !important;
  font-weight: 600 !important;
}
.date-filter-group button.active {
  background: var(--hgt-blue-tint) !important;
  border-color: rgba(110, 119, 245, 0.34) !important;
  color: var(--hgt-blue-pale) !important;
}

.hgt-sync .warn, .status-warn, .hgt-caveat--negative {
  color: var(--hgt-warning) !important;
}
.hgt-caveat, .info-banner, .hgt-pending-ads {
  border-radius: var(--hgt-r-md) !important;
  border: 1px solid var(--hgt-border-row) !important;
  background: var(--hgt-surface-2) !important;
}

.hgt-grid--kpi, .hgt-hero, .hgt-metricbar, .section {
  animation: hgtFadeUp 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .hgt-grid--kpi, .hgt-hero, .hgt-metricbar, .section { animation: none !important; }
}

/* === HGT HANDOFF COMPLETION PASS 2026-08-27b === */
@media (max-width: 900px) {
  .hgt-topbar { padding-inline: 14px; gap: 10px; }
  .hgt-grid--kpi, .tiles { grid-template-columns: 1fr 1fr; }
  .modal, .drill-modal, .modal-panel, .drill-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
}
@media (max-width: 560px) {
  .page-header h1 { font-size: 1.35rem; }
  .filters { flex-wrap: wrap; }
}
.page-shell, .tab-panel, .hgt-main > .panel, main .panel {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
.table-wrap, .table-scroll, .data-table-wrap, .drill-body, .drill-table-scroll, .ua-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
:focus-visible {
  outline: 2px solid var(--hgt-focus-ring, var(--lime, #C6F24E));
  outline-offset: 2px;
}
.login-card {
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(198,242,78,.10), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(110,119,245,.10), transparent 50%),
    var(--hgt-bg-elevated, #14141A) !important;
  border: 1px solid var(--hgt-border-subtle, rgba(255,255,255,.08)) !important;
  box-shadow: var(--hgt-shadow-panel, 0 18px 50px rgba(0,0,0,.45)) !important;
}

/* === CEO PROTOTYPE LAYOUT (Claude Design) 2026-08-27c === */
.ceo-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(118deg, #101015 0%, #0C0C10 52%, #08080B 100%);
  border: 1px solid var(--hgt-border, #1E1D24);
  border-radius: 14px;
  padding: 28px 30px;
  margin-bottom: 14px;
}
.ceo-hero-glow {
  position: absolute; right: -90px; top: -130px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(110,119,245,0.07) 0%, transparent 62%);
  pointer-events: none;
}
.ceo-hero-grid {
  position: relative;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 40px; flex-wrap: wrap;
}
.ceo-hero-main { min-width: 290px; }
.ceo-hero-figure {
  display: flex; align-items: baseline; gap: 10px;
  margin-top: 10px;
  font-size: 46px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.05;
  color: var(--hgt-text, #EDEAEF);
}
.ceo-hero-figure .hgt-currency {
  font-size: 15px; font-weight: 500; color: var(--hgt-text-subtle, #57545E);
}
.ceo-hero-change { display: flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 12.5px; }
.ceo-hero-quals {
  display: flex; gap: 28px; flex-wrap: wrap; padding-top: 4px; align-items: flex-start;
}
.ceo-qual { min-width: 110px; }
.ceo-qual-label, .ceo-qual-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--hgt-text-subtle, #6E6B76); font-weight: 600;
}
.ceo-qual-value {
  font-size: 24px; font-weight: 600; color: var(--hgt-text, #EDEAEF);
  margin-top: 7px; display: flex; align-items: center; gap: 7px;
}
.ceo-qual-sub { font-size: 11px; color: var(--hgt-text-muted, #8B8792); margin-top: 3px; max-width: 18ch; }
.ceo-hero-spark { flex: none; }
.ceo-spark-caption {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 10px; color: var(--hgt-text-subtle, #6E6B76); margin-top: 5px;
}
.ceo-section { margin-bottom: 28px; }
.ceo-sec-head {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.ceo-sec-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--hgt-text, #EDEAEF); }
.ceo-sec-sub { font-size: 11.5px; color: var(--hgt-text-subtle, #6E6B76); }
.ceo-sec-link {
  margin-left: auto; background: none; border: none; padding: 0;
  font: inherit; font-size: 11.5px; color: var(--hgt-blue, #6E77F5); cursor: pointer;
}
.ceo-sec-link:hover { color: var(--hgt-text, #EDEAEF); }
.ceo-split {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px; margin-bottom: 34px;
}
.ceo-panel {
  background: var(--hgt-surface-1, #0C0C10);
  border: 1px solid var(--hgt-border, #1E1D24);
  border-radius: 14px; padding: 22px 24px;
  height: calc(100% - 0px); box-sizing: border-box;
}
.ceo-panel-kicker {
  display: flex; align-items: center; gap: 9px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--hgt-text-muted, #8B8792); font-weight: 600;
}
.ceo-panel-emdash {
  font-size: 34px; font-weight: 600; color: var(--hgt-text-subtle, #57545E);
  margin-top: 14px; letter-spacing: -0.02em;
}
.ceo-panel-value { font-size: 34px; font-weight: 600; margin-top: 14px; }
.ceo-panel-copy, .ceo-panel-copy {
  font-size: 12.5px; color: var(--hgt-text-secondary, #C9C6D0);
  line-height: 1.65; margin: 12px 0 0;
}
.ceo-steps {
  display: flex; flex-direction: column; gap: 9px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--hgt-border, #1E1D24);
}
.ceo-step { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; color: var(--hgt-text-secondary, #C9C6D0); line-height: 1.55; }
.ceo-step-n {
  flex: none; width: 17px; height: 17px; border-radius: 5px;
  background: #111016; border: 1px solid var(--hgt-border, #1E1D24);
  color: var(--hgt-text-muted, #8B8792); font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.ceo-btn-ghost {
  background: transparent; color: var(--hgt-text-secondary, #C9C6D0);
  border: 1px solid #2A2833; border-radius: 9px;
  padding: 8px 14px; font-size: 12px; font-family: inherit;
  cursor: pointer; margin-top: 16px;
}
.ceo-btn-ghost:hover { border-color: #3A3841; color: var(--hgt-text, #EDEAEF); }
.ceo-funnel-row { display: flex; gap: 26px; flex-wrap: wrap; }
.ceo-funnel-metric { flex: 1; min-width: 150px; }
.ceo-funnel-value { font-size: 28px; font-weight: 600; margin-top: 11px; letter-spacing: -0.02em; }
.ceo-funnel-track {
  height: 6px; background: #16161B; border-radius: 999px; overflow: hidden; margin-top: 12px;
}
.ceo-funnel-fill {
  height: 100%; background: var(--hgt-blue, #2B32CB); border-radius: 999px;
}
.ceo-funnel-note {
  display: flex; align-items: flex-start; gap: 9px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--hgt-border, #1E1D24);
}
.ceo-funnel-note p { margin: 0; font-size: 11.5px; color: var(--hgt-text-muted, #8B8792); line-height: 1.6; }
.ceo-info-i {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: #16161B;
  color: #6E6B76; font-size: 9.5px; font-style: italic; margin-top: 1px;
}
.hgt-muted { color: var(--hgt-text-muted, #8B8792); font-size: 12px; }
.hgt-eyebrow {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--hgt-text-muted, #8B8792); font-weight: 600;
}
@media (max-width: 900px) {
  .ceo-hero-figure { font-size: 34px; }
  .ceo-hero-quals { gap: 18px; }
  .ceo-split { grid-template-columns: 1fr; }
}

/* ---- Table column fallback ------------------------------------------------
   hgt-ui.js emits `--hgt-cols:N` and defaults colsClass to .hgt-cols--fit.
   hgt-bi-components.css defines nineteen named templates but no --fit, so any
   table without a named template got `display:grid` with no columns and every
   cell stacked into its own row. Track 1 is declared explicitly and the rest
   are auto-created as equal columns in the same row, which works for any N
   (repeat() cannot take a calc() count). Named tables should still use their
   own template from components.css in preference to this. ----------------- */
.hgt-cols--fit {
  grid-template-columns: minmax(0, 1.7fr);
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

/* ---- Collapsed methodology panels -----------------------------------------
   methodologyBanner() now emits <details class="hgt-context">, closed. The
   negative tone variant is not in components.css, so it lives here. -------- */
.hgt-context--negative { border-left-color: var(--hgt-red); }
.hgt-context--negative .hgt-context-title { color: var(--hgt-red); }
.hgt-context-summary { list-style: none; display: flex; align-items: center; gap: 8px; }
.hgt-context-summary::-webkit-details-marker { display: none; }
.hgt-context-summary::after {
  content: "▸"; margin-left: auto; font-size: 10px;
  color: var(--hgt-text-faint); transition: transform var(--hgt-dur-fast) var(--hgt-ease);
}
.hgt-context[open] .hgt-context-summary::after { transform: rotate(90deg); }

/* ---- KPI cards must not overflow their own track ---------------------------
   .hgt-grid--kpi is repeat(auto-fit, minmax(196px, 1fr)). A long figure such as
   "EGP 2,218,407" is wider than 196px, so the track grew past its share and a
   five-card row wrapped to four-plus-one with dead space beside it. min-width:0
   lets the track hold its 1fr share; the figure scales with the container. -- */
.hgt-grid--kpi > .hgt-kpi { min-width: 0; }
.hgt-kpi-value { overflow-wrap: anywhere; }

/* ---- Merged-section sub-panels --------------------------------------------
   SCREENS.md merges several screens' sibling sections into one card holding
   two or three labelled panels (Revenue build, Where the orders stand, Mix &
   pace). A sub-panel is a label plus its content — never another boxed card,
   per README: "a section is ONE unified card ... never nest another boxed
   panel inside it". ------------------------------------------------------- */
.hgt-subpanel { min-width: 0; }
.hgt-subpanel > .hgt-eyebrow { margin-bottom: 10px; }
.hgt-subpanel .section { margin-bottom: 0; background: none; border: 0; padding: 0; box-shadow: none; }

/* ---- Metric bar: reserve the real track count ------------------------------
   .hgt-metricbar is repeat(auto-fit, minmax(178px, 1fr)), which sizes tracks
   from the container without knowing the lead cell spans two columns. A
   five-cell bar with a lead therefore needed six slots in a five-track grid and
   wrapped, leaving a half-empty second row. metricBar() now emits the true slot
   count; minmax(0,1fr) lets the tracks shrink to fit rather than wrap. Above
   900px only — below that components.css stacks the bar on purpose. -------- */
@media (min-width: 900px) {
  .hgt-metricbar[style*="--hgt-mb-tracks"] {
    grid-template-columns: repeat(var(--hgt-mb-tracks), minmax(0, 1fr));
  }
}

/* ══ Executive Summary — corrections against the design frame ═══════════════ */

/* Wider content. The tokens cap narrative screens at 1180 and tables at 1240,
   which left a large dead band on a 1900px display. Raised, not removed — text
   still has a comfortable measure. */
:root {
  --hgt-content-max: 1360px;
  --hgt-content-max-wide: 1460px;
}

/* Revenue build column header — the design labels Component / Share / EGP. */
.hgt-keyrow--head {
  border-bottom: 1px solid var(--hgt-border);
  padding-bottom: 8px;
}
.hgt-keyrow--head .hgt-keyrow-name,
.hgt-keyrow--head .hgt-keyrow-share,
.hgt-keyrow--head .hgt-keyrow-value {
  font-size: var(--hgt-fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--hgt-ls-micro);
  color: var(--hgt-text-subtle);
  font-weight: var(--hgt-fw-semibold);
}

/* A keyrow is flex; without min-width:0 a long name refuses to shrink and the
   value rides over it. That is what collided in the recovery legend. */
.hgt-keyrow-name { min-width: 0; }
.hgt-keyrow-value { white-space: nowrap; }
.hgt-keyrow-share { white-space: nowrap; }

/* Recovery donut: the legend needs the remaining width, and below ~430px the
   pair should stack rather than crush. */
.hgt-donut-wrap > .hgt-flex-1 { flex: 1 1 220px; min-width: 0; }
@media (max-width: 1180px) {
  .hgt-grid--split .hgt-donut-wrap { flex-direction: column; align-items: stretch; }
}

/* Stacked-bar segments: keep the number readable and never let it spill. */
.hgt-stack-seg {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

/* Mix & pace panels sit in a three-column grid; stretch them so the shortest
   does not leave a ragged bottom edge, and flatten anything the projection
   module boxes internally — a section is ONE card (README). */
.hgt-grid--thirds { align-items: stretch; }
.hgt-grid--thirds > .hgt-panel { display: flex; flex-direction: column; }
.hgt-grid--thirds .card,
.hgt-grid--thirds .stat-tile,
.hgt-grid--thirds .kpi-card {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* The section head can carry an action on the right (design: "All insights →"). */
.section-header { align-items: baseline; }
.hgt-section-action {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--hgt-blue-light);
  font-family: inherit;
  font-size: var(--hgt-fs-caption);
  cursor: pointer;
}
.hgt-section-action:hover { color: var(--hgt-text); }

/* ══ Mobile density ═════════════════════════════════════════════════════════
   At 375x812 the fixed top bar (63) plus the sticky desktop top bar (132) plus
   the bottom nav (114) held 309px — 38% of the screen — before a single figure.
   Favelin fits several metrics per screen because its chrome is ~80px. -----*/
@media (max-width: 599px) {

  /* 1 — The desktop top bar scrolls away. .hgt-mob-top already carries the
         brand, screen name, TOTAL/NET and the account, so pinning the sync line
         and the date presets on top of it duplicated the identity and cost
         132px permanently. */
  .hgt-topbar {
    position: static;
    top: auto;
    padding: 10px 0 6px;
  }
  .hgt-sync { font-size: 11px; }

  /* 2 — Bottom bar: the label row was 54px for one line of 9px text. */
  .hgt-mob-nav-lbl { padding: 5px 14px 1px; font-size: 8.5px; }
  .hgt-mob-nav-scroll { padding: 4px 10px calc(6px + env(safe-area-inset-bottom)); gap: 6px; }
  .hgt-mnav { padding: 7px 12px; font-size: 11.5px; }
  .hgt-main { padding-bottom: 78px; }

  /* 3 — Denser sections. Panel padding is token-driven (.hgt-panel and the
         legacy .section rule both read --hgt-panel-pad, the latter with
         !important), so the token is the only thing worth changing here. */
  :root {
    --hgt-panel-pad: 12px 13px 14px;
    --hgt-panel-pad-tight: 10px 11px;
  }
  .hgt-screen { gap: 14px; }
  .section-header { margin-bottom: 10px; }
  .section h3, .hgt-section-title { font-size: 12px; }
  .tab-subtitle, .hgt-section-qual { font-size: 11px; }

  /* 4 — Two metrics across, the way Favelin does it. Small cards pair; wide
         panels (a statement, a chart) still take the full width. */
  .hgt-grid--kpi,
  .hgt-grid--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hgt-grid--kpi > .hgt-kpi { padding: 12px 12px 13px; }
  .hgt-kpi-value, .hgt-kpi-figure .hgt-kpi-value { font-size: 22px; }
  .hgt-kpi-label { font-size: 9px; }

  /* 5 — The hero's own qualifier row pairs up rather than stacking four deep. */
  .hgt-hero-quals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .hgt-hero-figure { font-size: 30px; }

  /* 7 — The legacy card grids stack one-up on a phone, which is what made a
         six-card section 824px tall. Two across, like Favelin. */
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-grid > .card, .card-grid > .stat-tile { padding: 11px 12px; }
  .card-grid .card-value, .card-grid .stat-tile-value { font-size: 20px; }

  /* 8 — A section header of title + subtitle ran to 76px before any content. */
  .section-header { margin-bottom: 8px; row-gap: 2px; }
  .section-header h3 { line-height: 1.25; }

  /* 9 — The nav label row held one line of 8.5px text in 50px. */
  .hgt-mob-nav-lbl { line-height: 1.2; }
  .hgt-mob-nav-lbl > * { line-height: 1.2; }

  /* 10 — Over time's four-stat footer is the tallest thing under the chart. */
  .hgt-divide-top { gap: 10px; padding-top: 10px; }
  .hgt-fig--metric-sm { font-size: 17px; }
  .hgt-hero-qual-note { font-size: 10.5px; }

  /* 6 — Sub-panels inside a merged section stack, but tightly. */
  .hgt-subpanel > .hgt-eyebrow { margin-bottom: 6px; }
  .hgt-grid--panel, .hgt-grid--thirds, .hgt-grid--split { gap: 12px; }
}

/* ══ Round 3 — reported defects ═════════════════════════════════════════════ */

/* Eighteen drill columns need a wide min-width so the wrapper scrolls instead of
   crushing. components.css ships w740/w820/w880 only. */
.hgt-table--w1600 { min-width: 1600px; }

/* The pager was two bare chevrons. Give it room and make the position legible. */
.hgt-pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hgt-pager-pos { font-size: var(--hgt-fs-caption); color: var(--hgt-text-secondary); white-space: nowrap; }
.hgt-pager-pos b { color: var(--hgt-text); }
.hgt-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Hero spark: the hit targets that carry each day's tooltip. */
.hgt-spark-dot { cursor: crosshair; }
.hgt-hero-spark svg { width: 100%; }
.hgt-hero-spark { flex: 1 1 300px; min-width: 260px; }

/* The mobile TOTAL/NET pair did not visibly change state when tapped. */
.hgt-mode-btn.is-active,
.hgt-mode-btn[aria-pressed="true"] {
  background: var(--hgt-surface-3);
  color: var(--hgt-lime);
  font-weight: var(--hgt-fw-semibold);
}

@media (max-width: 899px) {
  /* "What is leaking" is a 1.75fr/1fr split — the table and the donut crushed each
     other on a phone. Two stacked panels, table first. */
  .hgt-grid--split { grid-template-columns: minmax(0, 1fr); }
  .hgt-grid--split > .hgt-panel { min-width: 0; }
  .hgt-donut-wrap { flex-direction: row; align-items: center; }
}

@media (max-width: 599px) {
  /* Stacked-bar values: below this width most bands cannot hold their digits, so
     the legend carries the number instead and the bar stays a clean proportion. */
  .hgt-stack-seg { font-size: 10px; }
  .hgt-donut { width: 118px; height: 118px; }
  .hgt-donut-wrap { gap: 12px; }
  /* The drill table is unusable stacked at 18 columns — let it scroll. */
  .drill-table-scroll { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 599px) {
  /* Segment values cannot fit most bands at 283px — the legend beneath already
     carries every number, so the bar stays a clean proportion. */
  .hgt-stack-seg { font-size: 0; }
  .hgt-stack-seg::after { content: ""; }
  /* Decorative glow wider than the viewport; contained rather than clipped. */
  .ceo-hero-glow { max-width: 100%; }
}

/* Meta Ads campaigns now use the design's own .hgt-cols--campaigns template
   (nine columns). w1180 gives it a floor so the wrapper still scrolls on a
   narrow viewport rather than crushing the campaign name. */
.hgt-table--w1180 { min-width: 1180px; }

/* Hero spark hover — marker plus a readout in the axis line. */
.hgt-spark-marker { fill: var(--hgt-lime); stroke: var(--hgt-bg); stroke-width: 1.5; transition: none; }
.hgt-spark-dot { cursor: crosshair; }
.hgt-spark-readout { font-variant-numeric: tabular-nums; color: var(--hgt-text-secondary); }
[data-spark-host] { cursor: crosshair; }

/* Drill table: eighteen columns need explicit widths, not a squeezed auto-fit.
   The wrapper scrolls; every column keeps enough room for its own content so no
   two values can ever sit on top of each other. */
.drill-table .hgt-tr {
  grid-template-columns:
    132px  /* order      */ 128px  /* placed     */ 168px /* customer */
    148px  /* phone      */ 150px  /* city/area  */ 300px /* full address */
    150px  /* detected   */ 132px  /* property   */ 108px /* total */
    100px  /* shipping   */  84px  /* pay        */ 132px /* created by */
    140px  /* confirm    */ 132px  /* delivery   */ 140px /* fulfillment */
    140px  /* deliv date */ 120px  /* courier    */ 110px /* journey */;
}
.drill-table .hgt-td, .drill-table .hgt-th { min-width: 0; padding-right: 14px; }
.drill-table .hgt-td { overflow-wrap: anywhere; }
.hgt-table--w2420 { min-width: 2420px; }

/* Meta "Daily spend vs revenue" — the frame's chart. Bars are spend, the line is
   Meta-attributed revenue, on independent scales. */
.hgt-chart-host { position: relative; }
.hgt-chart-hit { cursor: crosshair; }
.hgt-chart-host .hgt-legend-hint { font-variant-numeric: tabular-nums; }
