/* Mission automator. RedEast palette only: charcoal, gray #9C9C9C, red #ED2839,
   black and white. No invented brand colours. */

@font-face {
  font-family: "Cabinet Grotesk";
  src: url("./assets/fonts/CabinetGrotesk-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #080808;
  --panel: #101010;
  --panel-2: #151515;
  --line: #242424;
  --charcoal: #363636;
  --gray: #9c9c9c;
  --white: #ffffff;
  --red: #ed2839;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--white);
  font-family: "Cabinet Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

h1 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray);
  margin: 34px 0 12px;
}

/* ---------- header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--line);
}

.top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand { height: 22px; width: auto; display: block; }
.divider { width: 1px; height: 18px; background: var(--line); }

.lede {
  color: var(--gray);
  font-size: 14px;
  line-height: 1.6;
  margin: 18px 0 22px;
  max-width: 62ch;
}

.hint { color: var(--gray); font-size: 12.5px; line-height: 1.6; margin: 10px 0 0; }

/* ---------- buttons ---------- */

.ghost, .primary {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--charcoal);
  padding: 7px 12px;
}

.ghost:hover { border-color: var(--gray); }
.ghost.small { padding: 4px 9px; font-size: 12px; }

.primary {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  border: 1px solid var(--red);
  padding: 12px 20px;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
}

.primary:hover { opacity: 0.9; }
.primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- tabs ---------- */

.tabs { display: flex; gap: 8px; margin: 0 0 14px; }

.tab {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
}

.tab:hover { color: var(--white); border-color: var(--charcoal); }
.tab[aria-selected="true"] {
  color: var(--white);
  border-color: var(--white);
  background: var(--panel-2);
}

/* ---------- drop zone ---------- */

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 132px;
  border: 1px dashed var(--charcoal);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  text-align: center;
  padding: 20px;
}

.drop:hover, .drop.over { border-color: var(--red); }
.drop-title { font-size: 14px; }
.drop-sub { color: var(--gray); font-size: 12.5px; }

/* ---------- map ---------- */

.map {
  height: 340px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  z-index: 0;
}

.leaflet-container { background: #0a0a0a; }

.pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--white);
  color: var(--white);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.pin.home { border-color: var(--red); color: var(--red); }

/* ---------- tables ---------- */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
  background: var(--panel);
}

table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  white-space: nowrap;
}

th {
  color: var(--gray);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  background: var(--panel-2);
}

tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--mono); color: var(--gray); }
td.coord { font-family: var(--mono); }

td input {
  width: 68px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--white);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 4px 6px;
}

td button {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 7px;
  cursor: pointer;
}

td button:hover { color: var(--red); border-color: var(--red); }

/* ---------- form ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--gray); font-size: 12px; }

.field input, .field select {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--white);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 10px;
  width: 100%;
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--white);
}

#btn-build { margin-top: 18px; }
[hidden] { display: none !important; }

/* ---------- result ---------- */

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--gray);
}

.summary b { color: var(--white); font-weight: 600; }

.errors {
  border: 1px solid var(--red);
  background: rgba(237, 40, 57, 0.08);
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.6;
}

.errors ul { margin: 6px 0 0; padding-left: 18px; }

.download { margin-top: 16px; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--gray);
  font-size: 11.5px;
}

@media (max-width: 560px) {
  body { padding: 0 14px 48px; }
  .map { height: 260px; }
  .top-left h1 { font-size: 15px; }
  .foot { flex-direction: column; gap: 4px; }
}
