/* Current Scenario — horizontal score bar with hollow-ring components */
.cs-scorecard { margin-bottom: 22px; }
.cs-scorebar {
  display: flex;
  align-items: center;
  gap: 34px;
  flex-wrap: wrap;
}
.cs-scorebar-main { flex: 0 0 auto; min-width: 190px; }
.cs-rings {
  flex: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.cs-ring {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  flex: 1 1 0; min-width: 96px;
  background: none; border: none; color: inherit; font: inherit;
  padding: 8px 4px; border-radius: 10px; cursor: pointer;
  transition: background 0.14s;
}
.cs-ring:hover { background: rgba(255, 255, 255, 0.06); }
.cs-ring.on { background: rgba(255, 255, 255, 0.11); }
.cs-ring:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* reveal panel below the rings (on the navy card) */
.cs-ring-detail { display: none; }
.cs-ring-detail.show {
  display: block;
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
}
.cs-rd-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cs-rd-dot { width: 9px; height: 9px; border-radius: 50%; }
.cs-rd-name { font-family: var(--fs); font-size: 17px; color: #fff; }
.cs-rd-wt { font-family: var(--fm); font-size: 10.5px; color: rgba(255, 255, 255, 0.5); }
.cs-rd-desc { font-size: 12.5px; color: rgba(255, 255, 255, 0.72); line-height: 1.5; margin-bottom: 14px; max-width: 82ch; }
.cs-rd-metrics { display: flex; gap: 12px; flex-wrap: wrap; }
.cs-rd-metric { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; padding: 10px 14px; min-width: 140px; }
.cs-rd-l { font-family: var(--fm); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
.cs-rd-v { font-family: var(--fm); font-size: 18px; color: #fff; margin-top: 4px; }
.cs-ring-circ { position: relative; width: 76px; height: 76px; }
.cs-ring-circ svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cs-ring-track { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 6; }
.cs-ring-arc { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.cs-ring-pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--fm); font-size: 17px; font-weight: 500; color: #fff;
}
.cs-ring-lbl { font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, 0.82); text-align: center; line-height: 1.2; }
.cs-ring-wt { font-family: var(--fm); font-size: 9.5px; letter-spacing: 0.05em; color: rgba(255, 255, 255, 0.45); }

/* Strategic Scenarios — recalculate button (right-aligned, just left of the
   +/- marker, and only visible while the panel is open) */
.sm-rerun-wrap {
  display: none;          /* hidden while the panel is collapsed */
  margin-left: auto;      /* the ONLY auto margin here, so it takes all free space */
}
.collapse-panel[open] > summary > .sm-rerun-wrap { display: inline-flex; }
/* The shared +/- marker normally has margin-left:auto; on this panel give it a
   fixed gap instead so the two auto margins don't split the free space and
   strand the button mid-header. */
#sm-scn-panel > summary::after { margin-left: 12px; }

/* Strategic Scenarios — card corners: score top-left, × top-right,
   info bottom-left, delta bottom-right */
.sm-scn { display: flex; flex-direction: column; gap: 7px; }
.sm-scn-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sm-scn-name { font-size: 12.5px; font-weight: 500; color: var(--ink, #181614); line-height: 1.25; }
.sm-scn-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
.sm-scn-foot .scn-info-btn { position: static; }
.sm-scn-del { font-family: var(--fd, system-ui, sans-serif); font-size: 16px; line-height: 1; color: var(--muted, #72706a); cursor: pointer; padding: 0 4px; border-radius: 4px; }
.sm-scn-del:hover { color: var(--rust, #c0563c); background: rgba(196, 90, 56, 0.1); }
.sm-scn-lock { margin-left: auto; display: inline-flex; align-items: center; color: var(--muted, #72706a); opacity: 0.55; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.sm-scn-lock:hover { opacity: 1; background: var(--cream-mid, #eceae3); }
.sm-scn-lock.locked { opacity: 1; color: var(--navy, #1e3a7a); }
.sm-scn-locked { border-style: dashed; }

/* add tile — options expand in-flow (visible inside the box, not a clipped popup) */
.sm-scn-add { border: 1px dashed var(--line, #dbd8d0); border-radius: 8px; min-height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; background: var(--white, #fff); padding: 12px; transition: border-color 0.14s, background 0.14s; }
.sm-scn-add:hover { border-color: var(--teal, #3db98a); background: var(--cream, #f5f3ee); }
.sm-scn-add.open { align-items: stretch; justify-content: flex-start; }
.sm-scn-add-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted, #72706a); pointer-events: none; }
.sm-scn-add.open .sm-scn-add-inner { flex-direction: row; justify-content: center; gap: 6px; margin-bottom: 8px; }
.sm-scn-add.open .sm-scn-add-plus { font-size: 15px; }
.sm-scn-add-plus { font-size: 26px; line-height: 1; color: var(--teal-dark, #2a9270); }
.sm-scn-add-lbl { font-size: 12px; }
.sm-scn-add-menu { display: none; flex-direction: column; gap: 4px; width: 100%; }
.sm-scn-add.open .sm-scn-add-menu { display: flex; }
.sm-scn-add-item { text-align: left; border: 1px solid var(--line-soft, #eceae4); background: var(--cream, #f5f3ee); font-family: var(--fd, system-ui, sans-serif); font-size: 12px; color: var(--ink, #181614); padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.sm-scn-add-item:hover { background: var(--teal-pale, #d4f2e7); border-color: var(--teal, #3db98a); }
.sm-scn-add-custom { margin-top: 4px; border-style: dashed; color: var(--teal-dark, #2a9270); font-weight: 500; }
.sm-scn-badge-custom { background: var(--teal-dark, #2a9270); }
.sm-rerun {
  font-family: var(--fd, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 500;
  color: var(--navy, #1e3a7a);
  background: var(--cream, #f5f3ee);
  border: 1px solid var(--line, #dbd8d0);
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s, border-color 0.14s;
}
.sm-rerun:hover { background: var(--cream-mid, #eceae3); border-color: var(--teal, #3db98a); }

/* Projections — Alerts / Metrics / Strategy as an inline tab strip below the
   charts (Robinhood-style): plain labels with icons, the active tab underlined
   in teal, and its detail flowing unboxed underneath. */
.cs-tabs { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 20px 4px 0; border-bottom: 1px solid var(--line-soft); }
.cs-tab {
  display: flex; align-items: center; gap: 8px;
  border: none; background: none; cursor: pointer; position: relative;
  padding: 6px 2px 13px;
  font-family: var(--fm); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  transition: color 0.12s;
}
.cs-tab svg { width: 17px; height: 17px; }
.cs-tab:hover { color: var(--ink2); }
.cs-tab.on { color: var(--teal-dark); }
.cs-tab.on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--teal-dark); border-radius: 2px;
}
.cs-tab-badge {
  font-size: 10px; min-width: 17px; height: 17px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--cream-mid); color: var(--muted);
}
.cs-tab-badge:empty { display: none; }
.cs-tab-badge.bad { background: rgba(192, 86, 60, 0.14); color: var(--rust); }
.cs-tab-badge.warn { background: rgba(232, 201, 106, 0.24); color: #8a5a10; }
.cs-tab-badge.ok { background: rgba(61, 185, 138, 0.14); color: var(--teal-dim); }
.cs-tab-body { padding: 20px 4px 8px; }
.cs-tab-body .cs-metrics-full { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* Key Metrics: the partner-returns figures stack vertically beside the
   capital stacks so the column fills its space */
.cs-tab-body .cs-met-right .cs-metrics-full { grid-template-columns: 1fr; gap: 14px; }
.cs-strat-name { font-family: var(--fs); font-size: 22px; color: var(--navy); margin-bottom: 4px; }
.cs-tab-body #cs-projects { margin-top: 16px; }
/* the Graphs / Financials / Owners views hang off the same strip */
#page-current .cs-view { margin-top: 20px; }
#sm-sub-model .sm-view { margin-top: 20px; }
/* the modeler's main column already spaces its children (flex gap) — the
   strip's own top margin would double up under Compare Ownership Models */
#sm-sub-model .cs-tabs { margin-top: 0; }
/* dashboard: Property Performance / Loan Terms behind the same strip */
#page-dashboard .db-view { margin-top: 18px; }
.db-view-meta { font-family: var(--fm); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.db-view-meta:empty { display: none; }
/* Insights: a rotating card deck — one score component per card, weakest
   first, advancing every 12s; picking a chip pauses to focus. */
.csi-car { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 10px 32px; align-items: start; }
@media (max-width: 900px) { .csi-car { grid-template-columns: 1fr; } }
.csi-nav { display: flex; flex-direction: column; gap: 7px; }
.csi-chip { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--white); border-radius: 10px; padding: 10px 13px; font-size: 12.5px; color: var(--ink2); cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.csi-chip:hover { border-color: var(--teal); }
.csi-chip.on { border-color: var(--teal-dark); background: rgba(61, 185, 138, 0.10); color: var(--ink); }
.csi-chip .csi-score { min-width: 30px; height: 20px; font-size: 10.5px; flex: 0 0 auto; }
.csi-chip .csi-score.info { background: var(--cream-mid); color: var(--muted); }
.csi-chip-t { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.csi-chip-sub { font-family: var(--fm); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust); font-weight: 600; }
.csi-chip.attn { border-color: rgba(192, 86, 60, 0.45); }
.csi-chip.attn.on { border-color: var(--rust); background: rgba(192, 86, 60, 0.07); }
.csi-card { display: none; }
.csi-card.on { display: block; min-height: 56vh; animation: csiFade 0.35s ease; }
@keyframes csiFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.csi-card .csi-head { margin-bottom: 14px; }
.csi-card .csi-head b { font-size: 27px; }
.csi-card .csi-body { font-size: 16px; line-height: 1.8; max-width: 980px; }
.csi-card .csi-flag { font-size: 15px; }
.csi-card .csi-flag-years { font-size: 12px; }
.csi-card .csi-refi-row { font-size: 16px; padding: 5px 0; }
.csi-sec { padding: 15px 2px; border-bottom: 1px solid var(--line-soft); }
.csi-sec:last-child { border-bottom: none; }
.csi-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.csi-head b { font-family: var(--fs); font-size: 17px; color: var(--navy); font-weight: 500; }
.csi-wt { font-family: var(--fm); font-size: 9.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.csi-score { font-family: var(--fm); font-size: 12px; font-weight: 600; min-width: 34px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; padding: 0 8px; }
.csi-score.good { background: rgba(61, 185, 138, 0.14); color: var(--teal-dim); }
.csi-score.warn { background: rgba(232, 201, 106, 0.22); color: #8a5a10; }
.csi-score.bad { background: rgba(192, 86, 60, 0.14); color: var(--rust); }
.csi-body { font-size: 13px; line-height: 1.65; color: var(--ink2); max-width: 880px; }
.csi-body > .alerts { margin-top: 10px; }
.csi-refi-row { display: flex; gap: 12px; align-items: baseline; padding: 3px 0; }
.csi-refi-row b { font-family: var(--fm); color: var(--navy); min-width: 44px; }
/* alerts as narrative flags: a colored marker, prose body, muted year list */
.csi-flag { position: relative; margin-top: 9px; padding-left: 15px; font-size: 13px; line-height: 1.6; color: var(--ink2); }
.csi-flag::before { content: ''; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 50%; }
.csi-flag.warn::before { background: var(--gold-deep); }
.csi-flag.danger::before { background: var(--rust); }
.csi-flag b { color: var(--ink); }
.csi-flag-years { display: block; font-family: var(--fm); font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.cs-strat-tag { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 16px; }
.cs-strat-sub { font-family: var(--fm); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.cs-strat-empty { font-size: 13px; color: var(--muted); }

/* Metrics — grouped detail */
.cs-mg { margin-bottom: 20px; }
.cs-mg:last-child { margin-bottom: 0; }
.cs-mg-t { display: flex; align-items: center; gap: 7px; font-family: var(--fm); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.cs-mg-ic { display: inline-flex; color: var(--teal-dark); }
.cs-mg-ic svg { width: 14px; height: 14px; }
.cs-out { display: flex; align-items: flex-start; gap: 10px; }
.cs-out-ic { display: inline-flex; color: var(--teal-dark); background: var(--teal-pale, #d4f2e7); border-radius: 8px; padding: 7px; flex: 0 0 auto; margin-top: 2px; }
.cs-out-ic svg { width: 15px; height: 15px; }
/* capital stack diagrams: model-start and terminal stacks side by side,
   values labeled on the segments themselves */
.cs-met-grid { display: grid; grid-template-columns: minmax(330px, 1.2fr) 1fr; gap: 26px; margin-bottom: 20px; }
@media (max-width: 820px) { .cs-met-grid { grid-template-columns: 1fr; } }
.cs-cap-pair { display: flex; gap: 26px; align-items: flex-end; flex-wrap: wrap; }
.cs-cap-col { display: flex; flex-direction: column; flex: 1 1 150px; min-width: 150px; }
.cs-cap-title { font-family: var(--fm); font-size: 11px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--navy); margin-bottom: 9px; }
.cs-cap-title span { display: block; font-size: 10px; font-weight: 400; letter-spacing: 0.02em; text-transform: none; color: var(--muted); margin-top: 2px; }
.cs-cap-flex { display: flex; gap: 9px; height: 230px; }
.cs-cap-bar { width: 54px; display: flex; flex-direction: column; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); flex: 0 0 auto; }
.cs-cap-seg { min-height: 8px; transition: height 0.3s; }
.cs-cap-lbs { display: flex; flex-direction: column; min-width: 0; }
.cs-cap-lb { display: flex; flex-direction: column; justify-content: center; min-height: 32px; line-height: 1.25; overflow: visible; }
.cs-cap-lb b { font-family: var(--fm); font-size: 10px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink2); }
.cs-cap-lb span { font-family: var(--fm); font-size: 11.5px; color: var(--navy); white-space: nowrap; }

/* Strategy — horizontal 2026–2055 timeline (events alternate above/below) */
.cs-tl-h { overflow-x: auto; overflow-y: hidden; padding: 4px 0 10px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.cs-tl-h::-webkit-scrollbar { height: 9px; }
.cs-tl-h::-webkit-scrollbar-thumb { background: var(--cream-dark, #d8d4c6); border-radius: 5px; }
.cs-tl-h::-webkit-scrollbar-thumb:hover { background: var(--muted, #72706a); }
.cs-tl-h::-webkit-scrollbar-track { background: transparent; }
.cs-tl-track { position: relative; display: flex; gap: 8px; padding: 84px 8px; min-width: min-content; }
.cs-tl-track::before { content: ''; position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; background: var(--line); transform: translateY(-1px); }
.cs-tl-ev { position: relative; flex: 0 0 auto; width: 152px; display: grid; grid-template-rows: 1fr auto 1fr; align-items: center; }
.cs-tl-node { grid-row: 2; justify-self: center; width: 13px; height: 13px; border-radius: 50%; background: var(--muted); border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--line); z-index: 1; }
.cs-tl-ev.refi .cs-tl-node { background: var(--gold-deep); }
.cs-tl-ev.buyout .cs-tl-node { background: var(--rust); }
.cs-tl-ev.buyin .cs-tl-node { background: var(--teal); }
.cs-tl-card { background: var(--cream); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; position: relative; }
.cs-tl-ev.up .cs-tl-card { grid-row: 1; align-self: end; margin-bottom: 14px; }
.cs-tl-ev.down .cs-tl-card { grid-row: 3; align-self: start; margin-top: 14px; }
.cs-tl-ev.up .cs-tl-card::after { content: ''; position: absolute; top: 100%; left: 50%; width: 2px; height: 14px; background: var(--line); transform: translateX(-1px); }
.cs-tl-ev.down .cs-tl-card::after { content: ''; position: absolute; bottom: 100%; left: 50%; width: 2px; height: 14px; background: var(--line); transform: translateX(-1px); }
.cs-tl-yr { font-family: var(--fm); font-weight: 500; font-size: 12px; color: var(--navy); margin-bottom: 3px; }
.cs-tl-txt { font-size: 11px; color: var(--ink2); line-height: 1.3; }

/* Current Scenario view toggle (Trajectory / Financials / Partner Outcomes) */
.cs-view-head { align-items: center; }
.cs-view-toggle { display: inline-flex; gap: 2px; background: var(--cream-mid, #eceae3); border-radius: 8px; padding: 3px; }
/* score card and KPI column stretch to the same height so their bottoms
   align; the KPI grid's two 1fr rows absorb the extra space */
.db-hero { align-items: stretch; }
/* toggle rides at the bottom-right of the title row, hovering just above the
   KPI cards; the hero row then holds the score card + KPIs, top-aligned */
.db-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.db-head .db-title { margin-bottom: 0; }
.db-basis-toggle { flex: 0 0 auto; }
.cs-vseg, .sm-vseg, .db-bseg {
  border: none;
  background: none;
  font-family: var(--fd, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted, #72706a);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.cs-vseg:hover, .sm-vseg:hover, .db-bseg:hover { color: var(--ink, #181614); }
.cs-vseg.on, .sm-vseg.on, .db-bseg.on { background: var(--white, #fff); color: var(--navy, #1e3a7a); box-shadow: 0 1px 3px rgba(14, 31, 71, 0.12); }
.cs-partners-meta { margin-bottom: 12px; }
@media (max-width: 620px) {
  .cs-view-toggle { flex-wrap: wrap; }
  .cs-vseg, .sm-vseg, .db-bseg { font-size: 11px; padding: 5px 9px; }
}

/* CMAC admin insights page */
.ins-search-row { margin-bottom: 16px; }
.ins-search-row input {
  width: 100%;
  max-width: 340px;
  padding: 9px 13px;
  border: 1px solid var(--line, #dbd8d0);
  border-radius: 7px;
  font-size: 13px;
  font-family: var(--fd, system-ui, sans-serif);
  color: var(--ink, #181614);
  background: var(--white, #fff);
  outline: none;
}
.ins-search-row input:focus { border-color: var(--teal, #3db98a); }

.ins-scroll { overflow-x: auto; }
.ins-table.ins-selectable tbody tr.ins-row { cursor: pointer; transition: background 0.12s; }
.ins-table.ins-selectable tbody tr.ins-row:hover { background: var(--cream, #f5f3ee); }
.ins-table.ins-selectable tbody tr.ins-row.active { background: var(--teal-pale, #d4f2e7); }
.ins-active-tag {
  font-family: var(--fm, monospace);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-dim, #1a6b4e);
  background: rgba(61, 185, 138, 0.16);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---- Team & Access page ---- */
.team-add-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.team-add-row input {
  flex: 1;
  min-width: 180px;
  padding: 9px 13px;
  border: 1px solid var(--line, #dbd8d0);
  border-radius: 7px;
  font-size: 13px;
  font-family: var(--fd, system-ui, sans-serif);
  color: var(--ink, #181614);
  background: var(--white, #fff);
  outline: none;
}
.team-add-row input:focus { border-color: var(--teal, #3db98a); }
.team-add-row .gi-btn { flex: 0 0 auto; }
.team-note { font-size: 12px; color: var(--muted, #72706a); line-height: 1.45; }
.team-select {
  font-family: var(--fd, system-ui, sans-serif);
  font-size: 12.5px;
  color: var(--ink, #181614);
  background: var(--white, #fff);
  border: 1px solid var(--line, #dbd8d0);
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
}
.team-select:disabled { color: var(--muted, #72706a); background: var(--cream-mid, #eceae3); cursor: default; }
.team-input {
  font-family: var(--fd, system-ui, sans-serif);
  font-size: 12.5px;
  color: var(--ink, #181614);
  background: var(--white, #fff);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  width: 100%;
  max-width: 320px;
}
.team-input:hover { border-color: var(--line, #dbd8d0); }
.team-input:focus { outline: none; border-color: var(--teal, #3db98a); background: var(--white, #fff); }
.team-msg { font-size: 12.5px; margin-bottom: 14px; min-height: 1em; color: var(--teal-dark, #2a9270); opacity: 0; transition: opacity 0.15s; }
.team-msg.show { opacity: 1; }
.team-msg.err { color: var(--danger, #8a1e1e); }
.team-actions { text-align: right; white-space: nowrap; }
.team-del { background: none; border: 1px solid var(--line, #dbd8d0); color: var(--danger, #8a1e1e); font-family: var(--fd, system-ui, sans-serif); font-size: 11px; padding: 4px 10px; border-radius: 5px; cursor: pointer; }
.team-del:hover { background: #fbeaea; border-color: var(--danger, #8a1e1e); }
.team-pw { background: none; border: 1px solid var(--line, #dbd8d0); color: var(--teal-dark, #2a9270); font-family: var(--fd, system-ui, sans-serif); font-size: 11px; padding: 4px 10px; border-radius: 5px; cursor: pointer; margin-right: 6px; }
.team-pw:hover { background: var(--teal-pale, #d4f2e7); border-color: var(--teal, #3db98a); }
.team-you { font-family: var(--fm, monospace); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #72706a); background: var(--cream-mid, #eceae3); border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
.team-lastseen { font-family: var(--fd, system-ui, sans-serif); font-size: 12px; color: var(--ink2, #2e2b27); white-space: nowrap; }
.team-lastseen.team-muted { color: var(--muted, #72706a); }

/* ================= Quick Update ================= */
/* sidebar utility buttons (Quick Update, Notifications, Account) — same
   icon-rail row treatment as the nav tabs */
.qu-btn {
  display: flex; align-items: center; gap: 13px; width: 100%;
  font-family: var(--fd, system-ui, sans-serif); font-size: 12.5px; font-weight: 500;
  color: rgba(255, 255, 255, 0.55); background: transparent;
  border: 1px solid transparent; border-radius: 8px; text-align: left;
  padding: 11px 11px; cursor: pointer; white-space: nowrap; transition: color 0.14s, background 0.14s;
}
.qu-btn svg { flex: 0 0 auto; }
.qu-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.qu-btn.on { background: rgba(61, 185, 138, 0.14); border: 1px solid rgba(61, 185, 138, 0.35); color: #6fdcae; }

/* Quick Update — name-only expandable items + short partner list */
.qu-item { border: 1px solid var(--line, #dbd8d0); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.qu-item > summary { list-style: none; cursor: pointer; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--cream, #f5f3ee); }
.qu-item > summary::-webkit-details-marker { display: none; }
.qu-item-name { font-size: 13.5px; font-weight: 500; color: var(--ink, #181614); }
.qu-item-edit {
  pointer-events: none;              /* clicks fall through to the summary, which expands */
  font-family: var(--fd, system-ui, sans-serif); font-size: 11px; font-weight: 500;
  color: var(--navy, #1e3a7a); background: var(--white, #fff);
  border: 1px solid var(--line, #dbd8d0); border-radius: 6px; padding: 4px 12px;
}
.qu-item[open] .qu-item-edit { color: var(--muted, #72706a); background: var(--cream-mid, #eceae3); }
.qu-item-body { padding: 12px 14px; }
.qu-loan { border-bottom: 1px solid var(--line-soft, #eceae4); padding-bottom: 10px; margin-bottom: 10px; }
.qu-loan:last-of-type { border-bottom: none; margin-bottom: 6px; }
.qu-partner-list { max-height: 116px; overflow-y: auto; border: 1px solid var(--line-soft, #eceae4); border-radius: 8px; margin-bottom: 10px; }
.qu-partner-list .qu-partner { padding: 8px 12px; }
.qu-partner-list .qu-partner:last-child { border-bottom: none; }
.qu-addp { margin-top: 10px; padding: 12px; border: 1px solid var(--line-soft, #eceae4); border-radius: 8px; }
.qu-btn-primary.sm { padding: 7px 12px; font-size: 12px; margin-top: 4px; }

.qu-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(14, 31, 71, 0.5); display: flex; align-items: center; justify-content: center; padding: 24px; }
.qu-panel { background: var(--white, #fff); border-radius: 12px; width: 100%; max-width: 720px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(10, 23, 51, 0.4); }
.qu-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line, #dbd8d0); }
.qu-title { font-family: var(--fs, Georgia, serif); font-size: 24px; color: var(--navy, #1e3a7a); }
.qu-sub { font-size: 12.5px; color: var(--muted, #72706a); margin-top: 3px; }
.qu-body { overflow-y: auto; padding: 18px 24px; flex: 1; }
.qu-foot { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line, #dbd8d0); }
.qu-foot-btns { display: flex; gap: 10px; margin-left: auto; }
.qu-status { font-size: 12.5px; color: var(--teal-dark, #2a9270); }
.qu-status:not(.show) { visibility: hidden; }
.qu-status.err { color: var(--danger, #8a1e1e); }
.qu-btn-primary { background: var(--teal, #3db98a); color: var(--navy-dark, #0e1f47); border: none; border-radius: 7px; padding: 10px 18px; font-size: 13px; font-weight: 600; font-family: var(--fd, system-ui, sans-serif); cursor: pointer; }
.qu-btn-primary:hover { background: #4dcca0; }
.qu-btn-ghost { background: none; border: 1px solid var(--line, #dbd8d0); color: var(--navy, #1e3a7a); border-radius: 7px; padding: 10px 16px; font-size: 13px; font-family: var(--fd, system-ui, sans-serif); cursor: pointer; }

.qu-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.qu-field label { font-family: var(--fm, monospace); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted, #72706a); }
.qu-inp, #qu-entity { padding: 8px 11px; border: 1px solid var(--line, #dbd8d0); border-radius: 6px; font-size: 13px; font-family: var(--fd, system-ui, sans-serif); background: var(--cream, #f5f3ee); color: var(--ink, #181614); outline: none; width: 100%; }
.qu-inp:focus, #qu-entity:focus { border-color: var(--teal, #3db98a); background: #fff; }
#qu-entity { font-size: 14px; background: #fff; }
.qu-hint, .qu-none, .qu-empty, .qu-loading { font-size: 12.5px; color: var(--muted, #72706a); }
.qu-empty, .qu-loading { padding: 20px 0; }
.qu-empty.qu-err, .qu-err { color: var(--danger, #8a1e1e); }
.qu-entity-tag { font-size: 12.5px; color: var(--ink2, #2e2b27); margin-bottom: 14px; }
.qu-section { border: 1px solid var(--line, #dbd8d0); border-radius: 9px; margin-bottom: 14px; overflow: hidden; }
.qu-section > summary { list-style: none; cursor: pointer; padding: 12px 16px; background: var(--cream, #f5f3ee); font-family: var(--fs, Georgia, serif); font-size: 16px; color: var(--navy, #1e3a7a); }
.qu-section > summary::-webkit-details-marker { display: none; }
.qu-section > summary::after { content: '+'; float: right; font-family: var(--fm, monospace); color: var(--muted, #72706a); }
.qu-section[open] > summary::after { content: '\2212'; }
.qu-section-body { padding: 14px 16px; }
.qu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; }
.qu-card, .qu-loan, .qu-newp { border: 1px solid var(--line-soft, #eceae4); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.qu-card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.qu-card-head .qu-b-label { font-weight: 500; }
.qu-remove { background: none; border: 1px solid var(--line, #dbd8d0); color: var(--danger, #8a1e1e); font-size: 11px; padding: 4px 9px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.qu-remove:hover { background: #fbeaea; }
.qu-add { background: none; border: 1px dashed var(--line, #dbd8d0); color: var(--teal-dark, #2a9270); font-size: 12px; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-family: var(--fd, system-ui, sans-serif); }
.qu-add.sm { font-size: 11px; padding: 6px 10px; }
.qu-add:hover { border-color: var(--teal, #3db98a); }
.qu-fin-b { margin-bottom: 14px; }
.qu-fin-b-t, .qu-sub-t { font-family: var(--fm, monospace); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #72706a); margin-bottom: 8px; }
.qu-partner { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft, #eceae4); }
.qu-partner-n { flex: 1; font-size: 13px; color: var(--ink, #181614); }
.qu-partner-o { font-family: var(--fm, monospace); font-size: 12px; color: var(--muted, #72706a); }
.ins-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ins-table th {
  text-align: left;
  font-family: var(--fm);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ins-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  white-space: nowrap;
}
.ins-table tbody tr:last-child td { border-bottom: none; }
.ins-table .ins-num { text-align: right; font-family: var(--fm); }
.ins-table .ins-muted { color: var(--muted); }
.ins-table .ins-err { color: var(--danger); font-style: italic; }

.ins-empty, .ins-loading {
  padding: 20px 4px;
  color: var(--muted);
  font-size: 13px;
}
.ins-err { color: var(--danger); font-size: 13px; padding: 12px 4px; }

.ins-client {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.ins-client > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--cream);
  user-select: none;
}
.ins-client > summary::-webkit-details-marker { display: none; }
.ins-client > summary::before {
  content: '+';
  font-family: var(--fm);
  color: var(--muted);
  margin-right: 2px;
}
.ins-client[open] > summary::before { content: '−'; }
.ins-client-name {
  font-family: var(--fs);
  font-size: 15px;
  color: var(--navy);
}
.ins-client-sum {
  font-family: var(--fm);
  font-size: 11px;
  color: var(--muted);
}
.ins-client .ins-loans { border-top: 1px solid var(--line-soft); }
.ins-client .ins-loans th { background: var(--white); }

/* ---- refinance score (debt overview) ---- */
.refi-bench {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--cream, #f5f3ee);
  border: 1px solid var(--line, #dbd8d0);
  border-radius: 8px;
  font-size: 12px;
}
.refi-bench-lbl { font-family: var(--fm, monospace); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #72706a); }
.refi-bench-asof { font-family: var(--fm, monospace); font-size: 9.5px; letter-spacing: 0.04em; color: var(--teal-dark, #2a9270); background: var(--teal-pale, #d4f2e7); padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.refi-bench label { color: var(--ink2, #2e2b27); display: inline-flex; align-items: center; gap: 5px; }
.refi-bench input {
  width: 62px;
  padding: 4px 6px;
  border: 1px solid var(--line, #dbd8d0);
  border-radius: 5px;
  font-family: var(--fm, monospace);
  font-size: 12px;
  text-align: right;
  background: var(--white, #fff);
}
.refi-badge {
  flex: 0 0 auto;
  font-family: var(--fm, monospace);
  font-size: 13px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 6px;
  margin-right: 4px;
}
.refi-badge-max { font-size: 9px; opacity: 0.7; }
.refi-badge.high { background: rgba(61, 185, 138, 0.18); color: var(--teal-dim, #1a6b4e); border: 1px solid rgba(61, 185, 138, 0.35); }
.refi-badge.mid { background: rgba(232, 201, 106, 0.22); color: var(--gold-deep, #b8954a); border: 1px solid rgba(232, 201, 106, 0.5); }
.refi-badge.low { background: var(--cream-mid, #eceae3); color: var(--muted, #72706a); border: 1px solid var(--line, #dbd8d0); }
.refi-notes { font-family: var(--fd, system-ui, sans-serif); color: var(--ink2, #2e2b27); font-size: 11px; }
.refi-breakdown { padding: 14px 16px; border-top: 1px solid var(--line-soft, #eceae4); }
.refi-breakdown-t { font-family: var(--fm, monospace); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #72706a); margin-bottom: 10px; }
.refi-factor { display: flex; align-items: center; gap: 12px; margin-bottom: 7px; }
.refi-factor-l { flex: 0 0 210px; font-size: 12px; color: var(--ink2, #2e2b27); }
.refi-factor-bar { flex: 1; height: 6px; background: var(--cream-dark, #d8d4c6); border-radius: 3px; overflow: hidden; }
.refi-factor-bar > span { display: block; height: 100%; background: var(--teal, #3db98a); border-radius: 3px; }
.refi-breakdown-note { font-size: 11px; color: var(--muted, #72706a); margin-top: 8px; }
@media (max-width: 620px) { .refi-factor-l { flex-basis: 130px; } }

/* ---- session: auto-save status toast ---- */
.cmac-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9998;
  background: var(--navy-dark, #0e1f47);
  color: #fff;
  font-family: var(--fm, monospace);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(14, 31, 71, 0.28);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
}
.cmac-status.show { opacity: 1; transform: translateY(0); }
.cmac-status.err { background: var(--danger, #8a1e1e); }

/* ---- session: version history modal ---- */
.cmac-hist-ov {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(14, 31, 71, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cmac-hist-panel {
  width: 100%;
  max-width: 460px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--white, #fff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(10, 23, 51, 0.4);
}
.cmac-hist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line, #dbd8d0);
}
.cmac-hist-head h3 { font-family: var(--fs); font-size: 18px; color: var(--navy); font-weight: 400; }
.cmac-hist-x { background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.cmac-hist-list { overflow-y: auto; padding: 8px 18px 18px; }
.cmac-hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft, #eceae4);
}
.cmac-hist-row:last-child { border-bottom: none; }
.cmac-hist-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.cmac-hist-when { font-family: var(--fm); font-size: 11px; color: var(--muted); margin-top: 2px; }
.cmac-hist-empty { padding: 20px 0; color: var(--muted); font-size: 13px; }
