:root {
  --ink: #132018;
  --canopy: #173528;
  --leaf: #2a6a46;
  --mist: #d7e4d8;
  --dust: #f3ead8;
  --paper: #fbf6ec;
  --clay: #c45c26;
  --amber: #e0a01a;
  --blood: #b42318;
  --line: rgba(19, 32, 24, 0.12);
  --shadow: 0 18px 40px rgba(19, 32, 24, 0.12);
  --rail: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Figtree, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(224, 160, 26, 0.16), transparent 50%),
    linear-gradient(180deg, #f7f1e3 0%, var(--paper) 40%, #efe6d2 100%);
  display: grid;
  grid-template-columns: var(--rail) 1fr;
}
a { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; }

.rail {
  background: var(--ink);
  color: #efe6d2;
  min-height: 100vh;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  align-items: flex-start;
}
.ksric-lockup {
  display: block;
  height: 44px;
  width: auto;
  max-width: 100%;
  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  object-fit: contain;
}
.ksric-lockup-compact {
  height: 32px;
  padding: 4px 8px;
}
.ksric-lockup-login {
  height: 64px;
  margin: 0 0 16px;
  padding: 8px 10px;
}
.mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--amber), var(--clay));
  color: var(--ink); font-size: 18px;
}
.brand strong { display: block; font-family: Fraunces, serif; font-size: 1.25rem; font-weight: 650; }
.product-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-mark {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex: 0 0 auto;
}
.product-mark-lg {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
.product-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.brand em { display: block; font-style: normal; opacity: 0.65; font-size: 0.78rem; }
.rail nav { display: flex; flex-direction: column; gap: 4px; }
.rail nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  color: #d7e4d8;
  font-weight: 550;
}
.rail nav a.on, .rail nav a:hover { background: rgba(224, 160, 26, 0.16); color: #fff; }
.rail-note { margin-top: auto; font-size: 0.8rem; line-height: 1.45; opacity: 0.75; }

.shell { min-width: 0; }
.top {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 28px 32px 8px; gap: 16px;
}
.kicker {
  margin: 0; letter-spacing: 0.16em; text-transform: uppercase;
  font-size: 0.68rem; font-weight: 700; color: var(--leaf);
}
h1, h2, h3 { font-family: Fraunces, serif; font-weight: 650; letter-spacing: -0.02em; }
h1 { margin: 4px 0 0; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.top-meta { display: flex; gap: 10px; align-items: center; }
.clock, .pulse {
  border: 1px solid var(--line); background: rgba(255,255,255,0.55);
  padding: 8px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
}
.pulse { background: var(--ink); color: var(--dust); }
.pulse.hot { background: var(--blood); }

main { padding: 12px 32px 48px; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 0.9fr; gap: 18px; }
.grid-2.fold-grid { align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }

.card {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.card h2 { margin: 0 0 12px; font-size: 1.15rem; }
.fold-toolbar { margin: 0 0 14px; }
details.fold-panel > .fold-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  -webkit-user-select: none;
  user-select: none;
}
details.fold-panel > .fold-summary::-webkit-details-marker { display: none; }
details.fold-panel > .fold-summary::before {
  content: "▸";
  color: var(--leaf);
  font-size: 0.95rem;
  line-height: 1;
  flex: 0 0 auto;
}
details.fold-panel[open] > .fold-summary::before { content: "▾"; }
details.fold-panel > .fold-summary h2 {
  margin: 0;
  font-size: 1.15rem;
  flex: 1 1 auto;
}
details.fold-panel[open] > .fold-summary { margin-bottom: 12px; }
details.fold-panel.fold-section {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
details.fold-panel.fold-section > .fold-summary {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
}
details.fold-panel.fold-section[open] > .fold-summary {
  margin-bottom: 14px;
}
/* Closed fold cards keep their natural height so a neighbour open in the same row
   does not stretch them into a blank slab. */
.fold-grid > details.fold-panel:not([open]) {
  align-self: start;
  height: fit-content;
}
.muted { color: rgba(19,32,24,0.62); }

.kpi b { display: block; font-family: Fraunces, serif; font-size: 1.7rem; }
.kpi span { font-size: 0.78rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(19,32,24,0.6); }

#map { height: 520px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.map-legend button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.map-legend button.off { opacity: 0.4; }
.map-swatch { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.route-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 10px; }
.route-line select { min-width: 220px; }
.scroll-board { max-height: 320px; overflow: auto; }

.feed { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow: auto; }
.inc {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 10px;
  padding: 10px 12px; border-radius: 12px; text-decoration: none;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.55);
}
.inc:hover { border-color: var(--leaf); }
.inc .ref { font-weight: 800; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  background: var(--mist); color: var(--canopy);
}
.badge.warn { background: #f6e2b8; color: #7a4b00; }
.badge.bad { background: #f4cfc9; color: var(--blood); }
.badge.ok { background: #cfe8d4; color: #14532d; }

.phone {
  background: #1a1a1a; color: #d7f5c5; border-radius: 28px; padding: 18px 14px 22px;
  box-shadow: var(--shadow); font-family: ui-monospace, Menlo, Consolas, monospace;
}
.phone .screen {
  background: #0c1f12; border-radius: 16px; padding: 12px; min-height: 220px;
}
.phone label { display: block; font-size: 0.7rem; color: #8fbf96; margin: 8px 0 4px; }
.phone input, .phone textarea, .phone select {
  width: 100%; background: #14301e; color: #e8ffd9; border: 1px solid #2f5a3d;
  border-radius: 8px; padding: 8px;
  font-family: inherit;
}
.phone button, .btn {
  border: 0; border-radius: 999px; padding: 10px 14px; font-weight: 700; cursor: pointer;
  background: var(--amber); color: var(--ink);
}
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: var(--blood); color: white; }
.btn.leaf { background: var(--leaf); color: white; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.mt-8 { margin-top: 8px; }
.row.mt-10 { margin-top: 10px; }
.row.align-center { align-items: center; }
.row.align-center > input:not([type="checkbox"]):not([type="radio"]) { flex: 1; }
.nowrap-check { margin: 0; white-space: nowrap; }
.import-subhead.tight { margin-top: 8px; }
.sms-log { max-height: 240px; overflow: auto; display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; }
.sms-log .in { color: #8fd0ff; }
.sms-log .out { color: #d7f5c5; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(19,32,24,0.55); }

.timeline { border-left: 2px solid var(--mist); margin-left: 10px; padding-left: 16px; }
.timeline .ev { margin: 0 0 14px; }
.timeline .ev small { display: block; color: rgba(19,32,24,0.5); }

.phone-frame {
  width: min(420px, 100%);
  margin: 0 auto;
  background: #111;
  border-radius: 36px;
  padding: 18px 14px 28px;
  color: white;
}
.phone-frame .notch { width: 120px; height: 18px; background: #000; border-radius: 0 0 12px 12px; margin: -6px auto 12px; }
.phone-frame .muted { color: rgba(232, 255, 217, 0.78); }
.phone-frame h3, .phone-frame b { color: #fff; }
.phone-frame a { color: #e0a01a; }
.console-card {
  background: #1c2a22; border-radius: 18px; padding: 14px; margin-bottom: 10px;
}
.count { font-family: Fraunces, serif; font-size: 2.4rem; color: var(--amber); }

.prose { max-width: 820px; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.1em; }
.prose li { margin: 0.35em 0; }
.callout {
  background: var(--canopy); color: var(--dust); padding: 18px 20px; border-radius: 16px;
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  grid-template-columns: 1fr;
}
.login-card {
  width: min(440px, 92vw);
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.login-card-wide {
  width: min(520px, 94vw);
}
.spaced-top { margin-top: 10px; }
.card-spaced-top { margin-top: 16px; }
.card-spaced-bottom { margin-bottom: 14px; }
.grid-spaced-top { margin-top: 14px; }
.route-summary { margin: 0; }
.phone .demo-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d7f5c5;
  margin: 8px 0 4px;
}
.phone .btn.ghost-phone {
  color: #d7f5c5;
  border-color: #2f5a3d;
}
.phone .hint {
  margin: 8px 0 0;
  color: #8fbf96;
  font-size: 0.72rem;
}
.phone .rule {
  border: 0;
  border-top: 1px solid #2f5a3d;
  margin: 12px 0;
}
.phone .ussd-out {
  white-space: pre-wrap;
  margin: 8px 0 0;
  color: #d7f5c5;
  font-size: 0.78rem;
  min-height: 4.5rem;
}
.login-card [hidden] { display: none !important; }
.ksric-lockup-hit {
  display: block;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
}
.ksric-lockup-hit:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}
.ksric-lockup-hit .ksric-lockup-login { margin: 0; }
.ksric-lockup-wrap {
  display: block;
  margin: 0 0 12px;
  border-radius: 10px;
}
.ksric-lockup-wrap .ksric-lockup-login { margin: 0; }
.ksric-lockup-route {
  cursor: pointer;
  pointer-events: auto;
}
.ksric-lockup-inert {
  cursor: default;
  opacity: 0.92;
  pointer-events: none;
}
.ksric-lockup-active {
  cursor: pointer;
  pointer-events: auto;
  outline: 2px solid rgba(224, 160, 26, 0.55);
  outline-offset: 3px;
}
.ksric-lockup-active:focus-visible {
  outline: 3px solid var(--amber);
}

.path-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 16px;
}
.path-panes button {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 650;
  cursor: pointer;
}
.path-panes button small {
  display: block;
  margin-top: 4px;
  font-weight: 500;
  opacity: 0.7;
  font-size: 0.72rem;
}
.path-panes button.on {
  background: var(--ink);
  color: var(--dust);
  border-color: var(--ink);
}
.path-panes button.on small { opacity: 0.85; color: inherit; }

.admin-affordance {
  margin: 14px 0 0;
  text-align: center;
}
.admin-affordance .login-switch-btn {
  font-size: 0.78rem;
}

.ask-panel {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.ask-panel label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 650;
}
.ask-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}
.ask-row .btn { margin-top: 0; width: auto; min-width: 72px; }
.ask-answer, .ask-cite {
  margin: 10px 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
  white-space: pre-wrap;
}
.ask-cite { font-size: 0.74rem; }

.citizen-actions {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.citizen-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(28, 42, 34, 0.06);
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.citizen-map {
  height: 280px;
  margin-top: 8px;
  border-radius: 12px;
}

.knowledge-viewer { margin: 0 0 18px; }
.knowledge-stage {
  position: relative;
  display: block;
  width: 100%;
  height: 148px;
  padding: 0;
  border: 1.5px solid rgba(224, 160, 26, 0.8);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #1c2a22;
  box-shadow: 0 8px 18px rgba(19, 32, 24, 0.18);
}
.knowledge-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.knowledge-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.12) 0%, rgba(19,32,24,0.82) 100%);
  pointer-events: none;
}
.knowledge-name {
  position: absolute;
  left: 12px;
  right: 56px;
  bottom: 10px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
  line-height: 1.15;
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}
.knowledge-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(19, 32, 24, 0.88);
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 4px;
}
.knowledge-caption { margin: 8px 0 0; font-size: 0.78rem; line-height: 1.35; }
.knowledge-dialog {
  position: fixed;
  inset: 0;
  width: min(520px, 94vw);
  max-height: min(92vh, 760px);
  height: fit-content;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #132018;
  color: #efe6d2;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  z-index: 40;
}
.knowledge-dialog::backdrop { background: rgba(19, 32, 24, 0.62); }
.knowledge-dialog-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 8px;
}
.knowledge-dialog-bar h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff;
}
.knowledge-dialog-bar .btn {
  width: auto;
  margin: 0;
  color: #efe6d2;
  border-color: rgba(255,255,255,0.22);
}
.knowledge-hero {
  position: relative;
  height: 200px;
  background: #1c2a22;
}
.knowledge-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.knowledge-hero-copy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
}
.knowledge-hero-copy p { margin: 0; }
#knowledge-hero-common { font-family: Fraunces, serif; font-size: 1.45rem; font-weight: 650; color: #fff; }
#knowledge-hero-sci { font-size: 0.88rem; font-style: italic; color: var(--amber); }
.knowledge-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px;
}
.knowledge-thumbs button {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.28);
  overflow: hidden;
  cursor: pointer;
  background: #24352c;
}
.knowledge-thumbs button.on {
  border-color: var(--amber);
  border-width: 2.5px;
}
.knowledge-thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.knowledge-body {
  padding: 4px 18px 22px;
  overflow: auto;
  max-height: 38vh;
}
.knowledge-chip {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(42, 106, 70, 0.4);
  background: rgba(42, 106, 70, 0.2);
  font-size: 0.75rem;
  font-weight: 650;
  color: #b8d4c2;
}
.knowledge-body h3 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--amber);
}
.knowledge-body p { margin: 0 0 12px; font-size: 0.92rem; line-height: 1.45; color: rgba(255,255,255,0.9); }
.knowledge-credit { font-size: 0.72rem; color: rgba(255,255,255,0.55); }
.knowledge-warn { font-size: 0.78rem; color: rgba(224, 160, 26, 0.85); }
.login-card label { display: block; margin: 10px 0 4px; font-size: 0.82rem; font-weight: 650; }
.login-card .field-opt { font-weight: 500; color: #5b6b5e; }
.field-opt { font-weight: 500; color: rgba(19,32,24,0.55); }
.login-card input, .login-card select {
  width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--line);
}
.login-card .btn { width: 100%; margin-top: 12px; }
.login-card hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.login-device-options {
  display: grid;
  gap: 10px;
  margin: 14px 0 4px;
}
.login-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}
.login-check input {
  width: auto;
  margin-top: 3px;
  accent-color: #c98512;
}
.login-check strong {
  display: block;
  font-size: 0.92rem;
  color: #132018;
}
.login-check small {
  display: block;
  margin-top: 2px;
  color: rgba(19, 32, 24, 0.62);
  font-size: 0.78rem;
  line-height: 1.35;
}
.login-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 12px;
}
.login-panes button {
  margin: 0;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.65);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  line-height: 1.2;
  text-align: center;
}
.login-panes button small {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.72;
}
.login-panes button.on {
  background: var(--canopy);
  color: var(--dust);
  border-color: var(--canopy);
}
.login-panes button.on small { opacity: 0.9; }
.otp-channels { display: grid; gap: 8px; margin: 12px 0 0; }
.login-card .otp-channels .btn { margin-top: 0; }
.login-card .btn.ghost { margin-top: 8px; }
.login-switch-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}
.login-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9.5rem;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.75);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
  color: inherit;
}
.login-switch-btn[aria-pressed="true"] {
  background: #173528;
  border-color: #2a6a46;
  color: #efe6d2;
}
.login-card [data-pane-panel="county-admin"] .btn {
  font-size: 0.92rem;
  padding: 10px 14px;
}
.rail-note a { color: #e0a01a; }

.list-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.list-tools input[type="search"],
.list-tools input[type="date"],
.list-tools select {
  min-width: 150px;
  max-width: 240px;
  flex: 1 1 150px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font: inherit;
  background: #fff;
}
.list-tools.board-filters input[type="search"] {
  flex: 1 1 100%;
  max-width: none;
}
.list-tools.board-filters select {
  flex: 1 1 120px;
  min-width: 0;
}
.board-match { margin: 0 0 8px; font-size: 0.82rem; }
.scroll-board.fit-table th:last-child,
.scroll-board.fit-table td:last-child { white-space: nowrap; }
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.pager-nav { display: flex; gap: 8px; }
.pager .btn[disabled] { opacity: 0.4; cursor: default; pointer-events: none; }
.county-index { display: flex; flex-wrap: wrap; gap: 8px; }
.county-jump {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.75);
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
  color: inherit;
  text-align: left;
}
.county-jump:hover { border-color: #2a6a46; }
.facility-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.facility-filters select { min-width: 200px; max-width: 280px; }
.level-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.level-chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.75);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  color: inherit;
}
.level-chip.on, .level-chip[aria-pressed="true"] {
  background: #173528;
  color: #efe6d2;
  border-color: #2a6a46;
}
.keph-note { margin-top: 0; }
.store-policy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 8px;
}
.officer-desk { margin: 4px 0 8px; }
.officer-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) 2fr;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.officer-row:last-child { border-bottom: 0; }
.officer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.officer-controls input { min-width: 140px; max-width: 200px; }
.tag-rendezvous { color: #8a5a12; font-weight: 650; }

.geo-node {
  margin: 8px 0;
  background: rgba(255,255,255,0.45);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 10px 8px;
}
.geo-node > summary {
  cursor: pointer;
  font-weight: 650;
  padding: 10px 6px;
  list-style: none;
}
.geo-node > summary::-webkit-details-marker { display: none; }
.geo-node > summary::before { content: "▸ "; color: var(--leaf); }
.geo-node[open] > summary::before { content: "▾ "; }
.geo-sub { margin: 6px 0 6px 12px; background: rgba(255,255,255,0.55); }
.geo-facilities { margin: 4px 0 8px 4px; }
.geo-facility {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 2fr;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.geo-facility:last-child { border-bottom: 0; }
.geo-ward { margin: 4px 0 4px 10px; background: rgba(255,255,255,0.7); }
.fleet-block { margin: 0 4px 8px; }
.fleet-block table { margin: 0; }
.fleet-standby > summary { color: #8a5a12; }
.drone-controls,
.fleet-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fleet-line,
.fleet-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.fleet-editor select,
.fleet-add input { min-width: 140px; max-width: 220px; }
.drone-toggle { margin: 0; gap: 6px; font-size: 0.9rem; }
.lang-list { display: grid; gap: 8px; }
.lang-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.lang-row:last-child { border-bottom: 0; }
.lang-switch { margin: 0; white-space: nowrap; }
.geo-stock { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bar-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.bar-label { width: 140px; }
.bar-track { flex: 1; background: #efe6d2; border-radius: 8px; overflow: hidden; height: 12px; }
.bar-fill { background: #2a6a46; height: 12px; }
.stack-gap { margin-top: 14px; }
.secret-field { position: relative; display: block; }
.secret-field > input { padding-right: 4.6rem; }
.secret-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  width: auto;
  min-width: 0;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--leaf);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.login-card .secret-toggle { margin-top: 0; width: auto; }
.choice-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0 0 12px;
  padding: 8px 12px 10px;
}
.choice-list legend {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 6px;
}
.choice-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-weight: 650;
}
.stack label { display: block; margin: 8px 0 4px; font-size: 0.82rem; font-weight: 650; }
.stack label.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-weight: 650;
}
.stack input, .stack select, .stack textarea {
  width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
  font: inherit;
}
.stack input[type="checkbox"],
.stack input[type="radio"] {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}
.stack .row { align-items: center; margin: 8px 0; }
.import-subhead {
  margin: 18px 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
}
.import-create {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
}
.import-create table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.import-create th,
.import-create td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  font-size: 0.82rem;
}
.import-create th {
  font-weight: 650;
  white-space: nowrap;
  background: rgba(19, 32, 24, 0.04);
}
.import-create tr:last-child td { border-bottom: 0; }
.import-species,
.import-combo {
  display: grid;
  gap: 6px;
  min-width: 12rem;
}
.import-family-label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted, #5c6570);
}
.import-create .muted.tight { margin: 4px 0 0; font-size: 0.85rem; }
.import-create input,
.import-create select {
  width: 100%;
  min-width: 88px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font: inherit;
  background: #fff;
}
.import-create .import-remove {
  white-space: nowrap;
}
.import-existing {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
  margin-top: 8px;
}
.import-existing table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}
.import-existing th,
.import-existing td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.82rem;
  vertical-align: top;
}
.import-existing th {
  font-weight: 650;
  background: rgba(19, 32, 24, 0.04);
  white-space: nowrap;
}
.import-existing tr:last-child td { border-bottom: 0; }
.import-existing .import-edit-btn { white-space: nowrap; }
.import-edit {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}
.import-guard-warn {
  color: #7a4b00;
  font-weight: 650;
}
.banner {
  background: #f6e2b8; color: #7a4b00; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px;
  font-weight: 600;
}

@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .rail { position: relative; min-height: 0; }
  .rail nav { flex-direction: row; flex-wrap: wrap; }
  .grid-2, .grid-kpis, .grid-3 { grid-template-columns: 1fr; }
  main, .top { padding-left: 16px; padding-right: 16px; }
  #map { height: 320px; }
  .geo-facility { grid-template-columns: 1fr; }
}
