/* ─── Retention page (assets/js/retention.js) ──────────
   Card shell, pill toggles and control labels come from .ov-scope
   (orders-lower.css); this only adds the page's own pieces. Theme
   tokens only, so light and dark both work. */

.ret-page { display: flex; flex-direction: column; gap: 16px; }

/* ─── Each card's own filter row ─────────────────────── */

/* Dropdowns open over the rest of the card and the cards below. */
.ret-page .ret-card > .card { overflow: visible; }
.ret-page .ret-card:has(.multiselect-panel.show, .cd-panel.show) { position: relative; z-index: 20; }
.ret-filter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ret-filter-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ret-ms .multiselect-trigger { min-width: 150px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ret-ms .multiselect-trigger.is-filtered { border-color: var(--primary); color: var(--primary); }
/* Anchored under its own trigger (the global filter lane's panels are
   position: fixed for a reason that doesn't apply here). */
.ret-ms { position: relative; }
.ret-ms .multiselect-panel { position: absolute; top: calc(100% + 6px); left: 0; max-width: calc(100vw - 32px); z-index: 30; }
.ret-ms-search {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  margin-bottom: 6px;
}
.ret-ms-actions { display: flex; align-items: center; gap: 6px; width: 100%; }
.ret-ms-hint { margin-left: auto; font-size: 10.5px; color: var(--text-muted); }
.ret-ms-option label { display: flex; align-items: center; gap: 8px; width: 100%; }
.ret-ms-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ret-ms-count { color: var(--text-muted); font-size: 11px; }
.ret-ms-empty { padding: 10px 12px; font-size: 12px; color: var(--text-muted); }

/* ─── Cards ──────────────────────────────────────────── */

.ret-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; }
.ret-table-scroll { max-height: 560px; overflow: auto; }

.ret-table th, .ret-table td { white-space: nowrap; }
.ret-table th:first-child, .ret-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-surface);
}
.ret-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bg-surface-2); }
.ret-table thead th:first-child { z-index: 3; }
.ret-table .table-total-row td { background: var(--bg-surface-2); }

/* A value counting only part of its row (young customers left out), or a
   month still in progress. */
.ret-partial { text-decoration: underline dotted; text-underline-offset: 3px; }
.ret-partial-key { text-decoration: underline dotted; text-underline-offset: 3px; font-weight: 700; }
.ret-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.ret-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }

.ret-chart { position: relative; width: 100%; }

.ret-banner {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--warning-bg);
  color: var(--text-primary);
  font-size: 12.5px;
}
.ret-waiting { padding: 36px 20px; text-align: center; color: var(--text-muted); min-height: 120px; }
.ret-retry { margin-left: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); font-weight: 600; cursor: pointer; }
.ret-retry:hover { border-color: var(--primary); color: var(--primary); }

/* Time to Nth order: periods across the top, metrics down the side. */

.ret-select { min-width: 130px; }

/* Time to Nth order: the headline band above the table / charts. */
.ret-nth-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--bg-surface-2) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border-subtle);
}
.ret-nth-lede { font-size: 14px; line-height: 1.55; color: var(--text-secondary); max-width: 95ch; }
.ret-nth-lede strong { color: var(--text-primary); font-weight: 800; }
.ret-nth-empty { padding: 18px; color: var(--text-muted); font-size: 13px; }
.ret-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ret-stat { padding: 10px 12px; border-radius: 10px; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.ret-stat-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.ret-stat-value { margin-top: 4px; font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.01em; }
.ret-stat-value small { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-left: 2px; }
.ret-stat-note { margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.ret-spectrum { display: flex; height: 26px; border-radius: 8px; overflow: hidden; gap: 2px; background: var(--bg-surface); }
.ret-spec-seg {
  display: flex; align-items: center; justify-content: center; min-width: 2px;
  font-size: 11px; font-weight: 800;
}
.ret-spectrum-axis { display: flex; gap: 2px; margin-top: -8px; font-size: 10.5px; color: var(--text-muted); }
.ret-spectrum-axis span { text-align: center; overflow: hidden; white-space: nowrap; }

/* Periods whose customers haven't had long enough yet. */

.ret-young-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--warning); background: var(--warning-bg); vertical-align: 1px;
}

.ret-na, .ret-na-key {
  background-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--border) 5px 6px);
}
.ret-na-key { display: inline-block; width: 18px; height: 10px; border-radius: 3px; vertical-align: -1px; border: 1px solid var(--border); }
.ret-zero { color: var(--text-dim); }

/* Time to Nth order: metrics as columns, periods › View As as rows. */
.ret-nth-scroll { max-height: 640px; }
.ret-nth-table thead tr.ret-colgroups th {
  position: static;
  padding-top: 10px; padding-bottom: 4px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); text-align: center; background: var(--bg-surface);
  border-bottom: 2px solid var(--border-subtle);
}
.ret-nth-table thead tr.ret-colgroups th:empty { border-bottom: 0; }
.ret-nth-table .ret-row-label { min-width: 220px; max-width: 340px; }
.ret-row-label { display: table-cell; white-space: nowrap; }
.ret-nth-table thead th.ret-row-label { overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--border-subtle); }
.ret-row-name { display: inline-block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.ret-tw {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-right: 6px; padding: 0; vertical-align: middle;
  border: 1px solid var(--border); border-radius: 5px; background: var(--bg-surface-2);
  color: var(--text-secondary); font-size: 10px; line-height: 1; cursor: pointer;
}
.ret-tw:hover { border-color: var(--primary); color: var(--primary); }
.ret-tw-pad { display: inline-block; width: 24px; }
.ret-nth-table tr.ret-lvl-0 td { font-weight: 700; }
.ret-nth-table tr.ret-lvl-0 td.ret-row-label { color: var(--text-primary); }
.ret-nth-table tr.ret-lvl-1 td, .ret-nth-table tr.ret-lvl-2 td, .ret-nth-table tr.ret-lvl-3 td { font-size: 12px; }
.ret-nth-table tr.ret-lvl-2 td.ret-row-label, .ret-nth-table tr.ret-lvl-3 td.ret-row-label { color: var(--text-secondary); }
.ret-nth-table tr.ret-lvl-0 { border-top: 1px solid var(--border); }
.ret-rowbtns { display: flex; gap: 6px; }

/* Time to Nth order — graph view (Trend / Compare / Timing). */
.ret-g { display: flex; flex-direction: column; gap: 14px; }
.ret-g-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ret-g-title { font-size: 16px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.01em; }
.ret-g-sub { margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--text-muted); max-width: 110ch; }

/* Order movement: chart + "Periods to chart" side panel. */
.ret-mv { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: stretch; }
.ret-mv-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ret-mv-side {
  display: flex; flex-direction: column; gap: 10px; min-height: 0;
  padding: 14px; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-surface);
}
.ret-mv-side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ret-mv-side-head .btn-icon-text { white-space: nowrap; padding: 4px 6px; }
.ret-mv-side-title { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.ret-mv-side-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.ret-mv-search {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-surface-2); color: var(--text-primary); font-size: 12.5px;
}
.ret-mv-list { display: flex; flex-direction: column; overflow-y: auto; max-height: 360px; margin: 0 -6px; }
.ret-fullscreen .ret-mv-list { max-height: calc(100vh - 470px); min-height: 300px; }
/* Full screen: the chart takes the height the filters leave. */
.ret-chart-full { height: max(420px, calc(100vh - 470px)); }
.ret-mv-item {
  display: grid; grid-template-columns: 18px 16px 10px minmax(0, 1fr) auto; align-items: center; gap: 7px;
  padding: 7px 6px; border-radius: 8px; cursor: pointer;
}
.ret-mv-item[hidden] { display: none; }
.ret-mv-item:hover { background: var(--bg-hover); }
.ret-mv-item input { margin: 0; accent-color: var(--primary); }
.ret-mv-item .ret-dot { margin: 0; }
.ret-mv-text { display: flex; flex-direction: column; min-width: 0; }
.ret-mv-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); overflow-wrap: anywhere; }
.ret-mv-item.is-on .ret-mv-label { font-weight: 800; color: var(--text-primary); }
.ret-mv-label em { font-style: normal; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); margin-left: 4px; }
.ret-mv-text small { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ret-mv-val { font-size: 12px; color: var(--text-secondary); text-align: right; }
.ret-mv-item .ret-tw { margin: 0; }
.ret-mv-item .ret-tw-pad { width: 18px; }
.ret-zoom-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 26px; margin-bottom: -6px; font-size: 11.5px; color: var(--text-muted); }
.ret-mv-foot { font-size: 11px; color: var(--text-muted); line-height: 1.45; }

/* Movement › Split by: drill path above the chart. */
.ret-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12.5px; }
.ret-crumb {
  border: 1px solid var(--border); background: var(--bg-surface-2); color: var(--text-secondary);
  border-radius: 999px; padding: 3px 10px; font: inherit; font-weight: 700; cursor: pointer; max-width: 280px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ret-crumb:hover { border-color: var(--primary); color: var(--primary); }
.ret-crumb.is-here { background: var(--primary-light); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, transparent); cursor: default; }
.ret-crumb-sep { color: var(--text-muted); }
.ret-crumb-hint { color: var(--text-muted); font-size: 11.5px; margin-left: 4px; }
.ret-zoom-bar .btn-icon-text[disabled] { opacity: 0.4; cursor: default; }
.ret-mv-searchbox {
  display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-surface-2); color: var(--text-muted);
}
.ret-mv-searchbox:focus-within { border-color: var(--primary); }
.ret-mv-searchbox .ret-mv-search { border: 0; background: transparent; padding: 8px 0; outline: none; }
.ret-mv-modes { align-self: flex-start; }
.ret-mv-modes .segment-btn { padding: 3px 10px; font-size: 11.5px; }
.ret-mv-empty { padding: 10px 6px; font-size: 12px; color: var(--text-muted); }

/* Full screen: the card in an overlay over the whole window. */
.ret-fullscreen {
  position: fixed; inset: 12px; z-index: 900; overflow: auto;
  border-radius: 18px; box-shadow: var(--shadow-lg); background: var(--bg-surface);
}
.ret-fullscreen .ret-card > .card { min-height: 100%; margin: 0; }

@media (max-width: 640px) {
  .ret-ms .multiselect-trigger { min-width: 0; }
   .ret-mv { grid-template-columns: 1fr; }
}

/* ─── Breakdown tables ───────────────────────────────── */

.ri-rec { padding: 2px 8px; font-size: 11.5px; }

/* ─── Customer records (inline drill-down) ───────────── */

.ri-rec-bar { align-items: center; }
.ri-count { font-size: 13px; color: var(--text-secondary); margin-right: auto; }
.ri-pager { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.ri-pager .btn-icon-text[disabled] { opacity: 0.4; cursor: default; }
.ri-ellip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ri-caret { display: inline-block; width: 14px; color: var(--text-muted); }
.ri-tl-row > td { background: var(--bg-surface-2); padding: 8px 14px 12px 34px; }
.ri-tl { border-collapse: collapse; font-size: 12px; }
.ri-tl th { text-align: left; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 4px 14px 4px 0; }
.ri-tl td { padding: 3px 14px 3px 0; color: var(--text-secondary); }

/* ─── Retention page (retention-analytics.js) ────────── */
.ra-section { scroll-margin-top: 16px; }
.ra-section > .card { overflow: visible; }
.ra-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px 4px; }
.ra-q { display: flex; gap: 12px; align-items: flex-start; min-width: 0; flex: 1 1 420px; }
.ra-no {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary); font-size: 13px; font-weight: 800; margin-top: 1px;
}
.ra-q h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.01em; }
.ra-q p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); max-width: 90ch; }
.ra-q-inline { align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.ra-q-inline h3 { display: inline-flex; align-items: center; white-space: nowrap; }
.ra-title-i { width: 17px; height: 17px; margin-left: 7px; font-size: 11px; }
.ra-head-verdict { flex: 1 1 480px; min-width: 0; }
.ra-head-verdict .ra-verdict { margin: 0; padding: 7px 12px; font-size: 13px; line-height: 1.45; }

.ra-body { display: flex; flex-direction: column; gap: 12px; padding: 12px 20px 20px; }

.ra-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 24px; }
.ra-mini-title { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.ra-mini-ctl { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ra-mini-ctl .segment-btn { padding: 3px 10px; font-size: 11.5px; }
.ra-chips-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ra-chips-label { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-right: 2px; }
.ra-pick {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.ra-pick .ret-dot { margin: 0; opacity: 0.35; }
.ra-pick.is-on { color: var(--text-primary); border-color: var(--text-secondary); }
.ra-pick.is-on .ret-dot { opacity: 1; }
.ra-pick-n { font-size: 10.5px; color: var(--text-muted); }

/* Months as columns, metrics as rows. */
.ra-mtable th.ra-mcol, .ra-mtable td.ra-mcol { min-width: 210px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-mtable .ra-tot { background: var(--bg-surface-2); border-left: 1px solid var(--border-subtle); }
.ra-mtable tr.ra-trow-group td {
  padding-top: 14px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-muted); background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle);
}
.ra-mtable tr.ra-trow-sub td.ra-mcol { padding-left: 24px; font-weight: 500; color: var(--text-secondary); }

.ra-detail {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; scroll-margin-top: 16px;
  border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; background: var(--bg-surface-2);
}
.ra-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ra-detail-title { font-size: 14px; font-weight: 800; color: var(--text-primary); }

/* Time to Nth order: months as columns. */
.ret-flip tr.ret-flip-group td {
  padding-top: 14px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-muted); background: var(--bg-surface);
}
.ret-flip th.ret-young .ret-young-tag { display: block; width: fit-content; margin: 3px 0 0 auto; }
.ret-flip .ret-flip-total { background: var(--bg-surface-2); font-weight: 700; }

@media (max-width: 760px) {
  .ra-two { grid-template-columns: 1fr; }
  .ra-head, .ra-body { padding-left: 14px; padding-right: 14px; }
}

/* Change cells: better / worse, and values not judged. */
.ri-up, .ret-page table.data-table td.ri-up { color: var(--success); font-weight: 700; }
.ri-down, .ret-page table.data-table td.ri-down { color: var(--danger); font-weight: 700; }

/* Anything that lists its customers when clicked. */
.ret-click { cursor: pointer; }
.ret-page td.ret-click:hover { box-shadow: inset 0 0 0 2px var(--primary-glow); }
.ri-row { cursor: pointer; }
.ri-row:hover td { background: var(--bg-hover); }

/* ─── Each card's own filters ────────────────────────── */
.ret-page .ra-section:has(.multiselect-panel.show, .cd-panel.show) { position: relative; z-index: 20; }
.ra-filters-wrap { padding: 10px 20px 12px; border-bottom: 1px solid var(--border-subtle); }
.ra-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.ra-filters .ret-ms .multiselect-trigger { min-width: 128px; max-width: 200px; }
.ra-filters .segment-btn { padding: 5px 11px; }
.ra-view-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: 10px 16px; }
/* The verdict and the card's controls share one row (controls on the right). */
.ra-lead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ra-lead > .ra-verdict { flex: 1 1 520px; margin: 0; }
.ra-lead > .ra-view-row { margin-left: 0; justify-content: flex-start; }

/* ─── The verdict ────────────────────────────────────── */
.ra-verdict {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border-subtle); background: var(--bg-surface-2); font-size: 13.5px; line-height: 1.55; color: var(--text-secondary);
}
.ra-verdict strong { color: var(--text-primary); }
.ra-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.01em; white-space: nowrap; margin-top: 1px;
}
.ra-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ra-verdict.is-good { border-color: color-mix(in srgb, var(--success) 35%, transparent); background: var(--success-bg); }
.ra-verdict.is-good .ra-pill { color: var(--success); background: var(--bg-surface); }
.ra-verdict.is-bad { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-bg); }
.ra-verdict.is-bad .ra-pill { color: var(--danger); background: var(--bg-surface); }
.ra-verdict.is-steady .ra-pill { color: var(--info); background: var(--info-bg); }
.ra-verdict.is-early .ra-pill { color: var(--warning); background: var(--warning-bg); }
.ra-good-t { color: var(--success); font-weight: 800; }
.ra-bad-t { color: var(--danger); font-weight: 800; }
.ra-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.ra-stat { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-surface); border-top: 3px solid var(--border); }
.ra-stat.is-good { border-top-color: var(--success); }
.ra-stat.is-bad { border-top-color: var(--danger); }
.ra-stat-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.ra-stat-value { margin-top: 3px; font-size: 20px; font-weight: 800; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ra-stat-value small { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.ra-stat-note { margin-top: 2px; font-size: 11.5px; color: var(--text-muted); }
.ra-stat.is-good .ra-stat-note { color: var(--success); }
.ra-stat.is-bad .ra-stat-note { color: var(--danger); }
.ra-hint { font-weight: 500; color: var(--text-muted); font-size: 11.5px; margin-left: 6px; }

.ra-verdict em { font-style: normal; color: var(--text-muted); }

/* ─── Card 1 pivot ───────────────────────────────────── */
.ra-pivot-scroll { max-height: 720px; }
.ra-pivot tr.ra-node td { background: var(--bg-surface-2); border-top: 1px solid var(--border); }
.ra-pivot tr.ra-node-0 td { background: var(--primary-light); }
.ra-pivot tr.ra-node td.ra-mcol { color: var(--text-primary); }
.ra-pivot tr.ra-node .ret-tw { margin-right: 8px; }
.ra-pivot td.ra-mcol { position: sticky; left: 0; z-index: 1; background: var(--bg-surface); }

/* ─── Cards 3 and 4 (the shared frame, chart + rows panel) ─ */
.ra-cp .ra-view-row { justify-content: flex-start; }
.ra-cp select.ra-cp-more {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer; font-family: inherit; font-size: 11.5px; font-weight: 600;
  padding-right: 22px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 11px) 52%, calc(100% - 7px) 52%; background-size: 4px 4px; background-repeat: no-repeat;
}
.ra-cp select.ra-cp-more:not(.active) { background-color: transparent; }
.ra-cp .cc-ctrl .multiselect-trigger { min-width: 190px; }
.ra-cp .cc-key .ra-dash-key { margin-right: 5px; vertical-align: middle; }
.ra-cp .cc-label small { display: block; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.ra-cp .ret-chart { margin-top: 4px; }
.ra-cp .cg-inline-host { margin-top: 14px; }
.ra-cp .ret-table-scroll { margin-top: 14px; }
.ra-cp .cc-ins-row { margin-top: 2px; }

/* Full screen */
body:has(.ra-section.ra-full) { overflow: hidden; }
.ra-section.ra-full {
  position: fixed; inset: 12px; z-index: 900; overflow: auto; margin: 0;
  border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(15, 12, 10, 0.45), var(--shadow-lg); background: var(--bg-surface);
}
.ra-section.ra-full .card { min-height: 100%; margin: 0; border: 0; }
.ra-close {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none;
  border: 1px solid var(--border); border-radius: 50%; background: var(--bg-surface); color: var(--text-secondary); cursor: pointer;
}
.ra-close:hover { color: var(--primary); border-color: var(--primary); }

.ra-cp .ra-chart-empty { display: flex; align-items: center; justify-content: center; margin-top: 4px; border: 1px dashed var(--border-subtle); border-radius: 12px; }
.ra-cp .ra-cp-loading { margin-top: 14px; }
.ra-cp .ra-ins-ph { min-height: 170px; }
.ra-cp .ra-legend-ph { min-height: 30px; }

/* ─── Retention brief (top of the page) ───────────────── */
.rb { margin: 18px 0 0; scroll-margin-top: 16px; }
.rb.rb-kpis { margin: 0 0 18px; }
.rb.rb-kpis .rb-pillars { margin-bottom: 0; }
.rb-head { margin: 4px 0 10px; }
.rb-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text-primary); }
.rb-head p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); max-width: 120ch; }
.rb-verdict { margin-bottom: 12px; padding: 12px 16px; border: 1px solid var(--border); border-left-width: 1px; border-radius: var(--radius-md); background: var(--bg-surface); box-shadow: inset 0 3px 0 var(--primary); font-size: 14.5px; font-weight: 700; line-height: 1.45; color: var(--text-primary); }
.rb-pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rb-pillar { display: grid; gap: 8px; align-content: start; }
.rb-pl { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.rb-kpi { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; }
.rb-kl { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); }
.rb-kv { margin: 3px 0 2px; font-size: 21px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.rb-kd { font-size: 11.5px; font-weight: 700; color: var(--text-secondary); }
.rb-kd.bad { color: var(--danger); }
.rb-kd.good { color: var(--success); }
.rb-kw { margin-top: 2px; font-size: 10.5px; color: var(--text-muted); }
.rb-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.rb-col { --tone: var(--text-secondary); display: grid; gap: 8px; }
.rb-col[data-t="good"] { --tone: var(--success); }
.rb-col[data-t="bad"] { --tone: var(--danger); }
.rb-col[data-t="lack"] { --tone: var(--warning); }
.rb-ch { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 2px solid var(--tone, var(--primary)); font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--tone, var(--text-primary)); }
.rb-ch span { padding: 0 7px; border-radius: 999px; background: var(--bg-surface-2); border: 1px solid var(--border); font-size: 11px; color: var(--text-secondary); }
.rb-item { display: flex; flex-direction: column; gap: 5px; padding: 11px 13px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.rb-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rb-item h4 { margin: 0; font-size: 13.5px; font-weight: 800; line-height: 1.3; color: var(--text-primary); }
.rb-chip { flex-shrink: 0; padding: 2px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-surface-2); font-size: 11.5px; font-weight: 800; color: var(--tone); white-space: nowrap; }
.rb-ev { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-secondary); }
.rb-why { font-size: 12px; color: var(--text-secondary); }
.rb-why summary { cursor: pointer; font-weight: 700; color: var(--text-primary); }
.rb-why ol { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; line-height: 1.4; }
.rb-do { margin: 2px 0 0; padding-top: 6px; border-top: 1px dashed var(--border); font-size: 12px; line-height: 1.4; font-weight: 600; color: var(--text-primary); }
.rb-do b { color: var(--primary); }
.rb-cv { margin: 0; font-size: 11px; font-style: italic; color: var(--text-muted); }
.rb-none { margin: 0; font-size: 12px; color: var(--text-muted); }
.rb-link { align-self: flex-start; padding: 0; border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--primary); cursor: pointer; }
.rb-link:hover { text-decoration: underline; }
.rb-focus { margin-top: 14px; padding: 12px 16px 14px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.rb-focus .rb-ch { --tone: var(--primary); }
.rb-focus > ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 20px; }
.rb-focus > ol > li { display: flex; gap: 10px; }
.rb-fn { flex-shrink: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; }
.rb-focus h4 { margin: 2px 0 2px; font-size: 13.5px; font-weight: 800; color: var(--text-primary); }
.rb-ft { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--primary); }
.rb-focus ul { margin: 0; padding-left: 16px; display: grid; gap: 4px; font-size: 12px; line-height: 1.4; color: var(--text-secondary); }
.rb-foot { margin-top: 8px; font-size: 11.5px; color: var(--text-muted); }
.rb-dl { font-weight: 700; }
.ra-sub-pct { margin-left: 4px; font-size: 11px; color: var(--text-muted); }

/* ─── Loyal Customers: how to read the card ──────────── */
.ly-guide { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface-2); box-shadow: inset 0 3px 0 var(--primary); }
.ly-gh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; width: 100%; margin: 0 0 8px; padding: 0; border: 0; background: none; text-align: left; font: inherit; font-size: 12.5px; font-weight: 800; color: var(--text-primary); cursor: pointer; }
.ly-gh em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.ly-gh:hover em { color: var(--primary); }
.ly-gh-caret { width: 10px; color: var(--text-muted); }
.ly-guide.is-closed { padding-top: 8px; padding-bottom: 8px; }
.ly-guide.is-closed .ly-gh { margin: 0; }
.ly-gh span { font-size: 12px; font-weight: 700; color: var(--primary); }
.ly-guide dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 22px; margin: 0; }
.ly-guide dl > div { display: grid; grid-template-columns: 118px 1fr; gap: 8px; align-items: baseline; }
.ly-guide dt { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--text-primary); }
.ly-guide dt i { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.ly-guide dd { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-secondary); }

/* ─── Orders page: who was due to order ───────────────── */
.op-card { margin-top: 4px; }
.op-card .ra-head { align-items: center; }
.op-table td.ra-mcol { min-width: 250px; }
.op-table tr.op-due > td { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.op-table tr.ra-trow-group td { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.op-list { font-weight: 700; color: var(--primary); white-space: nowrap; }
.op-ly { margin-left: 6px; font-size: 11px; font-weight: 700; }
.op-ly.down { color: var(--danger); }
.op-ly.up { color: var(--success); }
.op-i { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 5px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--bg-surface); color: var(--text-muted); font: italic 700 10px/1 Georgia, serif; vertical-align: 1px; cursor: help; }
.op-i:hover, .op-i:focus-visible { border-color: var(--primary); color: var(--primary); }
.op-tip { position: fixed; z-index: 9999; display: none; max-width: 300px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--text-primary); color: var(--bg-surface); font-size: 12px; font-weight: 500; line-height: 1.45; text-transform: none; letter-spacing: 0; box-shadow: var(--shadow-md); pointer-events: none; }
.op-help-btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-surface); font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-primary); cursor: pointer; white-space: nowrap; }
.op-help-btn:hover, .op-help-btn.is-on { border-color: var(--primary); color: var(--primary); }
.op-i-dot { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--primary); color: #fff; font: italic 700 11px/1 Georgia, serif; }
.op-help { margin: 0 20px 6px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface-2); box-shadow: inset 0 3px 0 var(--primary); }
.op-help-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.op-help-head h3 { margin: 0; font-size: 14px; font-weight: 800; color: var(--text-primary); }
.op-help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px 24px; }
.op-help h4 { margin: 0 0 4px; font-size: 12.5px; font-weight: 800; color: var(--primary); }
.op-help p, .op-help li { margin: 0 0 4px; font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.op-help ul { margin: 0; padding-left: 16px; }
.op-help b { color: var(--text-primary); }
.op-card .cg-inline-host { margin-top: 12px; }
.op-card .cc-row .op-i { margin-left: 2px; }
/* twisty · name · (i) · value · List — on one line */
.op-card .cc-row { grid-template-columns: 18px minmax(0, 1fr) auto auto auto; }
.op-card .cc-row .op-list { font-size: 11.5px; }
.op-rows-h { margin: 10px 0 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.op-ly-toggle { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
/* Orders page, forecast vs actual (order-forecast.js) */
.fc-card { margin-top: 18px; }
.fc-trust { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-surface-2); font-size: 12px; color: var(--text-secondary); }
.fc-trust b { color: var(--text-primary); }
.fc-chip { padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-surface); font-size: 11px; color: var(--text-secondary); }
.fc-chip.is-off { color: var(--danger); }
.fc-trust-note { color: var(--text-muted); }
.fc-tiles { margin-bottom: 12px; }
.fc-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; margin-bottom: 12px; }
.fc-box { min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-surface); }
.fc-box h4 { display: flex; align-items: center; gap: 4px; margin: 0 0 6px; font-size: 12.5px; font-weight: 800; color: var(--text-primary); }
.fc-reset-line { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--primary); }
.fc-canvas { position: relative; height: 290px; }
.fc-ab { max-height: 290px; }
.fc-scroll { max-height: none; }
.fc-table th { white-space: nowrap; }
.fc-table td.ra-mcol { min-width: 230px; }
.fc-table td small { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); }
.fc-table tr.fc-row, .fc-table tr.fc-total { cursor: pointer; }
.fc-table tr.fc-row:hover > td { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.fc-table tr.is-on > td { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.fc-table tr.fc-total > td { font-weight: 800; border-top: 2px solid var(--border); }
.fc-bar { position: relative; width: 120px; height: 8px; border-radius: 4px; background: var(--bg-surface-2); overflow: visible; }
.fc-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--primary); opacity: .85; }
.fc-bar > em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-primary); }
@media (max-width: 900px) { .fc-grid { grid-template-columns: 1fr; } }
/* Loyal card: the customer-base tree (+ opens a row, numbers download) and Activity */
.ly-plus, .ly-plus-pad { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 8px; vertical-align: top; margin-top: 1px; flex-shrink: 0; }
.ly-plus { padding: 0; border: 1px solid var(--primary); border-radius: 4px; background: var(--bg-surface); color: var(--primary); font: 800 12px/1 var(--font-mono, monospace); cursor: pointer; }
.ly-plus:hover { background: var(--primary); color: #fff; }
.ly-lab { display: inline-block; vertical-align: top; }
/* Normal view: the tree scrolls inside its own box (as tall as the screen
   allows) with the month row and the row names pinned, like full screen. */
.ly-tree.ret-table-scroll { max-height: calc(100vh - 120px); }  /* until the card is boxed (card-tools.js) */
.ly-tree tbody tr > td.ra-mcol { position: sticky; left: 0; z-index: 1; background: var(--bg-surface); }
.ly-tree thead th.ra-mcol { left: 0; z-index: 3; }
.ly-tree tr.ly-sec td { position: static; }
.ly-tree td small, .ly-act td small, .ly-act th small { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.ly-tree td.ra-mcol { min-width: 330px; max-width: 380px; white-space: normal; }
.ly-tree .ly-lab { max-width: calc(100% - 26px); }
.ly-tree tr.ly-top > td { background: var(--bg-surface); }
.ly-tree tr.ly-top > td.ra-mcol { box-shadow: inset 3px 0 0 var(--ly-c, transparent); }
.ly-tree tr.ly-d1 > td, .ly-tree tr.ly-d2 > td { font-size: 12px; }
.ly-tree tr.ly-d2 > td { color: var(--text-secondary); }
.ly-tree tr.ly-bad td.mono { color: var(--danger); }
.ly-tree tr.ly-good td.mono { color: var(--success); }
.ly-tree tr.ly-sec td { padding-top: 12px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); background: var(--bg-surface-2); }
.ly-cell { cursor: pointer; }
.ly-cell:hover { text-decoration: underline; color: var(--primary); }
.ly-dl { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-surface); color: var(--primary); font-weight: 800; font-size: 12px; cursor: pointer; }
.ly-dl:hover { border-color: var(--primary); }
.ly-act .ra-sub-pct { display: block; }
.ly-act tr.ly-act-tot > td { font-weight: 800; border-top: 2px solid var(--border); }
/* Every card: ↓ download / ⤢ expand (card-tools.js) */
.ct-desc { display: none !important; }
.ct-i { width: 16px; height: 16px; margin-left: 7px; font-size: 10.5px; vertical-align: 2px; }
.ct-tools { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; flex-shrink: 0; }
.ra-head > .ct-tools { margin-left: auto; padding-left: 8px; }
body.ct-has-full { overflow: hidden; }
body.ct-has-full :has(.ct-full) { transform: none !important; filter: none !important; animation: none !important; contain: none !important; }
.ct-full { position: fixed !important; inset: 12px; z-index: 900; margin: 0 !important; overflow: auto; border-radius: 18px; background: var(--bg-surface); box-shadow: 0 0 0 100vmax rgba(15, 12, 10, .45), var(--shadow-md); }
.ct-full.card, .ct-full > .card { min-height: 100%; }
.ct-full .table-scroll, .ct-full .ret-table-scroll { max-height: none; }
.ct-full .ct-pin { position: sticky; z-index: 6; background: var(--bg-surface); }
/* Full screen with a table: everything above it stays, only the table scrolls
   (rows down, months across) under its own header row. */
.ct-full.ct-tablemode { display: flex; flex-direction: column; overflow: hidden; }
.ct-boxed { display: flex; flex-direction: column; height: calc(100vh - 84px); min-height: 560px; overflow: hidden; }
.ct-boxed > .card { overflow: hidden; }
.ct-tablemode .ct-col { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.ct-tablemode .ct-col > * { flex-shrink: 0; }
.ct-tablemode .ct-col > .ct-col, .ct-tablemode .ct-col > .ct-scroll { flex: 1 1 auto; min-height: 0; }
.ct-tablemode .ct-scroll { overflow: auto !important; max-height: none !important; }
.ct-tablemode .ct-scroll thead th { position: sticky; top: 0; z-index: 3; background: var(--bg-surface-2, var(--bg-surface)); }
.ct-tablemode .ct-scroll tbody tr > :first-child { position: sticky; left: 0; z-index: 2; background: var(--bg-surface); }
.ct-tablemode .ct-scroll thead th:first-child { left: 0; z-index: 4; }
.ct-full .ra-lead.ct-pin, .ct-full .ra-view-row.ct-pin { padding-bottom: 8px; box-shadow: 0 8px 10px -10px rgba(15, 12, 10, .35); }
/* Customer lists: Marketing or Ads (customer-export.js) */
.cx-overlay { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 16px; background: rgba(15, 12, 10, .45); }
.cx-box { width: min(520px, 100%); padding: 18px 20px; border-radius: 16px; background: var(--bg-surface); box-shadow: var(--shadow-md); }
.cx-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.cx-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text-primary); }
.cx-head p { margin: 3px 0 0; font-size: 12px; color: var(--text-muted); }
.cx-x { width: 30px; height: 30px; flex-shrink: 0; }
.cx-options { display: grid; gap: 10px; }
.cx-opt { display: grid; gap: 3px; padding: 12px 14px; text-align: left; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface); font: inherit; cursor: pointer; }
.cx-opt b { font-size: 13.5px; color: var(--text-primary); }
.cx-opt span { font-size: 12px; line-height: 1.45; color: var(--text-secondary); }
.cx-opt:hover:not(:disabled) { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.cx-opt:disabled { opacity: .55; cursor: default; }
.cx-note { position: fixed; left: 50%; bottom: 24px; z-index: 1300; display: none; padding: 9px 16px; transform: translateX(-50%); border-radius: 999px; background: var(--text-primary); color: var(--bg-surface); font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-md); }
.cx-note.is-error { background: var(--danger); color: #fff; }
.cx-text { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.cx-actions { display: flex; justify-content: flex-end; }
.cx-ok { width: auto; padding: 8px 22px; }
.export-access-check { align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.45; }
/* Loyal card: a row's trend in a popup (retention-analytics.js openLyPop) */
.ly-lab-link { cursor: pointer; }
.ly-lab-link:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.ly-pop-box { width: min(1000px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.ly-pop-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ly-pop-dl { font-weight: 700; color: var(--primary); }
.ly-pop-chart { position: relative; height: 340px; }
.ly-pop-ins { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface-2); box-shadow: inset 0 3px 0 var(--primary); }
.ly-pop-ins h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 800; color: var(--primary); }
.ly-pop-ins ul { margin: 0; padding-left: 18px; }
.ly-pop-ins li { margin: 0 0 5px; font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); }
.ly-pop-ins b { color: var(--text-primary); }
.op-table .ly-plus { margin-right: 8px; vertical-align: -2px; }

/* Loyal card: Create chart (retention-analytics.js cbRender) */
.cb-open { font-weight: 700; color: var(--primary); }
.cb-box { width: min(1180px, 100%); }
.cb-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin-bottom: 12px; }
.cb-bar .ret-select { max-width: 360px; }
.cb-bar .ly-pop-dl { margin-left: auto; }
.cb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; }
.cb-grid .ly-pop-chart { height: 420px; }
.cb-lines { max-height: 420px; overflow: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface-2); }
.cb-lines-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12px; }
.cb-line { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 2px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.cb-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-line em { font-style: normal; font-size: 11px; color: var(--text-muted); }
@media (max-width: 900px) { .cb-grid { grid-template-columns: 1fr; } }

.fc-table .fc-cell { cursor: pointer; }
.fc-table .fc-cell:hover { color: var(--primary); text-decoration: underline; }
/* Search inside long dropdowns (card-tools.js DropdownSearch) */
.ms-search-box { padding: 8px 10px 6px; position: sticky; top: 0; z-index: 2; background: var(--bg-surface); }
.ms-gen-search { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-surface-2); font: inherit; font-size: 12.5px; color: var(--text-primary); }
.ms-gen-search:focus { outline: none; border-color: var(--primary); }
