
/* Terrivon theme layer. Applied after both application stylesheets. */
:root {
  --theme-surface: #ffffff;
  --theme-surface-alt: #f5f8fb;
  --theme-edge: #dde6ed;
  --theme-primary: #17263c;
  --theme-secondary: #66798e;
}
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #f2f6f9; border: 1px solid #dde6ed;
  padding: 9px 12px; border-radius: 9px; color: #38576c;
  font-size: 11px; font-weight: 750; line-height: 1; white-space: nowrap;
  transition: background .18s ease,border-color .18s ease,color .18s ease;
}
.theme-toggle:hover { background: #e4eff3; border-color: #bcd5df; }
.theme-toggle svg { flex-shrink: 0; }
.theme-toggle .theme-moon { display: inline; }
.theme-toggle .theme-sun { display: none; }
html[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
html[data-theme="dark"] .theme-toggle .theme-sun { display: inline; }
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf4fa; --muted: #adc0d0; --line: #2c3e51;
  --nav: #0b1422; --nav-muted: #9badc0;
  --accent: #68c2d1; --accent-ink: #85d7e3;
  --background: #0e1724; --white: #192739; --success: #80d1bd;
  --shadow: 0 12px 30px rgba(0,0,0,.14);
  --theme-surface: #192739; --theme-surface-alt: #203248;
  --theme-edge: #31475b; --theme-primary: #eff6fd; --theme-secondary: #b2c4d5;
  background: var(--background); color: var(--ink);
}
html[data-theme="dark"] body { background: var(--background); color: var(--ink); }
html[data-theme="dark"] ::selection { background: #34758b; color: #fff; }
html[data-theme="dark"] a { color: #90ddea; }
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] select:focus-visible { outline-color:#9be5f0; }
html[data-theme="dark"] .sidebar { background: #0b1422; border-right: 1px solid #1e3044; }
html[data-theme="dark"] .workspace-label,
html[data-theme="dark"] .sidebar-footer { color: #879db3; }
html[data-theme="dark"] .nav-item { color: #a8bbcd; }
html[data-theme="dark"] .nav-item:hover { background: #1e3247; color:#fff; }
html[data-theme="dark"] .nav-item.active { background: #224259; border-color: #365e77; color: #f4fbff; }
html[data-theme="dark"] .nav-item.active .nav-icon { color: #8de2ed; }
html[data-theme="dark"] .sidebar-note { background: #18283c; border-color: #35516a; }
html[data-theme="dark"] .sidebar-note small { color: #adc0d1; }
html[data-theme="dark"] .topbar { background: #152237; border-color: #2b4055; }
html[data-theme="dark"] .topbar-divider { background: #304559; }
html[data-theme="dark"] .topbar-context { color: #a6bbcb; }
html[data-theme="dark"] .topbar-context strong { color: #edf5fc; }
html[data-theme="dark"] .crumb { color: #627f96; }
html[data-theme="dark"] .avatar { background: #28465a; color: #b8e5ef; }
html[data-theme="dark"] .environment-pill { color: #9ae0c7; background:#173b37; border-color: #285951; }
html[data-theme="dark"] .theme-toggle { background: #24384d; border-color:#37516a; color:#d3edf5; }
html[data-theme="dark"] .theme-toggle:hover { background:#2c4a62; border-color:#5989a3; }
html[data-theme="dark"] .page-footer { background:#0d1624; border-color:#263a50; color:#a0b1c1; }
html[data-theme="dark"] .page-heading h1,
html[data-theme="dark"] .rd-head h1 { color: #f3f8fd; }
html[data-theme="dark"] .page-heading p:not(.eyebrow),
html[data-theme="dark"] .rd-head p:not(.eyebrow) { color: #afc1d1; }
html[data-theme="dark"] .last-verified { color:#b4c2d2; }
html[data-theme="dark"] .eyebrow { color: #85d6e1; }
html[data-theme="dark"] .hero { background: linear-gradient(115deg,#1b324a 0%,#1b415a 66%,#256178 100%); border: 1px solid #355a70; }
html[data-theme="dark"] .hero p { color: #cfdeea; }
html[data-theme="dark"] .hero-button { background: #ddf3f6; color: #173749; }
html[data-theme="dark"] .hero-button:hover { background:#fff; }
html[data-theme="dark"] :is(.panel,.stat-card,.source-card,.standard-panel,.register-panel,.rd-panel,.rd-metric,.rd-workflow) {
  background: var(--theme-surface);
  border-color: var(--theme-edge);
  box-shadow: 0 7px 26px rgba(0,0,0,.13);
  color: var(--theme-primary);
}
html[data-theme="dark"] :is(.panel-heading,.featured-item,.quality-facts,.quality-facts div,.register-header,.register-actions,.table-header,.project-row,.source-card,.rd-panel-head,.rd-results-header,.rd-source,.rd-record-bottom,.rd-workflow-status,.rd-pagination,.table-footnote) {
  border-color: #314255;
}
html[data-theme="dark"] :is(.panel-heading h3,.register-header h3,.rd-panel-head h2,.rd-workflow h2,.standard-panel h3,.source-card h3,.rd-metric strong,.stat-card > strong,.quality-mark strong,.featured-text strong,.project-primary strong,.rd-record > strong) {
  color: #f0f6fc;
}
html[data-theme="dark"] :is(.stat-heading,.stat-bottom,.featured-text span,.quality-mark p,.quality-facts span,.source-card p,.standard-panel p,.table-footnote,.register-header > span,.project-primary small,.project-col,.rd-workflow p,.rd-source small,.rd-record-bottom,.rd-address,.rd-results-header span,.rd-record-bottom,.rd-head p) {
  color:#b0c1cf;
}
html[data-theme="dark"] .stat-heading svg { color:#8dbac8; }
html[data-theme="dark"] .featured-item { background: transparent; color: #e7f0f8; }
html[data-theme="dark"] .featured-item:hover,
html[data-theme="dark"] .project-row:hover { background:#253950; }
html[data-theme="dark"] :is(.featured-icon,.source-icon,.quality-circle) { background:#24445b; color:#9ce2eb; border-color:#3c667a; }
html[data-theme="dark"] .quality-facts strong {color:#e2edf7;}
html[data-theme="dark"] .project-status {background:#214b42;color:#9ce3c9;}
html[data-theme="dark"] .project-status.status-awarded {background:#233e61;color:#adceff;}
html[data-theme="dark"] .project-status.status-approved {background:#4d412b;color:#f7d48c;}
html[data-theme="dark"] .disclaimer,
html[data-theme="dark"] .source-intro {background:#1b3445;color:#b4deeb;border-color:#365768;}
html[data-theme="dark"] .disclaimer strong,
html[data-theme="dark"] .source-intro strong { color:#def5fa; }
html[data-theme="dark"] .source-intro p { color:#b5c7d4; }
html[data-theme="dark"] .search-field,
html[data-theme="dark"] .rd-search-controls input,
html[data-theme="dark"] .rd-search-controls select {background:#142334;border-color:#385068;color:#eaf3f9;}
html[data-theme="dark"] .search-field input {color:#f0f7fe;}
html[data-theme="dark"] :is(.search-field input,.rd-search-controls input)::placeholder {color:#a4b6c5;}
html[data-theme="dark"] :is(.outline-button,.filters select,.rd-export,.rd-pagination button) {
  background:#26394d; border-color:#466075; color:#e1eff7;
}
html[data-theme="dark"] :is(.outline-button,.rd-export,.rd-pagination button):hover:not(:disabled) {background:#2e4f65;}
html[data-theme="dark"] .filters label,
html[data-theme="dark"] .filter-label {color:#b0c4d4;}
html[data-theme="dark"] .table-header,
html[data-theme="dark"] .rd-results-header {background:#213248;color:#b9c8d6;}
html[data-theme="dark"] .project-row {background:#192739;color:#dce8f2;}
html[data-theme="dark"] .project-id,
html[data-theme="dark"] .rd-kind {color:#83d3e1;}
html[data-theme="dark"] .count-badge,
html[data-theme="dark"] .rd-total { background:#27475a;color:#9be4ef;}
html[data-theme="dark"] .text-action {color:#9ce3ef;}
html[data-theme="dark"] .source-publisher {color:#90d7e2;}
html[data-theme="dark"] .loading,
html[data-theme="dark"] .error-state {background:#1d2b3c;color:#c1d4e2;}
html[data-theme="dark"] :is(.detail-drawer,.rd-dialog) {background:#172536;color:#ecf5fb;}
html[data-theme="dark"] :is(.drawer-top,.drawer-bottom,.rd-dialog-heading,.rd-dialog-foot) {border-color:#34495d;color:#b1c4d5;}
html[data-theme="dark"] :is(.drawer-scroll h2,.drawer-scroll h3,.rd-dialog-heading h2,.rd-dialog-inner h3) {color:#f3f9fe;}
html[data-theme="dark"] .drawer-summary {color:#c0cfdd;}
html[data-theme="dark"] .metadata,
html[data-theme="dark"] .rd-facts {border-color:#3b5063;}
html[data-theme="dark"] .metadata div,
html[data-theme="dark"] .rd-facts div,
html[data-theme="dark"] .drawer-sources > div {border-color:#34495b;}
html[data-theme="dark"] .metadata dt,
html[data-theme="dark"] .rd-facts dt {color:#b2c1cf;}
html[data-theme="dark"] .metadata dd,
html[data-theme="dark"] .rd-facts dd {color:#e4f0fa;}
html[data-theme="dark"] .milestone-list li {color:#c0d1df;}
html[data-theme="dark"] .milestone-list li strong {color:#e5f4fc;}
html[data-theme="dark"] .milestone-list {border-color:#3b5e72;}
html[data-theme="dark"] .project-caution,
html[data-theme="dark"] .rd-record-callout,
html[data-theme="dark"] .rd-warning {background:#363124;color:#f3dc9b;border-color:#6a5838;}
html[data-theme="dark"] .rd-warning strong {color:#ffe6a9;}
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .rd-dialog-heading > button {background:#2d4055;color:#e8f4fa;}
html[data-theme="dark"] .rd-snapshot {color:#c5e7ef;background:#234458;border-color:#3c667a;}
html[data-theme="dark"] .rd-category {background:#26384d;border-color:#3b5064;color:#c6d8e7;}
html[data-theme="dark"] .rd-category span {color:#b1c9d7;}
html[data-theme="dark"] .rd-category.selected {background:#27738c;border-color:#3a9fbb;color:#fff;}
html[data-theme="dark"] .rd-category.selected span {color:#ebfbff;}
html[data-theme="dark"] .rd-search-controls label {color:#b1c4d3;}
html[data-theme="dark"] .rd-record {background:#1e2e42;border-color:#394e62;color:#edf6fb;}
html[data-theme="dark"] .rd-record:hover {background:#263d53;border-color:#64a8b9;}
html[data-theme="dark"] .rd-review {background:#493d29;color:#f0d49c;}
html[data-theme="dark"] .rd-record-bottom {border-color:#385066;}
html[data-theme="dark"] .rd-record-bottom span:last-child {color:#a1ddeb;}
html[data-theme="dark"] .rd-sources .rd-panel-head > span,
html[data-theme="dark"] .rd-pagination {color:#b3c4d2;}
html[data-theme="dark"] .rd-source strong {color:#edf5fc;}
html[data-theme="dark"] .rd-source a,
html[data-theme="dark"] .rd-link-list a {color:#93dfea;}
html[data-theme="dark"] .rd-workflow-index {color:#8bd4df;}
html[data-theme="dark"] .rd-workflow-status strong {color:#a2e3ed;}
html[data-theme="dark"] .rd-workflow-status span {color:#b4c9d7;}
html[data-theme="dark"] .rd-relations button {background:#213b50;border-color:#375b72;color:#ade9f2;}
html[data-theme="dark"] .rd-dialog-foot {color:#a3b8c9;}
html[data-theme="dark"] .rd-source-list,
html[data-theme="dark"] .rd-grid {background:var(--theme-surface);}
html[data-theme="dark"] .rd-pagination button:disabled {color:#8096aa;}
@media (max-width:760px) {
  .theme-toggle { padding:9px; }
  .theme-toggle #theme-label {display:none;}
  .topbar-right {gap:9px;}
}
@media (prefers-reduced-motion:reduce) {
  .theme-toggle {transition:none;}
}


/* Jurisdiction index dark mode */
html[data-theme="dark"] .rd-jurisdiction-overview,
html[data-theme="dark"] .rd-juris-card{background:#192739;border-color:#34495d;color:#edf6fc}
html[data-theme="dark"] .rd-jurisdiction-overview h2,
html[data-theme="dark"] .rd-juris-card-head h2{color:#f0f7fd}
html[data-theme="dark"] .rd-jurisdiction-overview p:not(.eyebrow),
html[data-theme="dark"] .rd-juris-card>p,
html[data-theme="dark"] .rd-service-area{color:#b7cada}
html[data-theme="dark"] .rd-map-btn{background:#25465a;border-color:#3b6379;color:#b9eaf2}
html[data-theme="dark"] .rd-map-btn:hover{background:#315c70}
html[data-theme="dark"] .rd-county-filter button{background:#22364a;border-color:#3a5167;color:#d2e5ef}
html[data-theme="dark"] .rd-county-filter button:hover{background:#2c5066}
html[data-theme="dark"] .rd-county-filter button strong{background:#36596d;color:#c0eefa}
html[data-theme="dark"] .rd-county-filter button.selected{background:#337a94;border-color:#51a7c0;color:#fff}
html[data-theme="dark"] .rd-county-filter button.selected strong{background:#d9f2fa;color:#135369}
html[data-theme="dark"] .rd-jurisdiction-line{background:#22475b;color:#aae5f0}
html[data-theme="dark"] .rd-review.rd-reviewed{background:#214b42;color:#ace9d7}
html[data-theme="dark"] .rd-juris-card-head>strong{color:#9ce2ef}
html[data-theme="dark"] .rd-juris-subdivisions button{background:#22364a;border-color:#3a5368;color:#dfedf6}
html[data-theme="dark"] .rd-juris-subdivisions button:hover{background:#2c4b61;border-color:#5c94a8}
html[data-theme="dark"] .rd-juris-subdivisions button strong{background:#36576b;color:#b0e7f1}
html[data-theme="dark"] .rd-juris-bottom{border-color:#344b60}
html[data-theme="dark"] .rd-juris-bottom button{background:#397f97;color:#fff}
html[data-theme="dark"] .rd-juris-bottom a{color:#9be2ed}

/* Compact rail for desktop navigation. Uses a real button, not hover-only controls. */
.sidebar{transition:width .18s ease,padding .18s ease}
.sidebar-toggle{display:inline-flex;align-items:center;gap:9px;border:1px solid #dae3eb;background:#f3f7fa;color:#436376;border-radius:7px;padding:8px 10px;font-weight:720;font-size:11px;white-space:nowrap;cursor:pointer}
.sidebar-toggle:hover{background:#e8f3f7;border-color:#b8d4df}
.sidebar-toggle .sidebar-chevron{transition:transform .18s ease}
body.sidebar-collapsed .sidebar{width:73px;padding-left:8px;padding-right:8px}
body.sidebar-collapsed .sidebar .brand{padding:0 6px 53px;justify-content:center}
body.sidebar-collapsed .sidebar .brand>div:last-child,
body.sidebar-collapsed .sidebar .workspace-label,
body.sidebar-collapsed .sidebar .sidebar-note,
body.sidebar-collapsed .sidebar .sidebar-footer{display:none}
body.sidebar-collapsed .sidebar .main-nav{gap:7px}
body.sidebar-collapsed .sidebar .nav-item{justify-content:center;padding:13px 8px;gap:0}
body.sidebar-collapsed .sidebar .nav-item .nav-label{display:none}
body.sidebar-collapsed .sidebar .nav-item .nav-icon{display:flex}
body.sidebar-collapsed .sidebar .brand-symbol{width:43px}
body.sidebar-collapsed .sidebar-toggle .sidebar-chevron{transform:rotate(180deg)}
html[data-theme="dark"] .sidebar-toggle{background:#273c51;border-color:#42617b;color:#e3f2fa}
html[data-theme="dark"] .sidebar-toggle:hover{background:#31536c;border-color:#6e9eaf}
@media (max-width:760px){
  .sidebar-toggle{display:none}
  body.sidebar-collapsed .sidebar{width:min(290px,85vw);padding:29px 17px 25px}
  body.sidebar-collapsed .sidebar .brand{padding:0 14px 53px;justify-content:flex-start}
  body.sidebar-collapsed .sidebar .brand>div:last-child,
  body.sidebar-collapsed .sidebar .workspace-label,
  body.sidebar-collapsed .sidebar .sidebar-note,
  body.sidebar-collapsed .sidebar .sidebar-footer{display:block}
  body.sidebar-collapsed .sidebar .nav-item{justify-content:flex-start;padding:13px 15px;gap:13px}
  body.sidebar-collapsed .sidebar .nav-item .nav-label{display:inline}
}
@media (max-width:1000px) and (min-width:761px){.sidebar-toggle-text{display:none}}
@media (prefers-reduced-motion:reduce){.sidebar,.sidebar-toggle .sidebar-chevron{transition:none}}

html[data-theme="dark"] .project-status.status-bidding{background:#35345f;color:#d5d1ff}

/* Explicit tooltip for the icon rail; works on keyboard focus too. */
@media (min-width:761px) {
 body.sidebar-collapsed .sidebar .nav-item { position:relative; }
 body.sidebar-collapsed .sidebar .nav-item::after {
  position:absolute;left:calc(100% + 12px);top:50%;transform:translateY(-50%);
  content:attr(aria-label);font-size:11px;font-weight:750;letter-spacing:normal;
  background:#16283c;color:#edf8ff;border:1px solid #41627b;
  border-radius:6px;padding:9px 12px;white-space:nowrap;
  box-shadow:0 9px 18px rgba(6,16,30,.25);z-index:50;
  visibility:hidden;opacity:0;pointer-events:none;transition:opacity .12s ease;
 }
 body.sidebar-collapsed .sidebar .nav-item:hover::after,
 body.sidebar-collapsed .sidebar .nav-item:focus-visible::after {
  visibility:visible;opacity:1;
 }
}
