:root {
  color-scheme: dark;
  --bg: #091311;
  --panel: #12221e;
  --line: #2a4038;
  --text: #eef5f1;
  --muted: #b2c4bb;
  --accent: #9ee5bc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.55 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px max(20px, calc((100vw - 1420px) / 2));
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
  font-size: 21px;
}
.brand small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.badge {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent);
  font-size: 12px;
}
.safety {
  padding: 10px 24px;
  background: #203025;
  color: #dbe8da;
  font-size: 13px;
  text-align: center;
}
nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px max(20px, calc((100vw - 1420px) / 2));
  border-bottom: 1px solid var(--line);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #10221a;
  padding: 9px 15px;
  font-weight: 650;
  cursor: pointer;
}
button:hover {
  filter: brightness(1.1);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.secondary,
nav button {
  background: #1b3028;
  border-color: #3a5447;
  color: var(--text);
}
nav button {
  white-space: nowrap;
}
nav button.active {
  background: var(--accent);
  color: #10221a;
}
.danger {
  background: #4b2525;
  color: #ffd6d6;
  border-color: #9d5b5b;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #e1bd65;
  outline-offset: 3px;
}
main {
  max-width: 1460px;
  margin: auto;
  padding: 20px;
}
.view {
  display: none;
}
.view.active {
  display: block;
}
#appStatus {
  max-width: 1420px;
  margin: 14px auto 0;
  padding: 0 20px;
  color: var(--muted);
  font-size: 14px;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 12px 0 24px;
}
.intro p {
  max-width: 820px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}
h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  margin: 8px 0 14px;
  letter-spacing: -0.04em;
}
h2 {
  font-size: 20px;
  line-height: 1.3;
  margin: 0 0 12px;
}
h3 {
  font-size: 17px;
  margin: 6px 0;
}
p {
  color: var(--muted);
  margin: 9px 0 16px;
}
a {
  color: var(--accent);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  min-width: 0;
}
.notice {
  background: #302a1c;
  border: 1px solid #776039;
  color: #f2d8a6;
  padding: 13px 16px;
  border-radius: 9px;
  margin-bottom: 18px;
  font-size: 14px;
}
.notice:empty {
  display: none;
}
.notice strong {
  display: block;
  overflow-wrap: anywhere;
}
.notice p:last-child {
  margin-bottom: 0;
}
.notice a {
  overflow-wrap: anywhere;
}
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr auto;
  gap: 14px;
  align-items: end;
}
.scout-panel {
  margin: 18px 0;
}
.check-label {
  flex-direction: row;
  align-items: center;
  gap: 9px;
}
.check-label input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  flex-shrink: 0;
}
.button-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
  margin-bottom: 10px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #486053;
  border-radius: 7px;
  background: #0a1812;
  color: var(--text);
  padding: 10px;
  min-height: 44px;
}
textarea {
  resize: vertical;
}
input[type="file"] {
  max-width: 100%;
}
.planner-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
  margin: 18px 0;
}
.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 18px 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.map-panel {
  padding: 0;
  overflow: hidden;
}
.map-toolbar {
  padding: 14px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.map-toolbar label {
  margin: 0;
  max-width: 160px;
}
#radarMap {
  height: 520px;
  background: #1b2d26;
  z-index: 1;
}
.map-panel > p {
  padding: 0 14px;
  font-size: 12px;
}
.feed {
  max-height: 510px;
  overflow: auto;
}
.prospect {
  display: block;
  text-align: left;
  width: 100%;
  margin: 7px 0;
  background: #1a3027;
  border: 1px solid #3a5447;
  color: var(--text);
  padding: 13px;
}
.prospect.selected {
  border-color: var(--accent);
  background: #274637;
}
.prospect small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
  margin-top: 5px;
}
.source-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #f0cb87;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.metric {
  padding: 10px;
  background: #0c1b14;
  border-radius: 7px;
}
.metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.estimate {
  padding: 12px;
  background: #0b1a13;
  border-radius: 9px;
  margin: 15px 0;
  min-height: 50px;
}
.worksheet-example {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #091811;
  padding: 12px;
  border-radius: 8px;
  font:
    13px/1.6 ui-monospace,
    monospace;
}
summary {
  cursor: pointer;
  color: var(--accent);
  min-height: 44px;
  padding: 10px 0;
}
.estimate strong {
  display: block;
  font-size: 26px;
  color: var(--accent);
}
#estimateError {
  color: #ffb6ac;
}
#savedNotes .panel {
  margin: 14px 0;
}
.cluster {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.stat {
  font-size: 17px;
  white-space: nowrap;
  color: var(--accent);
}
footer {
  max-width: 1460px;
  margin: 30px auto;
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 15px;
  background: #fff;
  color: #000;
  padding: 8px;
  z-index: 9999;
}
.skip-link:focus {
  top: 10px;
}
.empty {
  padding: 18px;
  color: var(--muted);
}
.note-meta {
  font-size: 12px;
  color: var(--muted);
}
ul,
ol {
  padding-left: 22px;
}
#quoteDraft {
  font-family: inherit;
  font-size: 14px;
}
#inspector {
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 760px) {
  header {
    padding: 16px;
  }
  .brand {
    font-size: 18px;
  }
  header > .badge {
    display: none;
  }
  nav {
    padding: 12px 14px;
  }
  main {
    padding: 14px;
  }
  .intro {
    display: block;
  }
  .intro .stat {
    display: block;
    margin-top: 12px;
  }
  .controls,
  .planner-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }
  .controls {
    gap: 4px;
  }
  .panel {
    padding: 16px;
  }
  .map-panel {
    padding: 0;
  }
  #radarMap {
    height: 340px;
  }
  .feed {
    max-height: 460px;
  }
  .safety {
    padding: 10px 14px;
    text-align: left;
  }
  .button-pair button {
    flex: 1;
    min-width: 130px;
  }
}
@media (max-width: 380px) {
  .form-grid,
  .filters,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .brand small {
    font-size: 11px;
  }
  .panel {
    padding: 12px;
  }
  .map-panel {
    padding: 0;
  }
}
@media print {
  header,
  nav,
  .safety,
  .button-pair,
  button,
  footer,
  #appStatus {
    display: none;
  }
  .view {
    display: none !important;
  }
  #debrief {
    display: block !important;
  }
  body {
    color: #000;
    background: #fff;
  }
  .panel {
    background: #fff;
    color: #000;
    border: 1px solid #aaa;
  }
  p,
  label {
    color: #222;
  }
  .lower-grid {
    display: block;
  }
  input,
  select,
  textarea {
    color: #000;
    background: #fff;
  }
}
