/* LiveProfit WCAG 2.1 AA baseline. Loaded AFTER each page's inline <style>
   so these rules win the cascade. Verified contrast ratios (WCAG 2.1 AA):
     dark --muted #8b95b5 vs --bg #0f1117     6.4:1   ✓ (was #7b84a3 @ 5.6:1)
     dark --muted #8b95b5 vs --surface2       5.0:1   ✓ (was 4.0:1 — failed)
     dark --text  #e8eaf0 vs --bg             15.6:1  ✓
     light --muted #58657a vs --bg #f1f5f9    5.5:1   ✓ (was #64748b @ 4.4:1 — failed)
     light --text  #0f172a vs --bg            17.2:1  ✓
   Focus indicator uses --focus (3:1 non-text minimum against any surface). */

:root {
  --muted: #8b95b5;
  --focus: #4A9EFF;

  /* Brand palette (Phase 10). Consolidated tokens reused across app pages.
     One-off hex values in inline <style> blocks are being migrated to these. */
  --brand-primary:   #6366F1;
  --brand-secondary: #A78BFA;
  --success:         #10B981;
  --warning:         #F59E0B;
  --danger:          #EF4444;
  --bg:              #0F0F13;
  --bg-elevated:     #1A1A22;
  --text:            #F1F5F9;
  --text-secondary:  #94A3B8;
  --border:          #2D2D3A;
}
[data-theme="light"] {
  --muted: #58657a;
  --focus: #1D63D1;
  --bg:              #F1F5F9;
  --bg-elevated:     #FFFFFF;
  --text:            #0F172A;
  --text-secondary:  #64748B;
  --border:          #E2E8F0;
}

/* ── Skip link (keyboard-only escape hatch to main content) ──────────────── */
.skip-link {
  position: absolute; top: -48px; left: 12px; z-index: 200;
  padding: 8px 14px; border-radius: 6px;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--focus);
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus { top: 12px; }

/* ── Focus-visible for every interactive element ─────────────────────────── */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus) !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}

/* Remove the default focus style on mouse click, keep it on keyboard. */
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
a:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible),
summary:focus:not(:focus-visible) {
  outline: none;
}

/* Screen-reader-only helper for labels attached to icon buttons. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
