/* ============================================================
   MARA — UI Kit (canonical design system, provided by design)
   + a compatibility bridge (§COMPAT) so not-yet-migrated views
   (Tailwind-utility markup + shared Ask MARA / peer partials)
   stay coherent during the re-skin. Remove the bridge once every
   view uses the design-system classes below.

   Fonts: Poppins 400/500/600 (headings, numerics)
          Open Sans 400/500/600 (body, UI)
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&family=Open+Sans:wght@400;500;600&display=swap");

/* ---------- 1. TOKENS ---------- */

:root {
  --bg: #f6f5f2;
  --content-bg: #ffffff; /* main content column ground — plain white in light mode */
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --surface-3: #efedE9;

  --line: rgba(25, 23, 21, .085);
  --line-2: rgba(25, 23, 21, .15);

  --ink: #191715;
  --ink-2: #57524c;
  --ink-3: #8b847c;

  --accent: oklch(0.52 0.115 288);
  --accent-ink: #ffffff;
  --accent-soft: oklch(0.955 0.02 288);
  --accent-line: oklch(0.86 0.055 288);

  /* Purple tint (highlight / next-up surface) — distinct from accent-soft */
  --tint: oklch(0.945 0.032 288);
  --tint-line: oklch(0.855 0.062 288);
  --tint-glow: oklch(0.52 0.115 288 / .13);

  /* Layout grid tracks */
  --cols-main: minmax(0, 1.66fr) minmax(304px, 1fr);
  --cols-stat: repeat(4, minmax(0, 1fr));
  --cols-entity: minmax(0, 1.7fr) minmax(88px, .95fr) 108px minmax(0, .95fr);
  --cols-tut: repeat(3, minmax(0, 1fr));

  --good: oklch(0.53 0.075 158);
  --good-soft: oklch(0.955 0.022 158);
  --good-line: oklch(0.87 0.045 158);

  --warn: oklch(0.60 0.085 68);
  --warn-soft: oklch(0.955 0.024 68);
  --warn-line: oklch(0.88 0.05 68);

  --risk: oklch(0.55 0.095 28);
  --risk-soft: oklch(0.955 0.022 28);
  --risk-line: oklch(0.88 0.05 28);

  --info: oklch(0.55 0.075 240);
  --info-soft: oklch(0.955 0.022 240);

  --ra: #e0a626;
  --rink: #17191c;

  --heat-1: #e6efe7;
  --heat-2: #f4eed9;
  --heat-3: #f5ddc2;
  --heat-4: #efd0bf;
  --heat-5: #efc9bf;

  --pad: 26px;
  --gap: 20px;
  --shell: 36px;
  --side: 246px;
  --drawer: 420px;
  --header-h: 61px;

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 16px;
  --r-pill: 99px;

  --shadow: 0 1px 2px rgba(25, 23, 21, .035), 0 12px 32px -22px rgba(25, 23, 21, .3);
  --shadow-lift: 0 1px 2px rgba(25, 23, 21, .05), 0 18px 40px -24px rgba(25, 23, 21, .42);
  --shadow-drawer: -24px 0 60px -34px rgba(25, 23, 21, .6);
  --paper: 0 1px 1px rgba(25, 23, 21, .06), 0 18px 40px -26px rgba(25, 23, 21, .45);

  --t-fast: .14s ease;
  --t: .16s ease;
  --t-panel: .26s cubic-bezier(.4, 0, .2, 1);
}

:root[data-theme="dark"] {
  --bg: #121110;
  --content-bg: #121110; /* keep the dark ground in dark mode */
  --surface: #1a1918;
  --surface-2: #1f1e1c;
  --surface-3: #272522;

  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .15);

  --ink: #f3f0eb;
  --ink-2: #a49d95;
  --ink-3: #7c756d;

  --accent: oklch(0.70 0.115 288);
  --accent-ink: #16141c;
  --accent-soft: oklch(0.28 0.04 288);
  --accent-line: oklch(0.42 0.07 288);

  --tint: oklch(0.285 0.042 288);
  --tint-line: oklch(0.42 0.07 288);
  --tint-glow: oklch(0.60 0.14 288 / .30);

  --good: oklch(0.73 0.085 158);
  --good-soft: oklch(0.28 0.035 158);
  --good-line: oklch(0.40 0.06 158);

  --warn: oklch(0.77 0.085 68);
  --warn-soft: oklch(0.29 0.035 68);
  --warn-line: oklch(0.42 0.06 68);

  --risk: oklch(0.68 0.095 28);
  --risk-soft: oklch(0.28 0.04 28);
  --risk-line: oklch(0.40 0.065 28);

  --info: oklch(0.72 0.075 240);
  --info-soft: oklch(0.28 0.035 240);

  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -24px rgba(0, 0, 0, .9);
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, .45), 0 20px 44px -24px rgba(0, 0, 0, 1);
  --shadow-drawer: -24px 0 60px -34px rgba(0, 0, 0, .9);
  --paper: 0 1px 1px rgba(0, 0, 0, .5), 0 20px 44px -26px rgba(0, 0, 0, 1);
}

:root[data-density="compact"] {
  --pad: 18px;
  --gap: 14px;
  --shell: 24px;
}

/* ---------- 2. BASE ---------- */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Open Sans", system-ui, sans-serif;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -.02em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }

button, input, select, textarea { font-family: inherit; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-pill);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 3. TYPE SCALE ---------- */

.t-display { font-family: "Poppins", sans-serif; font-size: 27px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
.t-h2      { font-family: "Poppins", sans-serif; font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.t-h3      { font-family: "Poppins", sans-serif; font-size: 17px; font-weight: 600; line-height: 1.3;  letter-spacing: -.015em; }
.t-h4      { font-family: "Poppins", sans-serif; font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.t-metric  { font-family: "Poppins", sans-serif; font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.t-body    { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.t-body-sm { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
.t-meta    { font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
.t-eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); }
.t-num     { font-variant-numeric: tabular-nums; }

.t-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 4. APP SHELL ---------- */

.app { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
  width: var(--side); flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 16px 18px; border-right: 1px solid var(--line); background: var(--surface);
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 26px; }
.sidebar__mark {
  width: 30px; height: 30px; flex: none; border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-family: "Poppins", sans-serif; font-size: 14px; font-weight: 600;
}
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar__rule { height: 1px; background: var(--line); margin: 22px 11px 18px; }
.sidebar__label { font-size: 10.5px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); padding: 0 11px 10px; }
.sidebar__foot { margin-top: auto; display: flex; align-items: center; gap: 11px; padding: 14px 8px 0; border-top: 1px solid var(--line); }

.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: var(--r-md);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  transition: background var(--t), color var(--t);
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.is-active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.nav-item.is-active i { color: var(--accent); }
.nav-item i { width: 17px; text-align: center; color: var(--ink-3); font-size: 15px; }
.nav-item.is-locked { color: var(--ink-3); opacity: .55; cursor: not-allowed; }
.nav-item__count { margin-left: auto; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); }

.entity-item { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: var(--r-md); color: var(--ink-2); font-size: 13px; font-weight: 500; transition: background var(--t), color var(--t); }
.entity-item:hover { background: var(--surface-2); color: var(--ink); }
.entity-item.is-active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.entity-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--ink-3); }
.entity-dot--good { background: var(--good); }
.entity-dot--warn { background: var(--warn); }
.entity-dot--risk { background: var(--risk); }
.entity-dot--info { background: var(--accent); }

/* Main content column sits on a plain-white ground (dark mode keeps its bg). */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--content-bg, #ffffff); }

.topbar {
  position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 12px;
  padding: 13px var(--shell); border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--content-bg, #fff) 84%, transparent); backdrop-filter: blur(14px);
}
.topbar__spacer { flex: 1; }
.topbar__divider { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }

.page { padding: 28px var(--shell) 44px; display: flex; flex-direction: column; gap: var(--gap); max-width: 1620px; width: 100%; min-width: 0; }
/* Let page children (grids/cards) shrink to the viewport instead of forcing horizontal scroll. */
.page > * { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.page-head__actions { display: flex; align-items: center; gap: 9px; }

.breadcrumb { display: flex; align-items: center; gap: 9px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 9px; }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb__sep { color: var(--line-2); }

.footer { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; padding: 8px 2px; font-size: 11.5px; color: var(--ink-3); }

/* ---------- 5. SURFACES ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: var(--pad); }
.card--flush { padding: 0; overflow: hidden; }
.card--quiet { background: var(--surface-2); box-shadow: none; }
.card--interactive { cursor: pointer; transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
.card--interactive:hover { border-color: var(--line-2); box-shadow: var(--shadow-lift); transform: translateY(-1px); }

.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px var(--pad); border-bottom: 1px solid var(--line); }
.card__body { padding: var(--pad); }
.card__foot { display: flex; align-items: center; gap: 10px; padding: 14px var(--pad); border-top: 1px solid var(--line); }

.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }

.highlight { position: relative; background: var(--tint); border: 1px solid var(--tint-line); border-radius: var(--r-xl); box-shadow: 0 1px 2px rgba(25,23,21,.04), 0 20px 44px -26px var(--tint-glow); padding: var(--pad); }
.highlight--good { background: var(--good-soft); border-color: var(--good-line); }
.highlight--warn { background: var(--warn-soft); border-color: var(--warn-line); }

.toolbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.toolbar__divider { width: 1px; height: 20px; background: var(--line); }
.toolbar__spacer { flex: 1; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- 6. BUTTONS ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-md); font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background var(--t), border-color var(--t), color var(--t), filter var(--t); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn--secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--secondary:hover { border-color: var(--line-2); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--outline { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--outline:hover { background: var(--surface-2); }
.btn--danger { background: var(--risk-soft); border-color: var(--risk-line); color: var(--risk); }
.btn--danger:hover { filter: brightness(.97); }
.btn--good { background: var(--good); color: #fff; }
.btn--good:hover { filter: brightness(1.06); color: #fff; }
/* Canva brand button — their purple→blue→cyan gradient, white label + logo mark. */
.btn--canva { background: linear-gradient(120deg,#7d2ae8 0%,#4b7bff 52%,#00c4cc 100%); color: #fff; border: 0; font-weight: 700; letter-spacing: .01em; box-shadow: 0 8px 22px -6px rgba(99,53,230,.55); transition: transform var(--t), box-shadow var(--t), filter var(--t); }
.btn--canva:hover { filter: brightness(1.07); color: #fff; transform: translateY(-1px); box-shadow: 0 12px 28px -6px rgba(99,53,230,.7); }
.btn--canva:active { transform: translateY(0); box-shadow: 0 6px 16px -6px rgba(99,53,230,.55); }
.btn--canva .canva-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; margin-right: 1px; }
.btn--canva .canva-mark svg { width: 22px; height: 22px; display: block; }
.btn--canva.btn--sm .canva-mark, .btn--canva.btn--sm .canva-mark svg { width: 16px; height: 16px; }
.btn--sm { height: 32px; padding: 0 13px; font-size: 12px; border-radius: 9px; }
.btn--lg { height: 42px; padding: 0 18px; font-size: 13.5px; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }

.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: border-color var(--t), color var(--t), background var(--t); }
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn--sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn--bare { border-color: transparent; background: transparent; }
.icon-btn--bare:hover { background: var(--surface-2); }
.icon-btn__dot { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--risk); border: 1.5px solid var(--surface); }

.kbd { font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--ink-3); }
.btn--primary .kbd { background: rgba(255, 255, 255, .2); color: inherit; }

/* ---------- 7. BADGES, PILLS, CHIPS ---------- */

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge--good { background: var(--good-soft); color: var(--good); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--risk { background: var(--risk-soft); color: var(--risk); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--solid { background: var(--accent); color: var(--accent-ink); }
.badge--solid .status__dot { background: var(--accent-ink); }
.badge--outline { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.status__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--good { color: var(--good); }
.status--warn { color: var(--warn); }
.status--risk { color: var(--risk); }

.tag-ro     { background: var(--risk-soft); color: var(--risk); }
.tag-opp    { background: var(--good-soft); color: var(--good); }
.tag-dep    { background: var(--info-soft); color: var(--info); }
.tag-impact { background: var(--warn-soft); color: var(--warn); }

.chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 500; cursor: pointer; transition: border-color var(--t), background var(--t), color var(--t); }
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip__x { color: var(--ink-3); font-size: 13px; line-height: 1; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.derived { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--accent-line); border-radius: var(--r-sm); background: var(--accent-soft); font-size: 11.5px; font-weight: 600; color: var(--accent); }
.derived__icon { flex: none; opacity: .8; }
.derived--warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }

/* ---------- 8. SEGMENTED CONTROL + TABS ---------- */

.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.segmented__btn { height: 28px; padding: 0 12px; border: none; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; transition: background var(--t), color var(--t); }
.segmented__btn:hover { color: var(--ink); }
.segmented__btn.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(25, 23, 21, .08); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { position: relative; padding: 10px 14px; border: none; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: color var(--t); }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); font-weight: 600; }
.tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.tab__count { margin-left: 7px; font-size: 11px; font-weight: 600; color: var(--ink-3); }

/* ---------- 9. FORMS ---------- */

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.field__hint { font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
.field__error { font-size: 11.5px; font-weight: 600; color: var(--risk); }
.field__req { color: var(--risk); margin-left: 2px; }

.input, .select, .textarea { width: 100%; min-height: 38px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: 13px; transition: border-color var(--t), box-shadow var(--t); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { min-height: 96px; line-height: 1.6; resize: vertical; }
.input.is-invalid { border-color: var(--risk-line); }

.search { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 12.5px; color: var(--ink); }

.switch { position: relative; width: 38px; height: 22px; flex: none; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line); cursor: pointer; transition: background var(--t); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(25, 23, 21, .2); transition: transform var(--t); }
.switch.is-on { background: var(--accent); border-color: transparent; }
.switch.is-on::after { transform: translateX(16px); }

.checkbox { width: 17px; height: 17px; flex: none; border: 1.5px solid var(--line-2); border-radius: 5px; background: var(--surface); cursor: pointer; transition: background var(--t), border-color var(--t); }
.checkbox.is-checked { background: var(--accent); border-color: var(--accent); }

.radio-card { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: border-color var(--t), background var(--t), box-shadow var(--t); }
.radio-card:hover { border-color: var(--line-2); }
.radio-card.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }

.dropzone { display: block; padding: 20px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color var(--t), background var(--t); }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ---------- 10. WIZARD / STEPPER ---------- */

.stepper { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 10px; }
.step__num { width: 26px; height: 26px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.step__label { font-size: 12.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.step__line { width: 32px; height: 1px; background: var(--line-2); margin: 0 12px; }
.step.is-current .step__num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.is-current .step__label { color: var(--ink); font-weight: 600; }
.step.is-done .step__num { background: var(--good-soft); border-color: var(--good-line); color: var(--good); }
.step.is-done .step__label { color: var(--ink-2); }
.step.is-locked { opacity: .5; }

/* Gate pill stepper (horizontal breadcrumb variant used on gate pages) */
.gatebar { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.gatestep { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.gatestep:hover { background: var(--surface-2); color: var(--ink); }
.gatestep.is-current { background: var(--accent); color: var(--accent-ink); }
.gatestep.is-current:hover { color: var(--accent-ink); }
.gatestep.is-done i { color: var(--good); }
.gatestep.is-locked { color: var(--ink-3); opacity: .55; cursor: not-allowed; }
.gatestep.is-locked:hover { background: none; }
.gatebar__sep { color: var(--line-2); font-size: 9px; }

/* ---------- 11. PROGRESS ---------- */

.progress { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress__fill { height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s cubic-bezier(.4, 0, .2, 1); }
.progress__fill--good { background: var(--good); }
.progress__fill--warn { background: var(--warn); }
.progress--thin { height: 4px; }

.ring { --pct: 0; width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface-3) 0); display: grid; place-items: center; }
.ring::after { content: ""; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); grid-area: 1 / 1; }
.ring__value { grid-area: 1 / 1; z-index: 1; font-family: "Poppins", sans-serif; font-size: 11.5px; font-weight: 600; }
.ring--lg { width: 96px; height: 96px; }
.ring--lg::after { width: 84px; height: 84px; }
.ring--lg .ring__value { font-size: 24px; }
.ring--onsoft::after { background: var(--tint); }

/* ---------- 12. METRICS ---------- */

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--gap); }
.metric { display: flex; flex-direction: column; gap: 8px; }
.metric__label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.metric__value { font-family: "Poppins", sans-serif; font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.metric__value small { font-size: 14px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.metric__delta { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.metric__delta--up { color: var(--good); }
.metric__delta--down { color: var(--risk); }
.metric__spark { height: 26px; }

/* ---------- 13. TABLES / DATA LISTS ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table--num td, .table--num th { text-align: right; }
.table__sticky-head th { position: sticky; top: 0; z-index: 2; }

.row { display: grid; align-items: center; gap: 14px; padding: 13px var(--pad); border-bottom: 1px solid var(--line); transition: background var(--t-fast); }
.row:hover { background: var(--surface-2); }
.row:last-child { border-bottom: none; }
.row--selected { background: var(--accent-soft); }

.group-head { display: flex; align-items: center; gap: 11px; padding: 11px var(--pad); background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.group-head__count { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }
.group-head__caret { transition: transform var(--t); }
.group-head.is-open .group-head__caret { transform: rotate(90deg); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 24px; text-align: center; }
.empty__title { font-size: 13.5px; font-weight: 600; }
.empty__body { font-size: 12.5px; color: var(--ink-3); max-width: 40ch; }

/* ---------- 14. TREE / VALUE CHAIN ---------- */

.tree { display: flex; flex-direction: column; }
.tree__node { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-md); cursor: pointer; transition: background var(--t-fast); }
.tree__node:hover { background: var(--surface-2); }
.tree__node.is-active { background: var(--accent-soft); font-weight: 600; }
.tree__caret { width: 14px; flex: none; color: var(--ink-3); transition: transform var(--t); }
.tree__node.is-open > .tree__caret { transform: rotate(90deg); }
.tree__children { margin-left: 18px; padding-left: 11px; border-left: 1px solid var(--line); }

.stage-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stage-col__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 9px; border-bottom: 2px solid var(--line); }
.stage-col--upstream .stage-col__head { border-bottom-color: var(--info); }
.stage-col--direct   .stage-col__head { border-bottom-color: var(--accent); }
.stage-col--downstream .stage-col__head { border-bottom-color: var(--good); }

/* ---------- 15. MATERIALITY HEATMAP ---------- */

.heat-row { display: flex; gap: 5px; }
.heat-btn { width: 34px; height: 34px; flex: none; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-2); font-family: "Poppins", sans-serif; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: transform var(--t-fast), box-shadow var(--t), border-color var(--t); }
.heat-btn:hover { transform: translateY(-1px); border-color: var(--line-2); }
.heat-btn--1 { background: var(--heat-1); }
.heat-btn--2 { background: var(--heat-2); }
.heat-btn--3 { background: var(--heat-3); }
.heat-btn--4 { background: var(--heat-4); }
.heat-btn--5 { background: var(--heat-5); }
.heat-btn.is-selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; color: var(--ink); }
.heat-btn--wide { width: auto; flex: 1; padding: 14px 8px; display: flex; flex-direction: column; gap: 3px; align-items: center; }

.matrix { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.matrix__cell { aspect-ratio: 1; border-radius: 5px; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--surface-3); }
.matrix__cell--1 { background: var(--heat-1); }
.matrix__cell--2 { background: var(--heat-2); }
.matrix__cell--3 { background: var(--heat-3); }
.matrix__cell--4 { background: var(--heat-4); }
.matrix__cell--5 { background: var(--heat-5); }
.matrix__axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--ink-3); }

.legend { display: flex; flex-direction: column; gap: 9px; }
.legend__item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.legend__swatch { width: 14px; height: 14px; flex: none; border-radius: 4px; }

/* ---------- 16. DRAWER / MODAL ---------- */

.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(15, 14, 13, .34); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.scrim.is-open { opacity: 1; pointer-events: auto; }

.drawer { position: fixed; top: 0; right: 0; z-index: 21; width: min(var(--drawer), 92vw); height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-drawer); transform: translateX(102%); transition: transform var(--t-panel); }
.drawer.is-open { transform: translateX(0); }
.drawer--left { left: 0; right: auto; border-left: none; border-right: 1px solid var(--line); transform: translateX(-102%); box-shadow: 24px 0 60px -34px rgba(25, 23, 21, .6); }
.drawer--left.is-open { transform: translateX(0); }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px var(--pad) 15px; border-bottom: 1px solid var(--line); }
.drawer__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px var(--pad); display: flex; flex-direction: column; gap: 16px; }
.drawer__foot { display: flex; align-items: center; gap: 10px; padding: 14px var(--pad); border-top: 1px solid var(--line); background: var(--surface); }

.modal { position: fixed; top: 50%; left: 50%; z-index: 21; transform: translate(-50%, -48%); width: min(560px, 92vw); max-height: 86vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lift); opacity: 0; pointer-events: none; transition: opacity var(--t-panel), transform var(--t-panel); }
.modal.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }

.popover { position: absolute; z-index: 12; min-width: 200px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lift); }
.popover__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink-2); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.popover__item:hover { background: var(--surface-2); color: var(--ink); }

.tooltip { padding: 6px 9px; border-radius: 7px; background: var(--ink); color: var(--bg); font-size: 11.5px; font-weight: 500; white-space: nowrap; box-shadow: var(--shadow); }

/* ---------- 17. COMMENTS / NOTES ---------- */

.note { display: flex; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: none; }
.note__avatar { width: 28px; height: 28px; flex: none; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; font-family: "Poppins", sans-serif; font-size: 11px; font-weight: 500; color: var(--ink-2); }
.note__meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.note__author { font-size: 12.5px; font-weight: 600; }
.note__time { font-size: 11px; color: var(--ink-3); }
.note__body { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.note-count { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.note-count.has-unread { color: var(--accent); }

/* ---------- 18. OUTLINE / PAGE RAIL ---------- */

.rail { position: sticky; top: calc(var(--header-h) + 17px); height: calc(100vh - 100px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); overflow: hidden; }
.rail__head { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.rail__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.rail__item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: none; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 12.5px; text-align: left; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.rail__item:hover { background: var(--surface-2); color: var(--ink); }
.rail__item.is-active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.rail__thumb { flex: none; width: 30px; height: 21px; border-radius: 3px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); font-size: 9.5px; font-weight: 600; }
.rail__thumb--dark { background: var(--rink); color: #fff; }
.rail__thumb--divider { background: linear-gradient(90deg, var(--surface-3) 50%, #2b3038 50%); }

/* ---------- 19. REPORT PAPER ---------- */

.rp { container-type: inline-size; position: relative; aspect-ratio: 1.414; background: #ffffff; color: var(--rink); border-radius: 5px; box-shadow: var(--paper); overflow: hidden; }
.rp--portrait { aspect-ratio: .7071; }
.rp__inner { position: absolute; inset: 0; padding: 6cqw 7cqw; display: flex; flex-direction: column; }
.rp__running { display: flex; justify-content: space-between; font-size: 1.05cqw; letter-spacing: .14em; text-transform: uppercase; color: #9aa0a8; }
.rp__foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 1.05cqw; color: #9aa0a8; }
.rp__kicker { width: 4cqw; height: .28cqw; background: var(--ra); margin-bottom: 1.8cqw; }
.rp__h1 { font-family: "Poppins", sans-serif; font-size: 3.6cqw; font-weight: 600; letter-spacing: -.03em; }
.rp__h2 { font-family: "Poppins", sans-serif; font-size: 2.6cqw; font-weight: 600; letter-spacing: -.03em; }
.rp__ref { font-size: 1.15cqw; font-weight: 600; color: var(--ra); margin-bottom: 1cqw; }
.rp-body { font-size: 1.32cqw; line-height: 1.72; color: #3d4147; }
.rp--dark { background: var(--rink); color: #fff; }
.rp__edge { position: absolute; top: 0; right: 0; bottom: 0; width: 3.4cqw; background: var(--ra); }

.rp-slot { position: relative; width: 100%; border: 1px dashed #cfd3d6; border-radius: .5cqw; background: #f7f8f8; background-size: cover; background-position: center; display: grid; place-items: center; cursor: pointer; }
.rp-slot.is-filled { border: none; background-color: transparent; }
.rp-slot__cta { color: #9aa0a8; font-size: 1.15cqw; font-weight: 600; }
.rp-slot__caption { position: absolute; left: 1.4cqw; bottom: 1.4cqw; padding: .55cqw 1cqw; border-radius: .5cqw; background: rgba(15, 17, 20, .62); color: #fff; font-size: 1cqw; }
.rp-slot--figure { aspect-ratio: 4 / 3; }
.rp-slot--wide { aspect-ratio: 16 / 4.6; }
.rp-slot--cover { position: absolute; inset: 0; border: none; border-radius: 0; }
.rp-slot--on-dark { border-color: rgba(255, 255, 255, .32); background: rgba(255, 255, 255, .05); }
.rp-slot--on-dark .rp-slot__cta { color: rgba(255, 255, 255, .6); }

.rp-scrim { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(15, 17, 20, .25) 0%, rgba(15, 17, 20, .88) 72%); }

/* ---------- 20. UTILITIES ---------- */

.stack   { display: flex; flex-direction: column; gap: var(--gap); }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.cluster { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cluster-sm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer  { flex: 1; }
.grid-2  { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid-3  { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.grid-4  { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scroll-y { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mt-auto { margin-top: auto; }

/* ---------- 21. RESPONSIVE ---------- */

@media (max-width: 1240px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1120px) {
  :root { --shell: 26px; }
  .rail { position: static; height: auto; }
  .rail__list { max-height: 420px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1020px) { :root { --side: 212px; } }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  :root { --shell: 18px; --pad: 18px; }
  .page-head { align-items: flex-start; }
  .topbar { flex-wrap: wrap; }
}

/* ---------- 22. PRINT ---------- */

@media print {
  .sidebar, .topbar, .toolbar, .rail, .drawer, .scrim, .footer { display: none !important; }
  .page { padding: 0; max-width: none; gap: 0; }
  .rp { box-shadow: none; border-radius: 0; break-after: page; }
  .rp-slot:not(.is-filled) { display: none; }
}

/* ============================================================
   §COMPAT — bridge for views still using Tailwind utilities and
   the shared Ask MARA / peer-benchmark partials. Superseded as
   each view migrates to the design-system classes above.
   ============================================================ */

/* Legacy token aliases → design tokens */
:root{
  --brand:var(--accent); --brand-strong:var(--accent); --brand-soft:var(--accent-soft);
  --brand-border:var(--accent-line); --brand-ink:var(--accent);
  --green:var(--good); --green-soft:var(--good-soft); --green-strong:var(--good); --green-border:var(--good-line);
  --amber:var(--warn); --amber-soft:var(--warn-soft);
  --rose:var(--risk); --rose-soft:var(--risk-soft); --rose-border:var(--risk-line);
  --ink-4:var(--ink-3);
  --font-display:"Poppins",system-ui,sans-serif; --font-body:"Open Sans",system-ui,sans-serif;
  --font-mono:ui-monospace,SFMono-Regular,Menlo,monospace;
  --r-btn:var(--r-md); --r-card:var(--r-xl); --r-input:var(--r-md);
  --shadow-sm:var(--shadow); --shadow-md:var(--shadow-lift); --shadow-lg:var(--shadow-lift);
  --focus-ring:0 0 0 3px var(--accent-soft);
}

/* Card title — 16px (design uses this for panel headers, between .t-h3 17 and .t-h4 14.5) */
.card-title{font-family:"Poppins",sans-serif;font-size:16px;font-weight:600;line-height:1.3;letter-spacing:-.02em;color:var(--ink)}

/* Spinner for button loaders (self-contained; does not depend on Font Awesome) */
@keyframes mara-spin{to{transform:rotate(1turn)}}
.fa-spin{display:inline-block;animation:mara-spin .85s linear infinite}

/* Brand logo image */
.sidebar__logo{width:30px;height:30px;flex:none;display:block}

/* Consult interstitial modal — image left, form right */
.cmodal{position:fixed;inset:0;z-index:90;display:none;align-items:center;justify-content:center;padding:24px}
.cmodal.open{display:flex}
.cmodal__scrim{position:absolute;inset:0;background:rgba(20,18,30,.55);backdrop-filter:blur(3px)}
.cmodal__box{position:relative;z-index:1;width:100%;max-width:840px;max-height:92vh;background:var(--surface);border-radius:var(--r-xl);overflow:hidden;display:grid;grid-template-columns:1fr 1fr;box-shadow:0 40px 90px -30px rgba(0,0,0,.55)}
@media (max-width:720px){ .cmodal__box{grid-template-columns:1fr;max-height:94vh;overflow-y:auto} }
.cmodal__img{position:relative;overflow:hidden;color:#fff;display:flex;flex-direction:column;justify-content:space-between;padding:26px;background:linear-gradient(158deg,var(--accent) 0%,#4b4390 54%,#2c2857 100%)}
@media (max-width:720px){ .cmodal__img{min-height:150px;padding:22px} }
.cmodal__img > *{position:relative;z-index:1}
.cmodal__img .tex{position:absolute;inset:0;z-index:0;opacity:.14;background-image:radial-gradient(circle at 1px 1px,#fff 1px,transparent 0);background-size:20px 20px}
.cmodal__ic{width:46px;height:46px;flex:none;border-radius:13px;background:rgba(255,255,255,.16);display:grid;place-items:center;font-size:22px}
.cmodal__img h3{font-family:var(--font-display);font-size:20px;font-weight:600;line-height:1.2;letter-spacing:-.01em;margin-top:auto}
.cmodal__img p{font-size:13px;opacity:.85;margin-top:8px;line-height:1.5}
.cmodal__body{position:relative;padding:26px;display:flex;flex-direction:column;overflow-y:auto}
.cmodal__x{position:absolute;top:12px;right:12px;z-index:2;border:0;background:var(--surface-2);width:32px;height:32px;border-radius:9px;color:var(--ink-2);cursor:pointer;font-size:15px;display:grid;place-items:center}
.cmodal__x:hover{background:var(--surface-3);color:var(--ink)}
.cmodal__eyebrow{font-size:10.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--accent)}
.cmodal__body h2{font-family:var(--font-display);font-size:19px;font-weight:600;letter-spacing:-.02em;color:var(--ink);margin:6px 0 8px;line-height:1.22}
.cmodal__body .lede{font-size:13px;color:var(--ink-2);line-height:1.55}
.cmodal__points{list-style:none;margin:13px 0 2px;padding:0;display:flex;flex-direction:column;gap:8px}
.cmodal__points li{display:flex;gap:8px;font-size:12.5px;color:var(--ink-2);line-height:1.45}
/* Scheduler variant: Calendly needs far more room than the hand-off form did.
   The box grows and takes a definite height so the body's flex column has
   something to divide, letting the embed claim whatever the heading leaves.
   The lede and bullets go — the panel beside them already makes the pitch, and
   a real calendar is worth more than a third restatement of it. */
.cmodal--sched .cmodal__box{max-width:1020px;height:min(780px,92vh)}
.cmodal--sched .cmodal__body .lede,
.cmodal--sched .cmodal__points{display:none}
/* The box owns the height; nothing inside it scrolls the panel itself. The
   scheduler takes what the heading and the skip link leave and is allowed to
   shrink to it — flex:1 1 0 with min-height:0, because a flex child defaults to
   min-height:auto and would otherwise refuse to shrink below Calendly's own
   height, pushing the skip link out of the box. Calendly scrolls inside its
   own iframe instead. */
.cmodal--sched .cmodal__body{overflow:hidden}
.cmodal__sched{margin-top:14px;flex:1 1 0;min-height:0;overflow:hidden;border-radius:var(--r-md)}
.cmodal__sched,
.cmodal__sched .calendly-inline-widget{min-width:0!important}
.cmodal__sched .calendly-inline-widget,
.cmodal__sched iframe{width:100%;height:100%!important;border:0}
/* Always reachable, never compressed. */
.cmodal--sched .cmodal__skip{flex:none;padding-top:12px}
@media (max-width:720px){
    .cmodal--sched .cmodal__box{height:94vh}
    .cmodal__sched{margin-top:10px}
}
.cmodal__points li i{color:var(--good);flex:none;margin-top:1px;font-size:15px}
.cmodal__form{margin-top:16px;display:flex;flex-direction:column;gap:9px}
.cmodal__form input{border:1px solid var(--line);background:var(--surface-2);border-radius:var(--r-md);padding:9px 12px;font-size:12.5px;color:var(--ink);outline:none}
.cmodal__form input:focus{border-color:var(--accent);background:var(--surface)}
.cmodal__form .flatpickr-wrapper{display:block;width:100%}
.cmodal__form .flatpickr-calendar.static{margin-top:6px}
.cmodal__skip{margin-top:14px;text-align:center;font-size:12.5px;color:var(--ink-3);text-decoration:none;font-weight:600}
.cmodal__skip:hover{color:var(--ink)}
.cmodal__help{margin-top:14px;text-align:center;font-size:12.5px;color:var(--ink-3)}
.cmodal__help a{color:var(--accent);font-weight:600;text-decoration:none;display:inline-flex;align-items:center;gap:5px}
.cmodal__help a:hover{text-decoration:underline}
.cmodal--sched .cmodal__help{flex:none;padding-top:4px}

/* Contextual "Book a consult" call-to-action card */
.consult-cta{display:flex;align-items:center;gap:14px;text-decoration:none;border:1px solid var(--accent-line);background:var(--accent-soft);border-radius:var(--r-xl);padding:14px 18px;margin-bottom:var(--gap);transition:box-shadow .14s,border-color .14s}
.consult-cta:hover{box-shadow:0 10px 26px -16px rgba(103,92,167,.55);border-color:var(--accent)}
.consult-cta .ic{width:40px;height:40px;flex:none;border-radius:11px;background:var(--surface);color:var(--accent);display:grid;place-items:center;font-size:19px}
.consult-cta .tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.consult-cta .tx b{font-size:13.5px;font-weight:600;color:var(--ink)}
.consult-cta .tx span{font-size:12.5px;color:var(--ink-2);line-height:1.45}
.consult-cta .cta{flex:none;display:inline-flex;align-items:center;gap:7px;background:var(--accent);color:#fff;border-radius:var(--r-md);padding:9px 15px;font-size:13px;font-weight:600;white-space:nowrap}
@media (max-width:620px){ .consult-cta{flex-wrap:wrap} .consult-cta .cta{width:100%;justify-content:center} }

/* ── Sidebar: mini-rail by default, expands over content on hover ──────────
   The layout never changes (only width + label opacity animate) so it can't
   reflow/flicker. [data-sidebar-toggle] pins it open (html.sidebar-pinned).   */
.sidebar__logo{transition:transform .4s ease}
@media (min-width: 981px) {
    html:not(.sidebar-pinned) .sidebar{
        /* z-index sits above page content (≤20) so the rail can expand over it on
           hover, but BELOW overlay scrims/drawers/modals (40+) so a side panel
           and its scrim cover the rail instead of the rail poking through. */
        position:fixed; left:0; top:0; height:100vh; width:74px; z-index:35;
        overflow-x:hidden; overflow-y:auto; scrollbar-width:none;
        transition:width .2s cubic-bezier(.4,0,.2,1), box-shadow .2s;
    }
    html:not(.sidebar-pinned) .sidebar::-webkit-scrollbar{ width:0; height:0 }
    html:not(.sidebar-pinned) .main{ margin-left:74px; }
    /* Pin the content to its expanded width so NOTHING reflows as the rail widens —
       only the container's visible width animates (icons never move). Labels just
       fade + are clipped by the narrow rail, then fade in on hover. */
    html:not(.sidebar-pinned) .sidebar > *{ width:calc(var(--side) - 32px); flex:none }
    html:not(.sidebar-pinned) .sidebar .nav-item,
    html:not(.sidebar-pinned) .sidebar .entity-item{ white-space:nowrap }
    html:not(.sidebar-pinned) .sidebar .sidebar__wordmark,
    html:not(.sidebar-pinned) .sidebar .sidebar__label,
    html:not(.sidebar-pinned) .sidebar .nav-item > span,
    html:not(.sidebar-pinned) .sidebar .nav-item__count,
    html:not(.sidebar-pinned) .sidebar .entity-item .truncate,
    html:not(.sidebar-pinned) .sidebar .sidebar__user-meta,
    html:not(.sidebar-pinned) .sidebar .sidebar__foot form{ opacity:0; transition:opacity .1s ease }
    html:not(.sidebar-pinned) .sidebar:hover{ width:var(--side); box-shadow:16px 0 44px -20px rgba(20,18,30,.4) }
    html:not(.sidebar-pinned) .sidebar:hover .sidebar__wordmark,
    html:not(.sidebar-pinned) .sidebar:hover .sidebar__label,
    html:not(.sidebar-pinned) .sidebar:hover .nav-item > span,
    html:not(.sidebar-pinned) .sidebar:hover .nav-item__count,
    html:not(.sidebar-pinned) .sidebar:hover .entity-item .truncate,
    html:not(.sidebar-pinned) .sidebar:hover .sidebar__user-meta,
    html:not(.sidebar-pinned) .sidebar:hover .sidebar__foot form{ opacity:1; transition:opacity .16s ease .04s }
    /* Logo does a half-turn on hover */
    html:not(.sidebar-pinned) .sidebar:hover .sidebar__logo{ transform:rotate(180deg) }
    /* Collapsed rail: the hover/active pill hugs the rail (icon-sized) instead of
       spanning the pinned expanded width and being clipped by the rail edge.
       The icon is left-aligned, so shrinking the item's width never moves it. */
    html:not(.sidebar-pinned) .sidebar .nav-item,
    html:not(.sidebar-pinned) .sidebar .entity-item{ transition:background var(--t), color var(--t), width .2s cubic-bezier(.4,0,.2,1) }
    html:not(.sidebar-pinned) .sidebar:not(:hover) .nav-item,
    html:not(.sidebar-pinned) .sidebar:not(:hover) .entity-item{ width:42px }
}

/* Tailwind-utility bridges for un-migrated view bodies */
.border-line{border-color:var(--line)}
.text-ink{color:var(--ink)}.text-brand{color:var(--accent)}.text-brand-dark{color:var(--accent)}
.bg-brand{background:var(--accent)}.bg-brand-light{background:var(--accent-soft)}.border-brand{border-color:var(--accent)}
button.bg-brand,a.bg-brand,input.bg-brand,.btn-primary{background:var(--accent);color:var(--accent-ink);border:1px solid transparent;border-radius:var(--r-md);font-weight:600}
button.bg-brand:hover,a.bg-brand:hover,.btn-primary:hover{filter:brightness(1.08);color:var(--accent-ink)}
button.bg-brand:disabled,.btn-primary:disabled{opacity:.5}
a.border-line,button.border-line{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);color:var(--ink);font-weight:600}
a.border-line:hover,button.border-line:hover{border-color:var(--line-2);color:var(--ink)}
.btn-quiet,button.btn-quiet,a.btn-quiet{background:var(--surface-3)!important;color:var(--ink)!important;border:1px solid transparent!important;border-radius:var(--r-md);font-weight:600}
.btn-quiet:hover{filter:brightness(.97)}
.rounded-lg{border-radius:var(--r-md)}.rounded-xl{border-radius:var(--r-xl)}.rounded-2xl{border-radius:var(--r-xl)}.rounded-full{border-radius:var(--r-pill)}
.rounded-xl.border.border-line.bg-white,.rounded-xl.bg-white.border.border-line,.rounded-2xl.border.border-line.bg-white{box-shadow:var(--shadow)}
input[type=text],input[type=email],input[type=number],input[type=date],input[type=search],input[type=password],textarea,select{border-radius:var(--r-md);border:1px solid var(--line);background:var(--surface);color:var(--ink)}
input:focus,textarea:focus,select:focus{border-color:var(--accent)!important;box-shadow:0 0 0 3px var(--accent-soft)!important;outline:none}
/* Bare composer / search inputs opt out of the field border + focus ring; the
   container carries any focus affordance instead. */
.search input,.search input:focus{border:0!important;background:none!important;box-shadow:none!important;padding:0!important;min-height:0!important;height:auto!important}
.search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
#ask-mara-input,#ask-mara-input:focus,.mara-ai-composer textarea:focus,.ask-mara-box textarea:focus{border:0!important;background:none!important;box-shadow:none!important}
label{font-weight:600;font-size:13px}
thead th{font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3);font-weight:600}
tbody tr{border-color:var(--line)}

/* Buttons render Open Sans 600 (brand direction) */
button,.btn,.btn-primary,.btn-quiet,a.border-line,button.border-line,input[type=submit],input[type=button]{font-family:"Open Sans",system-ui,sans-serif}

/* ---- Ask MARA inline panel (partials/ask_mara.php) ---- */
.ask-mara{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:22px 24px 20px;box-shadow:var(--shadow)}
.ask-mara-head{display:flex;align-items:center;gap:13px;margin-bottom:16px}
.ask-mara-ico{width:44px;height:44px;flex:none;display:inline-flex;align-items:center;justify-content:center;border-radius:12px;background:var(--accent-soft);color:var(--accent);font-size:18px}
.ask-mara-title{font-family:var(--font-display);font-weight:600;font-size:17px;color:var(--ink);line-height:1.2}
.ask-mara-sub{font-size:13px;color:var(--ink-3)}
.ask-mara-box{background:var(--surface-2);border:1px solid var(--line);border-radius:14px;padding:14px 16px 12px}
.ask-mara-box textarea{width:100%;border:0;outline:none;resize:none;font-family:var(--font-body);font-size:14px;line-height:1.55;color:var(--ink);background:none;min-height:52px}
.ask-mara-row{display:flex;align-items:center;justify-content:space-between;margin-top:8px}
.ask-mara-powered{font-size:11.5px;color:var(--ink-3)}
.ask-mara-btn{display:inline-flex;align-items:center;gap:8px;padding:9px 18px;border:0;border-radius:11px;background:var(--accent);color:var(--accent-ink);font-family:var(--font-body);font-weight:600;font-size:13px;cursor:pointer}
.ask-mara-btn:hover{filter:brightness(1.08)}
.ask-mara-chips{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}
.ask-mara-chip{display:inline-flex;align-items:center;gap:8px;padding:9px 15px;border:1px solid var(--line);border-radius:var(--r-pill);background:var(--surface);font-family:var(--font-body);font-size:13px;font-weight:600;color:var(--ink-2);cursor:pointer}
.ask-mara-chip i{color:var(--accent)}
.ask-mara-chip:hover{border-color:var(--accent-line);color:var(--accent)}

/* ---- Ask MARA slide-over (partials/mara_ai.php) ---- */
.mara-ai{position:fixed;inset:0;z-index:80;visibility:hidden;pointer-events:none;overflow:hidden}
.mara-ai.open{visibility:visible;pointer-events:auto}
.mara-ai-backdrop{position:absolute;inset:0;background:rgba(15,14,13,.4);opacity:0;transition:opacity .18s ease}
.mara-ai.open .mara-ai-backdrop{opacity:1}
.mara-ai-panel{position:absolute;top:0;right:0;width:min(560px,94vw);height:100%;display:flex;flex-direction:column;background:var(--surface);box-shadow:var(--shadow-drawer);transform:translateX(100%);transition:transform .22s ease}
.mara-ai.open .mara-ai-panel{transform:translateX(0)}
.mara-ai-head{display:flex;align-items:center;gap:11px;padding:15px 22px;background:var(--surface);border-bottom:1px solid var(--line)}
.mara-ai-logo{width:34px;height:34px;flex:none}
.mara-ai-name{font-family:var(--font-display);font-weight:600;font-size:15px;color:var(--ink);line-height:1.1}
.mara-ai-status{font-size:12px;color:var(--ink-3);display:flex;align-items:center;gap:5px}
.mara-ai-dot{width:7px;height:7px;border-radius:50%;background:var(--good)}
.mara-ai-head .mara-ai-icon:first-of-type{margin-left:auto}
.mara-ai-icon{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border:0;background:none;border-radius:9px;color:var(--ink-3);cursor:pointer;font-size:15px}
.mara-ai-icon:hover{background:var(--surface-2);color:var(--ink)}
.mara-ai-body{flex:1;min-height:0;overflow-y:auto;padding:24px;display:flex;flex-direction:column;gap:12px;align-items:center}
.mara-ai-intro{margin:auto 0;text-align:center;padding:10px 4px;width:100%;max-width:640px}
.mara-ai-intro-logo{width:46px;height:46px;margin:0 auto 14px;display:block}
.mara-ai-intro h3{font-family:var(--font-display);font-weight:600;font-size:19px;color:var(--ink);margin:0}
.mara-ai-intro p{font-size:14px;color:var(--ink-3);margin:6px 0 18px}
.mara-ai-starters{display:flex;flex-direction:column;gap:9px}
.mara-ai-starter{display:flex;align-items:center;gap:10px;text-align:left;padding:13px 16px;border:1px solid var(--line);border-radius:13px;background:var(--surface-3);font-family:var(--font-body);font-size:14px;font-weight:600;color:var(--ink-2);cursor:pointer}
.mara-ai-starter::before{content:"\f0eb";font-family:"Font Awesome 6 Free";font-weight:900;color:var(--accent);font-size:13px}
.mara-ai-starter:hover{border-color:var(--accent-line);color:var(--accent)}
.mara-ai-thread{display:flex;flex-direction:column;gap:12px;width:100%;max-width:760px}
.mara-ai-msg{max-width:88%;padding:11px 14px;border-radius:14px;font-size:14px;line-height:1.55}
.mara-ai-user{align-self:flex-end;background:var(--accent);color:var(--accent-ink);border-bottom-right-radius:5px}
.mara-ai-assistant{align-self:flex-start;background:var(--surface-3);color:var(--ink);border:1px solid var(--line);border-bottom-left-radius:5px}
.mara-ai-error{background:var(--risk-soft);border-color:var(--risk-line);color:var(--risk)}
.mara-ai-typing{display:inline-flex;gap:4px;align-items:center}
.mara-ai-typing span{width:6px;height:6px;border-radius:50%;background:var(--ink-3);animation:mara-ai-bounce 1s infinite}
.mara-ai-typing span:nth-child(2){animation-delay:.15s}
.mara-ai-typing span:nth-child(3){animation-delay:.3s}
@keyframes mara-ai-bounce{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.mara-ai-foot{padding:12px 22px 20px}
.mara-ai-composer{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:16px;padding:7px 8px 7px 16px;width:100%;background:var(--surface-3);box-shadow:var(--shadow)}
.mara-ai-composer:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.mara-ai-composer textarea{flex:1;border:0;outline:none;resize:none;font-family:var(--font-body);font-size:14px;line-height:1.5;color:var(--ink);background:none;max-height:140px;padding:0;display:block}
.mara-ai-composer textarea:focus,.ask-mara-box textarea:focus{border:0!important;box-shadow:none!important}
.mara-ai-send{flex:none;width:36px;height:36px;border:0;border-radius:10px;background:var(--accent);color:var(--accent-ink);cursor:pointer}
.mara-ai-send:disabled{background:var(--surface-3);color:var(--ink-3);cursor:default}
.mara-ai-tag{margin:8px 2px 0;font-family:var(--font-mono);font-size:10px;letter-spacing:.04em;color:var(--ink-3);text-align:center}

/* ---- Peer chips (partials/peer_panel.php, gate1/gate2) ---- */
.mara-peer-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;border-top:1px solid var(--line);padding:10px 16px}
.mara-peer-label{display:inline-flex;align-items:center;gap:4px;margin-right:4px;font-size:12px;font-weight:600;color:var(--ink-3)}
.mara-peer{display:inline-flex;align-items:center;gap:6px;padding:4px 10px 4px 4px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-pill);font-size:12px;font-weight:600;color:var(--ink-2);cursor:pointer}
.mara-peer:hover{border-color:var(--accent);color:var(--accent)}
.mara-peer img,.mara-peer .mono{width:16px;height:16px;flex:none;border-radius:50%;object-fit:contain;background:#fff}
.mara-peer .mono{display:inline-flex;align-items:center;justify-content:center;background:var(--surface-3);color:var(--ink-3);font-size:9px;font-weight:700}
.mara-peer-more{padding:5px 10px;border:0;border-radius:var(--r-pill);background:var(--surface-3);font-size:12px;font-weight:700;color:var(--ink-2);cursor:pointer}
.mara-peer-more:hover{background:var(--accent);color:var(--accent-ink)}
.mara-peer-empty{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;border:0;border-radius:var(--r-pill);background:var(--surface-3);font-size:12px;font-weight:600;color:var(--ink-3);cursor:pointer}
.mara-peer-empty:hover{background:var(--accent);color:var(--accent-ink)}
