/* ---------------------------------------------------------------------
   Design signature: section/part numbers rendered as small route-shield
   badges (mono type, thin border, rounded rect) — echoing highway signage,
   since a section NUMBER is the actual legal identifier readers navigate
   by, not a decorative index. Dashed dividers echo road lane markings.
--------------------------------------------------------------------- */

:root {
  --paper: #F6F6F3;
  --ink: #14181F;
  --route: #1E3A5F;
  --route-light: #5B8DC4;
  --amber: #E8A33D;
  --line: #D8DBDF;
}
.dark {
  --paper: #11141A;
  --ink: #E7E9EE;
  --route: #5B8DC4;
  --amber: #E8A33D;
  --line: rgba(255,255,255,0.12);
}

html { scroll-behavior: smooth; }

::selection { background: var(--amber); color: #14181F; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--route); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

/* ---- Shield / badge (signature element) ---- */
.shield {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--route);
  border-radius: 6px;
  padding: 4px 7px;
  line-height: 1;
}
.shield-outline {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--route);
  border: 1.5px solid var(--route);
  border-radius: 6px;
  padding: 3px 7px;
  line-height: 1.2;
  white-space: nowrap;
}
.dark .shield-outline { color: var(--route-light); border-color: var(--route-light); }

/* ---- Buttons / pills ---- */
.badge-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; width: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  transition: background .15s, border-color .15s;
}
.badge-btn:hover { background: rgba(30,58,95,0.06); }
.dark .badge-btn:hover { background: rgba(255,255,255,0.06); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.pill:hover { border-color: var(--route); }
.pill[data-active="true"] {
  background: var(--route);
  border-color: var(--route);
  color: #fff;
}
.pill .count {
  opacity: .6; font-variant-numeric: tabular-nums; font-size: 11px;
}

/* ---- Sidebar nav ---- */
.part-link {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink);
  opacity: .8;
}
.part-link:hover { background: rgba(30,58,95,0.06); opacity: 1; }
.dark .part-link:hover { background: rgba(255,255,255,0.06); }
.part-link[data-active="true"] {
  background: rgba(30,58,95,0.09);
  opacity: 1;
  font-weight: 600;
}
.dark .part-link[data-active="true"] { background: rgba(91,141,196,0.16); }
.part-link .num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  color: var(--route);
  min-width: 26px;
}
.dark .part-link .num { color: var(--route-light); }
.part-link .cnt {
  margin-left: auto; font-size: 10.5px; opacity: .5; font-variant-numeric: tabular-nums;
}
.nav-group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; opacity: .45;
  padding: 14px 8px 6px;
}

/* ---- Result card ---- */
.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.6);
  overflow: hidden;
  transition: border-color .15s;
}
.dark .card { background: rgba(255,255,255,0.03); }
.card:hover { border-color: var(--route); }

.card-head {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; text-align: left;
  padding: 13px 14px;
  cursor: pointer;
}

.card-body {
  border-top: 1px dashed var(--line);
  padding: 4px 16px 18px 16px;
}

/* lane-marking style separator, used sparingly inside the reader pane */
.lane-divider {
  height: 1px;
  background-image: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 18px);
  border: none;
  margin: 14px 0;
}

/* legal text rendering (from marked.js) */
.legal-text { font-size: 14.5px; line-height: 1.75; }
.legal-text p { margin: 0 0 10px; }
.legal-text ul, .legal-text ol { margin: 0 0 10px 1.1em; }
.legal-text li { margin-bottom: 4px; }
.legal-text strong { font-weight: 700; }
.legal-text h1, .legal-text h2, .legal-text h3 {
  font-weight: 700; margin: 14px 0 8px; font-size: 14.5px;
}
.legal-text table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.legal-text td, .legal-text th { border: 1px solid var(--line); padding: 5px 8px; vertical-align: top; }
.legal-text mark, .legal-text .hl { background: var(--amber); color: #14181F; border-radius: 2px; padding: 0 1px; }

mark, .hl { background: var(--amber); color: #14181F; border-radius: 2px; padding: 0 1px; }

.theme-tag {
  font-size: 10.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(30,58,95,0.08); color: var(--route);
}
.dark .theme-tag { background: rgba(91,141,196,0.15); color: var(--route-light); }

.icon-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500;
  color: var(--ink); opacity: .65;
  padding: 5px 8px; border-radius: 6px;
}
.icon-btn:hover { opacity: 1; background: rgba(30,58,95,0.07); }
.dark .icon-btn:hover { background: rgba(255,255,255,0.07); }

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