/* Rory Tenant portal — same bones as the admin portal, but white-labeled:
   app.js sets --brand / --brand-soft from the institution's theming contract
   after sign-in (fills identical light/dark; this portal is light-only, so
   the accent color is unused here). Defaults are the Rory ultramarine. */

/* Deliberately more serious than the member app: ink topbar, cooler
   neutrals, deeper contrast — the darker end of the Rory palette
   (ink #14161f / deep ultramarine #212ec9), so a CU ops screen never
   reads as consumer UI. */
:root {
  --brand: #212ec9;
  --brand-soft: #e6e8f4;
  --ink: #14161f;
  --ink-2: #4c5162;
  --topbar: #14161f;
  --topbar-ink: #f2f3f8;
  --topbar-muted: #9aa0b2;
  --line: #d9dce6;
  --bg: #eef0f5;
  --card: #ffffff;
  --danger: #c93b3b;
  /* Green is reserved for money that settled; one green, one tint. */
  --success: #0C814D;
  --success-soft: #eefaf3;
  /* Reserved status palette (never the brand series hue). */
  --status-settled: var(--success);
  --status-processing: #9aa1b4;
  --status-returned: var(--danger);
  --radius: 10px;
  font-family: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  /* Rory design-system tokens (docs/design-system.html) used by the home + 360. */
  --tint: #ECEFFF; --divider: #E5E8F2; --ground: #F7F8FE; --surface: #fff;
  --success-tint: #E7F6EE; --danger-tint: #FDECEA; --warn-tint: #FEF4E6; --warn-ink: #B45309;
  --r-card: 20px; --r-compact: 16px; --r-pill: 99px; --r-control: 14px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.error { color: var(--danger); }
h1, h2, h3 { margin: 0; font-weight: 650; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }

/* Login gate */
.gate { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 32px; overflow: hidden; background: #0a1029; isolation: isolate; }
.gate::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at center, rgba(10, 16, 41, 0.08) 30%, rgba(10, 16, 41, 0.42) 100%); }
.gate-art { position: absolute; inset: 0; z-index: 0; }
.gate-art img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.gate-card { position: relative; z-index: 2; background: rgba(255, 255, 255, 0.97); border: 1px solid rgba(152, 162, 255, 0.42); border-radius: 20px; padding: 40px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36); }
.gate-mark { width: 56px; height: 56px; margin: 0 auto; border-radius: 15px; background: var(--brand); color: #fff; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gate-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gate-card .env-chip { margin: 0 auto; }
.gate-card input { text-align: center; }

/* Shell: dark ink topbar — the "back office" signal. The tenant's brand
   color survives only in the logo mark and primary actions. */
.topbar { display: flex; align-items: center; gap: 24px; padding: 13px 24px; background: var(--topbar); color: var(--topbar-ink); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: 0.01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.tab { border: 0; background: none; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--topbar-muted); cursor: pointer; }
.tab:hover { color: var(--topbar-ink); }
.tab.active { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; }
.whoami { font-size: 12px; color: var(--topbar-muted); }
.topbar .btn.ghost { color: var(--topbar-muted); }
.topbar .btn.ghost:hover { color: var(--topbar-ink); }
.env-chip { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 999px; }
.env-chip.staging { background: #4a3d14; color: #f3d489; }
.env-chip.production { background: #4a1d1d; color: #f3a1a1; }
.env-chip.local { background: rgba(255,255,255,0.12); color: var(--topbar-muted); }
.env-switch { width: auto; font-size: 12px; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); color: var(--topbar-ink); }

.view { display: flex; gap: 24px; padding: 24px; align-items: flex-start; }
.list-pane { flex: 1; min-width: 0; }
.pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }

/* Stat tiles — hero numbers in ink, never in the series color. */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .stat-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .stat-label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.stat .stat-sub { font-size: 11px; color: var(--ink-2); margin-top: 4px; }
.stat .stat-value.empty { color: var(--ink-2); font-weight: 500; }

/* Chart card: status-stacked bars (reserved status palette, never the
   brand series hue), 2px surface gaps between segments, rounded data-end,
   recessive gridlines with a dollar scale, hover tooltip. */
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
.dashboard-chart-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.dashboard-chart-grid .chart-card { min-width: 0; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.gran-toggle { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.gran-toggle button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.gran-toggle button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.chart-legend { display: flex; gap: 16px; margin-bottom: 10px; font-size: 12px; color: var(--ink-2); }
.chart-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.bar-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--line); position: relative; margin-top: 18px; }
.grid-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.grid-line span { position: absolute; right: 0; top: -16px; font-size: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; cursor: default; padding: 0 5px; position: relative; z-index: 1; }
.bar-col .seg { min-height: 2px; }
.bar-col .seg + .seg { margin-top: 2px; }
.bar-col .seg.returned { background: var(--status-returned); border-radius: 4px 4px 0 0; }
.bar-col .seg.processing { background: var(--status-processing); }
.bar-col .seg:first-of-type { border-radius: 4px 4px 0 0; }
.bar-col .seg.settled { background: var(--status-settled); }
.bar-col.zero .seg { background: var(--line); }
.bar-col:hover .seg { filter: brightness(0.88); }
.peak-label { position: absolute; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-labels { display: flex; gap: 2px; margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--ink-2); padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-tip { position: fixed; background: var(--ink); color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 8px; pointer-events: none; z-index: 30; white-space: nowrap; line-height: 1.5; }
.wallet-share-card { display: flex; flex-direction: column; }
.wallet-share-body { flex: 1; display: flex; align-items: center; justify-content: center; gap: clamp(18px, 3vw, 34px); min-height: 190px; }
.wallet-share-chart { --debit-angle: 0deg; position: relative; width: 154px; aspect-ratio: 1; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--brand) 0 var(--debit-angle), var(--status-processing) var(--debit-angle) 360deg); box-shadow: inset 0 0 0 1px rgba(10, 16, 41, 0.06); }
.wallet-share-chart::after { content: ""; position: absolute; inset: 28px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.wallet-share-chart.empty { background: var(--bg); }
.wallet-share-center { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.wallet-share-center strong { font-size: 18px; line-height: 1.1; }
.wallet-share-center span { margin-top: 4px; color: var(--ink-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.wallet-share-legend { min-width: 128px; display: flex; flex-direction: column; gap: 14px; }
.wallet-share-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 7px; align-items: center; }
.wallet-share-row .dot { width: 10px; height: 10px; border-radius: 3px; }
.wallet-share-row strong { font-size: 13px; }
.wallet-share-row .share { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wallet-share-row small { grid-column: 2 / 4; color: var(--ink-2); font-size: 11px; }

/* Program settings rows */
.program-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.program-row:last-child { border-bottom: 0; }
.program-row .muted { font-size: 12px; }

/* Table */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); font-weight: 650; background: #f4f5f9; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.audit-detail { max-width: 520px; white-space: normal; overflow-wrap: anywhere; color: var(--ink-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--brand-soft); color: var(--ink); }
.badge.settled { background: var(--success-soft); color: var(--success); }
.badge.returned { background: #fbeaea; color: var(--danger); }
.badge.disabled { background: var(--bg); color: var(--ink-2); }

/* Filters / forms */
.user-filters { display: flex; gap: 10px; }
.user-filters select { width: auto; }
input, select { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.invite-row { display: flex; gap: 10px; margin-bottom: 14px; }
.invite-row input, .invite-row select { width: auto; flex: 1; }
.invite-row select { flex: 0 0 110px; }
.invite-row button { flex: none; }

/* Buttons */
.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(0.9); }
.btn.ghost { border: 0; background: none; color: var(--ink-2); }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn.danger { background: none; border-color: #f0d4d4; color: var(--danger); }

/* Keyboard focus: tabs, buttons, and table rows show a brand-aligned ring. */
.tab:focus-visible,
.btn:focus-visible,
.gran-toggle button:focus-visible,
.table tbody tr:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; z-index: 20; }
.toast.error { background: var(--danger); }

@media (max-width: 980px) {
  .view { flex-direction: column; }
  .dashboard-chart-grid { grid-template-columns: 1fr; }
  .invite-row { flex-wrap: wrap; }
}

@media (max-width: 720px) {
  .gate { justify-content: center; padding: 24px; }
  .gate::after { background: rgba(10, 16, 41, 0.44); }
  .gate-art img { object-position: 68% center; }
  .gate-card { padding: 32px 28px; }
}

/* Content editors (M3): lessons, offers, products */
.content-note { font-size: 12px; margin: 0 0 12px; }
.content-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.content-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fbfcfe; }
.content-item.off { opacity: 0.6; }
.content-row { display: flex; gap: 10px; }
.content-row .field { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.content-row .field.small { flex: 0 0 110px; }
.content-row .field > span { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.content-item textarea { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font: inherit; font-size: 13px; resize: vertical; min-height: 56px; }
.content-item textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.content-actions { display: flex; align-items: center; gap: 12px; }
.content-actions .spacer { flex: 1; }
.content-actions label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.quiz-q { border-left: 3px solid var(--line); padding-left: 10px; display: flex; flex-direction: column; gap: 6px; }
.quiz-hint { font-size: 11px; color: var(--ink-2); }

/* Standalone fields inside content cards (not in a .content-row) */
.content-item .field { display: flex; flex-direction: column; gap: 4px; }
.content-item .field > span { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.content-item textarea { width: 100%; }
.content-row .field.small { flex: 0 0 140px; }

/* Content editor: fields left, live member-app preview right */
.pane-subhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.pane-subhead .content-note { margin: 0; max-width: 640px; }
.content-item { flex-direction: row; gap: 18px; }
.ci-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ci-preview { flex: 0 0 320px; display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--line); padding-left: 18px; }
.ci-preview-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.ci-preview-body { display: flex; flex-direction: column; gap: 8px; }
.ci-opens { font-size: 11px; color: var(--ink-2); }

/* Offer card ≈ the app's Explore carousel card */
.app-offer-card { display: flex; gap: 12px; align-items: stretch; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 4px 14px rgba(10, 16, 41, 0.06); }
.app-offer-card.disabled, .app-lesson-row.disabled, .app-product-card.disabled { opacity: 0.45; }
.aoc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.aoc-chip { font-size: 9px; font-weight: 700; letter-spacing: 0.07em; padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--ink); }
.aoc-chip.success { background: var(--success-soft); color: var(--success); }
.aoc-headline { font-size: 14px; font-weight: 650; line-height: 1.3; }
.aoc-cta { margin-top: auto; background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 999px; }
.aoc-art { width: 84px; height: 84px; object-fit: contain; align-self: center; flex: none; }
.aoc-glyph { width: 56px; height: 56px; border-radius: 14px; background: var(--brand-soft); color: var(--ink); font-size: 22px; display: flex; align-items: center; justify-content: center; align-self: center; flex: none; }

/* Lesson row ≈ the institution page list item */
.app-lesson-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
/* Learn & earn rail card — mirrors the app's _LessonCard grammar. */
.app-lesson-card { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 4px 14px rgba(10, 16, 41, 0.06); }
.app-lesson-card.disabled { opacity: 0.45; }
.alc-tag { align-self: flex-start; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; background: var(--brand-soft); color: var(--ink); border-radius: 999px; padding: 3px 9px; }
.alc-title { font-size: 14px; font-weight: 700; }
.alc-foot { display: flex; align-items: center; justify-content: space-between; }
.alc-cta { font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--ink); border-radius: 999px; padding: 5px 14px; }
/* The module walkthrough: screens, quiz, claim line. */
.alm-module { display: flex; flex-direction: column; gap: 8px; }
.alm-page { font-size: 11.5px; line-height: 1.5; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.alm-empty { color: var(--ink-2); }
.alm-quiz { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.alm-q { font-size: 11.5px; font-weight: 650; margin-bottom: 6px; }
.alm-opt { font-size: 11px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; margin-top: 4px; }
.alm-opt.correct { color: var(--ink); border-color: currentColor; font-weight: 650; }
.alm-claim { font-size: 11px; font-weight: 650; }
.alr-main { flex: 1; min-width: 0; }
.alr-title { font-size: 13.5px; font-weight: 650; }
.alr-blurb { font-size: 11.5px; color: var(--ink-2); }
.alr-blurb:empty { display: none; }
.alr-points { font-size: 11px; font-weight: 700; background: var(--brand-soft); color: var(--ink); border-radius: 999px; padding: 3px 9px; flex: none; }
.alr-body { font-size: 11.5px; color: var(--ink-2); line-height: 1.45; padding: 0 2px; }

/* Product card ≈ the Explore product tile */
.app-product-card { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.apc-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--ink); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.apc-name { font-size: 13.5px; font-weight: 650; }
.apc-blurb { font-size: 11.5px; color: var(--ink-2); }
.apc-perk { font-size: 11px; font-weight: 600; color: var(--brand); margin-top: 2px; }

@media (max-width: 1100px) {
  .content-item { flex-direction: column; }
  .ci-preview { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; flex-basis: auto; }
}
.apc-icon svg { width: 20px; height: 20px; }

/* Exceptions queue + Member 360 (M3). Rory card grammar: white cards with a
   hairline border and 20px radius are furniture; brand-tinted cards are
   moments (a recommendation); pills are soft tint + colored text + dot. */
:root { --radius-card: 20px; --radius-inner: 14px; --brand-ink: #1b24c4; --warn: #a15d00; --warn-soft: #fff4dd; --danger-soft: #fdecec; }
.exc-kpis { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.exc-kpis .stat { border-radius: var(--radius-card); }
.exc-group { margin-bottom: 16px; }
.exc-group-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); margin: 6px 6px 8px; }
.risk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); flex: 0 0 8px; }
.risk-dot.high { background: var(--danger); }
.risk-dot.medium { background: var(--warn); }
.risk-dot.low { background: #8a93a8; }
.exc-row { display: grid; grid-template-columns: 36px minmax(160px, 1.4fr) minmax(150px, 1fr) 90px 90px 16px; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 12px 16px; margin-bottom: 8px; cursor: pointer; transition: box-shadow 120ms; }
.exc-row:hover, .exc-row:focus-visible { box-shadow: 0 6px 20px rgba(20, 22, 31, 0.08); outline: none; }
.exc-row.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.exc-avatar, .m360-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: 0 0 36px; }
.exc-who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.exc-who strong { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.exc-who small { font-size: 12px; }
.grade { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.g-A, .g-B { background: var(--success-soft); color: var(--success); }
.g-C { background: var(--warn-soft); color: var(--warn); }
.g-D, .g-E { background: var(--danger-soft); color: var(--danger); }
.exc-next { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.exc-next small { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); }
.exc-next span { font-size: 13px; font-weight: 600; color: var(--brand-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exc-impact { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.exc-sla { text-align: right; }
.exc-chev { color: var(--ink-2); font-size: 18px; text-align: right; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.ok { background: var(--success-soft); color: var(--success); }
.pill.neutral { background: var(--bg); color: var(--ink-2); font-weight: 600; }
.btn.small { padding: 7px 12px; font-size: 12.5px; border-radius: 999px; }
.btn.quiet { opacity: 0.7; }

.detail-pane { width: 420px; flex: 0 0 420px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 18px 20px 22px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.detail-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); margin: 20px 0 8px; }
.m360-head { display: flex; gap: 12px; align-items: flex-start; }
.m360-head .m360-avatar { width: 44px; height: 44px; flex-basis: 44px; font-size: 14px; }
.m360-id { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; flex: 1; }
.m360-id strong { font-size: 16px; }
.m360-id span { font-size: 12.5px; }
.score-card { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 14px; border-radius: var(--radius-card); background: var(--brand-soft); }
.score-card.g-C { background: var(--warn-soft); }
.score-card.g-D, .score-card.g-E { background: var(--danger-soft); }
.score-ring { --ring: var(--brand); width: 60px; height: 60px; border-radius: 50%; flex: 0 0 60px; background: conic-gradient(var(--ring) calc(var(--pct) * 1%), rgba(20, 22, 31, 0.08) 0); display: flex; align-items: center; justify-content: center; }
.score-ring span { width: 46px; height: 46px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: var(--ink); }
.score-card.g-A .score-ring, .score-card.g-B .score-ring { --ring: var(--success); }
.score-card.g-C .score-ring { --ring: var(--warn); }
.score-card.g-D .score-ring, .score-card.g-E .score-ring { --ring: var(--danger); }
.score-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.score-copy strong { font-size: 15px; }
.score-copy .muted { font-size: 12px; }
.drivers { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.driver { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); color: var(--ink); }
.driver.down { color: var(--danger); }
.driver.up { color: var(--success); }
.m360-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.m360-facts > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-inner); padding: 10px 12px; display: flex; flex-direction: column; line-height: 1.3; }
.m360-facts small { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); }
.m360-facts strong { font-size: 17px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.m360-facts .muted { font-size: 11.5px; }
.m360-progress { margin-top: 10px; }
.m360-progress .bar { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.m360-progress .bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.m360-progress small { display: block; margin-top: 5px; font-size: 11.5px; }
.rec-card { border-radius: var(--radius-card); padding: 14px 16px 12px; margin-bottom: 10px; background: var(--brand-soft); }
.rec-card.high { background: var(--danger-soft); }
.rec-card.medium { background: var(--warn-soft); }
.rec-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.rec-head strong { font-size: 14px; }
.rec-card .pill { background: rgba(255, 255, 255, 0.75); }
.rec-summary { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: var(--ink); }
.rec-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.rec-buttons .btn.ghost { background: rgba(255, 255, 255, 0.75); }
.rec-detail { display: block; margin-top: 8px; font-size: 11.5px; line-height: 1.4; }
.m360-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.kvc { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.kvc small { color: var(--ink-2); }
.kvc strong { font-variant-numeric: tabular-nums; text-align: right; display: flex; gap: 6px; align-items: center; }
.good { color: var(--success); }
.bad { color: var(--danger); }
.setup-dots { display: flex; gap: 6px; margin: 4px 0 8px; }
.setup-dots span { width: 100%; height: 6px; border-radius: 999px; background: var(--bg); }
.setup-dots span.on { background: var(--success); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--bg); color: var(--ink); }
.activity-list, .notes-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.activity-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.activity-list li:last-child { border-bottom: 0; }
.activity-list.quiet { color: var(--ink-2); }
.notes-list li { padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
.notes-list li:last-child { border-bottom: 0; }
.note-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; align-items: flex-start; }
.note-form textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: var(--radius-inner); padding: 8px 10px; font: inherit; resize: vertical; }

/* Command center dashboard */
.kpi-grid { grid-template-columns: repeat(6, minmax(140px, 1fr)); }
.stat.kpi { border-radius: var(--radius-card); }
.stat.kpi .stat-label { margin: 0 0 6px; }
.delta { display: block; font-size: 11.5px; font-weight: 600; margin-top: 6px; }
.delta.good { color: var(--success); }
.delta.bad { color: var(--danger); }
.cc-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; margin-bottom: 18px; }
.cc-grid .chart-card { margin: 0; border-radius: var(--radius-card); min-width: 0; }
.line-chart svg { width: 100%; height: auto; display: block; }
.line-chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.line-chart .axis { font-size: 10px; fill: var(--ink-2); }
.line-chart .line { fill: none; stroke: var(--success); stroke-width: 2.2; stroke-linejoin: round; }
.line-chart .area { fill: var(--success-soft); }
.line-chart .dot { fill: var(--card); stroke: var(--success); stroke-width: 2; }
.chart-legend i.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-legend { justify-content: space-between; }
.mix-body { display: flex; align-items: center; gap: 22px; }
.mix-chart { position: relative; width: 150px; aspect-ratio: 1; border-radius: 50%; flex: 0 0 150px; }
.mix-chart::after { content: ""; position: absolute; inset: 24px; border-radius: 50%; background: var(--card); }
.mix-center { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mix-center strong { font-size: 20px; }
.mix-center span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); }
.mix-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mix-row { display: grid; grid-template-columns: 10px 18px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.mix-row i.dot { width: 10px; height: 10px; border-radius: 3px; }
.mix-row .share { font-weight: 700; font-variant-numeric: tabular-nums; }
.drv-val { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.drv-val small { font-size: 11px; }
.cc-exc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cc-exc-grid > div { display: flex; flex-direction: column; background: var(--bg); border-radius: var(--radius-inner); padding: 10px 12px; }
.cc-exc-grid strong { font-size: 22px; }
.cc-exc-grid small { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
.cc-exc-copy { margin: 10px 0 0; font-size: 12.5px; }

/* Member 360, full page, three columns */
.m360-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.m360-page { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.4fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.m360-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px 18px; }
.card h3 { margin: 0 0 10px; font-size: 14px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.pill.g-A, .pill.g-B { background: var(--success-soft); color: var(--success); }
.pill.g-C { background: var(--warn-soft); color: var(--warn); }
.pill.g-D, .pill.g-E { background: var(--danger-soft); color: var(--danger); }
.card.score-card { margin-top: 0; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink-2); }
.kv strong { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; text-align: right; }
.activity-list li .when { flex: 0 0 56px; white-space: nowrap; }
.activity-list li span { flex: 1; }
.summary { margin: 0; font-size: 13.5px; line-height: 1.55; }
.rec { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: var(--radius-inner); background: var(--brand-soft); margin-bottom: 8px; }
.rec.high { background: var(--danger-soft); }
.rec.medium { background: var(--warn-soft); }
.rec-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec-body strong { font-size: 14px; }
.rec-body small { font-size: 12px; line-height: 1.35; }
.rec-body .impact { color: var(--ink); font-weight: 600; margin-top: 3px; }
.rec-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.next-best p { margin: 0; font-size: 13px; line-height: 1.5; }
.convo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.convo .who { display: flex; gap: 8px; align-items: baseline; }
.convo li span { display: block; margin-top: 2px; color: var(--ink); }

/* ── Rory web components (mirrors docs/design-system.html) ─────────────── */
.rcard { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-card); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.rcard.tinted { background: var(--brand-soft); border-color: var(--brand-soft); }
.rcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.rcard-head h3 { margin: 2px 0 0; font-size: 16px; font-weight: 700; }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; color: var(--ink-2); text-transform: uppercase; }
.lede { margin: 0 0 14px; font-size: 18px; line-height: 1.45; font-weight: 600; color: var(--ink); max-width: 60ch; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metrics.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric { background: var(--surface); border-radius: var(--r-compact); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--divider); }
.rcard.tinted .metric { border-color: transparent; }
.metric .big { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metrics.small .metric .big { font-size: 22px; }
.metric .cap { font-size: 12.5px; color: var(--ink-2); margin: 0; }
.metric.bad .big { color: var(--danger); }
.metric.good .big { color: var(--success); }
.cap { font-size: 12.5px; color: var(--ink-2); margin: 10px 0 0; line-height: 1.45; }
.rpill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.rpill.success { background: var(--success-tint); color: var(--success); }
.rpill.warn { background: var(--warn-tint); color: var(--warn-ink); }
.rpill:empty { display: none; }
.rbtn { border: 0; font: 700 13px "Onest", system-ui, sans-serif; border-radius: var(--r-pill); padding: 9px 16px; background: var(--brand); color: #fff; cursor: pointer; }
.rbtn.ghost { background: var(--brand-soft); color: var(--brand-ink); }
.lrow { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--divider); cursor: pointer; }
.lrow:last-child { border-bottom: 0; }
.lrow .grow { flex: 1; min-width: 0; }
.lrow .t { font-weight: 600; font-size: 14px; }
.lrow .s { font-size: 12px; color: var(--ink-2); }
.lrow:hover .t { color: var(--brand-ink); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: 0 0 36px; }
.chev { color: var(--ink-2); font-size: 18px; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.home-grid .rcard { margin-bottom: 16px; }
.pane-head h2 { font-size: 20px; }


/* Opportunities */
.opp { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.opp:last-child { border-bottom: 0; }
.opp.top { background: var(--brand-soft); margin: 0 -20px; padding: 14px 20px; border-radius: 0; border-bottom: 0; }
.opp.top + .opp { border-top: 1px solid var(--divider); }
.opp-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.opp-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.opp-title strong { font-size: 14.5px; }
.opp-body small { font-size: 12.5px; line-height: 1.4; }
.opp-body .impact { color: var(--success); font-weight: 700; }
.opp .rbtn { flex: 0 0 auto; }
.rpill.neutral { background: var(--bg); color: var(--ink-2); }
.opp-impact { font-size: 12.5px; font-weight: 600; color: var(--success); text-align: right; white-space: normal; }
.rec-body small .pill { vertical-align: middle; }

.lrow .amt { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; line-height: 1.25; }
.lrow .amt small { font-size: 11px; }
.rpill.danger { background: var(--danger-tint); color: var(--danger); }
#payments-card { margin-top: 0; }

.summary-lines { margin: 0; display: grid; gap: 8px; }
.summary-lines div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: baseline; }
.summary-lines dt { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.summary-lines dd { margin: 0; font-size: 13.5px; line-height: 1.45; }

.opp.task.high.top { background: var(--danger-tint); }
.opp.task.medium.top { background: var(--warn-tint); }
.opp .rec-actions { flex-direction: row; align-items: center; }

/* Auto book: integration and consumer columns side by side */
.book-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.book-col { cursor: pointer; transition: border-color 0.15s; }
.book-col:hover, .book-col.active { border-color: var(--brand); }
.book-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.book-metrics .metric .big { font-size: 22px; }
.book-table { border: 0; }
.book-table td { vertical-align: top; font-size: 13.5px; }
.book-table tbody tr { cursor: pointer; }
.book-table tbody tr:hover .t { color: var(--brand-ink); }
.book-table .t { font-weight: 600; }
.book-table .s { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.book-member { display: flex; gap: 10px; align-items: flex-start; }
@media (max-width: 900px) { .book-split { grid-template-columns: 1fr; } .book-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
