/* Rally Point — field console theme
   Ink-slate + signal amber + muted olive. Topo contours, grain, depth.
   Rounded everything. Condensed field-manual type for headers. */

:root {
  --ink-900: #0c1116;
  --ink-800: #12181d;
  --ink-700: #182129;
  --ink-600: #1f2b36;
  --ink-line: #2c3d4a;
  --paper: #f2ecdd;
  --paper-dim: #b9bfae;
  --amber: #e8a33d;
  --amber-hot: #f5b942;
  --amber-deep: #9c6b1e;
  --olive: #8a9a5b;
  --olive-deep: #55663a;
  --red: #d9534a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.5);
  --font-head: "Oswald", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--paper);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(232,163,61,.10), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(138,154,91,.10), transparent 60%),
    linear-gradient(180deg, var(--ink-800), var(--ink-900) 40%, #0a0e12);
  min-height: 100vh;
  padding-bottom: 92px;
}

/* faint topographic contour texture over everything */
.topo-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='720' viewBox='0 0 720 720'%3E%3Cg fill='none' stroke='%232c3d4a' stroke-width='1.1'%3E%3Cpath d='M-40 120 C120 60 220 180 380 140 C540 100 620 200 760 150'/%3E%3Cpath d='M-40 170 C120 110 220 230 380 190 C540 150 620 250 760 200'/%3E%3Cpath d='M-40 70 C120 10 220 130 380 90 C540 50 620 150 760 100'/%3E%3Cpath d='M-40 430 C100 380 260 470 400 420 C560 365 640 460 760 410'/%3E%3Cpath d='M-40 480 C100 430 260 520 400 470 C560 415 640 510 760 460'/%3E%3Cpath d='M-40 380 C100 330 260 420 400 370 C560 315 640 410 760 360'/%3E%3Cpath d='M120 760 C170 600 90 520 200 430 C300 350 260 260 330 190'/%3E%3Cpath d='M170 760 C215 610 140 525 245 440 C340 360 305 265 370 195'/%3E%3Cpath d='M70 760 C120 595 45 520 155 425 C255 345 215 255 285 185'/%3E%3C/g%3E%3C/svg%3E");
}
/* film grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E");
}

.app-header, main, .tab-bar { position: relative; z-index: 2; }

/* ---------- header ---------- */
.app-header { max-width: 1080px; margin: 0 auto; padding: 18px 16px 6px; }
.brand { display: flex; gap: 16px; align-items: stretch; }
.brand-logo {
  width: 148px; height: 148px; object-fit: cover; border-radius: 22px;
  box-shadow: var(--shadow); border: 1px solid var(--ink-line); flex: none;
}
.brand-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.brand-text h1 {
  font-family: var(--font-head); font-weight: 600; letter-spacing: .14em;
  font-size: clamp(30px, 5.4vw, 46px); margin: 0; line-height: 1;
  background: linear-gradient(180deg, #fdf8ea, #d9d2ba 70%, #b6ad8f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 0 rgba(0,0,0,.0);
}
.brand-sub { margin: 6px 0 10px; color: var(--paper-dim); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; }
.status-row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-family: var(--font-head); letter-spacing: .12em; font-size: 12px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ink-line);
  background: rgba(24,33,41,.85); color: var(--paper-dim);
}
.badge-ok { color: #cfe0a8; border-color: var(--olive-deep); background: rgba(85,102,58,.25); }
.badge-warn { color: var(--amber-hot); border-color: var(--amber-deep); background: rgba(156,107,30,.18); }
.brand-sign { height: 148px; width: auto; border-radius: 16px; margin-left: auto; box-shadow: var(--shadow); display: none; }
@media (min-width: 760px) { .brand-sign { display: block; } }
@media (max-width: 560px) { .brand-logo { width: 104px; height: 104px; border-radius: 18px; } }

.crisis-btn {
  margin-top: 14px; width: 100%; min-height: 58px; border: 0; cursor: pointer;
  border-radius: var(--radius); font-family: var(--font-head); font-size: 20px; letter-spacing: .18em;
  color: #fff7e8; background: linear-gradient(180deg, #c6453c, #9e2f27);
  box-shadow: 0 8px 22px rgba(158,47,39,.45), inset 0 1px 0 rgba(255,255,255,.25);
}
.crisis-btn:active { transform: translateY(1px); }

/* ---------- layout & cards ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 14px 16px 8px; }
.card {
  background: linear-gradient(180deg, rgba(31,43,54,.92), rgba(24,33,41,.94));
  border: 1px solid var(--ink-line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
  backdrop-filter: blur(2px);
}
.card h2, .card h3 { font-family: var(--font-head); letter-spacing: .08em; margin: 0 0 8px; font-weight: 600; }
.card h2 { font-size: 22px; }
.card h3 { font-size: 17px; color: var(--paper); }
.muted { color: var(--paper-dim); }
.small { font-size: 13px; }
.hint { color: var(--paper-dim); font-size: 13.5px; line-height: 1.45; }
.section-title {
  font-family: var(--font-head); font-size: 15px; letter-spacing: .22em; color: var(--amber-hot);
  text-transform: uppercase; margin: 22px 2px 10px; display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--amber-deep), transparent); }

/* readiness spine */
.spine { display: grid; gap: 10px; }
.spine-total { display: flex; align-items: baseline; gap: 10px; }
.spine-total .pct { font-family: var(--font-head); font-size: 44px; color: var(--amber-hot); line-height: 1; }
.spine-bar { height: 12px; border-radius: 999px; background: #0d1319; border: 1px solid var(--ink-line); overflow: hidden; }
.spine-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--olive), var(--amber)); transition: width .5s ease; }
.spine-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.spine-row { background: rgba(12,17,22,.5); border: 1px solid var(--ink-line); border-radius: var(--radius-sm); padding: 9px 11px; }
.spine-row .lbl { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-dim); }
.spine-row .val { font-family: var(--font-head); font-size: 19px; }

/* ---------- alerts ---------- */
.feed-line { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--paper-dim); }
.feed-line .ok { color: #cfe0a8; } .feed-line .bad { color: #f0a49e; }
.alert-card { border-left: 6px solid var(--olive); }
.alert-card.sev3 { border-left-color: #d9b23c; }
.alert-card.sev4 { border-left-color: var(--amber); }
.alert-card.sev5 { border-left-color: var(--red); }
.alert-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sev-chip {
  font-family: var(--font-head); letter-spacing: .1em; font-size: 12px; padding: 4px 10px;
  border-radius: 999px; background: rgba(138,154,91,.25); color: #d7e3b6; border: 1px solid var(--olive-deep);
}
.sev3 .sev-chip { background: rgba(217,178,60,.16); color: #eed88f; border-color: #8a7326; }
.sev4 .sev-chip { background: rgba(232,163,61,.16); color: var(--amber-hot); border-color: var(--amber-deep); }
.sev5 .sev-chip { background: rgba(217,83,74,.18); color: #f3b3ae; border-color: #8c332c; }
.alert-title { font-family: var(--font-head); font-size: 20px; letter-spacing: .04em; margin: 0; }
.alert-meta { color: var(--paper-dim); font-size: 13px; margin-top: 2px; }
.sowhat {
  margin-top: 10px; background: rgba(232,163,61,.08); border: 1px solid rgba(232,163,61,.35);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14.5px; line-height: 1.5;
}
.sowhat b { color: var(--amber-hot); font-family: var(--font-head); letter-spacing: .08em; font-size: 12.5px; display: block; margin-bottom: 2px; }
.linklike { color: var(--amber-hot); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
select, input, textarea {
  background: #0d1319; color: var(--paper); border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm); padding: 11px 12px; font: inherit; font-size: 15px; width: 100%;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--amber-deep); border-color: var(--amber); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row > * { min-width: 0; }
.grow { flex: 1; }

/* ---------- buttons & chips ---------- */
.btn {
  min-height: 48px; padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--ink-line); background: var(--ink-600); color: var(--paper);
  font-family: var(--font-head); letter-spacing: .08em; font-size: 15px; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-amber { background: linear-gradient(180deg, var(--amber-hot), var(--amber)); color: #241a05; border-color: var(--amber-deep); }
.btn-olive { background: linear-gradient(180deg, var(--olive), var(--olive-deep)); color: #f4f7e8; border-color: var(--olive-deep); }
.btn-ghost { background: transparent; }
.btn-big { width: 100%; min-height: 56px; font-size: 17px; margin-top: 10px; }
.btn-danger { background: linear-gradient(180deg, #c6453c, #9e2f27); color: #fff; border-color: #7c2d26; }
.chip {
  min-height: 44px; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-family: var(--font-head);
  letter-spacing: .06em; background: #0d1319; color: var(--paper-dim); border: 1px solid var(--ink-line);
}
.chip.on { background: var(--amber); color: #241a05; border-color: var(--amber-deep); }

/* ---------- tabs ---------- */
.tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(15,20,26,.96); border-top: 1px solid var(--ink-line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); backdrop-filter: blur(8px);
}
.tab-btn {
  border: 0; background: transparent; color: var(--paper-dim); cursor: pointer;
  font-family: var(--font-head); letter-spacing: .08em; font-size: 13.5px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px; border-radius: var(--radius-sm); min-height: 56px;
}
.tab-btn .tab-ico { font-size: 19px; }
.tab-btn.active { color: var(--amber-hot); background: rgba(232,163,61,.10); }

/* ---------- escape / pack / skills ---------- */
.rp-card .coords { font-variant-numeric: tabular-nums; color: var(--paper-dim); font-size: 13.5px; }
.map-frame { width: 100%; height: 300px; border: 0; border-radius: var(--radius-sm); background: #0d1319; }
.pack-item, .check-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; cursor: pointer;
  background: rgba(12,17,22,.45); border: 1px solid var(--ink-line); border-radius: var(--radius-sm); margin-bottom: 8px;
}
.check-item input { width: 24px; height: 24px; flex: none; margin-top: 1px; accent-color: var(--amber); }
.check-item.done .ci-t { color: var(--paper-dim); text-decoration: line-through; }
.ci-t { font-weight: 600; font-size: 15px; }
.ci-d { color: var(--paper-dim); font-size: 13px; }
.progress { height: 10px; border-radius: 999px; background: #0d1319; border: 1px solid var(--ink-line); overflow: hidden; margin: 8px 0 4px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--olive), var(--amber)); }
.guides-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.guide-card { padding: 0; overflow: hidden; cursor: pointer; text-align: left; color: var(--paper); font: inherit; width: 100%; }
.guide-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.guide-card .gc-body { padding: 13px 15px 15px; }
.guide-card .gc-body h3 { margin: 0 0 3px; }
.read-tag { font-size: 11.5px; letter-spacing: .1em; color: #cfe0a8; font-family: var(--font-head); }
.guide-hero { width: 100%; border-radius: var(--radius-sm); margin-bottom: 14px; box-shadow: var(--shadow); }
.step-row { display: flex; gap: 12px; margin-bottom: 12px; }
.step-num {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-head); font-size: 18px; background: var(--amber); color: #241a05;
  box-shadow: 0 3px 8px rgba(0,0,0,.4);
}
.caution {
  border: 1px solid #8c332c; background: rgba(217,83,74,.10); border-radius: var(--radius-sm);
  padding: 12px 14px; line-height: 1.5; font-size: 14.5px;
}
.caution b { color: #f3b3ae; font-family: var(--font-head); letter-spacing: .08em; display: block; font-size: 12.5px; margin-bottom: 2px; }
.kit-list { display: flex; flex-wrap: wrap; gap: 7px; }
.kit-list span { background: rgba(138,154,91,.16); border: 1px solid var(--olive-deep); color: #d7e3b6; border-radius: 999px; padding: 5px 11px; font-size: 13px; }

/* brief */
.brief-item h3 { font-size: 19px; }
.caught-up { text-align: center; padding: 26px 10px; color: var(--paper-dim); }
.caught-up .big { font-family: var(--font-head); font-size: 24px; color: var(--olive); letter-spacing: .1em; display: block; margin-bottom: 6px; }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; overflow-y: auto; padding: 18px 12px 40px;
  background: rgba(6,9,12,.82); backdrop-filter: blur(4px);
}
.sheet {
  max-width: 640px; margin: 0 auto; background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
  border: 1px solid var(--ink-line); border-radius: 22px; box-shadow: var(--shadow); padding: 22px;
  position: relative;
}
.sheet-wide { max-width: 820px; }
.sheet-logo { width: 100%; height: 150px; object-fit: cover; object-position: center 30%; border-radius: var(--radius-sm); margin-bottom: 14px; }
.sheet h2 { font-family: var(--font-head); letter-spacing: .06em; margin: 0 0 4px; font-size: 26px; }
.sheet-lede { color: var(--paper-dim); margin: 0 0 8px; line-height: 1.5; }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ink-line); background: rgba(12,17,22,.85); color: var(--paper); font-size: 17px; cursor: pointer; z-index: 2; }
.ob-step { border-top: 1px solid var(--ink-line); padding: 14px 0 4px; margin-top: 12px; }
.ob-step h3 { font-family: var(--font-head); letter-spacing: .06em; margin: 0 0 6px; font-size: 18px; }
.ob-step input { margin-bottom: 8px; }
.pack-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--ink-line); }
.pack-row:last-child { border-bottom: 0; }

/* crisis */
.crisis-overlay { position: fixed; inset: 0; z-index: 70; overflow-y: auto; background: linear-gradient(180deg, #180d0c, var(--ink-900)); padding: 22px 14px 40px; }
.crisis-inner { max-width: 680px; margin: 0 auto; }
.crisis-inner h2 { font-family: var(--font-head); font-size: 40px; letter-spacing: .12em; color: #f3b3ae; margin: 0; }
.crisis-sub { color: var(--paper-dim); margin: 2px 0 16px; }
.crisis-card { background: rgba(31,43,54,.9); border: 1px solid var(--ink-line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.crisis-card h3 { font-family: var(--font-head); font-size: 24px; margin: 0 0 4px; letter-spacing: .04em; }
.crisis-card .big-link { display: inline-block; margin-top: 8px; font-size: 18px; }
.tel-link { color: var(--amber-hot); font-size: 19px; font-weight: 600; text-decoration: none; }

/* ---------- print ---------- */
#print-area { display: none; }
@media print {
  body { background: #fff; padding: 0; }
  body::after, .topo-bg, .app-header, main, .tab-bar, .overlay, .crisis-overlay { display: none !important; }
  #print-area { display: block; color: #111; font-family: Georgia, serif; }
  #print-area h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: .04em; }
  #print-area h2 { font-size: 16px; margin: 18px 0 6px; border-bottom: 2px solid #111; padding-bottom: 3px; }
  #print-area table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  #print-area td, #print-area th { border: 1px solid #999; padding: 5px 7px; text-align: left; vertical-align: top; }
  #print-area img.strip { width: 100%; margin: 8px 0; }
  #print-area .cols { columns: 2; column-gap: 24px; font-size: 12.5px; }
  #print-area li { margin-bottom: 3px; }
  #print-area .foot { margin-top: 20px; font-size: 11px; color: #444; border-top: 1px solid #999; padding-top: 6px; }
}

/* ---------- overhaul: status line · official severity · map · people ---------- */
.status-line {
  margin-top: 12px; padding: 12px 16px; border-radius: var(--radius);
  font-family: var(--font-head); letter-spacing: .1em; font-size: 16px;
  border: 1px solid var(--ink-line); background: rgba(24,33,41,.9);
}
.status-line.quiet { color: #cfe0a8; border-color: var(--olive-deep); background: rgba(85,102,58,.22); }
.status-line.caution { color: var(--amber-hot); border-color: var(--amber-deep); background: rgba(156,107,30,.20); }
.status-line.alert {
  color: #ffd9d5; border-color: #8c332c;
  background: linear-gradient(180deg, rgba(198,69,60,.35), rgba(158,47,39,.30));
  animation: sl-pulse 2.2s ease-in-out infinite;
}
@keyframes sl-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(217,83,74,0); } 50% { box-shadow: 0 0 0 4px rgba(217,83,74,.25); } }

/* official severity chips — the sources' own scales */
.official-chip { font-family: var(--font-head); letter-spacing: .08em; font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid; }
.oc-red { background: rgba(217,83,74,.22); color: #ffb3ad; border-color: #a03d35; }
.oc-orange { background: rgba(224,123,57,.20); color: #ffc79b; border-color: #9c5a24; }
.oc-yellow { background: rgba(217,178,60,.18); color: #f0dd8e; border-color: #8a7326; }
.oc-olive { background: rgba(138,154,91,.25); color: #d7e3b6; border-color: var(--olive-deep); }
.oc-slate { background: rgba(125,140,163,.18); color: #c3cedd; border-color: #4c5a6e; }
.rank { font-family: var(--font-head); font-size: 11.5px; letter-spacing: .12em; color: var(--paper-dim); }
.alert-card.flash { animation: card-flash 1.6s ease; }
@keyframes card-flash { 0%,60% { box-shadow: 0 0 0 3px var(--amber-hot), var(--shadow); } 100% { box-shadow: var(--shadow); } }

/* live map */
.map-card { padding-bottom: 12px; }
#watch-map { height: 360px; border-radius: var(--radius-sm); background: #0d1319; border: 1px solid var(--ink-line); margin-top: 10px; z-index: 0; }
.map-dead { padding: 30px 14px; text-align: center; color: var(--paper-dim); font-size: 14px; }
.leaflet-container { font-family: var(--font-body); }
.leaflet-popup-content-wrapper { background: #182129; color: var(--paper); border-radius: 12px; border: 1px solid var(--ink-line); }
.leaflet-popup-tip { background: #182129; }
.leaflet-popup-content { font-size: 13.5px; line-height: 1.45; }
.leaflet-bar a { background: #182129; color: var(--paper); border-color: var(--ink-line); }
.rp-pin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0,0,0,.55); box-shadow: 0 1px 5px rgba(0,0,0,.6); }
.rp-pin.oc-red { background: #e2483d; } .rp-pin.oc-orange { background: #e07b39; }
.rp-pin.oc-yellow { background: #d9b23c; } .rp-pin.oc-olive { background: #8a9a5b; } .rp-pin.oc-slate { background: #7d8ca3; }
.rp-pin.pulse { animation: pin-pulse 1.8s ease-out infinite; }
@keyframes pin-pulse { 0% { box-shadow: 0 0 0 0 rgba(232,72,61,.55); } 100% { box-shadow: 0 0 0 14px rgba(232,72,61,0); } }
.rp-home { width: 18px; height: 18px; background: var(--olive); border: 2px solid #eef3da; transform: rotate(45deg); border-radius: 4px; box-shadow: 0 1px 6px rgba(0,0,0,.6); }

/* your people */
.ppl-summary { font-family: var(--font-head); letter-spacing: .06em; font-size: 16px; color: var(--amber-hot); margin: 4px 0 6px; }
.ppl-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px dashed var(--ink-line); }
.ppl-row:last-child { border-bottom: 0; }
.ppl-toggles { display: flex; gap: 7px; flex-wrap: wrap; }
.ppl-toggle { min-height: 42px; padding: 7px 13px; border-radius: 999px; cursor: pointer; font-family: var(--font-head); letter-spacing: .05em; font-size: 13.5px; background: #0d1319; color: var(--paper-dim); border: 1px solid var(--ink-line); }
.ppl-toggle.on { background: rgba(138,154,91,.28); color: #d7e3b6; border-color: var(--olive-deep); }
.ppl-toggle.on.conf { background: rgba(232,163,61,.25); color: var(--amber-hot); border-color: var(--amber-deep); }
