/* sandpoint-polish.css — platform-wide readability rules (v34.4). Loaded last.

   1. Text: ordinary text is 14px; secondary text 13px; small uppercase labels
      are 11.5px and only where they label a figure. Data grids (the P&L and
      other spreadsheet-like tables) stay at their compact size on purpose.
   2. Faint text: the third-level grey was 3.2:1 on white — below the 4.5:1
      needed for body text. It is now 4.8:1 in light mode.
   3. Keyboard focus is always visible.
   4. The logo is readable in dark mode on every page (Asset Management's
      header was the one that missed the existing rule).
   5. Money and other numbers line up: right-aligned, tabular figures. */

/* ── 2. contrast ─────────────────────────────────────────────────────────── */
:root[data-theme="light"] { --text2: #525D6A; --text3: #626B78; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --text2: #525D6A; --text3: #626B78; } }
:root[data-theme="dark"] { --text3: #ABB3AA; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --text3: #ABB3AA; } }

/* ── 1. type floor ───────────────────────────────────────────────────────── */
html body { font-size: 14px; }
html body :is(p, li, .tracker-sub, .muted, .sandpoint-att-meta, .dd-ph-s, .sub, .hint, .help) { font-size: max(13px, 1em); }
html body :is(.tracker-sub, .muted) { font-size: 13px; line-height: 1.5; color: var(--text2) !important; }
html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea) { font-size: max(13.5px, 1em); }
html body :is(.btn, button.btn) { font-size: max(13px, 1em); }
html body .btn.xs { font-size: 12px; }
/* Figure labels: still small caps, but readable. */
html body .met-lbl { font-size: 11.5px !important; letter-spacing: .05em !important; color: var(--text2) !important; }
html body .met .met-help, html body .met .dd-kpi-sub { font-size: 12.5px; color: var(--text2); }
/* Table headings: one size everywhere. */
html body table thead th { font-size: 12px; letter-spacing: .04em; }
/* Ordinary table cells: 13.5px. Spreadsheet grids keep their own size. */
html body table:not(.pnl-tbl):not(.dd-ck-table) tbody td { font-size: max(13.5px, 1em); }

/* ── 5. numbers ──────────────────────────────────────────────────────────── */
html body :is(td.num, td.money, td.r, th.num, th.money, .met-val, .money) { font-variant-numeric: tabular-nums; }
html body :is(td.num, td.money, th.num, th.money) { text-align: right; }

/* ── 3. focus ───────────────────────────────────────────────────────────── */
html body :is(a, button, [role=button], [role=tab], [role=menuitem], summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid #A97424; outline-offset: 2px; }
html body #sandpoint-header :is(a, button, [role=button]):focus-visible { outline-color: #E0C48A; }

/* ── 4. logo in dark mode ───────────────────────────────────────────────── */
html[data-theme="dark"] body .topbar :is(.topbar-left img, img[alt*="Sand Point" i], img.logo) { filter: brightness(0) invert(1) !important; opacity: .94; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body .topbar :is(.topbar-left img, img[alt*="Sand Point" i], img.logo) { filter: brightness(0) invert(1) !important; opacity: .94; }
}

/* Phones: comfortable tap targets for the controls people use most. */
@media (max-width: 760px) {
  html body :is(.btn, button.btn, select, .filter, .search-input) { min-height: 40px; }
}

/* Uppercase is kept for small figure labels and section bars only. The
   jump-to-section chips are navigation, so they read as ordinary words. */
html body:not([data-sandpoint-workspace="map"]) .sandpoint-jump button { text-transform: none !important; letter-spacing: 0 !important; font-size: 13px !important; font-weight: 600 !important; }

/* One page-title size. Most Asset Management pages title themselves at 18px;
   the tracker pages (CapEx, Leasing, Insurance…) used 15px, so a page title
   looked like a section heading there. */
html body :is(.tracker-title, .rw-title) { font-size: 18px !important; font-weight: 600 !important; line-height: 1.3; }
