/* ========================================
   CaseDigest – Legal SaaS Theme
   Palette: navy · gold · midnight · teal
   ======================================== */

:root {
  --primary:       #1e3a5f;
  --primary-light: #4a7fc1;
  --primary-dark:  #0f1f35;
  --secondary:     #c9992d;
  --accent:        #c9992d;
  --success:       #10B981;
  --warning:       #F59E0B;
  --danger:        #EF4444;

  --bg:            #EFF4FB;
  --card-bg:       #FFFFFF;
  --text:          #1F2937;
  --text-muted:    #6B7280;
  --border:        #E5E7EB;

  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 4px 6px -1px rgba(30,58,95,.12), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px -5px rgba(30,58,95,.18);
  --transition:    .2s ease;

  --header-h:      64px;
  --footer-h:      56px;
  --surface:       var(--card-bg);
}

/* ── Color schemes ──────────────────────────── */
/* Navy = default (:root). Others override primary colors + bg tint. */

/* Midnight — electric blue */
[data-scheme="midnight"] {
  --primary:       #2563EB;
  --primary-light: #93C5FD;
  --primary-dark:  #1D4ED8;
  --bg:            #EFF6FF;
  --shadow:        0 4px 6px -1px rgba(37,99,235,.12), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px -5px rgba(37,99,235,.2);
}
[data-scheme="midnight"][data-theme="dark"] {
  --bg:        #060D1F;
  --card-bg:   #0D1A35;
  --border:    #1E3058;
  --text:      #DBEAFE;
  --text-muted:#6B8EC4;
}

/* Sunset — warm coral/orange */
[data-scheme="sunset"] {
  --primary:       #F97316;
  --primary-light: #FDBA74;
  --primary-dark:  #EA580C;
  --bg:            #FFF7ED;
  --shadow:        0 4px 6px -1px rgba(249,115,22,.12), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px -5px rgba(249,115,22,.2);
}
[data-scheme="sunset"][data-theme="dark"] {
  --bg:        #1A0C00;
  --card-bg:   #2A1500;
  --border:    #52280A;
  --text:      #FEF0E0;
  --text-muted:#B07A50;
}

/* Berry — vivid fuchsia/magenta */
[data-scheme="berry"] {
  --primary:       #C026D3;
  --primary-light: #F0ABFC;
  --primary-dark:  #A21CAF;
  --bg:            #FDF4FF;
  --shadow:        0 4px 6px -1px rgba(192,38,211,.12), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px -5px rgba(192,38,211,.2);
}
[data-scheme="berry"][data-theme="dark"] {
  --bg:        #160919;
  --card-bg:   #240D2A;
  --border:    #481A52;
  --text:      #FAE8FF;
  --text-muted:#A060B0;
}

/* Teal — clean & modern */
[data-scheme="teal"] {
  --primary:       #0D9488;
  --primary-light: #5EEAD4;
  --primary-dark:  #0F766E;
  --bg:            #F0FDFA;
  --shadow:        0 4px 6px -1px rgba(13,148,136,.12), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px -5px rgba(13,148,136,.2);
}
[data-scheme="teal"][data-theme="dark"] {
  --bg:        #031714;
  --card-bg:   #082824;
  --border:    #134E4A;
  --text:      #CCFBF1;
  --text-muted:#5BA89E;
}

/* Graphite — charcoal & slate */
[data-scheme="graphite"] {
  --primary:       #374151;
  --primary-light: #9CA3AF;
  --primary-dark:  #1F2937;
  --bg:            #F9FAFB;
  --shadow:        0 4px 6px -1px rgba(55,65,81,.12), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px -5px rgba(55,65,81,.2);
}
[data-scheme="graphite"][data-theme="dark"] {
  --bg:        #0A0C0E;
  --card-bg:   #141618;
  --border:    #2A2D32;
  --text:      #F3F4F6;
  --text-muted:#6B7280;
}

/* ── Mono — pure black & white ──── */
[data-scheme="mono"] {
  --primary:       #111111;
  --primary-light: #555555;
  --primary-dark:  #000000;
  --secondary:     #444444;
  --accent:        #555555;
  --bg:            #FFFFFF;
  --card-bg:       #FFFFFF;
  --border:        #CCCCCC;
  --text:          #111111;
  --text-muted:    #888888;
  --shadow:        none;
  --shadow-lg:     none;
}
[data-scheme="mono"][data-theme="dark"] {
  --primary:       #EEEEEE;
  --primary-light: #AAAAAA;
  --primary-dark:  #FFFFFF;
  --secondary:     #CCCCCC;
  --accent:        #AAAAAA;
  --bg:            #000000;
  --card-bg:       #111111;
  --border:        #333333;
  --text:          #EEEEEE;
  --text-muted:    #666666;
  --shadow:        none;
  --shadow-lg:     none;
}

/* Flat layout — borders replace depth cues */
[data-scheme="mono"] .card,
[data-scheme="mono"] .case-card,
[data-scheme="mono"] .lp-feat-card    { box-shadow: none; border: 1px solid var(--border); }
[data-scheme="mono"] .card:hover,
[data-scheme="mono"] .case-card:hover { box-shadow: none; transform: none; }
[data-scheme="mono"] .modal-box       { box-shadow: none; border: 1px solid var(--border); }
[data-scheme="mono"] .feedback-panel  { box-shadow: none; border: 1px solid var(--border); }
[data-scheme="mono"] .scheme-dropdown { box-shadow: none; border: 1px solid var(--border); }

/* Header & footer — flat bg instead of colour gradient */
[data-scheme="mono"] .site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
[data-scheme="mono"] .site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
}
[data-scheme="mono"][data-theme="dark"] .site-header {
  background: #000000;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
[data-scheme="mono"][data-theme="dark"] .site-footer {
  background: #000000;
  border-top: 1px solid var(--border);
}

/* Nav header controls */
[data-scheme="mono"] .site-header .hamburger-btn,
[data-scheme="mono"] .site-header .nav-style-toggle {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}
[data-scheme="mono"] .site-header .hamburger-btn:hover,
[data-scheme="mono"] .site-header .nav-style-toggle:hover { background: var(--border); }
[data-scheme="mono"] .header-subnav { background: #ffffff; border-top: 1px solid var(--border); }
[data-scheme="mono"] .subnav-link { color: var(--text-muted); }
[data-scheme="mono"] .subnav-link:hover,
[data-scheme="mono"] .subnav-link.active-route { color: var(--text); background: var(--border); }

[data-scheme="mono"][data-theme="dark"] .site-header .hamburger-btn,
[data-scheme="mono"][data-theme="dark"] .site-header .nav-style-toggle { color: var(--text); background: transparent; border-color: var(--border); }
[data-scheme="mono"][data-theme="dark"] .site-header .hamburger-btn:hover,
[data-scheme="mono"][data-theme="dark"] .site-header .nav-style-toggle:hover { background: var(--border); }
[data-scheme="mono"][data-theme="dark"] .header-subnav { background: #000000; border-top: 1px solid var(--border); }

/* Nav links, footer, scheme picker */
[data-scheme="mono"] .logo               { color: var(--text); }
[data-scheme="mono"] .nav-link           { color: var(--text-muted); }
[data-scheme="mono"] .nav-link:hover     { color: var(--text); }
[data-scheme="mono"] .nav-user-btn       { color: var(--text-muted); }
[data-scheme="mono"] .nav-user-btn:hover { color: var(--text); }
[data-scheme="mono"] .footer-inner       { color: var(--text-muted); }
[data-scheme="mono"] .footer-link        { color: var(--text-muted); opacity: 1; }
[data-scheme="mono"] .footer-link:hover  { color: var(--text); opacity: 1; }
[data-scheme="mono"] .scheme-picker-btn  { color: var(--text-muted); border-color: var(--border); }
[data-scheme="mono"] .scheme-picker-btn:hover { color: var(--text); background: var(--border); }
[data-scheme="mono"] .btn-outline-sm     { color: var(--text-muted); border-color: var(--border); }
[data-scheme="mono"] .btn-outline-sm:hover { color: var(--text); background: var(--border); }
[data-scheme="mono"] .site-header .btn-primary      { background: transparent; color: var(--text); border: 1px solid var(--border); }
[data-scheme="mono"] .site-header .btn-primary:hover { background: var(--border); color: var(--text); }

[data-scheme="mono"][data-theme="dark"] .logo               { color: var(--text); }
[data-scheme="mono"][data-theme="dark"] .nav-link           { color: var(--text-muted); }
[data-scheme="mono"][data-theme="dark"] .nav-link:hover     { color: var(--text); }
[data-scheme="mono"][data-theme="dark"] .nav-user-btn       { color: var(--text-muted); }
[data-scheme="mono"][data-theme="dark"] .nav-user-btn:hover { color: var(--text); }
[data-scheme="mono"][data-theme="dark"] .footer-inner       { color: var(--text-muted); }
[data-scheme="mono"][data-theme="dark"] .footer-link        { color: var(--text-muted); opacity: 1; }
[data-scheme="mono"][data-theme="dark"] .footer-link:hover  { color: var(--text); opacity: 1; }
[data-scheme="mono"][data-theme="dark"] .scheme-picker-btn  { color: var(--text-muted); border-color: var(--border); }
[data-scheme="mono"][data-theme="dark"] .scheme-picker-btn:hover { color: var(--text); background: var(--border); }
[data-scheme="mono"][data-theme="dark"] .btn-outline-sm     { color: var(--text-muted); border-color: var(--border); }
[data-scheme="mono"][data-theme="dark"] .btn-outline-sm:hover { color: var(--text); background: var(--border); }
[data-scheme="mono"][data-theme="dark"] .site-header .btn-primary      { background: transparent; color: var(--text); border: 1px solid var(--border); }
[data-scheme="mono"][data-theme="dark"] .site-header .btn-primary:hover { background: var(--border); color: var(--text); }

/* Buttons — all variants outlined */
[data-scheme="mono"] .btn-primary,
[data-scheme="mono"] .btn-danger,
[data-scheme="mono"] .btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
[data-scheme="mono"] .btn-primary:hover,
[data-scheme="mono"] .btn-danger:hover,
[data-scheme="mono"] .btn-outline:hover {
  background: var(--border);
  color: var(--text);
  box-shadow: none;
}

/* Tabs */
[data-scheme="mono"] .tab-btn.active { color: var(--text); border-bottom-color: var(--text); }

/* Misc */
[data-scheme="mono"] .feedback-fab { background: var(--bg); color: var(--text); border: 2px solid var(--border); box-shadow: none; }
[data-scheme="mono"] .feedback-fab:hover { background: var(--border); box-shadow: none; transform: scale(1.05); }
[data-scheme="mono"] .lp-badge,
[data-scheme="mono"][data-theme="dark"] .lp-badge { background: var(--border); color: var(--text); }
[data-scheme="mono"] .pricing-popular-badge,
[data-scheme="mono"][data-theme="dark"] .pricing-popular-badge { background: var(--text); color: var(--bg); }

/* ── Dark mode ─────────────────────────────── */
[data-theme="dark"] {
  --bg:            #0F172A;
  --card-bg:       #1E293B;
  --text:          #F1F5F9;
  --text-muted:    #94A3B8;
  --border:        #334155;
  --shadow:        0 4px 6px -1px rgba(0,0,0,.45), 0 2px 4px -1px rgba(0,0,0,.3);
  --shadow-lg:     0 10px 25px -5px rgba(0,0,0,.6);
}

/* Navy scheme (default) has no dark override — lighten primary so links/buttons are readable */
:root[data-theme="dark"]:not([data-scheme]) {
  --primary:      #4a7fc1;
  --primary-dark: #1e3a5f;
}

[data-theme="dark"] body { color-scheme: dark; }

/* Placeholder color */
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: .55; }

/* Inputs in dark mode */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
  color-scheme: dark;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--text-muted); opacity: .45; }

/* Modal backdrop darker */
[data-theme="dark"] .modal-overlay        { background: rgba(0,0,0,.65); }
[data-theme="dark"] .modal-close:hover    { background: #334155; }

/* Tabs */
[data-theme="dark"] .tab-btn             { color: var(--text-muted); }
[data-theme="dark"] .tab-btn.active      { color: var(--primary-light); border-bottom-color: var(--primary-light); }
[data-theme="dark"] .tab-btn:hover:not(.active) { color: var(--text); }

/* Alerts */
[data-theme="dark"] .alert-error   { background: #2D0F0F; color: #FCA5A5; border-color: #7F1D1D; }
[data-theme="dark"] .alert-success { background: #0C2A20; color: #6EE7B7; border-color: #065F46; }
[data-theme="dark"] .alert-info    { background: #0F1E40; color: #93C5FD; border-color: #1E3A8A; }

/* Landing page badge dark */
[data-theme="dark"] .lp-badge { background: #1E3A8A; color: var(--primary-light); }

/* Pricing dark */
[data-theme="dark"] .pricing-popular {
  box-shadow: 0 0 0 1px var(--primary-light), var(--shadow-lg);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Header --- */
.site-header {
  height: var(--header-h);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: 0 2px 12px rgba(15,31,53,.35);
  position: sticky; top: 0; z-index: 100;
}
/* Bar mode: header grows to fit the subnav row */
[data-nav-style="bar"] .site-header { height: auto; }

.header-inner {
  max-width: 1100px; margin: 0 auto;
  height: var(--header-h); padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}

.logo {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.5px;
  text-decoration: none;
}

.env-badge {
  display: inline-block;
  font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .15rem .5rem; border-radius: 999px;
  margin-left: .4rem; vertical-align: middle; line-height: 1.6;
  color: #fff;
}

.header-nav {
  display: flex; align-items: center; gap: .75rem;
  color: rgba(255,255,255,.9);
}

.nav-user-btn {
  font-size: .9rem; color: rgba(255,255,255,.9);
  background: none; border: none; cursor: pointer; padding: 0;
}
.nav-user-btn:hover { color: #fff; }

.nav-link { color: rgba(255,255,255,.9); font-size: .9rem; }
.nav-link:hover { color: #fff; }
/* Hide inline nav links when a layout mode is active */
[data-nav-style="bar"] #nav-cases-link,
[data-nav-style="bar"] #nav-admin-link,
[data-nav-style="hamburger"] #nav-cases-link,
[data-nav-style="hamburger"] #nav-admin-link { display: none !important; }

/* --- Hamburger button --- */
.hamburger-btn {
  display: none;
  align-items: center;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 7px;
  padding: .3rem .55rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: #fff;
}
[data-nav-style="hamburger"] .hamburger-btn { display: flex; }

/* --- Nav style toggle button --- */
.nav-style-toggle {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  padding: .2rem .45rem;
  cursor: pointer;
  font-size: .8rem;
  color: rgba(255,255,255,.85);
  line-height: 1;
}
.nav-style-toggle:hover { background: rgba(255,255,255,.22); color: #fff; }
.nav-style-toggle.overriding {
  background: rgba(255,255,255,.25);
  border-color: rgba(255,255,255,.45);
  color: #fff;
}

/* --- Secondary subnav bar (bar mode only) --- */
.header-subnav {
  display: none;
  background: rgba(0,0,0,.18);
  border-top: 1px solid rgba(255,255,255,.1);
}
[data-nav-style="bar"] .header-subnav { display: block; }

.header-subnav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; gap: .1rem;
  height: 38px;
}

.subnav-link {
  color: rgba(255,255,255,.85);
  font-size: .88rem;
  padding: .3rem .75rem;
  border-radius: 6px;
  text-decoration: none;
}
.subnav-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.subnav-link.active-route { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }

.referral-subnav-tag {
  margin-left: auto;
  font-size: .8rem;
  color: #fff;
  background: rgba(201,153,45,.25);
  border: 1px solid rgba(201,153,45,.5);
  border-radius: 999px;
  padding: .15rem .75rem;
  white-space: nowrap;
}

/* --- Hamburger dropdown menu --- */
.hamburger-anchor {
  position: relative;
}

.nav-drawer-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: transparent;
  opacity: 0; pointer-events: none;
}
.nav-drawer-overlay.open { opacity: 1; pointer-events: all; }

.nav-drawer {
  position: absolute; top: calc(100% + 6px); left: 0;
  width: max-content; min-width: 140px;
  background: linear-gradient(160deg, var(--primary-dark), var(--primary) 100%);
  z-index: 1000;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  padding: .35rem .3rem;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease;
}
.nav-drawer.open { opacity: 1; pointer-events: all; transform: translateY(0); }

.drawer-nav {
  display: flex; flex-direction: column; gap: .1rem;
}

.drawer-link {
  color: rgba(255,255,255,.9);
  font-size: .9rem;
  padding: .5rem .75rem;
  border-radius: 7px;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  transition: background .12s ease;
}
.drawer-link:hover { background: rgba(255,255,255,.15); color: #fff; }
.drawer-link.active-route { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }

/* --- Footer --- */
.site-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
  height: var(--footer-h);
  background: var(--primary-dark);
}

.footer-inner {
  max-width: 1100px; margin: 0 auto;
  height: 100%; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  color: rgba(255,255,255,.7);
  font-size: .85rem;
}

/* --- Main container --- */
.container {
  max-width: 1100px; margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

#app { padding-bottom: var(--footer-h); }

/* --- Utility --- */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.text-center { text-align: center; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(30,58,95,.35); }

.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-outline   { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-outline-sm {
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,.6);
  padding: .35rem 1rem; font-size: .85rem; font-weight: 500; border-radius: 6px;
}
.btn-outline-sm:hover { background: rgba(255,255,255,.15); }

.btn-sm { padding: .35rem .85rem; font-size: .82rem; }
.btn-icon { padding: .4rem .6rem; }
.btn-ghost { background: transparent; color: var(--text-muted); border: none; }
.btn-ghost:hover { color: var(--text); }

/* ── Scheme picker ───────────────────────────── */
.scheme-picker {
  position: relative; display: inline-flex; align-items: center;
}
.scheme-picker-btn {
  background: transparent; border: 1.5px solid rgba(255,255,255,.6);
  border-radius: 6px; padding: .35rem .55rem; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  color: #fff; font-size: .82rem; white-space: nowrap;
  transition: background var(--transition);
}
.scheme-picker-btn:hover { background: rgba(255,255,255,.15); }
.scheme-swatch {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5); flex-shrink: 0;
}
.scheme-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 200;
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: .4rem; min-width: 160px;
  display: none; flex-direction: column; gap: 2px;
}
.scheme-dropdown.open { display: flex; }
.scheme-option {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .7rem; border-radius: 6px; cursor: pointer;
  font-size: .875rem; color: var(--text); border: none;
  background: transparent; width: 100%; text-align: left;
  transition: background var(--transition);
}
.scheme-option:hover { background: rgba(30,58,95,.08); }
.scheme-option.active { background: rgba(30,58,95,.14); font-weight: 600; }
.scheme-dot {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(0,0,0,.12);
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }

/* Add Case — two-column metadata grid on desktop */
.add-case-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2rem;
  margin-bottom: .25rem;
}
@media (max-width: 680px) {
  .add-case-meta-grid { grid-template-columns: 1fr; }
}

/* --- Forms --- */
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.form-group label, .form-label { font-size: .85rem; font-weight: 600; color: var(--text); }
.req { color: var(--danger); }

input[type="text"], input[type="email"], input[type="date"], input[type="number"],
select, textarea {
  padding: .55rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text);
  background: var(--card-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(30,58,95,.12);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── Scheme picker hover color fix for non-navy schemes ── */
[data-scheme="midnight"] .scheme-option:hover { background: rgba(37,99,235,.08); }
[data-scheme="midnight"] .scheme-option.active { background: rgba(37,99,235,.14); }
[data-scheme="sunset"] .scheme-option:hover { background: rgba(249,115,22,.08); }
[data-scheme="sunset"] .scheme-option.active { background: rgba(249,115,22,.14); }
[data-scheme="berry"] .scheme-option:hover { background: rgba(192,38,211,.08); }
[data-scheme="berry"] .scheme-option.active { background: rgba(192,38,211,.14); }
[data-scheme="teal"] .scheme-option:hover { background: rgba(13,148,136,.08); }
[data-scheme="teal"] .scheme-option.active { background: rgba(13,148,136,.14); }
[data-scheme="graphite"] .scheme-option:hover { background: rgba(55,65,81,.08); }
[data-scheme="graphite"] .scheme-option.active { background: rgba(55,65,81,.14); }

/* ── Spinner ─────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-center { display: flex; flex-direction: column; align-items: center; color: var(--text-muted); padding: 3rem 0; }

/* ── Alert ───────────────────────────────────── */
.alert {
  padding: .75rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
  display: flex; align-items: flex-start; gap: .6rem;
}
.alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-info    { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ── Modal ───────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 25px 60px rgba(0,0,0,.25);
  width: 100%; max-width: 540px;
  padding: 2rem;
  position: relative;
  max-height: 90vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; font-size: 1.4rem;
  color: var(--text-muted); cursor: pointer;
  line-height: 1; padding: .2rem .4rem;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--primary); }

/* ── Toasts ──────────────────────────────────── */
#toast-container {
  position: fixed; bottom: calc(var(--footer-h) + 1rem); right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem; align-items: flex-end;
}
.toast {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem 1.1rem;
  font-size: .9rem;
  box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease;
  max-width: 320px;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.success { border-color: #A7F3D0; background: #ECFDF5; color: #065F46; }
.toast.error   { border-color: #FECACA; background: #FEF2F2; color: #991B1B; }
.toast.info    { border-color: #BFDBFE; background: #EFF6FF; color: #1E40AF; }

/* ── Floating Feedback FAB ───────────────────── */
.feedback-fab {
  position: fixed; bottom: calc(var(--footer-h) + .75rem); right: 1.5rem; z-index: 900;
  width: 52px; height: 52px;
  background: var(--primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(30,58,95,.45);
  transition: transform .2s, box-shadow .2s;
  user-select: none;
}
.feedback-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(30,58,95,.55);
}

/* ── Feedback panel ──────────────────────────── */
.feedback-panel {
  position: fixed; bottom: calc(var(--footer-h) + 4.5rem); right: 1.5rem; z-index: 901;
  width: 340px; max-width: calc(100vw - 2rem);
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.feedback-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: .95rem;
}
.feedback-panel-close {
  background: none; border: none; font-size: 1.3rem;
  cursor: pointer; color: var(--text-muted); line-height: 1; padding: 0;
}
.feedback-panel-body { padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.feedback-panel-body .form-group { margin-bottom: 0; }
.feedback-panel-body textarea { width: 100%; min-height: 80px; }
.feedback-type-row { display: flex; gap: 1.25rem; margin-top: .25rem; }
.feedback-type-opt { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.fb-screenshot-preview {
  max-height: 120px; overflow: hidden; border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: .35rem;
}
.fb-screenshot-preview img { width: 100%; object-fit: cover; }
.fb-status { margin-top: .5rem; font-size: .88rem; }

/* ── Footer nav ─────────────────────────────── */
.footer-nav    { display: flex; gap: 1.25rem; }
.footer-link   { color: rgba(255,255,255,.7); opacity: 1; text-decoration: none; font-size: .88rem; font-weight: 500; transition: color var(--transition), opacity var(--transition); }
.footer-link:hover { color: #fff; opacity: 1; }

/* ── Env badge ───────────────────────────────── */
.env-badge {
  display: inline-block;
  font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .15rem .5rem; border-radius: 999px;
  margin-left: .4rem; vertical-align: middle; line-height: 1.6;
  color: #fff;
}

/* ── Tabs (app UI) ───────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
  padding: .65rem 1.25rem; border: none; background: none;
  color: var(--text-muted); font-size: .9rem; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover:not(.active) { color: var(--text); }

/* ── Case card ───────────────────────────────── */
.case-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.case-card:hover { box-shadow: var(--shadow-lg); }

.case-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  gap: .75rem;
}
.case-card-left { flex: 1; min-width: 0; }
.case-docket    { font-size: .78rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.case-title     { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; }
.case-meta      { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .8rem; margin-bottom: .35rem; }
.case-date      { color: var(--text-muted); }
.case-excerpt   { font-size: .82rem; color: var(--text-muted); line-height: 1.5; margin-top: .35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 600px; }
.case-expand-icon { color: var(--text-muted); font-size: .75rem; flex-shrink: 0; margin-top: .25rem; transition: transform var(--transition); }

.case-card.expanded .case-expand-icon { transform: rotate(90deg); }
.case-card-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}
.case-card.expanded .case-card-body { display: block; padding-top: 1rem; }

.case-condensed-full { font-size: .9rem; line-height: 1.75; color: var(--text); white-space: pre-wrap; margin-bottom: 1rem; }
.case-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

/* Judge / bench chips (gold/amber) */
.judge-chip {
  display: inline-block;
  background: #fef3c7; color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  font-size: .72rem; font-weight: 600;
  padding: .1rem .55rem;
}
[data-theme="dark"] .judge-chip { background: #3d2e00; color: #fcd34d; border-color: #d97706; }

/* Tag badges (navy/primary) */
.tag-badge {
  display: inline-block;
  background: rgba(30,58,95,.1); color: var(--primary);
  border: 1px solid rgba(30,58,95,.2);
  border-radius: 999px;
  font-size: .72rem; font-weight: 600;
  padding: .1rem .55rem;
}
[data-theme="dark"] .tag-badge { background: rgba(74,127,193,.15); color: var(--primary-light); border-color: rgba(74,127,193,.3); }

/* ── Tag input (chip inputs) ─────────────────── */
.tag-chip-list {
  display: flex; flex-wrap: wrap; gap: .35rem;
  margin-bottom: .35rem;
}
.tag-chip-list:empty { margin-bottom: 0; }
.tag-input-wrapper {
  display: flex; align-items: center;
  padding: .4rem .6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  cursor: text;
  min-height: 42px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tag-input-wrapper:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(30,58,95,.12);
}
.tag-input-wrapper input {
  border: none; outline: none; background: transparent;
  color: var(--text); font-size: .9rem;
  padding: .1rem 0; min-width: 120px; flex: 1;
  box-shadow: none; width: auto;
}
.tag-chip {
  display: inline-flex; align-items: center; gap: .25rem;
  background: rgba(30,58,95,.1); color: var(--primary);
  border: 1px solid rgba(30,58,95,.2);
  border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  padding: .15rem .55rem;
}
.chip-remove {
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: .6; padding: 0; line-height: 1; font-size: .8rem;
}
.chip-remove:hover { opacity: 1; }

/* Edit form inside case card */
.edit-form-wrap {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  border: 1.5px solid var(--border);
  margin-top: .75rem;
}

/* Success banner in add form */
.success-banner {
  display: flex; align-items: center; gap: .5rem;
  background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0;
  border-radius: var(--radius-sm); padding: .65rem 1rem; margin-bottom: 1rem;
  font-size: .9rem;
}

/* Empty state */
.empty-state {
  text-align: center; padding: 4rem 2rem; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { color: var(--text-muted); }

/* Search UI */
:root { --total-header-h: var(--header-h); }
[data-nav-style="bar"] { --total-header-h: calc(var(--header-h) + 38px); }

.search-sticky-wrap { position: sticky; top: var(--total-header-h); z-index: 90; }
.search-form-card { margin-bottom: .5rem; }
.search-filters-collapsed { display: none; }
.search-collapse-btn { padding: .3rem .55rem; font-size: .8rem; line-height: 1; min-width: 1.8rem; }

.search-bar-row { display: flex; gap: .75rem; margin-bottom: 1rem; }
.search-bar-row input { flex: 1; }
.search-cap-banner { font-size: .85rem; color: #92400e; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 6px; padding: .6rem 1rem; margin-bottom: .75rem; }
.search-cap-banner--bottom { margin-top: 1rem; margin-bottom: 0; }
.search-cap-banner--done { color: var(--text-muted); background: transparent; border-color: var(--border); }

/* Batch selection */
.selection-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; margin-bottom: .75rem; background: var(--bg); border: 1px solid var(--primary); border-radius: 8px; flex-wrap: wrap; }
.selection-bar-left { display: flex; align-items: center; gap: .6rem; }
.selection-count { font-size: .88rem; font-weight: 600; color: var(--primary); }
.selection-bar-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.case-card.selected, tr.case-row.selected > td { background: #eef0fc; }
.case-select-wrap { display: flex; align-items: center; padding-right: .5rem; cursor: pointer; flex-shrink: 0; }
.case-select-chk { width: 1rem; height: 1rem; cursor: pointer; accent-color: var(--primary); }

.filter-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.filter-row .form-group { margin-bottom: 0; flex: 1 1 160px; }
.field-checks { display: flex; flex-wrap: wrap; gap: .4rem .75rem; margin-top: .25rem; }
.field-check { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; cursor: pointer; user-select: none; }
.field-check input[type="checkbox"] { cursor: pointer; accent-color: var(--primary); width: 14px; height: 14px; }

.loading-row { display: flex; justify-content: center; padding: 2rem; }

/* Invite code box */
.invite-code-box {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem;
  margin-bottom: .75rem;
}
.invite-code-text {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: .18em; color: var(--primary);
  flex: 1;
}

/* ── Dashboard page header ───────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem;
}
.page-header h1 { font-size: 1.6rem; color: var(--primary); }

/* ── Onboard card ────────────────────────────── */
.onboard-wrap {
  max-width: 480px; margin: 2rem auto;
}
.onboard-toggle {
  display: flex; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1.5rem;
}
.onboard-opt {
  flex: 1; padding: .6rem 0; text-align: center;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  color: var(--text-muted); transition: background var(--transition), color var(--transition);
}
.onboard-opt.active { background: var(--primary); color: #fff; }
.onboard-opt:not(.active):hover { background: var(--bg); }

/* ── Pricing page ────────────────────────────── */
.pricing-page {
  max-width: 1000px; margin: 0 auto; padding: 2.5rem 1rem 3rem;
}
.pricing-header {
  text-align: center; margin-bottom: 2.5rem;
}
.pricing-header h1 { font-size: 2rem; margin-bottom: .5rem; }
.pricing-header p  { color: var(--text-muted); font-size: 1.05rem; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.pricing-card-free {
  grid-column: 1 / -1;
  max-width: 320px;
  justify-self: center;
  width: 100%;
}
.pricing-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  position: relative;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.pricing-popular {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-lg);
}
.pricing-popular-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .25rem .85rem; border-radius: 999px; white-space: nowrap;
}
.pricing-tier-label {
  font-size: .85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--primary); margin-bottom: .75rem;
}
.pricing-price {
  display: flex; align-items: baseline; gap: .25rem; margin-bottom: 1.25rem;
}
.pricing-amount { font-size: 2.75rem; font-weight: 800; color: var(--text); line-height: 1; }
.pricing-period { font-size: .9rem; color: var(--text-muted); }
.pricing-features {
  list-style: none; margin: 0 0 1.75rem; padding: 0;
  display: flex; flex-direction: column; gap: .55rem; flex: 1;
}
.pricing-features li { font-size: .9rem; color: var(--text-muted); }
.pricing-features li::before { content: '✓ '; color: var(--success); font-weight: 700; }
.pricing-cta { width: 100%; text-align: center; justify-content: center; margin-top: auto; }
.pricing-footer-note {
  text-align: center; margin-top: 2rem; font-size: .85rem; color: var(--text-muted);
}
.pricing-features .pricing-feat-limited {
  opacity: .55;
}
.pricing-features .pricing-feat-limited::before { content: '↗ '; color: var(--text-muted); }

/* ── Graph feature spotlight ──────────────────── */
.pricing-graph-spotlight {
  margin-top: 3rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  display: flex; align-items: flex-start; gap: 2rem;
  padding: 2.25rem 2rem;
}
.pgs-icon {
  flex-shrink: 0;
  width: 80px; height: 80px;
  background: #eef0fd;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.pgs-body { flex: 1; }
.pgs-badge {
  display: inline-block;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--primary); background: #eef0fd;
  padding: .2rem .7rem; border-radius: 999px; margin-bottom: .75rem;
}
.pgs-title { font-size: 1.35rem; font-weight: 800; margin-bottom: .6rem; color: var(--text); }
.pgs-desc  { font-size: .92rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 1rem; }
.pgs-bullets {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  display: flex; flex-direction: column; gap: .45rem;
}
.pgs-bullets li { font-size: .88rem; color: var(--text-muted); }
.pgs-bullets li::before { content: '→ '; color: var(--primary); font-weight: 700; }
.pgs-cta { width: auto; }
@media (max-width: 700px) {
  .pricing-graph-spotlight { flex-direction: column; }
  .pricing-grid { grid-template-columns: 1fr; }
}

/* ── Contact page ─────────────────────────────── */
.contact-page    { max-width: 640px; margin: 0 auto; padding: 2.5rem 1rem 3rem; }
.contact-header  { text-align: center; margin-bottom: 2rem; }
.contact-header h1 { font-size: 2rem; margin-bottom: .4rem; }
.contact-header p  { color: var(--text-muted); }
.contact-card    { padding: 2rem; }

/* ── Info pages (Terms, Refunds, FAQ) ────────── */
.info-page {
  max-width: 760px; margin: 0 auto; padding: 2rem 1.5rem 3rem;
}
.info-page h1 {
  font-size: 2rem; font-weight: 700; margin-bottom: .25rem;
  color: var(--text);
}
.info-updated {
  color: var(--text-muted); font-size: .85rem; margin-bottom: 2rem;
}
.info-page h2 {
  font-size: 1.25rem; font-weight: 700; margin: 2rem 0 .5rem;
  color: var(--primary);
  border-bottom: 2px solid var(--border); padding-bottom: .35rem;
}
.info-page h3 {
  font-size: 1rem; font-weight: 600; margin: 1.25rem 0 .35rem;
}
.info-page p, .info-page li { line-height: 1.7; color: var(--text-muted); }
.info-page ul, .info-page ol { padding-left: 1.4rem; margin: .5rem 0 1rem; }
.info-page a { color: var(--primary); text-decoration: underline; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.5rem; }
.faq-item {
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 0;
  overflow: hidden;
}
.faq-q {
  padding: 1rem 1.25rem; font-weight: 600; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between;
  align-items: center; color: var(--text);
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--primary); flex-shrink: 0; }
details[open] .faq-q::after { content: '−'; }
.faq-a { padding: 0 1.25rem 1rem; line-height: 1.7; color: var(--text-muted); }
.faq-section-heading { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 1.75rem 0 .5rem; }

/* ── Landing page ────────────────────────────── */
.lp-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 2rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .lp-hero { grid-template-columns: 1fr; padding: 2.5rem 1rem; }
  .lp-hero-visual { display: none; }
}
.lp-badge {
  display: inline-block;
  background: var(--primary-light); color: #fff;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1.25rem;
}
[data-theme="dark"] .lp-badge { background: rgba(74,127,193,.25); color: var(--primary-light); }
.lp-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900; line-height: 1.12;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 1.1rem;
}
.lp-hero-sub {
  font-size: 1.05rem; line-height: 1.65;
  color: var(--text-muted); margin-bottom: 1.75rem; max-width: 480px;
}
.lp-hero-hint {
  margin-top: .85rem; font-size: .82rem; color: var(--text-muted);
}
.lp-hero-cta { font-size: 1rem; padding: .7rem 1.8rem; }

/* Google sign-in button */
.lp-google-btn {
  display: inline-flex; align-items: center; gap: .75rem;
  padding: .75rem 1.75rem;
  background: #fff; color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: 8px; font-size: 1rem; font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  transition: box-shadow var(--transition), background var(--transition);
  text-decoration: none;
}
.lp-google-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); background: #f8f9fa; text-decoration: none; }
.lp-google-btn svg  { width: 20px; height: 20px; flex-shrink: 0; }

/* Auth card embedded in landing */
.lp-auth-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: .75rem;
  max-width: 300px;
}
.lp-auth-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 0; }
.lp-auth-card p { font-size: .85rem; color: var(--text-muted); margin: 0; }

/* Floating mock case cards */
.lp-mock-stack {
  position: relative; height: 300px;
}
.lp-mock-card {
  position: absolute;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 260px;
  overflow: hidden;
}
.lp-mc-accent { height: 4px; background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.lp-mc-body   { padding: .75rem 1rem; }
.lp-mc-title  { font-weight: 700; font-size: .88rem; margin-bottom: .3rem; }
.lp-mc-meta   { font-size: .76rem; color: var(--text-muted); margin-bottom: .4rem; }
.lp-mc-1 { top: 0;     left: 30px;  transform: rotate(-2deg); z-index: 3; }
.lp-mc-2 { top: 90px;  left: 0;     transform: rotate(1.5deg); z-index: 2; }
.lp-mc-3 { top: 175px; left: 50px;  transform: rotate(-1deg); z-index: 1; opacity: .85; }

/* Features section */
.lp-features, .lp-steps, .lp-cta-section {
  padding: 4rem 2rem;
}
.lp-features      { background: var(--bg); }
.lp-steps         { background: var(--card-bg); }
.lp-cta-section   { background: var(--primary-dark); color: #fff; }

.lp-section-inner {
  max-width: 1000px; margin: 0 auto;
  text-align: center;
}
.lp-section-label {
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--primary); margin-bottom: .6rem;
}
.lp-cta-section .lp-section-label { color: rgba(255,255,255,.7); }
.lp-section-inner h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .6rem; }
.lp-section-sub { color: var(--text-muted); max-width: 520px; margin: 0 auto 2.5rem; }

.lp-feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  text-align: left;
  margin-top: 2rem;
}
.lp-feat-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.lp-feat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.lp-feat-icon { font-size: 1.8rem; margin-bottom: .6rem; }
.lp-feat-card h3 { font-size: 1rem; margin: 0 0 .4rem; }
.lp-feat-card p  { font-size: .88rem; color: var(--text-muted); margin: 0; line-height: 1.55; }

/* grid variants */
.lp-feat-grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.lp-feat-grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* alt-background feature section */
.lp-features-alt { background: var(--bg); }
.lp-features-alt .lp-feat-card { background: var(--card-bg); }

/* ── Feature spotlight sections ───────────────────────── */
.lp-feat-spotlight {
  padding: 5rem 2rem;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.lp-feat-spotlight-graph { background: linear-gradient(135deg, var(--card-bg) 0%, color-mix(in srgb, var(--primary) 4%, var(--card-bg)) 100%); }
.lp-feat-spotlight-mobile { background: var(--bg); }

.lp-spotlight-inner {
  display: flex;
  align-items: center;
  gap: 4rem;
  text-align: left;
  max-width: 1000px;
  margin: 0 auto;
}
.lp-spotlight-inner-rev { flex-direction: row-reverse; }

.lp-spotlight-text { flex: 1 1 0; min-width: 0; }
.lp-spotlight-text h2 { font-size: clamp(1.4rem, 2.8vw, 1.9rem); margin: .4rem 0 1rem; }
.lp-spotlight-text p  { font-size: .93rem; color: var(--text-muted); line-height: 1.65; margin: 0 0 1rem; }

.lp-spotlight-bullets {
  list-style: none; padding: 0; margin: 0 0 1.2rem;
}
.lp-spotlight-bullets li {
  padding-left: 1.4rem; position: relative;
  font-size: .9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: .35rem;
}
.lp-spotlight-bullets li::before {
  content: '→'; position: absolute; left: 0; color: var(--primary); font-weight: 700;
}
.lp-spotlight-note {
  font-size: .8rem; color: var(--text-muted); font-style: italic; margin-bottom: 1.4rem !important;
}

.lp-spotlight-visual {
  flex: 0 0 280px; display: flex; align-items: center; justify-content: center;
}

/* Graph mock */
.lp-graph-mock {
  width: 260px; height: 200px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.lp-graph-mock svg { width: 100%; height: 100%; }

/* Phone mock */
.lp-phone-frame {
  width: 160px; height: 290px;
  background: var(--card-bg);
  border: 3px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.lp-phone-screen { flex: 1; padding: .75rem .6rem; display: flex; flex-direction: column; gap: .5rem; }
.lp-phone-bar { height: 6px; background: var(--primary); border-radius: 3px; margin-bottom: .3rem; opacity: .5; }
.lp-phone-item {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg); border-radius: 8px; padding: .5rem .6rem;
}
.lp-phone-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); opacity: .15; flex-shrink: 0; }
.lp-phone-lines { flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.lp-phone-line { height: 6px; background: var(--border); border-radius: 3px; }
.lp-phone-line-l { width: 90%; }
.lp-phone-line-m { width: 70%; }
.lp-phone-line-s { width: 50%; }
.lp-phone-badge {
  font-size: .6rem; font-weight: 700; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: .15rem .4rem; border-radius: 4px; white-space: nowrap; flex-shrink: 0;
}
.lp-phone-badge-muted { color: var(--text-muted); background: var(--border); }

@media (max-width: 720px) {
  .lp-spotlight-inner, .lp-spotlight-inner-rev { flex-direction: column; gap: 2rem; text-align: center; }
  .lp-spotlight-bullets li { text-align: left; }
  .lp-spotlight-visual { flex: none; }
  .lp-feat-spotlight { padding: 3rem 1.25rem; }
}

.lp-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  text-align: left;
}
.lp-step {
  padding: 1.5rem;
  border-left: 3px solid var(--primary);
  background: var(--bg);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.lp-step-num {
  font-size: 2rem; font-weight: 900; color: var(--primary);
  line-height: 1; margin-bottom: .5rem;
}
.lp-step h3 { font-size: .95rem; margin: 0 0 .35rem; }
.lp-step p  { font-size: .85rem; color: var(--text-muted); margin: 0; line-height: 1.55; }

.lp-cta-section h2 { margin-bottom: .5rem; color: #fff; }
.lp-cta-section p  { color: rgba(255,255,255,.7); margin-bottom: 1.5rem; }
.lp-cta-section .btn-primary {
  background: #fff; color: var(--primary-dark);
}
.lp-cta-section .btn-primary:hover {
  background: rgba(255,255,255,.9);
}

@media (max-width: 640px) {
  .lp-features, .lp-steps, .lp-cta-section { padding: 2.5rem 1rem; }
  .lp-feat-grid { gap: .75rem; }
  .lp-feat-card { padding: 1.25rem 1rem; }
  .lp-steps-grid { gap: .75rem; }
  .lp-step { padding: 1.25rem 1rem; }
  .info-page { padding: 1.25rem .75rem 2rem; }
  .info-page h1 { font-size: 1.5rem; }
}

/* ── Mobile / small-screen overrides ─────────── */
@media (max-width: 520px) {
  :root { --footer-h: 80px; }
  .header-inner { padding: 0 .75rem; }
  .logo { font-size: 1.2rem; }
  .header-nav { gap: .35rem; }
  #nav-user-name { display: none !important; }
  .footer-inner {
    flex-direction: column;
    justify-content: center;
    gap: .2rem;
    padding: .4rem 1rem;
    text-align: center;
  }
  .footer-nav { flex-wrap: wrap; justify-content: center; gap: .5rem 1rem; }
  .container { padding: 1.25rem 1rem; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { white-space: nowrap; font-size: .82rem; padding: .6rem .85rem; }
}

@media (max-width: 600px) {
  .modal-box { padding: 1.25rem 1rem; }
  .feedback-panel { right: .5rem; left: .5rem; width: auto; }
}

/* ── Yahoo sign-in button ────────────────── */
.lp-yahoo-btn {
  display: inline-flex; align-items: center; gap: .75rem;
  padding: .75rem 1.75rem;
  background: #6001D2; color: #fff;
  border: none;
  border-radius: 8px; font-size: 1rem; font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: box-shadow var(--transition), background var(--transition);
  text-decoration: none;
}
.lp-yahoo-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.28); background: #5000B8; text-decoration: none; color: #fff; }

/* ── Admin dashboard ─────────────────────── */
.stats-row {
  display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.75rem;
  flex: 1; min-width: 120px; text-align: center;
}
.stat-num {
  font-size: 2.25rem; font-weight: 800; color: var(--primary); line-height: 1;
}
.stat-label {
  font-size: .8rem; color: var(--text-muted); margin-top: .35rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
}
.admin-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
}
.admin-table th {
  text-align: left; padding: .55rem .75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
}
.admin-table td {
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(30,58,95,.04); }

/* ── Admin page sections ─────────────────── */
.admin-section { margin-top: 2rem; }
.admin-section h2 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.admin-mode-badge {
  font-size: .68rem; font-weight: 800; letter-spacing: .1em;
  padding: .2rem .55rem; border-radius: 4px; vertical-align: middle;
}
.admin-mode-badge-test { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.admin-mode-badge-live { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* ── Tier upgrade banner (Firm Admin tab) ─────── */
.tier-banner {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
}
.tier-banner-top {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-bottom: .9rem;
}
.tier-banner-badge {
  font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  padding: .2rem .6rem; border-radius: 4px;
}
.tier-upgrade-row {
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.tier-upgrade-card {
  flex: 1 1 160px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
}
.tier-upgrade-name  { font-weight: 700; font-size: .95rem; margin-bottom: .15rem; }
.tier-upgrade-price { font-size: .8rem; color: var(--text-muted); margin-bottom: .6rem; }
.tier-upgrade-bullets {
  list-style: none; padding: 0; margin: 0 0 .85rem;
}
.tier-upgrade-bullets li {
  font-size: .82rem; color: var(--text-muted); padding-left: 1.1rem; position: relative;
  margin-bottom: .25rem; line-height: 1.45;
}
.tier-upgrade-bullets li::before {
  content: '✓'; position: absolute; left: 0; color: var(--primary); font-weight: 700;
}
.admin-filter-count { font-size: .75rem; font-weight: 600; color: var(--text-muted); background: var(--border); border-radius: 999px; padding: .1rem .55rem; }
.admin-filter-row th { background: var(--card-bg); padding: .4rem .5rem; }

/* ── Pricing tier config table ──────────────── */
.tier-config-table td:first-child { white-space: nowrap; font-weight: 600; }
.tier-input {
  padding: .3rem .45rem;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: .85rem;
}
.col-filter {
  width: 100%; padding: .35rem .5rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text);
  font-size: .82rem; font-family: inherit;
}
.col-filter:focus { outline: none; border-color: var(--primary); }

/* ── Badges ──────────────────────────────── */
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .15rem .6rem; font-size: .72rem; font-weight: 700; letter-spacing: .03em; }
.badge-admin  { background: #dbeafe; color: #1d4ed8; }
.badge-user   { background: var(--border); color: var(--text-muted); }
.badge-danger { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .badge-admin  { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .badge-user   { background: #334155; color: #94a3b8; }
[data-theme="dark"] .badge-danger { background: #7f1d1d; color: #fca5a5; }

/* ── Contact message cards ───────────────── */
.msg-card { margin-bottom: 1rem; padding: 1rem 1.25rem; }
.msg-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .25rem; flex-wrap: wrap; }
.msg-reply-preview { background: var(--bg); border-left: 3px solid #198754; padding: .5rem .75rem; border-radius: 4px; font-size: .875rem; color: var(--text-muted); margin-bottom: .5rem; }
.msg-reply-form textarea { padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-family: inherit; font-size: .875rem; }

/* ── Feedback cards ──────────────────────── */
.fb-admin-card { margin-bottom: 1rem; padding: 1rem 1.25rem; }
.fb-admin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; flex-wrap: wrap; }
.fb-screenshot-thumb { margin-top: .75rem; cursor: pointer; max-height: 80px; overflow: hidden; border-radius: 6px; position: relative; transition: max-height .3s; }
.fb-screenshot-thumb.expanded { max-height: 1000px; }
.fb-thumb-hint { position: absolute; bottom: 4px; right: 6px; font-size: .7rem; color: rgba(255,255,255,.85); background: rgba(0,0,0,.4); padding: .1rem .4rem; border-radius: 4px; }

/* ── Case links ──────────────────────────── */
.case-link-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .9rem;
  background: var(--primary); color: #fff;
  border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600;
  text-decoration: none;
  transition: background var(--transition);
}
.case-link-btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }

.related-link-row {
  display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem;
}
.related-link-row input { flex: 1; margin-bottom: 0; }

.related-links-list {
  margin-top: .75rem; font-size: .85rem; color: var(--text-muted);
}
.related-links-list a {
  color: var(--primary); text-decoration: underline;
}
.related-links-list a:hover { color: var(--primary-dark); }

.opt-label {
  font-weight: 400; color: var(--text-muted); font-size: .8rem;
}
.char-count {
  font-weight: 400; color: var(--text-muted); font-size: .78rem; font-variant-numeric: tabular-nums;
}

/* ── File attachments ────────────────────── */
.attach-pending {
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
}
.attach-drop-area {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-size: .88rem; color: var(--text-muted); margin-bottom: .5rem;
}
.attach-pick-btn {
  display: inline-flex; align-items: center;
  padding: .3rem .75rem;
  background: var(--primary); color: #fff !important;
  border-radius: 6px; font-size: .82rem; font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.attach-pick-btn:hover { background: var(--primary-dark); }
.attach-list {
  display: flex; flex-direction: column; gap: .35rem;
}
.attach-item {
  display: flex; align-items: center; gap: .6rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .4rem .75rem;
  font-size: .85rem;
}
.attach-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text);
}
.attach-size {
  color: var(--text-muted); font-size: .78rem; flex-shrink: 0;
}
.attach-status {
  font-size: .85rem; flex-shrink: 0;
}
.attach-status.done     { color: var(--success); }
.attach-status.error    { color: var(--danger); }
.attach-status.uploading { color: var(--primary); }
.form-hint {
  font-size: .78rem; color: var(--text-muted); margin-top: .35rem;
}

/* ── Lightbox ─────────────────────────────── */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.82);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img {
  max-width: 90vw; max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.lightbox-close {
  position: fixed; top: 1rem; right: 1.25rem;
  background: none; border: none;
  color: #fff; font-size: 2rem; line-height: 1;
  cursor: pointer; z-index: 1001;
  opacity: .85;
  transition: opacity .15s;
}
.lightbox-close:hover { opacity: 1; }

/* ── OCR Modal ────────────────────────────── */
.ocr-modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  width: min(640px, 92vw);
  display: flex; flex-direction: column; gap: .75rem;
  position: relative;
  max-height: 85vh;
}
.ocr-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 1rem; color: var(--text);
}
.ocr-modal-close {
  position: static;
  color: var(--text-muted);
  font-size: 1.4rem;
}
.ocr-modal-text {
  flex: 1;
  min-height: 220px; max-height: 55vh;
  resize: vertical;
  font-family: monospace; font-size: .82rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  background: var(--bg); color: var(--text);
  overflow-y: auto;
}
.ocr-modal-actions {
  display: flex; gap: .5rem; justify-content: flex-end;
}

/* ── View toggle ──────────────────────────── */
.view-toggle {
  display: flex; gap: 0;
  flex-shrink: 0;
}
.view-toggle .btn {
  border-radius: 0;
}
.view-toggle .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.view-toggle .btn:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── Case table (desktop search view) ────── */
.case-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.case-table th {
  text-align: left;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .6rem .85rem;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
}
.case-table td {
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.case-table tr.case-row {
  cursor: pointer;
  transition: background var(--transition);
}
.case-table tr.case-row:hover { background: var(--bg); }
.case-table tr.detail-row td {
  padding: .75rem 1rem 1rem;
  background: var(--bg);
}
.case-table tr.detail-row.hidden { display: none; }

/* ── Filter row — wide screens ────────────── */
@media (min-width: 1024px) {
  .filter-row { flex-wrap: nowrap; gap: .75rem; }
  .filter-row .form-group { flex: 1; min-width: 0; }
}

/* ── Auth modal (matches Seatable style) ──────────────────────────────────── */
.auth-modal-header { text-align: center; margin-bottom: 1.25rem; }
.auth-modal-logo   { font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px; color: var(--text); margin-bottom: .25rem; }
.auth-modal-sub    { font-size: .85rem; color: var(--text-muted); margin: 0; }
.auth-modal-oauth-row { display: flex; justify-content: center; gap: 1rem; margin-bottom: .5rem; }
.auth-oauth-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: #fff; border: 1.5px solid #dadce0;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  transition: box-shadow var(--transition), background var(--transition);
  text-decoration: none;
}
.auth-oauth-icon:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); background: #f8f9fa; text-decoration: none; }
.auth-oauth-apple { background: #000; border-color: #000; }
.auth-oauth-apple:hover { background: #222; }
.auth-oauth-yahoo { background: #6001D2; border-color: #6001D2; }
.auth-oauth-yahoo:hover { background: #4a00a8; }
.auth-modal-divider { max-width: 100% !important; }
.auth-modal-tabs   { max-width: 100% !important; }
.auth-modal-input  { max-width: 100% !important; margin-bottom: .6rem; }
.auth-modal-submit { max-width: 100% !important; width: 100%; margin-top: .25rem; }

.lp-auth-divider {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; max-width: 260px; color: var(--text-muted); font-size: .8rem; margin: .6rem 0;
}
.lp-auth-divider::before,
.lp-auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.lp-auth-tabs {
  display: flex; gap: 0; margin-bottom: .85rem;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  width: 100%; max-width: 260px;
}
.lp-auth-tab {
  flex: 1; padding: .45rem 0; font-size: .85rem; font-weight: 500;
  background: none; border: none; cursor: pointer; color: var(--text-muted);
}
.lp-auth-tab.active { background: var(--primary); color: #fff; }

.lp-auth-input {
  display: block; width: 100%; max-width: 260px; padding: .5rem .7rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--input-bg, var(--bg)); color: var(--text);
  font-size: .9rem; box-sizing: border-box;
}
.lp-auth-input:focus { outline: none; border-color: var(--primary); }
.lp-auth-error { color: var(--danger, #dc2626); font-size: .82rem; max-width: 260px; margin-bottom: .4rem; }

.auth-page-wrap { display: flex; justify-content: center; align-items: flex-start; padding: 3rem 1rem; min-height: 60vh; }
.auth-page-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; width: 100%; max-width: 400px; box-shadow: 0 4px 24px rgba(0,0,0,.08); }

/* ══════════════════════════════════════════════════════
   Dark-mode contrast fixes
   ══════════════════════════════════════════════════════ */

/* Toast colours in dark mode (were hardcoded light pastels) */
[data-theme="dark"] .toast.success { background: #0C2A20; color: #6EE7B7; border-color: #065F46; }
[data-theme="dark"] .toast.error   { background: #2D0F0F; color: #FCA5A5; border-color: #7F1D1D; }
[data-theme="dark"] .toast.info    { background: #0F1E40; color: #93C5FD; border-color: #1E3A8A; }

/* Success banner in dark mode (hardcoded light green) */
[data-theme="dark"] .success-banner { background: #0C2A20; color: #6EE7B7; border-color: #065F46; }

/* Primary-coloured text: swap var(--primary) → var(--primary-light) in dark mode
   so these elements are visible against dark card/page backgrounds.
   Affects: navy (#1e3a5f on #1E293B ≈ 1.3:1) and graphite (#374151 on #141618 ≈ 1.7:1) */
[data-theme="dark"] .case-docket,
[data-theme="dark"] .stat-num,
[data-theme="dark"] .page-header h1,
[data-theme="dark"] .invite-code-text,
[data-theme="dark"] .pricing-tier-label,
[data-theme="dark"] .info-page h2,
[data-theme="dark"] .lp-section-label,
[data-theme="dark"] .lp-step-num,
[data-theme="dark"] .faq-q::after { color: var(--primary-light); }

/* Hero title gradient: darken → lighten so text is visible on dark page bg */
[data-theme="dark"] .lp-hero-title {
  background-image: linear-gradient(135deg, var(--primary-light), var(--text));
}

/* Tag chips dark mode (was missing override — same fix as tag-badge) */
[data-theme="dark"] .tag-chip {
  background: rgba(74,127,193,.15); color: var(--primary-light); border-color: rgba(74,127,193,.3);
}

/* btn-outline in dark mode: primary is too dark to use as text/border colour */
[data-theme="dark"] .btn-outline {
  color: var(--primary-light);
  border-color: var(--primary-light);
}
[data-theme="dark"] .btn-outline:hover {
  background: var(--primary-light);
  color: var(--bg);
}

/* Mono dark: active auth-tab has primary=#EEE, so text must be dark, not white */
[data-scheme="mono"][data-theme="dark"] .lp-auth-tab.active  { background: var(--primary); color: var(--bg); }
[data-scheme="mono"][data-theme="dark"] .onboard-opt.active  { background: var(--primary); color: var(--bg); }
[data-scheme="mono"][data-theme="dark"] .attach-pick-btn     { background: var(--primary); color: var(--bg) !important; }

/* ── Judgment entry expand/collapse arrow ────────────────────────────────────── */
.je-arrow {
  display: inline-block;
  font-size: .65rem;
  color: var(--text-muted);
  transition: transform .15s;
  flex-shrink: 0;
}
details.judgment-entry-block[open] > summary .je-arrow {
  transform: rotate(90deg);
}

/* ── Citation typeahead ──────────────────────────────────────────────────────── */
.cd-input-wrap { position: relative; }
.cd-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--card-bg, #fff); border: 1px solid var(--border);
  border-radius: 6px; z-index: 200; max-height: 220px; overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,.12); margin-top: 2px;
}
.cd-option {
  padding: .45rem .75rem; cursor: pointer; font-size: .85rem;
  border-bottom: 1px solid var(--border);
}
.cd-option:last-child { border-bottom: none; }
.cd-option:hover { background: rgba(79,70,229,.08); }
.cd-option .cd-opt-sub { font-size: .75rem; color: var(--text-muted); margin-top: 1px; }
.cd-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.cd-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  background: rgba(79,70,229,.1); border-radius: 999px;
  padding: .2rem .55rem; font-size: .78rem; color: var(--text);
}
.cd-chip button {
  background: none; border: none; cursor: pointer; padding: 0;
  line-height: 1; color: var(--text-muted); font-size: .95rem;
}
.cd-chip button:hover { color: var(--danger, #dc2626); }

/* Cited-in section */
.cited-in-section {
  margin-top: .75rem; padding: .5rem .75rem;
  background: rgba(79,70,229,.04); border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0; font-size: .82rem;
}
.cited-in-section strong { display: block; margin-bottom: .3rem; font-size: .85rem; }

/* Dashboard */
.dashboard-row:hover { background: rgba(79,70,229,.06); }

/* Graph */
.graph-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9000 !important;
  height: 100dvh !important;
  border-radius: 0 !important;
  border: none !important;
}

/* Markdown rendered content */
.md-body p { margin: 0 0 .5rem; }
.md-body p:last-child { margin-bottom: 0; }
.md-body ul, .md-body ol { margin: .25rem 0 .5rem 1.25rem; padding: 0; }
.md-body li { margin-bottom: .15rem; }
.md-body strong { font-weight: 600; }
.md-body em { font-style: italic; }
.md-body code { font-family: monospace; background: rgba(0,0,0,.06); padding: .1em .3em; border-radius: 3px; font-size: .9em; }
.md-body blockquote { margin: .5rem 0; padding: .25rem .75rem; border-left: 3px solid var(--border); color: var(--text-muted); }
.md-body h1,.md-body h2,.md-body h3,.md-body h4 { font-weight: 600; margin: .5rem 0 .25rem; line-height: 1.3; }
.md-body mark { background: #fef08a; color: inherit; border-radius: 2px; padding: 0 .15em; }

/* Print overlay */
#print-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: #f4f4f4;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#print-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}
#print-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}
#print-content .case-block {
  background: #fff;
  max-width: 17cm;
  margin: 0 auto 2rem;
  padding: 2cm;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  font-family: Georgia, serif;
  font-size: 12pt;
  color: #111;
}
#print-content h2 { font-size: 14pt; margin: 0 0 .25rem; color: #333; }
#print-content h3 { font-size: 13pt; font-weight: normal; margin: 0 0 1rem; }
#print-content .meta-table { border-collapse: collapse; margin-bottom: 1rem; font-size: 11pt; }
#print-content .meta-table th { text-align: left; color: #555; padding-right: 1rem; font-weight: normal; white-space: nowrap; }
#print-content .entry { border-top: 1px solid #ddd; margin-top: 1rem; padding-top: 1rem; }
#print-content .entry-subject { font-weight: bold; font-size: 11pt; margin: 0 0 .5rem; color: #333; }
#print-content .entry-section { margin-bottom: .75rem; }
#print-content .label { display: block; font-size: 9pt; font-weight: bold; text-transform: uppercase; letter-spacing: .05em; color: #888; margin-bottom: .2rem; }
#print-content .ratio-body p { margin: .15rem 0; line-height: 1.5; }
#print-content .ratio-body ul, #print-content .ratio-body ol { margin: .25rem 0 .25rem 1.25rem; padding: 0; }
#print-content .ratio-body li { margin-bottom: .1rem; }
#print-content .ratio-body strong { font-weight: 600; }
#print-content .ratio-body em { font-style: italic; }
#print-content p, #print-content li { margin: .15rem 0; line-height: 1.5; }
#print-content ul { margin: .25rem 0 .25rem 1.25rem; padding: 0; }
@media print {
  body > *:not(#print-overlay) { display: none !important; }
  #print-overlay { position: static; background: none; display: block; }
  #print-toolbar { display: none !important; }
  #print-content { overflow: visible; padding: 0; }
  #print-content .case-block { box-shadow: none; padding: 0; margin: 0; }
  .page-break { page-break-after: always; }
  .search-sticky-wrap { position: static; }
}

/* Quill editor in entry forms */
.quill-ratio-editor { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.quill-ratio-editor .ql-toolbar { border: none; border-bottom: 1px solid var(--border); background: var(--surface); }
.quill-ratio-editor .ql-container { border: none; font-size: .9rem; min-height: 120px; }
.quill-ratio-editor .ql-editor { min-height: 120px; line-height: 1.6; }
