:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --panel: rgba(255, 255, 255, 0.92);
  --ink: #1d1b18;
  --muted: #6d6258;
  --line: #e7ded4;
  --accent: #e94722;
  --accent-dark: #b72d14;
  --gold: #f7b731;
  --shadow: 0 24px 80px rgba(30, 20, 10, 0.18);
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); overflow: hidden; }

.app-shell { display: grid; grid-template-columns: minmax(330px, 420px) 1fr; height: 100vh; padding: 18px; gap: 18px; }
.panel { background: var(--panel); backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,.65); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; overflow: auto; z-index: 2; }
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.brand__icon { width: 48px; height: 48px; display: grid; place-items: center; background: #1d1b18; color: white; border-radius: 16px; font-size: 25px; }
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: .11em; text-transform: uppercase; font-size: 11px; margin: 0 0 3px; }
h1 { font-size: clamp(28px, 4vw, 42px); line-height: .95; margin: 0; letter-spacing: -.04em; }
.route-form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: 13px; }
input, select { width: 100%; border: 1px solid var(--line); background: #fffaf5; color: var(--ink); padding: 14px 15px; border-radius: 16px; font: inherit; outline: none; transition: border .16s, box-shadow .16s; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(233, 71, 34, .14); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
button { border: 0; cursor: pointer; font: inherit; }
#routeButton { margin-top: 4px; border-radius: 18px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: white; font-weight: 900; padding: 15px 18px; box-shadow: 0 12px 26px rgba(233, 71, 34, .25); }
#routeButton:disabled { opacity: .62; cursor: progress; }

.external-map { display: block; text-align: center; border-radius: 18px; background: #fffaf5; color: var(--accent-dark); font-weight: 900; padding: 13px 16px; border: 1px solid rgba(233, 71, 34, .25); text-decoration: none; transition: border .16s, transform .16s, box-shadow .16s; }
.external-map:hover { border-color: rgba(233, 71, 34, .55); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(233, 71, 34, .12); }
.hidden { display: none !important; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 12px; }
.stats div { background: #fffaf5; border: 1px solid var(--line); border-radius: 18px; padding: 13px; }
.stats strong { display: block; font-size: 23px; letter-spacing: -.04em; }
.stats span { color: var(--muted); font-size: 12px; font-weight: 800; }
.status { background: #1d1b18; color: white; border-radius: 16px; padding: 12px 14px; font-size: 13px; line-height: 1.45; }
.fires-section { margin-top: 20px; }
.section-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.ghost { color: var(--accent); background: transparent; font-weight: 900; padding: 8px; }
.fires-list { display: grid; gap: 10px; margin-top: 12px; }
.fire-item { width: 100%; display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; text-align: left; background: #fffaf5; border: 1px solid var(--line); border-radius: 16px; padding: 12px; color: var(--ink); }
.fire-item:hover { border-color: rgba(233, 71, 34, .45); transform: translateY(-1px); }
.fire-item__marker { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(233, 71, 34, .11); }
.fire-item__content strong { display: block; font-size: 14px; }
.fire-item__content small { color: var(--muted); display: block; margin-top: 2px; }
.fire-item__distance { font-size: 12px; font-weight: 900; color: var(--accent-dark); }
.map-area { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); background: #ddd; }
#map { height: 100%; min-height: 480px; }
.legend { position: absolute; left: 18px; right: 18px; bottom: 18px; display: flex; gap: 10px; flex-wrap: wrap; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.7); border-radius: 18px; padding: 10px 12px; box-shadow: 0 10px 24px rgba(0,0,0,.12); font-size: 12px; font-weight: 800; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.dot.high { background: #d72612; }
.dot.medium { background: #f37021; }
.dot.low { background: #f7b731; }
.line { display: inline-block; width: 22px; height: 8px; border-bottom: 3px solid rgba(233, 71, 34, .42); margin-right: 5px; }
.empty { color: var(--muted); font-size: 14px; line-height: 1.5; background: #fffaf5; border: 1px dashed var(--line); border-radius: 16px; padding: 14px; }
@media (max-width: 860px) {
  body { overflow: auto; }
  .app-shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; padding: 10px; }
  .panel { order: 2; border-radius: 20px; }
  .map-area { order: 1; height: 58vh; min-height: 420px; border-radius: 20px; }
  .form-grid { grid-template-columns: 1fr; }
}
