:root {
  color-scheme: light;
  --background: #cdc6be;
  --surface: #d8d1c7;
  --surface-strong: #e4ddd4;
  --surface-muted: #c2bbb2;
  --text: #1d1d1b;
  --text-soft: #5e5852;
  --text-faint: #6d6b63;
  --border: rgba(29, 29, 27, 0.16);
  --border-strong: rgba(29, 29, 27, 0.32);
  --control-border: rgba(29, 29, 27, 0.44);
  --accent: #1d1d1b;
  --accent-soft: rgba(29, 29, 27, 0.08);
  --danger: #991b1b;
  --danger-soft: rgba(153, 27, 27, 0.10);
  --focus: #1d1d1b;
  --glass: rgba(216, 209, 199, 0.85);
  --shadow-card: 0 2px 4px rgba(29, 29, 27, 0.04), 0 10px 24px -4px rgba(29, 29, 27, 0.12), 0 20px 48px -8px rgba(29, 29, 27, 0.08);
  --shadow-hero: 0 4px 8px rgba(29, 29, 27, 0.04), 0 16px 36px -4px rgba(29, 29, 27, 0.14), 0 32px 64px -8px rgba(29, 29, 27, 0.10);
  --shadow-console: 0 2px 6px rgba(29, 29, 27, 0.04), 0 8px 20px -3px rgba(29, 29, 27, 0.10), 0 18px 36px -6px rgba(29, 29, 27, 0.07);
  --shadow-soft: 0 4px 16px -2px rgba(29, 29, 27, 0.10), 0 10px 30px -4px rgba(29, 29, 27, 0.12);
  --shadow-float: 0 12px 28px rgba(29, 29, 27, 0.08), 0 28px 60px -6px rgba(29, 29, 27, 0.22), 0 48px 96px -12px rgba(29, 29, 27, 0.16);
  --shadow-hover: 0 6px 14px -2px rgba(29, 29, 27, 0.08), 0 18px 40px -4px rgba(29, 29, 27, 0.18);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --duration-fast: 140ms;
  --duration-medium: 200ms;
  --duration-enter: 260ms;
  --font-serif: "Editorial New", "Newsreader", "Playfair Display", "Georgia", "Times New Roman", serif;
  --font-display: "Canopée", "Canopee", "Bebas Neue", "Oswald", "League Gothic", sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Space Mono", "Roboto Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --page-gutter: 16px;
  --content-width: 1180px;
  --header-height: 120px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #1d1d1b;
  --surface: #262523;
  --surface-strong: #302e2b;
  --surface-muted: #3a3834;
  --text: #cdc6be;
  --text-soft: #a8a198;
  --text-faint: #78726a;
  --border: rgba(205, 198, 190, 0.14);
  --border-strong: rgba(205, 198, 190, 0.28);
  --control-border: rgba(205, 198, 190, 0.38);
  --accent: #cdc6be;
  --accent-soft: rgba(205, 198, 190, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.16);
  --focus: #cdc6be;
  --glass: rgba(29, 29, 27, 0.88);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.5), 0 14px 32px -4px rgba(0, 0, 0, 0.65), 0 28px 56px -8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-hero: 0 6px 16px rgba(0, 0, 0, 0.55), 0 20px 48px -6px rgba(0, 0, 0, 0.75), 0 40px 80px -10px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-console: 0 4px 12px rgba(0, 0, 0, 0.45), 0 12px 28px -4px rgba(0, 0, 0, 0.6), 0 24px 48px -8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-soft: 0 6px 24px -2px rgba(0, 0, 0, 0.55), 0 16px 40px -4px rgba(0, 0, 0, 0.65);
  --shadow-float: 0 16px 36px rgba(0, 0, 0, 0.65), 0 36px 80px -6px rgba(0, 0, 0, 0.9), 0 54px 110px -12px rgba(0, 0, 0, 0.8);
  --shadow-hover: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 24px 54px -6px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--duration-medium);
  animation-timing-function: var(--ease-out);
}

::view-transition-old(root) {
  animation-name: theme-fade-out;
}

::view-transition-new(root) {
  animation-name: theme-fade-in;
}

@keyframes theme-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes theme-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes sheet-enter {
  from {
    opacity: 0;
    transform: scale(0.99);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes surface-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  min-width: 320px;
  width: 100%;
  margin: 0;
  overflow-x: clip;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: var(--space-3);
  left: var(--space-3);
  min-height: 44px;
  padding: 10px var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--background);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  width: 100%;
  height: var(--header-height);
  grid-template-rows: 48px 56px;
  justify-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3) 10px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    color-mix(in srgb, var(--background) 35%, transparent) 25%,
    color-mix(in srgb, var(--background) 82%, transparent) 100%
  );
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
  pointer-events: none;
  transition:
    background var(--duration-medium) ease,
    backdrop-filter var(--duration-medium) ease,
    -webkit-backdrop-filter var(--duration-medium) ease,
    box-shadow var(--duration-medium) ease,
    border-color var(--duration-medium) ease;
}

.site-header.is-scrolled {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    color-mix(in srgb, var(--background) 50%, transparent) 25%,
    color-mix(in srgb, var(--background) 90%, transparent) 100%
  );
  backdrop-filter: blur(32px) saturate(1.35);
  -webkit-backdrop-filter: blur(32px) saturate(1.35);
  border-bottom: 0;
  box-shadow: none;
}

.search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: color-mix(in srgb, var(--background) 75%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-medium) var(--ease-out);
}

body.search-active .search-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.pill-nav {
  display: flex;
  max-width: calc(100vw - 24px);
  height: 48px;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-1);
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  box-shadow:
    0 0 28px 4px rgba(29, 29, 27, 0.08),
    0 12px 36px -4px rgba(29, 29, 27, 0.14),
    0 4px 12px rgba(29, 29, 27, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  pointer-events: auto;
  transform-origin: center;
  animation: surface-enter var(--duration-enter) var(--ease-out) both;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transition:
    opacity var(--duration-medium) var(--ease-out),
    transform var(--duration-medium) var(--ease-out),
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-medium) var(--ease-out),
    background-color var(--duration-medium) ease;
}

:root[data-theme="dark"] .pill-nav {
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow:
    0 0 32px 6px rgba(0, 0, 0, 0.55),
    0 14px 40px -4px rgba(0, 0, 0, 0.75),
    0 4px 14px rgba(0, 0, 0, 0.40),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.pill-nav::-webkit-scrollbar {
  display: none;
}

.pill-nav a,
.pill-nav button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 120ms cubic-bezier(0.2, 0, 0, 1),
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.pill-nav a:hover,
.pill-nav button:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.pill-nav a.is-active,
.pill-nav button.is-active {
  background: var(--text);
  color: var(--background);
}

.pill-nav a:active,
.pill-nav button:active {
  transform: scale(0.96);
}

.pill-nav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
}

.pill-nav a.is-active span,
.pill-nav button.is-active span {
  background: var(--background);
  color: var(--text);
}

.nav-saved-btn {
  position: relative;
}

.nav-saved-btn[aria-pressed="true"],
.nav-saved-btn.is-active {
  background: color-mix(in srgb, #b45309 16%, var(--surface-muted)) !important;
  color: #b45309 !important;
}

.nav-saved-btn .nav-saved-label {
  display: inline-block !important;
  color: inherit;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

.nav-saved-btn .nav-saved-count {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: #b45309;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

:root[data-theme="dark"] .nav-saved-btn[aria-pressed="true"],
:root[data-theme="dark"] .nav-saved-btn.is-active {
  background: color-mix(in srgb, #f59e0b 20%, var(--surface-muted)) !important;
  color: #f59e0b !important;
}

:root[data-theme="dark"] .nav-saved-btn .nav-saved-count {
  background: #f59e0b;
  color: #1d1d1b;
}

.site-header.is-scrolled .pill-nav {
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 8%, transparent);
}

.search-dock {
  position: relative;
  display: grid;
  width: 100%;
  height: 56px;
  justify-items: center;
  pointer-events: none;
  animation: surface-enter var(--duration-enter) var(--ease-out) 40ms both;
}

.search-experience {
  position: relative;
  width: min(100%, 680px);
  height: 56px;
  pointer-events: auto;
  transition: width var(--duration-medium) var(--ease-out);
}

.search-experience.is-open {
  width: min(100%, 760px);
}

.search-shell {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  margin: 0 auto;
  padding: 0 var(--space-2) 0 var(--space-4);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  box-shadow:
    0 0 36px 6px rgba(29, 29, 27, 0.10),
    0 18px 46px -4px rgba(29, 29, 27, 0.16),
    0 4px 14px rgba(29, 29, 27, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
  text-align: left;
  transform-origin: center;
  transition:
    border-color var(--duration-medium) ease,
    box-shadow var(--duration-medium) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    background-color var(--duration-medium) ease;
}

:root[data-theme="dark"] .search-shell {
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow:
    0 0 44px 8px rgba(0, 0, 0, 0.60),
    0 20px 54px -4px rgba(0, 0, 0, 0.80),
    0 4px 16px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.search-shell:focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent),
    0 0 44px 8px color-mix(in srgb, var(--accent) 15%, transparent),
    0 22px 56px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-header .search-shell.is-pressed {
  transform: scale(0.99);
}

.site-header .search-shell.is-engaged {
  transform: scale(1.006);
}

.search-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-right: var(--space-3);
  border: 1.8px solid var(--text-soft);
  border-radius: 50%;
  transform-origin: center;
  transition:
    border-color var(--duration-fast) ease,
    transform var(--duration-medium) var(--ease-out);
}

.search-icon::before {
  position: absolute;
  inset: -7px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: scale(0.82);
  transition:
    opacity var(--duration-medium) var(--ease-out),
    transform var(--duration-medium) var(--ease-out);
}

.search-icon::after {
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 7px;
  height: 1.8px;
  background: var(--text-soft);
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

:root[data-theme="dark"] .search-icon {
  border-color: var(--accent);
}

:root[data-theme="dark"] .search-icon::after {
  background: var(--accent);
}

.search-shell.is-engaged .search-icon {
  border-color: var(--accent);
  transform: rotate(-5deg) scale(1.04);
}

.search-shell.is-engaged .search-icon::before {
  opacity: 0.24;
  transform: scale(1);
}

.search-input-wrap {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
}

.search-shell input {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.search-shell input::placeholder {
  color: var(--text-soft);
  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
  opacity: 0.85;
}

:root[data-theme="dark"] .search-shell input {
  color: #ffffff;
}

:root[data-theme="dark"] .search-shell input::placeholder {
  color: var(--text-soft);
  opacity: 0.85;
}

.search-shell input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-shell kbd {
  display: none;
  min-width: 28px;
  height: 28px;
  line-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
  margin-right: 4px;
}

:root[data-theme="dark"] .search-shell kbd {
  border-color: rgba(205, 198, 190, 0.20);
  background: rgba(205, 198, 190, 0.08);
  color: var(--accent);
}

.search-match-count {
  display: inline-flex;
  min-height: 32px;
  flex: 0 0 auto;
  align-items: center;
  margin-left: var(--space-2);
  margin-right: 4px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.search-shell.has-value > kbd {
  display: none;
}

.clear-search {
  display: none;
  min-width: 60px;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    transform var(--duration-fast) ease;
}

.clear-search:hover {
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface-strong));
  border-color: var(--accent);
  color: var(--text);
  transform: scale(1.02);
}

:root[data-theme="dark"] .clear-search {
  border-color: rgba(205, 198, 190, 0.20);
  background: var(--surface-muted);
  color: var(--text);
}

:root[data-theme="dark"] .clear-search:hover {
  border-color: var(--accent);
  background: var(--surface-strong);
  color: #ffffff;
}

.search-shell.has-value .clear-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-tools {
  position: absolute;
  z-index: 10;
  top: calc(100% + var(--space-2));
  left: 50%;
  display: grid;
  width: min(calc(100vw - 24px), 760px);
  max-height: min(620px, calc(100vh - var(--header-height) - 16px));
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 96%, var(--glass));
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.40),
    0 4px 16px rgba(0, 0, 0, 0.20);
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  opacity: 0;
  overflow-y: auto;
  pointer-events: none;
  transform: translate(-50%, -6px) scale(0.99);
  visibility: hidden;
  transition:
    opacity 200ms var(--ease-out),
    transform 200ms var(--ease-out),
    visibility 0s linear 200ms;
}

:root[data-theme="dark"] .search-tools {
  border-color: var(--border-strong);
  background: var(--surface-strong);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.80),
    0 6px 20px rgba(0, 0, 0, 0.50);
}

.search-experience.is-open .search-tools {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  visibility: visible;
  transition-delay: 0s;
}

.search-tool-group {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.search-boundary {
  display: grid;
  gap: 3px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-muted) 65%, transparent);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.search-boundary strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.search-start-view,
.search-results-view {
  display: grid;
  min-width: 0;
  gap: var(--space-3);
}

.search-group-heading,
.command-heading {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.clear-recents {
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.recent-results {
  display: grid;
  gap: 2px;
}

.recent-option {
  display: grid;
  width: 100%;
  min-height: 46px;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

.recent-option:hover {
  background: var(--surface-strong);
  border-color: var(--border);
}

.recent-option span:first-child {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 750;
}

.recent-option span:last-child {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-result-total {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.hidden-filter-note {
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border));
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.command-results {
  display: grid;
  max-height: 344px;
  gap: 6px;
  padding: 2px 2px 2px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.command-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    transform var(--duration-fast) ease;
}

.command-option:hover {
  background: var(--surface-strong);
  border-color: var(--border);
}

.command-option[aria-selected="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text);
}

.command-option[aria-selected="true"] .command-detail {
  color: var(--text-soft);
}

.command-option[aria-selected="true"]::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  content: "";
}

.command-candidate-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.command-candidate-header .command-code {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 850;
  overflow-wrap: anywhere;
  letter-spacing: -0.01em;
}

:root[data-theme="dark"] .command-candidate-header .command-code {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--accent);
}

.command-candidate-header .classification-badge,
.command-candidate-header .mandatory-badge {
  font-size: 10px;
  padding: 2px 8px;
  min-height: 20px;
  font-weight: 800;
}

.command-description {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.command-detail {
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}


.command-empty {
  display: grid;
  min-height: 112px;
  place-content: center;
  gap: var(--space-1);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  text-align: center;
}

.command-empty strong {
  color: var(--text);
  font-size: 14px;
}

.command-empty span {
  font-size: 12px;
}

.filter-pills-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: var(--space-2);
  padding: 0 32px 2px 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: var(--space-1);
  scroll-snap-type: inline proximity;
  touch-action: pan-x;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 32px), transparent 100%);
}

.search-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 4px 0;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}

.search-prompts button {
  width: 100%;
  min-height: 46px;
  padding: 0 var(--space-4);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  justify-content: center;
  text-align: center;
  transition:
    transform 120ms var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

:root[data-theme="dark"] .search-prompts button {
  border-color: rgba(205, 198, 190, 0.20);
  background: var(--surface-muted);
  color: var(--text);
}

.search-prompts button:hover {
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface-strong));
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

:root[data-theme="dark"] .search-prompts button:hover {
  border-color: var(--accent);
  background: var(--surface-strong);
  color: #ffffff;
}

.search-prompts button:active {
  transform: scale(0.98);
}

.search-prompts:focus-within,
.quick-filter-row:focus-within {
  -webkit-mask-image: none;
  mask-image: none;
}

.search-prompts::-webkit-scrollbar,
.quick-filter-row::-webkit-scrollbar {
  display: none;
}

.search-tools-label {
  padding-left: var(--space-1);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-prompts button,
.quick-filter,
.shortcut-toggle,
.more-filters {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    transform 100ms var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.search-prompts button[aria-current="true"] {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.search-prompts button:hover,
.quick-filter:hover,
.shortcut-toggle:hover,
.more-filters:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.quick-filter[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.shortcut-toggle[aria-pressed="false"] {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.search-tools-footer {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-1) 0;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 11px;
}

.search-tools-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.search-tools-footer kbd {
  min-width: 24px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  font-family: var(--font-mono);
  text-align: center;
}

.search-tools-footer .shortcut-toggle {
  min-height: 44px;
  padding: 0 var(--space-3);
  background: transparent;
}

main,
footer {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding-right: var(--page-gutter);
  padding-left: var(--page-gutter);
}

.intro {
  position: relative;
  z-index: 40;
  padding: var(--space-5) 0 var(--space-5);
}

.intro:has([aria-expanded="true"]),
.intro:focus-within {
  z-index: 80;
}

.intro-heading {
  display: grid;
  max-width: 1084px;
  gap: var(--space-4);
  margin: 0 auto;
}

.eyebrow,
.section-number,
.micro-label,
.guide-pages {
  margin: 0;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-stage {
  position: relative;
  z-index: 45;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: 28px 24px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hero);
  animation: surface-enter var(--duration-enter) var(--ease-out) both;
}

:root[data-theme="dark"] .hero-stage {
  background: var(--surface);
  border: 1px solid rgba(205, 198, 190, 0.18);
  box-shadow: var(--shadow-hero);
}

.hero-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
  flex-shrink: 0;
}

.hero-telemetry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.telemetry-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

.hero-stage .intro-heading {
  margin: 0;
  max-width: 100%;
}

.hero-stage .intro-heading h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5.8vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
}

.hero-bottom-split {
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

@media (min-width: 768px) {
  .hero-bottom-split {
    grid-template-columns: 1fr auto;
    gap: var(--space-5);
  }
}

.hero-bottom-split .intro-summary {
  max-width: 58ch;
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.58;
}

.hero-cta-wrap {
  display: flex;
  align-items: center;
}

.hero-signature-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 4px 6px 4px 20px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--background);
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  transition:
    transform 100ms var(--ease-out),
    background-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

.hero-signature-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.hero-signature-cta:active {
  transform: scale(0.98);
}

.cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--text);
  color: var(--background);
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
}

.hero-signature-cta:hover .cta-icon {
  transform: translateY(2px);
}

.hero-tactical-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.hero-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-strong) 92%, black);
  border: 1px solid var(--control-border);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease,
    transform var(--duration-fast) ease;
}

.hero-action-btn:hover {
  background: color-mix(in srgb, var(--accent-soft) 85%, var(--surface));
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 20%, transparent);
}

.hero-action-btn:active {
  transform: scale(0.98);
}

.hero-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.hero-patrol-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-2);
}

.hero-patrol-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-patrol-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.patrol-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    transform var(--duration-fast) ease;
}

.patrol-chip:hover {
  background: var(--surface-strong);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.patrol-chip:active {
  transform: scale(0.97);
}

.hero-capabilities {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-top: var(--space-4);
  animation: surface-enter var(--duration-enter) var(--ease-out) 140ms both;
}

@media (min-width: 640px) {
  .hero-capabilities {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .hero-capabilities {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.capability-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: left;
  color: inherit;
  font-family: inherit;
  transition:
    border-color var(--duration-fast) ease,
    background-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease,
    transform var(--duration-fast) ease;
}

.capability-card.is-interactive {
  cursor: pointer;
}

.capability-card.is-interactive:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface) 95%, var(--accent-soft));
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 24px color-mix(in srgb, var(--accent) 14%, transparent);
}

.capability-card.is-interactive:active {
  transform: scale(0.99);
}

.capability-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  color: var(--text-faint);
}

.cap-num {
  color: var(--accent);
}

.cap-div {
  opacity: 0.4;
}

.cap-tag {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.capability-card strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
}

.capability-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.capability-hint {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 750;
  color: var(--accent);
  opacity: 0.85;
  transition:
    opacity var(--duration-fast) ease,
    transform var(--duration-fast) ease;
}

.capability-card.is-interactive:hover .capability-hint {
  opacity: 1;
  transform: translateX(3px);
}

.source-status {
  display: none !important;
}

.source-status-mark {
  width: 10px;
  height: 10px;
  align-self: start;
  margin: 6px 5px 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.source-status-content {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.source-status-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 2px;
}

.source-status-heading strong {
  color: var(--text);
  font-size: 13px;
}

.source-status-content > span,
.source-status-content > small {
  display: block;
}

.source-status-content > small {
  color: var(--text-faint);
  font-size: 12px;
}

.source-review-status {
  width: fit-content;
  margin-top: var(--space-1);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--danger-soft);
  color: var(--danger) !important;
  font-weight: 700;
}

.source-review-status[data-status="active"] {
  background: var(--accent-soft);
  color: var(--accent) !important;
}

.source-status-action {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition:
    transform 100ms var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.source-action-long {
  display: none;
}

.content-section {
  position: relative;
  z-index: 1;
  padding: var(--space-6) 0 var(--space-7);
  border-top: 1px solid var(--border-strong);
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

.section-heading {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.section-heading h2 {
  margin: var(--space-2) 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.section-heading > div > p:last-child {
  max-width: 62ch;
  margin: var(--space-2) 0 0;
  color: var(--text-soft);
}

.results-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  text-align: left;
}

.results-meta p,
.section-count {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.results-meta strong {
  color: var(--text);
  font-family: var(--font-mono);
}

#result-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 650;
  color: var(--text-soft);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] #result-summary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-soft);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.text-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 100ms var(--ease-out),
    color var(--duration-fast) ease,
    opacity var(--duration-fast) ease;
}

.browse-filter-toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: 0 var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.browse-filter-toggle > span:last-child {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 16px;
}

.browse-filter-toggle.has-active-filters {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.active-filter-count {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--surface-strong);
  font-family: var(--font-mono);
  font-size: 10px;
}

.filter-bar {
  display: grid;
  min-width: 0;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.filter-bar label:not(.appearance-filter) {
  display: grid;
  gap: var(--space-1);
}

.filter-bar label > span:first-child {
  padding-left: var(--space-2);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-bar select,
.appearance-filter,
.reset-filters {
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px var(--control-border);
}

.filter-bar select {
  width: 100%;
  padding: 0 38px 0 var(--space-3);
}

.appearance-filter {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  cursor: pointer;
}

.appearance-filter input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.appearance-filter span {
  font-size: 13px;
}

.reset-filters {
  padding: 0 var(--space-4);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.reset-filters:disabled {
  color: var(--text-faint);
  cursor: default;
  opacity: 0.55;
}

.results[aria-busy="true"] {
  min-height: 360px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 139px,
    var(--border) 140px
  );
  opacity: 0.42;
}

.offense-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
  transition:
    transform 140ms var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

:root[data-theme="dark"] .offense-row {
  background: var(--surface);
  border: 1.5px solid rgba(205, 198, 190, 0.14);
  box-shadow: var(--shadow-card);
}

.offense-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 6px 20px rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] .offense-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(205, 198, 190, 0.25), 0 8px 24px rgba(0, 0, 0, 0.6);
}

.offense-row:focus-visible {
  outline-offset: 2px;
}

.offense-row:last-child {
  margin-bottom: 0;
}

.offense-row:target {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}

.code-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.code-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
}

.citation-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
}

.code-column .micro-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.code-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.description-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-top: 0;
}

.offense-description {
  max-width: 68ch;
  margin: 0;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.012em;
}

.official-heading {
  max-width: 68ch;
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.45;
}

.offense-context {
  max-width: 78ch;
  margin: 2px 0 0;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Statutory detail
   One floating sheet serves every record. Statutory text is the only content in the app
   that can run to thousands of words, so it gets the deepest overlay treatment in the
   system rather than a panel nested inside an offense row. */
.statutory-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin-top: 0;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
}

.statutory-flag::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.statute-sheet {
  width: min(calc(100vw - 32px), 740px);
  max-height: min(740px, calc(100vh - 96px));
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: var(--radius-lg);
  background: var(--glass);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(22px) saturate(1.08);
  color: var(--text);
  overflow: hidden;
}

:root[data-theme="dark"] .statute-sheet {
  border-color: rgba(205, 198, 190, 0.22);
  background: var(--surface);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.85),
    0 8px 24px rgba(0, 0, 0, 0.50);
}

.statute-sheet[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-enter var(--duration-medium) var(--ease-out) both;
}

.statute-sheet::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.statute-sheet-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
}

.statute-sheet-identity {
  flex: 1 1 auto;
  min-width: 0;
}

.statute-sheet-header .micro-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.statute-sheet-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--text);
}

.statute-sheet-close {
  flex-shrink: 0;
  min-width: 68px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 100ms var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

:root[data-theme="dark"] .statute-sheet-close {
  border-color: rgba(205, 198, 190, 0.20);
  background: var(--surface-muted);
  color: var(--text);
}

.statute-sheet-close:hover {
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface-strong));
  border-color: var(--accent);
  color: var(--text);
  transform: scale(1.02);
}

:root[data-theme="dark"] .statute-sheet-close:hover {
  border-color: var(--accent);
  background: var(--surface-strong);
  color: #ffffff;
}

.statute-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Same skeleton vocabulary as the results list, so a wait reads the same everywhere. */
.statute-skeleton {
  min-height: 280px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 139px,
    var(--border) 140px
  );
  opacity: 0.42;
}

.detail-notice {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--danger) 36%, var(--border));
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.detail-heading {
  margin: 0 0 16px;
  max-width: 68ch;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
}

.statute-sheet-close:hover,
.detail-copy-link:hover {
  border-color: var(--border-strong);
  background: var(--surface-strong);
  color: var(--text);
}

.detail-ilga:hover {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border));
  background: var(--accent-soft);
}

.detail-ilga {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  margin-bottom: 20px;
  transition:
    transform 100ms var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.statute-blocks {
  margin-top: 18px;
}

.statute-block {
  max-width: 68ch;
  margin: 0 0 16px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.statute-subsection {
  padding-left: 18px;
}

.statute-heading {
  font-weight: 750;
}

.key-language {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.key-language-list {
  max-width: 68ch;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.key-language-list li {
  margin-bottom: 10px;
}

/* Exceptions are the same surface as elements, distinguished by an accent edge rather
   than another tinted box — the brief asks for fewer nested boxes, not more. */
.key-exceptions {
  border-left: 2px solid color-mix(in srgb, var(--accent) 55%, var(--border));
}

/* Emphasis only. The text is byte-identical to the statute; this changes weight and
   colour so a qualifier is findable at a glance, and nothing else. */
.statutory-qualifier {
  color: var(--text);
  font-weight: 750;
}

.key-language-caveat {
  max-width: 78ch;
  margin: 12px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.45;
}

.detail-source-line,
.detail-provenance {
  max-width: 78ch;
  margin: 20px 0 0;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--surface-muted) 65%, transparent);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
}

.statute-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.detail-copy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 0;
  padding: 0 18px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 100ms var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.modal-save-btn {
  background: var(--surface-strong);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  font-weight: 750;
}

:root[data-theme="dark"] .modal-save-btn {
  background: var(--surface-muted);
  border-color: rgba(205, 198, 190, 0.20);
  color: var(--text);
}

.modal-save-btn:hover {
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface-strong));
  border-color: var(--accent);
  color: var(--text);
  transform: scale(1.02);
}

:root[data-theme="dark"] .modal-save-btn:hover {
  border-color: var(--accent);
  background: var(--surface-strong);
  color: #ffffff;
}

.modal-save-btn.is-saved {
  background: #d97706;
  border-color: #b45309;
  color: #ffffff;
  font-weight: 750;
}

:root[data-theme="dark"] .modal-save-btn.is-saved {
  background: #b45309;
  border-color: #d97706;
  color: #ffffff;
}

.modal-save-btn.is-saved:hover {
  background: #92400e;
  border-color: #f59e0b;
}

.modal-issue-link {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-weight: 750;
}

:root[data-theme="dark"] .modal-issue-link {
  background: rgba(205, 198, 190, 0.08);
  border-color: rgba(205, 198, 190, 0.16);
  color: var(--text-soft);
}

.modal-issue-link:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--text);
  transform: scale(1.02);
}

:root[data-theme="dark"] .modal-issue-link:hover {
  border-color: var(--accent);
  background: var(--surface-strong);
  color: #ffffff;
}

.primary-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
}

.reporting-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0;
}

.reporting-codes span {
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11px;
}

.description-column {
  min-width: 0;
  grid-column: 1 / -1;
}

.record-advisory {
  max-width: 78ch;
  margin: 0;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}

.record-advisory a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--accent);
  font-weight: 700;
}

.content-status-panel {
  display: grid;
  min-height: 280px;
  place-content: center;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
}

.content-status-panel h3,
.content-status-panel p {
  margin: 0;
}

.content-status-panel > p:not(.section-number) {
  color: var(--text-soft);
}

.content-status-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.content-status-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.offense-row:target .offense-context {
  color: var(--text-soft);
}

.record-advisory {
  display: none !important;
}

.source-proof {
  display: none !important;
  min-height: 44px;
}

.ilga-statute-link {
  display: inline-flex;
  min-height: 34px;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-2);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.4;
  text-decoration: none;
  width: fit-content;
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    transform 100ms var(--ease-out),
    box-shadow var(--duration-fast) ease;
}

:root[data-theme="dark"] .ilga-statute-link {
  background: rgba(205, 198, 190, 0.08);
  border-color: rgba(205, 198, 190, 0.22);
  color: var(--text);
}

.ilga-statute-link:hover {
  background: var(--surface-strong);
  border-color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] .ilga-statute-link:hover {
  background: rgba(205, 198, 190, 0.18);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.ilga-statute-action {
  font-weight: 800;
}

mark {
  border-radius: 2px;
  background: var(--accent-soft);
  color: inherit;
}

.empty-state {
  padding: var(--space-8) var(--space-4);
  border-top: 1px solid var(--border);
  text-align: center;
}

.empty-state h3 {
  margin: var(--space-2) 0 0;
  font-size: 24px;
}

.empty-state > p:not(.section-number) {
  margin: var(--space-2) auto 0;
  color: var(--text-soft);
}

.empty-suggestions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.empty-suggestions button {
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 100ms var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 var(--space-5);
  border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--background);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 8px color-mix(in srgb, var(--accent) 25%, transparent);
  transition:
    transform 120ms cubic-bezier(0.2, 0, 0, 1),
    background-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease,
    filter var(--duration-fast) ease;
}

.guide-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  border-top: none;
  margin-top: var(--space-4);
}

@media (min-width: 768px) {
  .guide-list {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
}

@media (min-width: 1100px) {
  .guide-list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
  }
}

.guide-row {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
  transition:
    transform 140ms var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

:root[data-theme="dark"] .guide-row {
  background: var(--surface);
  border-color: rgba(205, 198, 190, 0.14);
  box-shadow: var(--shadow-card);
}

@media (hover: hover) and (pointer: fine) {
  .guide-row:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
  }
}

.guide-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.guide-number {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}

.guide-pages {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 750;
  color: var(--text-faint);
}

.guide-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.guide-row h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: var(--text);
}

.guide-row div > p:last-child {
  max-width: 68ch;
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

.guide-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 20px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 750;
  text-decoration: none;
  transition:
    transform 100ms var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

:root[data-theme="dark"] .guide-row a {
  background: rgba(205, 198, 190, 0.10);
  border-color: rgba(205, 198, 190, 0.25);
  color: var(--text);
}

.guide-row a:hover {
  background: #1d1d1b;
  border-color: #1d1d1b;
  color: #cdc6be;
}

:root[data-theme="dark"] .guide-row a:hover {
  background: #cdc6be;
  border-color: #cdc6be;
  color: #1d1d1b;
}

.motion-ready .section-heading.is-reveal-ready,
.motion-ready .guide-row.is-reveal-ready {
  opacity: 0;
  transform: translateY(10px);
}

.motion-ready .section-heading.is-revealed,
.motion-ready .guide-row.is-revealed {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--duration-enter) var(--ease-out),
    transform var(--duration-enter) var(--ease-out);
}

.motion-ready .guide-row:nth-child(3n + 2).is-revealed {
  transition-delay: 40ms;
}

.motion-ready .guide-row:nth-child(3n).is-revealed {
  transition-delay: 80ms;
}

footer,
.site-footer {
  display: block;
  width: 100%;
  padding: 72px 0 40px;
  border-top: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-muted));
  color: var(--text-soft);
  font-size: 13px;
}

:root[data-theme="dark"] footer,
:root[data-theme="dark"] .site-footer {
  background: #181715;
  border-color: rgba(205, 198, 190, 0.16);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 56px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1.15fr 1fr;
  gap: 56px;
  align-items: start;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-seals {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.footer-seal-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-seal-svg {
  width: 44px;
  height: 44px;
  color: var(--accent);
  flex-shrink: 0;
}

.footer-seal-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.seal-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text);
}

.seal-sub {
  font-size: 11px;
  color: var(--text-faint);
}

.footer-statement {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 44ch;
  margin: 0;
}

.footer-source-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  margin-top: 4px;
}

:root[data-theme="dark"] .footer-source-card {
  background: #1f1e1b;
  border-color: rgba(205, 198, 190, 0.18);
  box-shadow: var(--shadow-card);
}

.footer-meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.footer-source-anchor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.footer-source-anchor:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-col-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.footer-directory {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.footer-dir-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  min-height: 52px;
  transition:
    color var(--duration-fast) ease,
    padding-left var(--duration-fast) var(--ease-out);
}

.footer-dir-row:hover {
  color: var(--accent);
  padding-left: 6px;
}

.dir-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.dir-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  transition: color var(--duration-fast) ease;
}

.footer-dir-row:hover .dir-num {
  color: var(--accent);
}

.footer-trust-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-policy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-policy-list a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.footer-policy-list a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-actions-panel {
  margin-top: 4px;
}

.footer-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  min-height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-transform: uppercase;
  transition:
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

.footer-clear-btn:hover {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.footer-legal-copy {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-faint);
  max-width: 68ch;
  margin: 0;
}

.footer-legal-copy a {
  color: var(--text-soft);
  text-decoration: underline;
}

.footer-legal-copy a:hover {
  color: var(--text);
}

.footer-origin-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.origin-flag {
  font-size: 14px;
}

@media (max-width: 980px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 44px;
  }

  .footer-col-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .footer-inner {
    gap: 28px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

.trust-page .site-header {
  height: 64px;
  grid-template-rows: 48px;
  align-content: start;
}

.trust-page .pill-nav {
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
}

.trust-page .pill-nav::-webkit-scrollbar {
  display: none;
}

.trust-page footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 40px var(--page-gutter);
  flex-wrap: wrap;
}

.trust-page footer > a {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  color: var(--text-soft);
  text-decoration: underline;
}

.trust-page footer > a:hover {
  color: var(--text);
}

.trust-page main {
  max-width: 880px;
  padding-top: var(--space-4);
}

.trust-page .intro {
  padding-top: var(--space-6);
}

.trust-page .content-section {
  padding: var(--space-6) 0;
}

.trust-page .content-section > p,
.trust-page .section-heading > div > p:last-child {
  max-width: 74ch;
}

.trust-page code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-muted);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.trust-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
}

.trust-links a,
.trust-links button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.scroll-to-top {
  position: fixed;
  z-index: 50;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 50%;
  background: var(--glass);
  color: var(--accent);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(18px) saturate(1.12);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.92);
  transition:
    opacity var(--duration-medium) var(--ease-out),
    transform var(--duration-medium) var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

.scroll-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.scroll-to-top:hover {
  border-color: var(--accent);
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  transform: translateY(-2px) scale(1.05);
}

.scroll-to-top:active {
  transform: translateY(0) scale(0.95);
}

.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  right: auto;
  bottom: max(var(--space-4), env(safe-area-inset-bottom));
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--background);
  font-size: 13px;
  font-weight: 650;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.update-prompt {
  position: fixed;
  z-index: 85;
  right: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  display: grid;
  width: min(calc(100vw - 32px), 520px);
  min-height: 64px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  margin: 0 auto;
  padding: var(--space-2);
  padding-left: var(--space-4);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--glass);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(18px) saturate(1.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  visibility: hidden;
  transition:
    opacity var(--duration-medium) var(--ease-out),
    transform var(--duration-medium) var(--ease-out),
    visibility 0s linear var(--duration-medium);
}

.update-prompt.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
  transition-delay: 0s;
}

.update-prompt-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.update-prompt-copy strong {
  color: var(--text);
  font-size: 13px;
}

.update-prompt-copy span {
  color: var(--text-soft);
  font-size: 12px;
}

.update-prompt-actions {
  display: flex;
  gap: var(--space-1);
}

.update-prompt button {
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 100ms var(--ease-out),
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.update-later {
  background: var(--surface-muted);
  color: var(--text-soft);
}

.update-refresh {
  background: var(--text);
  color: var(--background);
}

html.update-ready .toast {
  bottom: calc(var(--space-4) + 96px);
}

.error-message {
  padding: var(--space-7) 0;
  color: var(--danger);
}

.pill-nav a:active,
.pill-nav button:active,
.recent-option:active,
.command-option:active,
.hidden-filter-note:active,
.search-prompts button:active,
.quick-filter:active,
.shortcut-toggle:active,
.more-filters:active,
.browse-filter-toggle:active,
.row-action:active,
.primary-button:active,
.text-button:active,
.source-proof:active,
.source-status-action:active,
.empty-suggestions button:active,
.update-prompt button:active,
.guide-row a:active {
  transform: translateY(1px);
}

@media (hover: hover) and (pointer: fine) {
  .recent-option:hover,
  .command-option:hover,
  .search-prompts button:hover,
  .quick-filter:hover,
  .shortcut-toggle:hover,
  .more-filters:hover,
  .row-action:hover,
  .primary-button:hover,
  .statute-sheet-close:hover,
  .detail-ilga:hover,
  .detail-copy-link:hover,
  .guide-row a:hover {
    transform: translateY(-1px);
  }

  .recent-option:hover,
  .command-option:hover {
    background: var(--surface-muted);
  }

  .command-option[aria-selected="true"]:hover {
    background: var(--accent-soft);
  }

  .offense-row:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
  }

  .source-proof:hover {
    color: var(--text);
    transform: translateX(2px);
  }

  .source-status-action:hover,
  .empty-suggestions button:hover,
  .update-later:hover {
    border-color: var(--border-strong);
    background: var(--surface-muted);
    color: var(--text);
    transform: translateY(-1px);
  }

  .update-refresh:hover {
    background: var(--accent);
    color: var(--surface-strong);
    transform: translateY(-1px);
  }
}



@keyframes bottom-sheet-enter {
  from {
    transform: translateY(100%);
    opacity: 0.8;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 640px) {
  :root {
    --page-gutter: 32px;
  }

  .category-dropdown-dock {
    display: block;
  }

  .pill-nav span,
  .search-shell kbd {
    display: inline-block;
  }

  .pill-nav a,
  .pill-nav button {
    padding: 0 var(--space-4);
    font-size: 13px;
  }

  .search-prompts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 14px;
  }

  .intro {
    padding-top: 36px;
  }

  .hero-stage {
    padding: 36px 32px;
    border-radius: 28px;
    gap: var(--space-6);
  }

  .source-status {
    gap: var(--space-4);
  }

  .source-action-long {
    display: inline;
  }

  .source-action-short {
    display: none;
  }

  .section-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-6);
  }

  .results-meta,
  .section-count {
    text-align: right;
  }

  #result-summary {
    margin-left: auto;
  }

  .filter-bar {
    grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  }
}

@media (min-width: 980px) {
  :root {
    --page-gutter: 48px;
  }

  .content-section {
    padding: var(--space-8) 0;
  }

  .filter-bar {
    grid-template-columns: minmax(190px, 0.8fr) minmax(280px, 1.2fr) auto auto;
    align-items: end;
    padding: var(--space-2);
  }

  .filter-bar label:not(.appearance-filter) > span {
    display: none;
  }

  .offense-row {
    display: grid;
    grid-template-columns: minmax(210px, 0.28fr) minmax(360px, 1fr) auto;
    align-items: start;
    column-gap: var(--space-6);
    row-gap: 0;
    padding: 22px 24px;
    margin-bottom: 16px;
  }

  .code-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .reporting-codes,
  .mandatory-badge {
    margin-top: 0;
  }

  .offense-context {
    margin-top: 6px;
    line-height: 1.5;
  }

  .source-proof {
    margin-top: var(--space-2);
  }

  .description-column {
    grid-column: 2;
    grid-row: 1;
  }

  .offense-actions {
    grid-column: 3;
    grid-row: 1;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  .pill-nav,
  .search-dock,
  .eyebrow,
  .intro h1,
  .intro-summary,
  .source-status,
  .statute-sheet[open] {
    animation: none;
  }

  .site-header.is-scrolled .pill-nav,
  .search-experience,
  .search-tools,
  .site-header .search-shell.is-pressed,
  .site-header .search-shell.is-engaged,
  .search-shell.is-engaged .search-icon,
  .search-shell.is-engaged .search-icon::before,
  .pill-nav a:active,
  .pill-nav button:active,
  .recent-option:active,
  .command-option:active,
  .hidden-filter-note:active,
  .search-prompts button:active,
  .quick-filter:active,
  .shortcut-toggle:active,
  .more-filters:active,
  .browse-filter-toggle:active,
  .row-action:active,
  .primary-button:active,
  .text-button:active,
  .source-proof:active,
    .source-status-action:active,
    .empty-suggestions button:active,
    .update-prompt button:active,
  .statute-sheet-close:active,
  .detail-ilga:active,
  .detail-copy-link:active,
  .statute-sheet-close:active,
  .detail-ilga:active,
  .detail-copy-link:active,
    .guide-row a:active,
  .motion-ready .section-heading.is-reveal-ready,
  .motion-ready .guide-row.is-reveal-ready,
  .motion-ready .section-heading.is-revealed,
  .motion-ready .guide-row.is-revealed {
    transform: none;
  }

  .search-experience,
  .search-tools,
  .update-prompt {
    transition-duration: 0.01ms;
  }

  .update-prompt,
  .update-prompt.is-visible {
    transform: none;
  }

  .motion-ready .section-heading.is-reveal-ready,
  .motion-ready .guide-row.is-reveal-ready,
  .motion-ready .section-heading.is-revealed,
  .motion-ready .guide-row.is-revealed {
    opacity: 1;
    transition: opacity 120ms ease;
    transition-delay: 0ms;
  }

  .search-icon::before {
    transition: opacity 120ms ease;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.01ms;
  }
}

/* ==========================================================================
   Modern UI: SVG Icons, Category Chips Bar, Classification Badges, Tabs & Field Tools
   ========================================================================== */

/* ==========================================================================
   Single Unified Filter Console
   ========================================================================== */

.unified-filter-console {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-3) 0 var(--space-4);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--border-strong) 85%, transparent);
  border-radius: var(--radius-lg);
  background: var(--glass);
  box-shadow: var(--shadow-console);
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

/* Scenario Quick Hub */
.scenario-hub {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.scenario-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.scenario-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.scenario-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  transition:
    transform 100ms cubic-bezier(0.2, 0, 0, 1),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

:root[data-theme="dark"] .scenario-pill {
  background: var(--surface);
  border-color: rgba(205, 198, 190, 0.18);
  color: var(--text-soft);
}

@media (hover: hover) and (pointer: fine) {
  .scenario-pill:hover {
    border-color: var(--border-strong);
    background: var(--surface-strong);
    color: var(--text);
    transform: translateY(-1px);
  }

  :root[data-theme="dark"] .scenario-pill:hover {
    background: var(--surface-strong);
    border-color: rgba(205, 198, 190, 0.35);
    color: #ffffff;
  }
}

.scenario-pill.is-active,
.scenario-pill[aria-pressed="true"] {
  background: #1d1d1b;
  border-color: #1d1d1b;
  color: #cdc6be;
  font-weight: 750;
  box-shadow: 0 2px 10px rgba(29, 29, 27, 0.25);
}

:root[data-theme="dark"] .scenario-pill.is-active,
:root[data-theme="dark"] .scenario-pill[aria-pressed="true"] {
  background: #cdc6be;
  border-color: #cdc6be;
  color: #1d1d1b;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* 1. Primary Filter Pills Row */
.filter-pills-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 2px 6px;
}

.filter-pills-row::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.08);
  transition:
    transform 120ms cubic-bezier(0.2, 0, 0, 1),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

.filter-pill:hover {
  border-color: var(--border-strong);
  background: var(--surface-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.filter-pill:active {
  transform: scale(0.96);
}

.filter-pill.is-active,
.filter-pill[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--background);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
}

.filter-pill .pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--background) 25%, transparent);
  color: inherit;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.filter-pill.is-active .pill-badge {
  background: color-mix(in srgb, var(--background) 30%, black);
  color: #fff;
}

.filter-pill[data-filter-pill="traffic"].is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.filter-pill[data-filter-pill="criminal"].is-active {
  border-color: #991b1b;
  background: #991b1b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(153, 27, 27, 0.35);
}

.filter-pill[data-filter-pill="mandatory"].is-active {
  border-color: #b45309;
  background: #b45309;
  color: #fff;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.35);
}

.filter-pill[data-filter-pill="felony"].is-active {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #fff;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.35);
}

.filter-pill[data-filter-pill="misdemeanor"].is-active {
  border-color: #1e3a8a;
  background: #1e3a8a;
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.35);
}

.filter-pill[data-filter-pill="petty"].is-active {
  border-color: #475569;
  background: #475569;
  color: #fff;
  box-shadow: 0 2px 8px rgba(71, 85, 105, 0.35);
}

/* 2. Precision Controls Row */
.filter-controls-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-2) var(--space-3);
  align-items: flex-end;
  padding-top: var(--space-2);
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.filter-select-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.filter-select-label {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-left: 2px;
}

.filter-popover-wrapper {
  position: relative;
  min-width: 0;
}

.filter-popover-wrapper:has([aria-expanded="true"]),
.filter-popover-wrapper:focus-within {
  z-index: 50;
}

.filter-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    border-color var(--duration-fast) ease,
    background-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.filter-select-trigger:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.filter-select-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 80%, transparent);
}

.filter-select-trigger.has-active-value {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  color: var(--accent);
  font-weight: 700;
}

.trigger-label-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  flex: 1 1 auto;
}

.trigger-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-soft);
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out), color var(--duration-fast) ease;
}

.filter-select-trigger[aria-expanded="true"] .trigger-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.filter-popover-menu {
  position: absolute;
  z-index: 100;
  top: calc(100% + 6px);
  left: 0;
  min-width: 270px;
  max-width: min(calc(100vw - 32px), 360px);
  max-height: min(420px, calc(100vh - 180px));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.28),
    0 4px 14px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: popover-drop var(--duration-fast) var(--ease-out) both;
}

:root[data-theme="dark"] .filter-popover-menu {
  background: #1f1e1b;
  border-color: rgba(205, 198, 190, 0.28);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.92),
    0 6px 18px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.filter-select-group[data-filter-type="chapter"] .filter-popover-menu {
  left: auto;
  right: 0;
}

@media (max-width: 640px) {
  .filter-popover-menu {
    left: 0 !important;
    right: 0 !important;
    min-width: 100%;
    max-width: 100%;
    max-height: 280px;
  }
}

@keyframes popover-drop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.filter-popover-header {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  margin-top: 4px;
}

.filter-popover-header:first-child {
  border-top: none;
  margin-top: 0;
}

.filter-popover-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chapter-popover-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  padding-top: 4px;
}

.filter-popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.filter-popover-item:hover,
.filter-popover-item:focus-visible {
  background: color-mix(in srgb, var(--surface-muted) 85%, transparent);
  color: var(--text);
  outline: none;
}

.filter-popover-item.is-selected {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-muted));
  color: var(--accent);
  font-weight: 700;
}

.popover-check {
  display: none;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}

.filter-popover-item.is-selected .popover-check {
  display: inline-block;
}

.popover-item-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.popover-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  text-transform: uppercase;
  flex-shrink: 0;
}

.popover-tag.felony-x {
  background: color-mix(in srgb, #dc2626 22%, var(--surface));
  color: #f87171;
  border: 1px solid color-mix(in srgb, #dc2626 40%, transparent);
}

.popover-tag.felony-1,
.popover-tag.felony-2,
.popover-tag.felony-3,
.popover-tag.felony-4 {
  background: color-mix(in srgb, #ea580c 20%, var(--surface));
  color: #fb923c;
  border: 1px solid color-mix(in srgb, #ea580c 35%, transparent);
}

.popover-tag.misdemeanor-a,
.popover-tag.misdemeanor-b,
.popover-tag.misdemeanor-c {
  background: color-mix(in srgb, #2563eb 20%, var(--surface));
  color: #60a5fa;
  border: 1px solid color-mix(in srgb, #2563eb 35%, transparent);
}

.popover-tag.petty-tag {
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.sr-select-backing {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.filter-select {
  width: 100%;
  min-height: 44px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease;
}

.filter-select:focus {
  border-color: var(--accent);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.filter-reset-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, #dc2626 40%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, #dc2626 12%, var(--surface));
  color: #ef4444;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.filter-reset-pill:hover {
  background: color-mix(in srgb, #dc2626 22%, var(--surface));
  border-color: #ef4444;
  color: #fff;
}

.filter-reset-pill .active-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: #dc2626;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

/* 3. Active Filter Dismiss Chips */
.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: var(--space-2);
  border-top: 1px dashed color-mix(in srgb, var(--border) 60%, transparent);
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

.active-chip:hover {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  border-color: var(--accent);
}

.active-chip-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 20%, transparent);
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

/* Visual Classification Badges */
.classification-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-felony-x {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.badge-felony {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

.badge-misdemeanor {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

.badge-petty {
  background: rgba(29, 29, 27, 0.08);
  color: var(--text);
  border-color: rgba(29, 29, 27, 0.20);
}

.badge-traffic {
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
  color: var(--text-soft);
  border-color: var(--border);
}

:root[data-theme="dark"] .badge-felony-x {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.52);
}

:root[data-theme="dark"] .badge-felony {
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.5);
}

:root[data-theme="dark"] .badge-misdemeanor {
  background: rgba(14, 165, 233, 0.22);
  color: #7dd3fc;
  border-color: rgba(14, 165, 233, 0.48);
}

:root[data-theme="dark"] .badge-petty {
  background: rgba(205, 198, 190, 0.12);
  color: var(--text);
  border-color: rgba(205, 198, 190, 0.25);
}

/* Mandatory Court Appearance Badge */
.mandatory-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  max-width: 100%;
}

:root[data-theme="dark"] .mandatory-badge {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.52);
  color: #fca5a5;
}

/* Card Action Deck & Groups */
.offense-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.action-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.action-group-primary {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
}

.action-group-utility {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 52px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition:
    transform 100ms cubic-bezier(0.2, 0, 0, 1),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
  .row-action:hover {
    border-color: var(--border-strong);
    background: var(--surface-strong);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
}

.row-action:active {
  transform: scale(0.96);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.row-action.statute-btn {
  background: var(--surface-muted);
  border-color: var(--border-strong);
  color: var(--text);
  font-weight: 750;
  padding: 0 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] .row-action.statute-btn {
  background: rgba(205, 198, 190, 0.10);
  border-color: rgba(205, 198, 190, 0.28);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 10px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) and (pointer: fine) {
  .row-action.statute-btn:hover {
    background: #1d1d1b;
    border-color: #1d1d1b;
    color: #cdc6be;
    box-shadow: 0 4px 18px rgba(29, 29, 27, 0.25);
  }

  :root[data-theme="dark"] .row-action.statute-btn:hover {
    background: #cdc6be;
    border-color: #cdc6be;
    color: #1d1d1b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  }
}

.row-action.calc-fine-btn {
  background: color-mix(in srgb, #b45309 12%, var(--surface));
  border-color: color-mix(in srgb, #b45309 32%, transparent);
  color: var(--text);
  font-weight: 750;
  padding: 0 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 8px rgba(180, 83, 9, 0.12);
}

:root[data-theme="dark"] .row-action.calc-fine-btn {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.38);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 10px rgba(245, 158, 11, 0.15);
}

@media (hover: hover) and (pointer: fine) {
  .row-action.calc-fine-btn:hover {
    background: #b45309;
    border-color: #b45309;
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(180, 83, 9, 0.35);
  }

  :root[data-theme="dark"] .row-action.calc-fine-btn:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #1d1d1b;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.45);
  }
}

.row-action.bookmark-btn {
  padding: 0 16px;
}

:root[data-theme="dark"] .row-action.bookmark-btn {
  background: rgba(205, 198, 190, 0.08);
  border-color: rgba(205, 198, 190, 0.20);
  color: var(--text-soft);
}

@media (hover: hover) and (pointer: fine) {
  :root[data-theme="dark"] .row-action.bookmark-btn:hover {
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }
}

.row-action.bookmark-btn.is-bookmarked {
  border-color: #d97706;
  background: color-mix(in srgb, #f59e0b 16%, var(--surface));
  color: #d97706;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 6px rgba(217, 119, 6, 0.2);
}

:root[data-theme="dark"] .row-action.bookmark-btn.is-bookmarked {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.52);
  color: #fbbf24;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 10px rgba(245, 158, 11, 0.25);
}

@media (min-width: 640px) {
  .offense-actions {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-3);
    padding-top: 0;
    border-top: none;
  }
}

/* Statute Sheet Modal Tabs */
.statute-sheet-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-muted) 80%, transparent);
  overflow-x: auto;
  scrollbar-width: none;
}

.statute-sheet-tabs::-webkit-scrollbar {
  display: none;
}

.statute-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 100ms var(--ease-out),
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.statute-tab:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.statute-tab.is-active {
  border-color: var(--border-strong);
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 750;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] .statute-tab.is-active {
  border-color: rgba(205, 198, 190, 0.28);
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.40);
}

.statute-panel {
  display: none;
}

.statute-panel.is-active {
  display: block;
}

.statute-penalties-card {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-muted) 85%, transparent);
  margin: 18px 0;
}

:root[data-theme="dark"] .statute-penalties-card {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.statute-penalties-card h4 {
  margin: 0 0 var(--space-2);
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
}

.statute-penalties-card p {
  margin: 0 0 var(--space-2);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.enhancement-notice-box {
  margin-top: var(--space-3);
  padding: 14px 16px;
  border-radius: 10px;
  background: color-mix(in srgb, #f59e0b 12%, var(--surface-muted));
  border-left: 4px solid #f59e0b;
}

:root[data-theme="dark"] .enhancement-notice-box {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
}

.enhancement-notice-box strong {
  display: block;
  font-size: 12.5px;
  font-weight: 750;
  color: var(--text);
  margin-bottom: 4px;
}

.enhancement-notice-box p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-soft);
}

/* Keyboard Shortcuts Dialog Table */
.keyboard-shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.keyboard-shortcuts-table th,
.keyboard-shortcuts-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.keyboard-shortcuts-table th {
  background: var(--surface-muted);
  font-weight: 750;
  color: var(--text-soft);
}

.keyboard-shortcuts-table tr:hover td {
  background: var(--surface-strong);
}

.keyboard-shortcuts-table kbd {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 750;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* PFA Badges & Evaluation Box */
.pfa-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: #f3e8ff;
  border: 1px solid #d8b4fe;
  color: #7e22ce;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
  white-space: nowrap;
  max-width: 100%;
}

:root[data-theme="dark"] .pfa-badge {
  background: rgba(168, 85, 247, 0.20);
  border-color: rgba(168, 85, 247, 0.46);
  color: #c084fc;
}

.chip-pfa.is-active {
  background: color-mix(in srgb, #f59e0b 22%, var(--surface-strong));
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 12px color-mix(in srgb, #f59e0b 25%, transparent);
}

.pfa-evaluation-box {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.pfa-evaluation-box.is-eligible {
  border-color: color-mix(in srgb, #ef4444 45%, transparent);
  background: color-mix(in srgb, #ef4444 10%, var(--surface-muted));
}

.pfa-evaluation-box.is-eligible h4 {
  color: #f87171;
}

.pfa-evaluation-box.is-release {
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-muted));
}

.pfa-evaluation-box.is-release h4 {
  color: var(--text);
}

.pfa-evaluation-box p {
  font-size: 13px;
  line-height: 1.5;
  margin-top: 4px;
  color: var(--text-soft);
}

/* Speed Calculator Dialog */
.speed-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-4);
}

@media (max-width: 768px) {
  .speed-calc-grid {
    grid-template-columns: 1fr;
  }
}

.speed-calc-inputs {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--surface-muted);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.calc-field label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.calc-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.calc-field select {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 13px;
}

.calc-result-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.calc-result-card.is-court-required {
  border-color: color-mix(in srgb, #f59e0b 50%, var(--border));
}

.calc-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.calc-result-citation {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 750;
  color: var(--text);
  margin: 0;
}

.calc-diff-badge {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 750;
  font-family: var(--font-mono);
}

.calc-diff-badge.diff-high {
  background: color-mix(in srgb, #ef4444 20%, transparent);
  color: #f87171;
  border: 1px solid color-mix(in srgb, #ef4444 40%, transparent);
}

.calc-diff-badge.diff-norm {
  background: color-mix(in srgb, #f59e0b 20%, transparent);
  color: #fbbf24;
  border: 1px solid color-mix(in srgb, #f59e0b 40%, transparent);
}

.calc-result-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  margin: 0;
}

.calc-fine-note {
  font-size: 13px;
  color: var(--text-soft);
  margin: var(--space-1) 0;
}

.calc-narrative-box {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  margin: var(--space-2) 0;
}

.discretionary-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

/* Onboarding Dialog */
.onboarding-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.onboarding-step-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.onboarding-step-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--background);
  font-weight: 750;
  font-size: 13px;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.onboarding-step-card h3 {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  margin: 0 0 4px 0;
}

.onboarding-step-card p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.45;
  margin: 0;
}

.onboarding-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-4);
}

/* ==========================================================================
   Comprehensive Mobile Ergonomics & Responsive Architecture (<= 639px)
   ========================================================================== */

@media (max-width: 639px) {
  .site-header {
    top: 0;
    gap: 6px;
    padding: max(8px, env(safe-area-inset-top)) 12px 6px;
  }

  .pill-nav {
    max-width: 100%;
    height: 42px;
    gap: 2px;
    padding: 2px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: none;
    -webkit-mask-image: none;
    justify-content: flex-start;
  }

  .pill-nav a,
  .pill-nav button {
    min-width: 36px;
    min-height: 36px;
    padding: 0 9px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    gap: 4px;
  }

  .pill-nav span {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 9.5px;
  }

  .search-dock {
    width: 100%;
    max-width: 100%;
  }

  .search-shell {
    min-height: 46px;
    padding: 0 12px;
    gap: 8px;
  }

  .search-shell input {
    font-size: 16px;
    min-height: 44px;
  }

  .search-icon {
    width: 16px;
    height: 16px;
  }

  .search-tools {
    position: fixed;
    top: calc(max(8px, env(safe-area-inset-top)) + 104px);
    left: 12px;
    right: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 130px);
    gap: var(--space-2);
    padding: var(--space-2);
    transform: none;
  }

  .search-experience.is-open .search-tools {
    transform: none;
  }

  .hero-stage {
    padding: 16px 14px;
    border-radius: 18px;
    gap: 12px;
  }

  .hero-top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .hero-badge {
    font-size: 11px;
    padding: 4px 10px;
  }

  .hero-telemetry {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }

  .telemetry-pill {
    font-size: 10px;
    padding: 3px 8px;
  }

  .hero-headline {
    font-size: clamp(1.75rem, 6.5vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 2px 0;
  }

  .hero-stage p {
    font-size: 13.5px;
    line-height: 1.45;
  }

  .hero-capabilities {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: var(--space-2);
  }

  .capability-card {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
  }

  .capability-card h3 {
    font-size: 12.5px;
  }

  .capability-card p {
    font-size: 11px;
    line-height: 1.35;
  }

  /* Scenario Quick Hub - 1-Line Touch Rail */
  .scenario-hub {
    margin-bottom: 6px;
    padding-bottom: 8px;
    gap: 6px;
  }

  .scenario-label {
    font-size: 10.5px;
    letter-spacing: 0.06em;
  }

  .scenario-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    margin: 0 -14px;
    padding: 2px 14px 4px;
  }

  .scenario-pills::-webkit-scrollbar {
    display: none;
  }

  .scenario-pill {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Unified Filter Console - 1-Line Touch Rail */
  .unified-filter-console {
    margin: 8px 0 12px;
    padding: 12px;
    border-radius: 16px;
    gap: 8px;
  }

  .filter-pills-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    margin: 0 -12px;
    padding: 2px 12px 6px;
  }

  .filter-pills-row::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    min-height: 38px;
    padding: 0 12px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .filter-controls-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 8px;
  }

  .filter-select-trigger {
    min-height: 42px;
    padding: 0 12px;
    font-size: 13px;
  }

  .filter-popover-menu {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 280px;
    border-radius: 14px;
  }

  /* Offense Cards */
  .offense-row {
    padding: 14px;
    border-radius: 14px;
    gap: 8px;
    margin-bottom: 10px;
  }

  .code-identity {
    gap: 4px;
  }

  .primary-code {
    font-size: 16px;
    line-height: 1.25;
  }

  .code-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    margin-bottom: 2px;
  }

  .offense-description {
    font-size: 14px;
    line-height: 1.45;
    margin: 4px 0;
  }

  .official-heading {
    font-size: 12px;
    line-height: 1.35;
    margin-bottom: 4px;
  }

  .offense-context {
    font-size: 10.5px;
    line-height: 1.35;
  }

  .ilga-statute-link {
    margin-top: 6px;
    margin-bottom: 2px;
    padding: 4px 10px;
    font-size: 11.5px;
    min-height: 34px;
  }

  .offense-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  }

  .offense-actions .row-action {
    min-height: 40px;
    font-size: 12px;
    font-weight: 700;
  }

  .command-option {
    min-height: 82px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    gap: 2px var(--space-2);
  }

  .command-code {
    grid-column: 1;
    grid-row: 1;
  }

  .command-description,
  .command-detail {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .command-description {
    grid-row: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .command-detail {
    grid-row: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .command-court {
    grid-column: 2;
    grid-row: 1;
  }

  .search-tools-footer > span {
    display: none;
  }

  .search-tools-footer {
    justify-content: flex-end;
  }

  .category-dropdown-dock,
  .mobile-filter-dock {
    display: block;
  }

  .appearance-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
  }

  .category-chips-container {
    margin: 18px 0 14px;
  }

  .category-chip {
    min-height: 44px;
    padding: 6px 14px;
    font-size: 12px;
  }

  /* Bottom Sheets & Dialogs */
  .statute-sheet {
    box-sizing: border-box;
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 90vh;
    margin: auto auto 0;
    border-width: 1px 0 0 0;
    border-radius: 22px 22px 0 0;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .statute-sheet-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 20px 14px 12px;
  }

  .statute-sheet-header::before {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--text-soft) 40%, transparent);
    content: "";
  }

  .statute-sheet-title {
    font-size: 16px;
    word-break: break-word;
  }

  .statute-sheet-close {
    flex: 0 0 auto;
    min-width: 52px;
    min-height: 40px;
    padding: 0 12px;
    font-size: 12px;
  }

  .statute-sheet-body {
    padding: 14px;
  }

  .speed-calc-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .speed-calc-inputs {
    padding: 14px;
    gap: 12px;
  }

  /* Footer Mobile */
  .site-footer {
    padding: 36px 14px calc(36px + env(safe-area-inset-bottom));
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-col-brand .brand-badge {
    font-size: 26px;
  }

  .footer-dir-row {
    min-height: 48px;
    padding: 0 12px;
    font-size: 13px;
  }

  .footer-seals {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.noscript-overview {
  margin: var(--space-4) 0;
}

.noscript-card {
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  line-height: 1.5;
}

.noscript-card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: 0;
}

.noscript-card h4 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 8px 0 0;
}

.noscript-card ul {
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}




