:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --border: #e3e3df;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #1a6b3c;
  --accent-soft: #e7f1ea;
  --row-alt: #fafaf8;
  --total: #f0efea;
  --subtotal: #f6f5f1;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: grid;
  grid-template-columns: 260px 1fr;
}

/* ─── Login ─── */
.login-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}
.login-overlay.active { display: flex; }
body.locked > aside,
body.locked > main { visibility: hidden; }
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 36px;
  width: 380px; max-width: calc(100% - 32px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.06);
}
/* The pricing mode is wider than the standard login modes so the two
   plan cards can sit side by side comfortably. */
.login-card.is-pricing { width: 620px; }

/* ── Pricing modal ─────────────────────────────────────────────────── */
.pricing-mode .login-title { font-size: 24px; }
.pricing-mode .login-sub  { font-size: 13px; margin-bottom: 18px; }

.pricing-benefits {
  list-style: none; padding: 0; margin: 0 0 22px;
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; row-gap: 8px;
  font-size: 13px; color: var(--text);
}
.pricing-benefits li { display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.pricing-benefits .check {
  color: var(--accent); font-weight: 700; flex-shrink: 0; margin-top: 1px;
}

.pricing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.pricing-card {
  position: relative; text-align: left; cursor: pointer;
  background: var(--panel); color: var(--text);
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 18px 18px 16px;
  font: inherit;
  transition: border-color 120ms, box-shadow 120ms, transform 120ms;
}
.pricing-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(26,107,60,0.10);
  transform: translateY(-1px);
}
.pricing-card--featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--panel) 60%);
}
.pricing-badge {
  position: absolute; top: -10px; right: 14px;
  background: var(--accent); color: white;
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px;
}
.pricing-plan-name { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 6px; }
.pricing-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.pricing-amt { font-size: 26px; font-weight: 700; color: var(--text); }
.pricing-per { font-size: 12px; color: var(--muted); }
.pricing-sub { font-size: 12px; color: var(--muted); min-height: 32px; margin-bottom: 12px; }
.pricing-cta {
  display: inline-block;
  background: var(--accent); color: white;
  padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 600;
}
.pricing-card:hover .pricing-cta { filter: brightness(0.95); }
.pricing-footer { margin-top: 6px; }

/* ── Post-signup thank-you block ───────────────────────────────────── */
.thanks-block {
  background: var(--accent-soft);
  border: 1px solid #c8e0d2;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px; line-height: 1.5;
  margin: 8px 0 14px;
}
.thanks-block p { margin: 0 0 8px; }
.thanks-block p:last-child { margin-bottom: 0; }
.thanks-block a { color: var(--accent); }
.login-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 20px; }
.login-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* ── DCMW Research wordmark ─────────────────────────────────────── */
.dcmw-logo {
  display: flex; flex-direction: column; align-items: center;
  line-height: 1; color: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
.dcmw-logo .dcmw-mark {
  font-weight: 800; letter-spacing: -0.02em;
}
.dcmw-logo .dcmw-sub {
  font-weight: 500; letter-spacing: 0.32em;
  /* Optical alignment: shift sub right by half a letter-space to
     compensate for the trailing letter-spacing pulling text left. */
  text-indent: 0.32em;
}
.dcmw-logo--lg .dcmw-mark { font-size: 44px; }
.dcmw-logo--lg .dcmw-sub  { font-size: 11px; margin-top: 6px; }
.dcmw-logo--sm .dcmw-mark { font-size: 22px; }
.dcmw-logo--sm .dcmw-sub  { font-size: 7.5px; margin-top: 3px; }
/* Sidebar override: top-left brand should align left, not center. */
.sidebar .dcmw-logo { align-items: flex-start; }
.sidebar .dcmw-logo .dcmw-sub { text-indent: 0; }
.login-title { font-size: 22px; margin: 0 0 6px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.login-field input {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font: inherit; background: white; color: var(--text);
}
.login-field input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.login-error {
  background: #fdecea; color: #8a2018; border: 1px solid #f3c0bb;
  border-radius: 6px; padding: 8px 10px; font-size: 12px;
}
.login-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.login-btn {
  padding: 9px 12px; border-radius: 6px; font: inherit; font-size: 13px;
  cursor: pointer; border: 1px solid transparent;
}
.login-btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.login-btn-primary:hover { filter: brightness(0.95); }
.login-btn-guest { background: white; color: var(--text); border-color: var(--border); }
.login-btn-guest:hover { background: var(--accent-soft); border-color: var(--accent); }
.login-links {
  margin-top: 10px; text-align: center; font-size: 12px; color: var(--muted);
}
.login-links a { color: var(--accent); text-decoration: none; }
.login-links a:hover { text-decoration: underline; }
.login-link-sep { margin: 0 6px; }
.login-mode[hidden] { display: none; }
.login-disclaimer {
  margin-top: 18px; padding: 10px 12px;
  background: #fdf6e3; border: 1px solid #ecd9a4;
  border-radius: 6px; font-size: 11px; line-height: 1.45;
  color: #6b5a17;
}
.login-disclaimer strong { color: #4a3f10; }

/* ── Paywall for guest historical charts ────────────────────────── */
/* The original chart contents are removed from layout entirely; a
   self-contained locked placeholder takes their place so guests can't
   peek at any data through a blur. */
.paywall-blur-host > .paywall-blur-inner { display: none !important; }

.paywall-locked {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  min-height: 320px;
  padding: 32px 24px;
  background:
    repeating-linear-gradient(135deg,
      rgba(26,107,60,0.03) 0 12px,
      rgba(26,107,60,0.06) 12px 24px);
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin: 8px 0 4px;
}
.paywall-locked .paywall-lock-icon {
  width: 44px; height: 44px; margin-bottom: 14px;
  color: var(--accent);
}
.paywall-locked .paywall-headline {
  font-weight: 700; font-size: 16px; margin-bottom: 6px; color: var(--text);
  display: inline-flex; align-items: center; gap: 8px;
}
.paywall-locked .paywall-sub {
  font-size: 13px; color: var(--muted); margin-bottom: 16px;
  max-width: 360px;
}
.paywall-locked .paywall-cta {
  background: var(--accent); color: white; border: none;
  padding: 10px 18px; border-radius: 6px; font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.paywall-locked .paywall-cta:hover { filter: brightness(0.95); }
.paywall-locked .paywall-cta svg { width: 14px; height: 14px; }

.user-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); margin-left: 12px;
}
.user-badge .user-name { font-weight: 600; color: var(--text); }
.user-badge .logout-link {
  color: var(--accent); cursor: pointer; text-decoration: none;
  border: none; background: none; padding: 0; font: inherit;
}
.user-badge .logout-link:hover { text-decoration: underline; }

/* ─── Sidebar ─── */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 4px 8px 16px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.brand .version { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 400; }

#nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 6px; cursor: pointer; color: var(--text);
  font-size: 13px;
}
.nav-item:hover { background: var(--accent-soft); }
.nav-item.active { background: #2b2b2b; color: white; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); padding: 12px 10px 4px; }
.nav-section-toggle {
  display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  background: #e2e2dc; color: #333; font-weight: 700;
  padding: 8px 10px; margin: 10px 0 4px; border-radius: 6px;
}
.nav-section-toggle:hover { background: #d6d6cf; color: var(--text); }
.nav-caret { font-size: 14px; width: 14px; display: inline-block; }
.nav-subsection { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); padding: 8px 10px 2px 18px; opacity: 0.75; }
.nav-item .ticker { width: 56px; padding-right: 8px; font-weight: 600; font-size: 11px; color: var(--muted); flex-shrink: 0; }
.nav-item.active .ticker { color: #c8e6d2; }
.nav-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Subscriber-tier items shown to guests with a lock icon. */
.nav-item .nav-item-label { flex: 1; }
.nav-item-locked { color: var(--muted); }
.nav-item-locked:hover { color: var(--text); background: var(--accent-soft); }
.nav-item-lock { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.75; }
.nav-item-locked:hover .nav-item-lock { opacity: 1; }

/* ─── Beta banner (sitewide, until payments go live) ─── */
.beta-banner {
  background: #b00020;
  color: white;
  font-size: 12px; line-height: 1.4;
  padding: 6px 24px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid #8a0019;
}
.beta-banner strong {
  background: white; color: #b00020;
  font-size: 10px; font-weight: 800; letter-spacing: 0.6px;
  padding: 2px 6px; border-radius: 3px; flex-shrink: 0;
}
.beta-banner-msg { opacity: 0.95; }

/* "Coming soon" callout shown inside the pricing modal until billing
   goes live. */
.pricing-coming-soon {
  background: #fef3c7;
  border: 1px solid #f5d68a;
  color: #5b4708;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px; line-height: 1.5;
  margin-bottom: 16px;
}
.pricing-coming-soon strong { color: #b08312; }

/* ─── Main ─── */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.crumbs { font-size: 13px; color: var(--text); font-weight: 500; }
.crumbs .sep { color: var(--muted); margin: 0 6px; }
.meta { font-size: 12px; color: var(--muted); }
.unicolor-host { margin-left: auto; display: flex; align-items: center; }
.unicolor-host:empty { display: none; }
.unicolor-host:empty + .user-host { margin-left: auto; }
.user-host { display: flex; align-items: center; }
.ticker-pills .unicolor-toggle { margin-left: auto; }

.page { padding: 24px; overflow-y: auto; }
h1.company-title { font-size: 28px; margin: 0 0 4px; }
.company-sub { color: var(--muted); margin-bottom: 24px; }

/* ─── Sections (Reported / Adjustments / Comparable) ─── */
.layer {
  margin-bottom: 32px;
}
.layer-title {
  font-size: 18px; font-weight: 600; margin: 0 0 4px;
}
.layer-desc { color: var(--muted); margin-bottom: 12px; font-size: 13px; }

.table-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.table-head {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.table-head:hover { background: var(--row-alt); }
.table-head .chev { display: inline-block; width: 12px; transition: transform 0.15s; color: var(--muted); }
.table-card.open .chev { transform: rotate(90deg); }
.table-head .title { font-weight: 600; }
.table-head .subtitle { color: var(--muted); font-size: 12px; margin-left: 8px; }
.table-body { display: none; padding: 0 0 12px; overflow-x: auto; }
.table-card.open .table-body { display: block; }

table.fin {
  width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums;
}
table.fin th, table.fin td {
  padding: 6px 10px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.fin th:first-child, table.fin td:first-child {
  text-align: left; padding-left: 16px; min-width: 280px;
}
table.fin thead th {
  background: var(--row-alt); color: var(--muted); font-weight: 500;
  position: sticky; top: 0;
}
table.fin tr.wa-row td {
  font-weight: 600; background: var(--row-alt); border-top: 1px solid var(--border);
}
table.fin tr.sector-spacer td {
  background: transparent; border-bottom: none; padding: 0; height: 28px;
}
table.fin tr.section-header td {
  font-weight: 500; background: transparent; color: var(--muted);
  text-transform: uppercase; font-style: italic; letter-spacing: 0.5px;
  font-size: 11px; padding-top: 14px;
}
table.fin th.label-col { text-transform: uppercase; letter-spacing: 0.5px; font-size: 11px; }
table.fin th.cat-col { text-transform: uppercase; letter-spacing: 0.5px; font-size: 11px; color: var(--muted); }
table.fin td.cat-col { color: var(--muted); font-style: italic; font-size: 12px; white-space: nowrap; }
table.fin th.mrq-col, table.fin td.mrq-col { background: var(--accent-soft); }
table.fin th.mrq-col .period-tag { display: block; font-weight: 600; margin-top: 2px; }
table.fin tr.subtotal { background: var(--subtotal); font-weight: 600; }
table.fin tr.total    { background: var(--total);    font-weight: 700; }
table.fin td.hardcoded { color: #0070c0; }            /* Excel hardcoded-blue */
table.fin td.formula   { color: #1a1a1a; }            /* black formulas */
table.fin td.indent,
table.fin.compact td.indent,
table.fin.compact td.indent:first-child { padding-left: 28px; }
table.fin td.check-fail { color: #c0392b; font-weight: 700; }
table.fin td.check-ok   { color: #1a6b3c; }

/* Cap-rate snapshot table: first column is the ticker (4 chars), not a long
   line-item label, so the 280px min-width default would waste space. Tight
   padding + smaller font lets the 13-column table fit a normal viewport.
   Wrap multi-word headers (e.g. "Other Tang. Assets") onto two lines to keep
   numeric column widths reasonable. */
table.fin.compact th, table.fin.compact td { padding: 5px 5px; font-size: 11px; }
table.fin.compact th { white-space: normal; line-height: 1.2; }
table.fin.compact th:first-child,
table.fin.compact td:first-child { min-width: 0; padding-left: 10px; }
.chart-card.compact-table { overflow-x: auto; }
table.fin td.muted    { color: var(--muted); }

/* NAV per-Share Sensitivity: center-align all cells, with merged
   "Cap Rate" group header above the cap-rate %s and a merged
   "NOI Change" label spanning the NOI % rows. */
table.fin.profile-sensitivity th,
table.fin.profile-sensitivity td { text-align: center; }
table.fin.profile-sensitivity th:first-child,
table.fin.profile-sensitivity td:first-child { text-align: center; padding-left: 5px; }
table.fin.profile-sensitivity th.sens-group-label {
  text-align: center; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; font-size: 11px; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
table.fin.profile-sensitivity th.sens-row-label {
  font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
  font-size: 11px; color: var(--muted); vertical-align: middle;
  writing-mode: vertical-rl; transform: rotate(180deg);
  white-space: nowrap; padding: 4px 2px;
  background: var(--row-alt);
}
table.fin.profile-sensitivity th.sens-corner { background: transparent; border-bottom: none; }
table.fin.profile-sensitivity tr.sens-group-row th.sens-corner { border-bottom: none; }

/* Home comps table — sortable headers, all numeric columns right-aligned. */
table.fin.home-comps th, table.fin.home-comps td { padding: 6px 8px; font-size: 11.5px; white-space: nowrap; }
table.fin.home-comps th { white-space: normal; line-height: 1.2; }
table.fin.home-comps th:first-child, table.fin.home-comps td:first-child { min-width: 0; padding-left: 12px; }
table.fin.home-comps th.sortable { cursor: pointer; user-select: none; }
table.fin.home-comps th.sortable:hover { color: var(--ink); background: var(--accent-soft); }
table.fin.home-comps th.sorted { color: var(--ink); font-weight: 600; background: var(--accent-soft); }
table.fin.home-comps th.num, table.fin.home-comps td.num { text-align: right; }
table.fin.home-comps .sort-arrow { font-size: 10px; color: var(--muted); }

.empty {
  color: var(--muted); padding: 16px; text-align: center; font-style: italic;
}

/* Date range slider — pinned below page header */
.range-host {
  position: sticky; top: 0; left: 0; right: 0; z-index: 10;
  background: var(--panel); border-bottom: 1px solid var(--border);
  margin: 0 24px 16px; padding: 14px 16px; display: grid;
  grid-template-columns: 110px 1fr auto; gap: 16px; align-items: center;
  border: 1px solid var(--border); border-radius: 8px;
  margin-top: 16px;
}
.range-label {
  font-size: 11px; letter-spacing: 0.5px; color: var(--muted); font-weight: 600;
}
.range-track {
  position: relative; height: 20px;
  /* The native input reserves half-a-thumb on each end so the thumb stays
     inside the input's bounds. Inset the background line and fill by the
     same amount so 0% and 100% positions line up visually. */
  padding: 0 7px;
}
.range-track::before {
  content: ""; position: absolute; left: 7px; right: 7px; top: 9px; height: 2px;
  background: var(--border); border-radius: 2px;
}
.range-fill {
  position: absolute; top: 9px; height: 2px; background: var(--accent);
  border-radius: 2px;
}
.range-input {
  position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 20px;
  background: transparent; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: white; border: 2px solid var(--accent);
  cursor: pointer; pointer-events: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.range-input::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: white; border: 2px solid var(--accent);
  cursor: pointer; pointer-events: auto;
}
.range-readout {
  font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.range-count { color: var(--muted); margin-left: 6px; font-size: 12px; }

/* Inline variant — used inside a chart card, no sticky positioning. */
.range-host.range-inline {
  position: static; margin: 4px 0 14px; padding: 10px 14px;
}

/* Quick-range buttons row spans the full width of the range host. */
.range-quick {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.range-quick-btn {
  font: inherit; font-size: 12px;
  padding: 3px 10px; border-radius: 14px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); cursor: pointer;
  line-height: 1.5;
}
.range-quick-btn:hover { background: var(--border); }
.range-quick-btn.active {
  background: var(--accent); color: white; border-color: var(--accent);
}

/* Chart cards (Implied Cap Rates page) */
.chart-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px 20px 18px; margin-bottom: 20px;
}
.chart-card-title { font-weight: 600; margin-bottom: 12px; font-size: 14px; }
.chart-canvas-wrap { position: relative; height: 280px; }
.chart-canvas-wrap--tall { height: 380px; }

.cap-hist-tooltip {
  position: absolute;
  pointer-events: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text);
  min-width: 240px;
  max-width: 280px;
  opacity: 0;
  transition: opacity 0.08s ease-out;
  z-index: 5;
}
.cap-hist-tooltip-head {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; margin-bottom: 4px;
  padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
.cap-hist-tooltip-head .swatch {
  width: 10px; height: 10px; border-radius: 2px; display: inline-block;
}
.cap-hist-tooltip-head .qtr {
  margin-left: auto; font-weight: 400; color: var(--muted); font-size: 10px;
}
.cap-hist-tooltip table {
  width: 100%; border-collapse: collapse;
}
.cap-hist-tooltip td {
  padding: 1px 0; vertical-align: top;
}
.cap-hist-tooltip td:last-child {
  text-align: right; font-variant-numeric: tabular-nums;
}
.cap-hist-tooltip tr.sub td {
  border-top: 1px solid var(--border); padding-top: 3px; font-weight: 600;
}
.cap-hist-tooltip tr.total td {
  border-top: 1px solid var(--text); padding-top: 3px; font-weight: 700;
}
.cap-hist-tooltip-foot {
  margin-top: 4px; color: var(--muted); font-size: 10px; text-align: right;
}

.ticker-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ticker-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 16px; cursor: pointer;
  background: var(--row-alt); font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); user-select: none;
}
.ticker-pill .swatch { width: 8px; height: 8px; border-radius: 50%; }
.ticker-pill.off { opacity: 0.35; }
.ticker-pill:hover { background: var(--accent-soft); }
.ticker-pill-toggle-all { font-style: italic; border-style: dashed; }

.metric-pill {
  display: inline-block; padding: 4px 14px; border-radius: 16px;
  font-size: 12px; font-weight: 600; cursor: pointer; user-select: none;
  background: var(--row-alt); border: 1px solid var(--border);
}
.metric-pill:hover { background: var(--accent-soft); }
.metric-pill.active { background: var(--accent); color: white; border-color: var(--accent); }

.company-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.company-title-block { flex: 1; min-width: 0; }
.export-all-btn {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 4px;
}

.export-btn {
  margin-left: auto;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.export-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.chart-card-title-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.chart-card-title-row .chart-card-title {
  margin-bottom: 0;
  flex: 1;
}
.cap-spread-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  user-select: none;
}

/* Sliding "Color Toggle" switch (replaces the old Unicolor checkbox). */
.color-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  user-select: none;
}
.color-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.color-toggle .color-toggle-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  background: #ccc;
  border-radius: 999px;
  transition: background 0.18s ease;
  flex-shrink: 0;
}
.color-toggle .color-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: left 0.18s ease;
}
.color-toggle .color-toggle-switch.on {
  background: var(--accent, #1a6b3c);
}
.color-toggle .color-toggle-switch.on .color-toggle-knob {
  left: 18px;
}
.ticker-pills .color-toggle { margin-left: auto; }

/* Bar chart trigger on row labels */
table.fin td.chartable {
  cursor: pointer; position: relative;
}
table.fin td.chartable:hover { background: var(--accent-soft); }
table.fin td.chartable::after {
  content: "📊"; opacity: 0; margin-left: 6px; font-size: 11px;
  transition: opacity 0.1s;
}
table.fin td.chartable:hover::after { opacity: 0.6; }
table.fin.home-comps td.chartable::after { content: none; }

/* Modal */
.chart-modal {
  position: fixed; inset: 0; z-index: 50;
}
.chart-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.4);
}
.chart-modal-card {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(900px, 92vw); background: var(--panel);
  border-radius: 10px; box-shadow: 0 18px 40px rgba(0,0,0,0.25);
  padding: 16px 20px 22px;
}
.chart-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600; margin-bottom: 12px;
}
#chart-modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--muted); padding: 0 4px;
}
#chart-modal-close:hover { color: var(--text); }

.period-tag {
  display: inline-block; font-size: 10px; font-weight: 600;
  background: var(--accent); color: white; padding: 1px 6px;
  border-radius: 3px; margin-left: 6px; vertical-align: middle;
}

/* Property Transactions page */
.tx-slider { margin: 14px 0 8px; }

/* Date-picker variant of the range host (used on Property Transactions). */
.range-host.range-datepick { grid-template-columns: 110px 1fr auto; }
.range-dateinputs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text);
}
.range-date-sep { color: var(--muted); font-size: 12px; }
.range-date-input {
  font: inherit; font-size: 13px;
  padding: 3px 8px; border-radius: 4px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.range-date-input:focus { outline: none; border-color: var(--accent); }
.tx-filters { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
.tx-filter-row { display: flex; align-items: center; gap: 12px; }
.tx-filter-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); min-width: 110px;
}
.tx-filter-row .ticker-pills { margin-bottom: 0; }
.tx-summary {
  font-size: 13px; color: var(--muted); margin: 8px 0 10px;
}
.tx-summary strong { color: var(--ink); }
.tx-notes { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Property Transactions table — grouped headers */
.tx-table thead .tx-group-row th {
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border, #d9d6cc);
  padding: 4px 8px;
}
.tx-table thead .tx-group-row th.tx-group-h {
  color: var(--ink);
}
.tx-table .tx-group-start { border-left: 1px solid var(--border, #d9d6cc); }
.tx-table thead th.tx-sortable { cursor: pointer; user-select: none; }
.tx-table thead th.tx-sortable:hover { color: var(--ink); }
.tx-table thead th.tx-sort-active { color: var(--ink); font-weight: 600; }

/* Tighter cell padding + smaller font so 18 columns fit; force horizontal
   layout and surface an always-visible scrollbar on the surrounding card
   so users can see there's more data to the right. */
table.fin.tx-table th, table.fin.tx-table td {
  padding: 4px 6px;
  font-size: 10.5px;
}
table.fin.tx-table th:first-child, table.fin.tx-table td:first-child {
  padding-left: 8px; min-width: 0;
}
table.fin.tx-table { table-layout: auto; width: max-content; min-width: 100%; }
/* Notes column ellipsis — but tighter to save space. */
table.fin.tx-table td.tx-notes { max-width: 240px; }

/* Always-visible horizontal scrollbar on the tx-table card body.
   The table has 1000+ rows, so without a max-height the horizontal
   scrollbar would sit at the very bottom (off-screen). Cap the height
   so both scrollbars are reachable from any scroll position on the page.
   `-webkit-appearance: none` forces the scrollbar to render even when
   macOS is set to "Show scroll bars: When scrolling" (the default). */
.tx-table-host .table-body {
  overflow: auto !important;
  max-height: 70vh;
  scrollbar-width: thin;            /* Firefox */
  scrollbar-color: #888 #e6e3d8;
  padding-bottom: 4px;
}
/* Sticky header inside the scroll container so column labels stay visible
   while scrolling the long row list. */
.tx-table-host .table-body table.fin.tx-table thead th {
  position: sticky;
  top: 0;
  background: var(--row-alt, #fafaf8);
  z-index: 2;
}
.tx-table-host .table-body::-webkit-scrollbar {
  -webkit-appearance: none;
  height: 12px;
  background: #e6e3d8;
}
.tx-table-host .table-body::-webkit-scrollbar-track {
  background: #e6e3d8;
  border-top: 1px solid var(--border, #d9d6cc);
}
.tx-table-host .table-body::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 6px;
  border: 2px solid #e6e3d8;
}
.tx-table-host .table-body::-webkit-scrollbar-thumb:hover { background: #555; }


/* Leverage page — highlighted (selected) metric column */
table.fin th.lev-selected,
table.fin td.lev-selected {
  background: rgba(26, 82, 118, 0.10);
}
table.fin th.lev-selected {
  background: rgba(26, 82, 118, 0.18);
}
.lev-toggle { color: #666; cursor: pointer; user-select: none; }
.lev-toggle-opt { padding: 0 2px; }
.lev-toggle-opt.active { color: var(--text, #222); font-weight: 600; text-decoration: underline; }
.lev-toggle-opt:hover { color: var(--text, #222); }

/* ─── Company Profile ─────────────────────────────────────────────── */
.profile-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.profile-grid table.fin td.hardcoded { color: #1a1a1a; }
.profile-grid-bs  { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
.profile-grid-val { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.profile-grid-val3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2.4fr); }
.profile-grid-nav { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.profile-grid-locked-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-grid-locked-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .profile-grid-locked-3, .profile-grid-locked-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1400px) {
  .profile-grid-val3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .profile-grid-bs, .profile-grid-val, .profile-grid-val3, .profile-grid-nav {
    grid-template-columns: minmax(0, 1fr);
  }
}
.profile-pie-wrap { padding: 8px 12px 14px; height: 320px; position: relative; }
.profile-nav-controls {
  padding: 10px 14px 12px; display: flex; align-items: center;
  font-size: 12px; color: var(--text);
}
.profile-nav-controls input {
  font: inherit; border: 1px solid #d4d2cc; padding: 3px 6px; border-radius: 3px;
  color: #0070c0; font-weight: 600;
}
.profile-nav-readout { color: #555; font-weight: 500; }
table.fin.profile-sensitivity th,
table.fin.profile-sensitivity td { text-align: center; font-variant-numeric: tabular-nums; }
table.fin.profile-sensitivity th:first-child,
table.fin.profile-sensitivity td:first-child {
  text-align: center; font-weight: 600; min-width: 0; padding-left: 5px;
}
table.fin.profile-sensitivity th.sens-noi-pct,
table.fin.profile-sensitivity th.sens-row-label {
  background: #faf9f5;
}
table.fin.profile-sensitivity thead th.sens-corner {
  background: transparent !important; border-bottom: none;
}
table.fin.profile-sensitivity th.sens-noi-mm-head {
  font-weight: 500; color: var(--muted);
}
table.fin.profile-sensitivity td.sens-noi-mm {
  background: #faf9f5; font-weight: 600;
}
table.fin.profile-sensitivity th.sens-spacer,
table.fin.profile-sensitivity td.sens-spacer {
  width: 14px; min-width: 14px; max-width: 14px;
  padding: 0; background: transparent !important;
  border-left: none; border-right: none; border-bottom: none;
}
.profile-growth-controls {
  padding: 10px 14px 4px; display: flex; gap: 6px; flex-wrap: wrap;
  justify-content: flex-start; width: 100%; box-sizing: border-box;
}
/* Override .export-btn's margin-left:auto so toggles stay grouped. */
.profile-growth-controls .growth-toggle { margin-left: 0; }
.growth-toggle.active {
  background: #2e4053; color: #fff; border-color: #2e4053;
}
.profile-growth-wrap { padding: 6px 12px 14px; height: 320px; position: relative; }
.growth-window-wrap {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 12px; font-size: 12px; color: var(--muted);
}
.growth-window-select {
  font: inherit; border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 6px; background: var(--panel); cursor: pointer;
}

/* NAV sensitivity — emphasize the centerline row & column with borders
   so the implied (cap × NOI Δ = 0) axis reads at a glance. */
table.fin.profile-sensitivity .center-col {
  border-left: 2px solid #2e4053;
  border-right: 2px solid #2e4053;
}
table.fin.profile-sensitivity tr.center-row > td,
table.fin.profile-sensitivity tr.center-row > th {
  border-top: 2px solid #2e4053;
  border-bottom: 2px solid #2e4053;
}
