/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Search the Law — Main Stylesheet
   Professional, mobile-first, WCAG 2.1 AA compliant, dark hero cinematic design
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  --brand-blue: #185FA5;
  --brand-green: #0F6E56;
  --brand-amber: #854F0B;
  --brand-blue-light: #85B7EB;
  --brand-green-light: #5DCAA5;
  --brand-amber-light: #FAC775;
  --navy: #1a2332;
  --navy-light: #243447;
  --gold: #b8952e;
  --gold-light: #d4b44a;
  --gold-subtle: #f8f4e8;
  --green: #2d7d46;
  --green-light: #e8f5e9;
  --red: #c62828;
  --red-light: #fce8e8;
  --orange: #e65100;
  --orange-light: #fff3e0;
  --bg: #fafaf7;
  --white: #ffffff;
  --text: #2c3e50;
  --text-light: #5a6c7d;
  --text-muted: #8a9bae;
  --border: #e0ddd8;
  --border-light: #eeecea;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1100px;
  --transition: 0.2s ease;
}

/* ── Animation Classes ─────────────────────────────────────────────── */
.anim { transition: all 0.6s cubic-bezier(0.4,0,0.2,1); }
.anim-fast { transition: all 0.4s cubic-bezier(0.4,0,0.2,1); }
.anim-slow { transition: all 0.8s cubic-bezier(0.4,0,0.2,1); }

@media (prefers-reduced-motion: reduce) {
  .anim, .anim-fast, .anim-slow {
    animation: none !important;
    transition: none !important;
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; }

/* ── Skip to content (accessibility) ───────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.75rem 1.5rem;
  background: var(--navy);
  color: var(--white);
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ── Navigation ────────────────────────────────────────────────── */
.navbar {
  background: var(--navy);
  padding: 0.75rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo {
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.logo:hover { text-decoration: none; }
.logo .accent { color: var(--gold); }
.logo-svg { height: 35px; width: auto; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: #a0b0c0;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-links a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}
.nav-links a.active {
  color: var(--gold);
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

@media (max-width: 640px) {
  .menu-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.6rem 0.75rem; }
}

/* ── Layout ────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

main { flex: 1; }

/* ── Hero / Landing ────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3rem 1.25rem 2rem;
  background: #0d1117;
  color: #f0f0f0;
}

.hero h1 {
  display: none;
}

.hero p {
  color: #999999;
  font-size: 1rem;
  max-width: 600px;
  margin: 2rem auto 1.5rem;
  line-height: 1.5;
}

/* Dark mode hero with animation */
.hero-dark {
  background: #0d1117;
  color: #f0f0f0;
  padding: 2rem 1.25rem;
}

.hero-dark h1 {
  display: none;
}

.hero-dark p {
  color: #999999;
}

/* ── Search Box ────────────────────────────────────────────────── */
.search-container {
  max-width: 680px;
  margin: 0 auto;
}

.search-box {
  display: flex;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 149, 46, 0.15);
}

.search-box input {
  flex: 1;
  border: none;
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: transparent;
  outline: none;
  min-width: 0;
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box button {
  background: var(--gold);
  color: var(--white);
  border: none;
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.search-box button:hover { background: var(--gold-light); }

.search-examples {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #999999;
}

.search-examples a {
  color: #cccccc;
  text-decoration: underline;
  text-decoration-color: #555555;
  text-underline-offset: 2px;
}
.search-examples a:hover { color: var(--brand-blue-light); text-decoration-color: var(--brand-blue-light); }

.search-tips {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: #999999;
  opacity: 0.9;
}

.search-tips code {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.72rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: #cccccc;
}

/* ── Trust Banner ──────────────────────────────────────────────── */
.trust-banner {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin: 1.5rem auto;
  max-width: 680px;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #e0e0e0;
}

.trust-banner .icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; color: var(--brand-green-light); }

/* ── Source Cards (landing page) ───────────────────────────────── */
.sources-section {
  padding: 2rem 0 3rem;
}

.sources-section h2 {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 1.5rem;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.source-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.source-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

.source-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.source-card p {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.45;
}

.source-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.source-badge.gov { background: #e3f2fd; color: #1565c0; }
.source-badge.parl { background: #f3e5f5; color: #6a1b9a; }
.source-badge.free { background: var(--green-light); color: var(--green); }

/* ── Brand-Specific Badge Colors ───────────────────────────────── */
.source-badge.case-law { background: var(--brand-blue); color: var(--white); }
.source-badge.legislation { background: var(--brand-green); color: var(--white); }
.source-badge.parliament { background: var(--brand-amber); color: var(--white); }
.source-badge.ai-powered { background: #6b7280; color: var(--white); }

/* ── Pricing Section ──────────────────────────────────────────── */
.pricing-section {
  padding: 3rem 1.25rem;
  background: var(--bg);
  text-align: center;
}

.pricing-section h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.pricing-intro {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto 2rem;
}

.pricing-card {
  background: var(--white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-blue);
  transform: translateY(-2px);
}

.pricing-card-popular {
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, rgba(24, 95, 165, 0.03) 0%, transparent 100%);
}

.pricing-card-popular:hover {
  box-shadow: 0 12px 32px rgba(24, 95, 165, 0.15);
}

.pricing-badge {
  display: inline-block;
  background: var(--brand-blue);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin: -1.5rem auto 1rem;
  width: fit-content;
}

.pricing-header {
  margin-bottom: 1.5rem;
}

.pricing-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.pricing-amount {
  font-size: 2rem;
  font-weight: 600;
  color: var(--navy);
}

.pricing-period {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-light);
}

.pricing-limits {
  flex: 1;
  margin-bottom: 1.5rem;
  text-align: left;
}

.pricing-limits p {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.pricing-limits strong {
  color: var(--navy);
  font-weight: 600;
}

.pricing-cta {
  background: var(--white);
  color: var(--brand-blue);
  border: 2px solid var(--brand-blue);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.pricing-cta:hover {
  background: var(--brand-blue);
  color: var(--white);
}

.pricing-cta-primary {
  background: var(--brand-blue);
  color: var(--white);
}

.pricing-cta-primary:hover {
  background: #144686;
  border-color: #144686;
}

.pricing-note {
  font-size: 0.85rem;
  color: var(--text-light);
  max-width: 800px;
  margin: 0 auto;
}

/* ── Intelligence Panel (search results) ──────────────────────── */
.intelligence-panel {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.intelligence-panel .area-tag {
  display: inline-block;
  background: rgba(184,149,46,0.2);
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  margin-bottom: 0.6rem;
}

.intelligence-panel .context {
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.92;
}

.intelligence-panel .verified {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.78rem;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Result Tabs ───────────────────────────────────────────────── */
.result-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.result-tab {
  background: none;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.result-tab:hover { color: var(--text); }

.result-tab.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

.result-tab .count {
  background: var(--border-light);
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-weight: 600;
}

.result-tab.active .count {
  background: var(--gold-subtle);
  color: var(--gold);
}

/* ── Result Lists ──────────────────────────────────────────────── */
.result-panel { display: none; }
.result-panel.active { display: block; }

.result-list { list-style: none; }

.result-item {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.result-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.result-item a.result-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--navy);
  font-weight: 400;
  line-height: 1.4;
  display: block;
  margin-bottom: 0.3rem;
}
.result-item a.result-title:hover { color: var(--gold); text-decoration: none; }

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.result-meta .separator { color: var(--border); }

.result-snippet {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
  border-left: 3px solid var(--gold-subtle);
  padding-left: 0.75rem;
  margin-top: 0.4rem;
}

.result-snippet mark {
  background: var(--gold-subtle);
  color: var(--text);
  padding: 0 0.15rem;
  border-radius: 2px;
}

/* ── Case Detail Page ──────────────────────────────────────────── */
.case-header-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-top: 3px solid var(--gold);
}

.case-header-card h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.case-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem;
  font-size: 0.85rem;
}

.case-meta-item {
  display: flex;
  flex-direction: column;
}

.case-meta-item .label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.case-meta-item .value {
  color: var(--text);
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
}
.btn-primary:hover { background: var(--gold-light); text-decoration: none; }

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); border-color: var(--text-muted); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-light);
}
.btn-ghost:hover { color: var(--text); background: rgba(0,0,0,0.04); text-decoration: none; }

/* ── Appeal/Status Badge ───────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
}

.status-badge.good { background: var(--green-light); color: var(--green); }
.status-badge.warning { background: var(--orange-light); color: var(--orange); }
.status-badge.danger { background: var(--red-light); color: var(--red); }

/* ── Sidebar Panels (citations, legislation, TOC) ─────────────── */
.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .content-with-sidebar {
    grid-template-columns: 1fr;
  }
}

.sidebar-panel {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  position: sticky;
  top: 4.5rem;
}

.sidebar-panel h3 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-list { list-style: none; }

.sidebar-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.82rem;
}

.sidebar-list li:last-child { border-bottom: none; }

.sidebar-list a { color: var(--text); }
.sidebar-list a:hover { color: var(--gold); }

.sidebar-list .cite-ref {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.1rem;
}

/* ── Judgment Text ─────────────────────────────────────────────── */
.judgment-text {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.judgment-text .heading {
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy);
  margin: 1.5rem 0 0.5rem;
}

/* ── Explain Panel ─────────────────────────────────────────────── */
.explain-panel {
  background: var(--gold-subtle);
  border: 1px solid #e8dfc0;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.explain-panel h2 {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.explain-panel .content {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

/* ── Loading States ────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 0.75rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, #f0ede8 37%, var(--border-light) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Empty State ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 2rem 1.25rem;
  margin-top: 3rem;
  font-size: 0.82rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.footer-col h4 {
  color: rgba(255,255,255,0.9);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}

.footer-col a {
  color: rgba(255,255,255,0.6);
  display: block;
  padding: 0.2rem 0;
}
.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ── Coverage Disclaimer ───────────────────────────────────────── */
.coverage-note {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-top: 1.5rem;
}

.coverage-note strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.3rem;
}

/* ── Utility Classes ───────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ── Auth & Account UI ────────────────────────────────────────── */
.auth-nav-item { display: flex; align-items: center; }

.btn-sign-in {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  color: var(--gold);
  background: transparent;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.btn-sign-in:hover { background: var(--gold); color: var(--white); text-decoration: none; }

.btn-account {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text);
  transition: border-color var(--transition);
}
.btn-account:hover { border-color: var(--gold); }

.account-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--gold);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 50%;
}

.account-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-panel {
  position: fixed;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  z-index: 1000;
  min-width: 220px;
  padding: 0.75rem;
}

.account-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.tier-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  background: var(--gold-subtle);
  color: var(--gold);
}

.account-panel-nav a {
  display: block;
  padding: 0.4rem 0.25rem;
  font-size: 0.85rem;
  color: var(--text);
  border-radius: var(--radius-sm);
}
.account-panel-nav a:hover { background: var(--bg); text-decoration: none; }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,35,50,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 380px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.auth-modal h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 0.85rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.form-group input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition);
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-subtle);
}

.auth-error {
  background: var(--red-light);
  color: var(--red);
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

.auth-switch {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.auth-switch a { color: var(--gold); font-weight: 600; }

/* ── Side Panel (saved searches, bookmarks) ──────────────────── */
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 90vw;
  height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.side-panel-header h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--navy);
}

.side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.saved-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
}

.saved-item:last-child { border-bottom: none; }

.saved-query {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  display: block;
}

.saved-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0 0.25rem;
}
.btn-icon:hover { color: var(--red); }

.empty-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.folder-heading {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 1rem 0 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-light);
}

.folder-heading:first-child { margin-top: 0; }

/* ── Bookmark Button ─────────────────────────────────────────── */
.bookmark-btn.bookmarked { color: var(--gold); }

/* ── Save Search Button in Results ───────────────────────────── */
.save-search-btn {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: all var(--transition);
}
.save-search-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── Mobile Responsive ────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Hero */
  .hero { padding: 2rem 1rem 1.5rem; }
  .hero p { font-size: 0.88rem; }

  /* Search box */
  .search-box { flex-direction: column; overflow: visible; border-radius: var(--radius-md); }
  .search-box input { border-radius: var(--radius-md) var(--radius-md) 0 0; }
  .search-box button { border-radius: 0 0 var(--radius-md) var(--radius-md); width: 100%; }

  /* Advanced filters */
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  .courts-grid {
    grid-template-columns: 1fr;
  }
  .related-searches {
    flex-direction: column;
    align-items: flex-start;
  }
  .related-pill {
    width: 100%;
    text-align: center;
  }

  /* Source cards */
  .sources-grid { grid-template-columns: 1fr; }
  .sources-section h2 { font-size: 1.1rem; }

  /* Pricing */
  .pricing-section { padding: 2rem 1rem; }
  .pricing-section h2 { font-size: 1.2rem; }
  .pricing-intro { font-size: 0.9rem; margin-bottom: 1.5rem; }
  .pricing-grid { grid-template-columns: 1fr; gap: 1rem; }
  .pricing-card { padding: 1.5rem 1rem; }
  .pricing-amount { font-size: 1.5rem; }
  .pricing-cta { padding: 0.7rem 1.25rem; font-size: 0.85rem; }

  /* Search examples */
  .search-examples { font-size: 0.8rem; }
  .search-tips { font-size: 0.78rem; }

  /* Trust banner */
  .trust-banner { font-size: 0.82rem; padding: 0.8rem; }

  /* Result tabs */
  .result-tabs { gap: 0.25rem; }
  .result-tab { padding: 0.5rem 0.6rem; font-size: 0.78rem; }

  /* Intelligence panel */
  .intelligence-panel { padding: 1rem; }
  .intelligence-panel .context { font-size: 0.85rem; }

  /* Case header */
  .case-header-card { padding: 1rem; }
  .case-header-card h1 { font-size: 1.15rem; }
  .case-meta-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .case-actions { flex-direction: column; }
  .case-actions .btn { width: 100%; justify-content: center; }

  /* Sidebar */
  .sidebar-panel { position: static; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-col a { padding: 0.3rem 0; }
  .footer-bottom { flex-direction: column; gap: 0.3rem; }

  /* Auth modal */
  .auth-modal { width: 95%; margin: 1rem; }

  /* Side panel */
  .side-panel { width: 100%; }
}

@media (max-width: 768px) and (min-width: 481px) {
  .sources-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .case-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
  .side-panel { width: 85%; }
}

/* ── Advanced Filters ──────────────────────────────────────────── */
.advanced-filters-wrapper {
  margin-top: 0.8rem;
}

.filters-toggle {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.9rem;
  padding: 0.25rem 0;
  cursor: pointer;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filters-toggle:hover {
  color: var(--text);
}

.toggle-icon {
  display: inline-block;
  font-size: 0.8rem;
}

.advanced-filters {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 0.6rem;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.filter-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition);
}

.filter-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 149, 46, 0.1);
}

/* Court Filter Checkboxes */
.filter-group-courts {
  grid-column: 1 / -1;
}

.filter-group-courts fieldset {
  border: none;
  padding: 0;
}

.filter-group-courts legend {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  display: block;
}

.courts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

/* ── Result Snippet ────────────────────────────────────────────── */
.result-snippet {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
}

.result-snippet mark {
  background: rgba(184, 149, 46, 0.25);
  padding: 0.05rem 0.1rem;
  border-radius: 2px;
  font-weight: 500;
  color: inherit;
}

/* ── Related Searches ──────────────────────────────────────────── */
.related-searches {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.related-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.related-pill {
  display: inline-block;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.related-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(184, 149, 46, 0.05);
  text-decoration: none;
}

/* ── Print Styles ──────────────────────────────────────────────── */
@media print {
  .navbar, .site-footer, .search-container, .result-tabs, .btn { display: none; }
  body { background: white; }
  .case-header-card, .judgment-text { border: none; box-shadow: none; }
  .advanced-filters-wrapper, .advanced-filters { display: none; }
}
