@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme colors - Modern Slate & Blue Palette */
  --bg-page: #0b0f19;
  --bg-header: rgba(15, 23, 42, 0.82);
  --bg-card: #1e293b;
  --bg-card-hover: #24334a;
  --bg-input: #0f172a;
  --bg-soft: #162032;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border-color: #334155;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.15);

  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --accent-border: rgba(59, 130, 246, 0.35);

  --ai-accent: #a855f7;
  --ai-bg: rgba(168, 85, 247, 0.08);
  --ai-border: rgba(168, 85, 247, 0.25);
  --ai-text-header: #c084fc;

  --warn-accent: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.08);
  --warn-border: rgba(245, 158, 11, 0.3);

  --badge-bg: rgba(51, 65, 85, 0.7);
  --badge-text: #e2e8f0;
  --badge-hover-bg: rgba(59, 130, 246, 0.2);
  --badge-hover-text: #60a5fa;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 16px 32px -4px rgba(0, 0, 0, 0.4), 0 8px 16px -4px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.2);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme support via prefers-color-scheme or manual override */
@media (prefers-color-scheme: light) {
  :root {
    --bg-page: #f8fafc;
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #f8fafc;
    --bg-soft: #f1f5f9;

    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;

    --border-color: #e2e8f0;
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-highlight: rgba(0, 0, 0, 0.12);

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --accent-border: rgba(37, 99, 235, 0.25);

    --ai-accent: #7c3aed;
    --ai-bg: rgba(124, 58, 237, 0.05);
    --ai-border: rgba(124, 58, 237, 0.2);
    --ai-text-header: #6d28d9;

    --badge-bg: #e2e8f0;
    --badge-text: #334155;
    --badge-hover-bg: #dbeafe;
    --badge-hover-text: #1d4ed8;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.12);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-page);
  color-scheme: dark light;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-ui);
  color: var(--text-main);
  background-color: var(--bg-page);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-container {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  flex: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

html {
  scroll-padding-top: 96px;
}

header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
  margin-bottom: 32px;
  transition: background var(--transition-normal);
}

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.legal-banner {
  max-width: 1040px;
  margin: -12px auto 24px;
  padding: 10px 24px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.legal-banner svg {
  flex-shrink: 0;
  color: var(--warn-accent);
  margin-top: 2px;
}

.legal-banner strong {
  color: var(--text-main);
}

.legal-banner a {
  color: var(--warn-accent);
}

@media (max-width: 640px) {
  .legal-banner {
    margin: 0 16px 20px;
  }
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

nav.main-nav a {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

nav.main-nav a:hover {
  color: var(--text-main);
  background: var(--border-subtle);
  text-decoration: none;
}

nav.main-nav a.active {
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

/* Page Intro Banner */
.page-intro {
  margin-bottom: 28px;
}

.page-intro h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1.2;
}

.page-intro p.subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
  max-width: 720px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
}

/* ==========================================================================
   Search Form & Filter Panel
   ========================================================================== */

.search-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-panel:focus-within {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

form.search-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-row-main {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1 1 300px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
}

form.search-form input[type=text] {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

form.search-form input[type=text]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

form.search-form select {
  padding: 12px 36px 12px 14px;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-main);
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2594a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all var(--transition-fast);
}

form.search-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-row-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.filter-toggles {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

label.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

label.toggle-switch input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 22px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: all var(--transition-fast);
}

label.toggle-switch input[type=checkbox]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

label.toggle-switch input[type=checkbox]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

label.toggle-switch input[type=checkbox]:checked::after {
  transform: translateX(16px);
  background: #ffffff;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

button.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
  transition: all var(--transition-fast);
}

button.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

/* Report-an-issue form */
.report-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.report-context {
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: 0 0 20px;
}

.report-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin: 18px 0 6px;
}

.report-label:first-of-type {
  margin-top: 0;
}

.report-form select,
.report-form input[type=email],
.report-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 14.5px;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

.report-form textarea {
  resize: vertical;
  line-height: 1.6;
}

.report-form select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2594a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

.report-form select:focus,
.report-form input[type=email]:focus,
.report-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button.btn-primary:active {
  transform: translateY(0);
}

a.btn-secondary, a.btn-clear {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

a.btn-secondary:hover, a.btn-clear:hover {
  color: var(--text-main);
  background: var(--bg-soft);
  text-decoration: none;
}

/* Results Header Bar */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.result-count {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.result-count strong {
  color: var(--text-main);
}

.tag-hierarchy-panel {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px;
  padding: 14px 18px; margin-bottom: 16px;
}
.tag-hierarchy-panel .section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 10px;
}
.tag-hierarchy-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px;
}
.tag-hierarchy-row:last-child { margin-bottom: 0; }
.tag-hierarchy-super { font-size: 13px; font-weight: 600; color: var(--text-main); text-decoration: none; }
.tag-hierarchy-super:hover { color: var(--accent); text-decoration: underline; }
.tag-hierarchy-arrow { color: var(--text-dim); }

/* Breadcrumb-style hierarchy crumbs: broad (super-category) -> narrow
   (category/tag), left to right, matching the order used in the results-bar
   ("Showing N results in [super] in [category]"). The super-category crumb
   is bold/accented to read as the broader, containing topic; narrower
   crumbs are visually quieter. */
.tag-hierarchy-chevron {
  flex: none;
  color: var(--text-dim);
}
.tag-hierarchy-crumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}
.tag-hierarchy-crumb.is-super {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-weight: 700;
}
.tag-hierarchy-crumb.is-super:hover {
  background: var(--accent-border);
}
.tag-hierarchy-crumb.is-category {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 500;
}
.tag-hierarchy-crumb.is-category:hover {
  color: var(--accent);
  border-color: var(--accent-border);
}
.tag-hierarchy-crumb.is-current {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 600;
}
.tag-hierarchy-count {
  color: var(--text-dim);
  font-weight: 400;
}
.tag-hierarchy-seeall {
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 4px;
}
.tag-hierarchy-seeall:hover {
  color: var(--accent);
  text-decoration: underline;
}

.active-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-left: 6px;
}

/* ==========================================================================
   Opinion List & Cards
   ========================================================================== */

ul.opinion-list {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

ul.opinion-list li.opinion-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
}

ul.opinion-list li.opinion-card-item:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.op-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

a.op-title {
  font-size: 17.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

a.op-title:hover {
  color: var(--accent);
}

.op-number-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.op-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.op-meta-date {
  display: flex;
  align-items: center;
  gap: 5px;
}

.op-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.op-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  text-decoration: none;
}

a.badge:hover {
  background: var(--badge-hover-bg);
  color: var(--badge-hover-text);
  border-color: var(--accent-border);
  text-decoration: none;
}

.badge.category-badge {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}

.badge.tag-badge {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.32);
}

.more-tags {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 8px;
}

/* "+N more" tag toggle: display:contents lets the <summary> and the
   revealed tag badges act as ordinary flex items inside .op-badges,
   instead of the <details> block breaking the badge row. */
.more-tags-toggle {
  display: contents;
}
.more-tags-toggle summary {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.more-tags-toggle summary::-webkit-details-marker {
  display: none;
}
.more-tags-toggle summary:hover {
  color: var(--accent);
  text-decoration: underline;
}
.more-tags-toggle[open] summary {
  color: var(--accent);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 36px 0 48px;
}

.pagination a, .pagination span {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.pagination a {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.pagination a:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.pagination span.current {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.pagination .disabled {
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border-subtle);
  pointer-events: none;
  opacity: 0.5;
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  margin: 20px 0;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-main);
  margin: 0 0 8px;
}

/* ==========================================================================
   Detail View Page (`view.php`)
   ========================================================================== */

.detail-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-back:hover {
  color: var(--text-main);
  border-color: var(--accent);
  background: var(--bg-soft);
  text-decoration: none;
}

.doc-pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-pager a {
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.doc-pager a:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  text-decoration: none;
}

.opinion-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 40px;
}

.opinion-detail-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 28px;
  margin-bottom: 28px;
}

.opinion-detail-header h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 10px 0 12px;
}

.opinion-detail-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.opinion-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* AI Summary Section */
/* AI-generated content: distinct violet accent, clearly not government text. */
.ai-summary-box {
  background: var(--ai-bg);
  border: 1px solid var(--ai-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 32px 0;
  position: relative;
  overflow: hidden;
}

.ai-summary-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--ai-accent), #818cf8);
}

.ai-summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.ai-sparkle-icon {
  color: var(--ai-accent);
  display: flex;
}

.ai-summary-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ai-text-header);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ai-summary-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--ai-border);
  color: var(--ai-text-header);
  border-radius: 999px;
  margin-left: auto;
}

.ai-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ai-accent);
  margin: 16px 0 6px !important;
}

.ai-section-label:first-of-type {
  margin-top: 0 !important;
}

.ai-summary-box p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-main);
  margin: 0 0 12px;
}

.ai-summary-disclaimer {
  font-size: 12.5px;
  color: var(--text-dim);
  font-style: italic;
  margin: 16px 0 0 !important;
  padding-top: 12px;
  border-top: 1px dashed var(--ai-border);
}

/* Document Divider */
/* Divider marking the start of the reproduced government document. */
.doc-divider {
  text-align: center;
  margin: 36px 0 28px;
  padding-top: 28px;
  border-top: 1px dashed var(--border-color);
  position: relative;
}

.doc-divider-badge {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-card);
  padding: 0 16px;
}

.doc-divider-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.doc-divider-note {
  font-size: 12.5px;
  color: var(--text-dim);
}

/* Excerpt Quote Block */
/* Verbatim excerpt from the source document -- neutral/quote styling, not AI styling. */
blockquote.commissioner-excerpt {
  margin: 0 0 32px;
  padding: 20px 24px;
  background: var(--bg-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-main);
}

blockquote.commissioner-excerpt .excerpt-label {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* Main Body Reader Text */
.opinion-body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-main);
}

.opinion-body p {
  margin: 0 0 1.25em;
}

.opinion-body h2, .opinion-body h3, .opinion-body h4 {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--text-main);
  margin: 1.5em 0 0.6em;
  line-height: 1.3;
}

.opinion-body blockquote {
  margin: 1.5em 0;
  padding: 12px 20px;
  border-left: 3px solid var(--border-color);
  background: var(--bg-soft);
  font-style: italic;
}

.opinion-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-family: var(--font-ui);
  font-size: 14.5px;
}

.opinion-body th, .opinion-body td {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.opinion-body th {
  background: var(--bg-soft);
  font-weight: 600;
}

.op-source-footer {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* ==========================================================================
   Explore Topics Page (`explore.php`)
   ========================================================================== */

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.explore-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

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

.explore-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.explore-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.explore-card-title a {
  color: inherit;
}

.explore-card-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.explore-card-count {
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
}

.explore-card-description {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.explore-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   Bookmarklet Installer (`bookmarklet.php`)
   ========================================================================== */

.installer-hero {
  text-align: center;
  max-width: 680px;
  margin: 20px auto 40px;
}

.installer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  max-width: 760px;
  margin: 0 auto 48px;
}

.bookmarklet-btn-container {
  text-align: center;
  padding: 28px;
  background: var(--bg-soft);
  border: 2px dashed var(--accent-border);
  border-radius: var(--radius-lg);
  margin: 24px 0 32px;
}

a.bookmarklet-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
  cursor: grab;
  transition: all var(--transition-fast);
}

a.bookmarklet-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.4);
  text-decoration: none;
}

.steps-list {
  padding-left: 0;
  list-style: none;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.steps-list li {
  position: relative;
  padding-left: 44px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
}

.steps-list li::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 2px 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-soft);
  padding: 36px 0;
  margin-top: auto;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-inner p {
  margin: 0;
  line-height: 1.6;
}

.footer-copyright {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 8px !important;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  
  nav.main-nav {
    justify-content: center;
  }

  .opinion-detail-card {
    padding: 24px;
  }

  .search-row-main {
    flex-direction: column;
    align-items: stretch;
  }

  form.search-form select {
    width: 100%;
  }

  .search-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   Chapter 13 Guide Page (`guide.php`)
   ========================================================================== */

.guide-page {
  max-width: 960px;
}

/* Disclaimer Callout Box */
.guide-disclaimer {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
}

.guide-disclaimer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--warn-accent);
  margin-bottom: 10px;
}

.guide-disclaimer ul {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

.guide-disclaimer li {
  margin-bottom: 6px;
}

.guide-disclaimer li:last-child {
  margin-bottom: 0;
}

.guide-disclaimer-footer {
  margin-top: 24px;
  margin-bottom: 40px;
}

.guide-disclaimer-footer p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Table of Contents Box */
.guide-toc {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}

.guide-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.guide-toc-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.guide-toc-icon {
  color: var(--accent);
  display: flex;
}

.guide-toc-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-toc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-toc-toggle:hover {
  color: var(--text-main);
  border-color: var(--accent-border);
  background: var(--bg-card-hover);
}

.guide-toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.guide-toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.guide-toc-item:hover {
  color: var(--accent);
  background: var(--bg-card-hover);
  border-color: var(--accent-border);
  transform: translateX(3px);
  text-decoration: none;
}

.guide-toc-item-num {
  width: 22px;
  height: 22px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Collapsible Section Cards (<details> & <summary>) */
details.guide-collapsible {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  overflow: hidden;
}

details.guide-collapsible[open] {
  box-shadow: var(--shadow-md);
  border-color: var(--border-highlight);
}

summary.guide-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background var(--transition-fast);
}

summary.guide-summary::-webkit-details-marker {
  display: none;
}

summary.guide-summary:hover {
  background: var(--bg-card-hover);
}

.guide-summary-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guide-summary-chevron {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: transform var(--transition-normal), background var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}

details[open] summary.guide-summary .guide-summary-chevron {
  transform: rotate(180deg);
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.guide-content {
  padding: 0 28px 28px;
  border-top: 1px solid var(--border-subtle);
}

.guide-content p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 16px 0 14px;
}

.guide-content p:last-child {
  margin-bottom: 0;
}

.guide-content strong {
  color: var(--text-main);
}

.guide-content ul {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-muted);
  padding-left: 24px;
  margin: 12px 0 16px;
}

.guide-content li {
  margin-bottom: 8px;
}

.guide-qa-question {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--accent);
  margin: 24px 0 4px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-subtle);
}

.guide-qa-question:first-of-type {
  border-top: none;
  padding-top: 0;
}

/* 13.03 vs 13.04 Comparison Grid */
.guide-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.guide-compare-col {
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.guide-compare-col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.guide-compare-col-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.guide-compare-col.public-door .guide-compare-col-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.guide-compare-col.subject-door .guide-compare-col-icon {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.guide-compare-col h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.guide-compare-col p {
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0;
}

.guide-note-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-main);
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.guide-note-box svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent);
}

.guide-note-box.editorial-note {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  margin: 0 0 20px;
}

.guide-note-box.editorial-note svg {
  color: var(--warn-accent);
}

.guide-note-box span {
  flex: 1;
  min-width: 0;
}

/* Spotlight Card (Burks Case) */
.guide-spotlight-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 20px 0;
}

/* This card's background is always dark, in both themes, so its direct-child
   text needs its own fixed light color rather than the theme's normal
   (light-mode-dark) body text color -- otherwise it's unreadable in light
   mode. Nested boxes like .guide-takeaway-box have their own theme-aware
   background and are unaffected by this. */
.guide-spotlight-card > p {
  color: #cbd5e1;
}

.guide-spotlight-card > p strong {
  color: #f8fafc;
}

.guide-citation {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: inline-block;
  margin-bottom: 16px;
}

.guide-takeaway-box {
  background: var(--bg-soft);
  border-left: 4px solid var(--ai-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.guide-takeaway-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ai-text-header);
  margin-bottom: 6px;
}

/* Mini Cards Grid (Other Sections) */
.guide-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.guide-mini-card {
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.guide-mini-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

.guide-mini-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.guide-mini-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.guide-mini-card h3 a {
  color: var(--accent);
  text-decoration: none;
}

.guide-mini-card h3 a:hover {
  text-decoration: underline;
}

.guide-mini-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.guide-see-opinions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  transition: all var(--transition-fast);
  text-decoration: none;
  align-self: flex-start;
}

.guide-see-opinions:hover {
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
}

@media (max-width: 768px) {
  .guide-compare,
  .guide-mini-grid {
    grid-template-columns: 1fr;
  }
  summary.guide-summary {
    padding: 18px 20px;
    font-size: 17px;
  }
  .guide-content {
    padding: 0 20px 20px;
  }
}


.badge-count {
  opacity: .65;
  font-size: 11px;
  margin-left: 2px;
}

.guide-related-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.guide-related-tags-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-right: 4px;
}
