/* Working look only: the real one comes from the mood board Joe picks. */
:root {
  --bg: #14171a;
  --panel: #1d2125;
  --line: #2c3238;
  --text: #e8eaec;
  --muted: #9aa3ab;
  --accent: #f2b33d;
  --good: #6fd08c;
  --warn: #ff8a5c;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
}
.brand { font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.brand .sub { color: var(--accent); font-weight: 600; margin-left: 4px; }
.updated { color: var(--muted); font-size: 12px; }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 16px 10px;
}
.tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
}
.tabs button[aria-selected="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); }

/* Grows with a long tips list, so the page scrolls and the footer stays below it. */
main { flex: 1 0 auto; display: flex; }
.view { display: none; flex: 1; flex-direction: column; min-width: 0; }
.view.active { display: flex; }

#map {
  flex: 1;
  min-height: 60dvh;
  margin: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #0d0f11;
}
.map-missing { color: var(--muted); margin: 8px 16px; font-size: 13px; }

.filters { padding: 0 16px 8px; }
input[type="search"], select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips button {
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
}
.chips button[aria-pressed="true"] { color: var(--bg); background: var(--text); border-color: var(--text); }

.tip-list, .key-list { list-style: none; margin: 0; padding: 0 16px 16px; }

.tip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
}
.tip .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.tip .kind {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.tip .text { margin: 6px 0 8px; }
.tip .place { color: var(--text); background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.tip .src { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.tip a { color: var(--accent); }
.tip.old { opacity: 0.6; }
.conf-low { color: var(--warn); }
.conf-high { color: var(--good); }

.run-setup { padding: 0 16px 8px; }
.field { display: block; color: var(--muted); font-size: 13px; }
.field select { margin-top: 4px; }
.hint { color: var(--muted); font-size: 13px; }
.key-list { padding: 8px 0 0; max-height: 40dvh; overflow-y: auto; }
.key-list label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 44px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.key-list input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.key-list small { display: block; color: var(--muted); }
.run-actions { display: flex; gap: 8px; margin: 12px 0; }
.run-actions button {
  flex: 1;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 600;
}
.run-actions .primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.scan {
  margin: 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0 12px;
}
.scan summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.scan[open] { padding-bottom: 12px; }
.file-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  cursor: pointer;
}
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.scan textarea {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.scan > button {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
}
.scan-result { color: var(--good); font-size: 13px; }
.scan-result:empty { display: none; }

.run-options { list-style: none; margin: 0; padding: 0 16px 16px; }
.run-options > .hint { margin: 4px 0 10px; }
.option {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.option.open { border-color: var(--accent); }
.option-head {
  display: block;
  width: 100%;
  padding: 12px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.option-title { display: block; font-weight: 800; font-size: 16px; }
.option-meta { display: block; color: var(--accent); font-size: 13px; font-weight: 600; margin-top: 2px; }
.option-why { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.option-path { display: block; font-size: 12px; margin-top: 6px; }
.option .steps { list-style: none; margin: 0; padding: 0 12px; }
.option:not(.open) .steps { display: none; }
.option.open .steps { padding-bottom: 12px; }
.steps li { border-left: 3px solid var(--accent); padding: 6px 10px; margin-bottom: 6px; }
.steps h3 { margin: 0 0 2px; font-size: 15px; }
.steps p { margin: 4px 0; color: var(--muted); font-size: 13px; }

.stop-label {
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 800;
  text-align: center;
  line-height: 24px;
  border: 2px solid #000;
}

.leaflet-tooltip.place-label {
  background: rgba(13, 15, 17, 0.8);
  border: 0;
  box-shadow: none;
  color: var(--text);
  font: 600 11px/1.2 system-ui, sans-serif;
  padding: 2px 6px;
}
.leaflet-tooltip.place-label::before { display: none; }

.leaflet-popup-content { font: 13px/1.4 system-ui, sans-serif; max-width: 260px; }
.leaflet-popup-content h4 { margin: 0 0 6px; font-size: 14px; }
.leaflet-popup-content ul { margin: 0; padding-left: 16px; }

.foot { color: var(--muted); font-size: 11px; padding: 8px 16px 16px; }

@media (min-width: 900px) {
  .tabs { max-width: 480px; }
  .tip-list, .filters, .run-setup, .run-options { max-width: 760px; }
}
