@font-face { font-family: 'Druk'; src: url('/fonts/Druk-Bold.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Druk Wide'; src: url('/fonts/DrukTextWide-Medium.ttf') format('truetype'); font-display: swap; }

:root {
  --navy: #011689;
  --blue: #257CE1;
  --white: #ffffff;
  --ink: #0b1440;
  --dim: rgba(255, 255, 255, 0.7);
  --line: rgba(255, 255, 255, 0.16);
  --panel: 400px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--navy);
  color: var(--white);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: grid;
  grid-template-columns: var(--panel) 1fr;
  height: 100dvh;
  overflow: hidden;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.panel {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 18px 14px;
  background: linear-gradient(180deg, var(--navy) 0%, #0a2aa8 100%);
  overflow: hidden; min-height: 0;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { height: 70px; width: auto; flex: none; }
h1 {
  font-family: 'Druk', Impact, sans-serif; font-weight: 700; text-transform: uppercase;
  font-size: 40px; line-height: 1.02; margin: 0; letter-spacing: 1.6px;
}
.sub, .nearest, .chip, .status, .foot, .list .chain, dialog button {
  font-family: 'Druk Wide', -apple-system, sans-serif;
}
.sub { margin: 6px 0 0; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.4px; }

.nearest {
  width: 100%; padding: 15px 16px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--white); color: var(--navy); font-size: 14px; text-transform: uppercase;
}
.nearest:active { transform: scale(0.98); }
.nearest[aria-busy='true'] { opacity: 0.7; }

.search input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1); color: var(--white); font-size: 16px;
}
.search input::placeholder { color: var(--dim); }
.search input:focus { outline: 2px solid var(--blue); border-color: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--white);
  padding: 7px 11px; border-radius: 999px; font-size: 11px; cursor: pointer; text-transform: uppercase;
}
.chip[aria-pressed='true'] { background: var(--blue); border-color: var(--blue); }
.chip small { opacity: 0.7; margin-left: 4px; }

.status { margin: 2px 0 -6px; font-size: 11px; color: var(--dim); text-transform: uppercase; }
.list { list-style: none; margin: 0 -18px; padding: 0 18px; overflow-y: auto; flex: 1; min-height: 0; }
.list li { border-top: 1px solid var(--line); }
.list button {
  all: unset; box-sizing: border-box; width: 100%; padding: 11px 2px; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
}
.list button:hover .name, .list button:focus-visible .name { color: #9cc6ff; }
.list .name, .list .addr, .list .chain { grid-column: 1; }
.list .name { font-weight: 700; font-size: 15px; }
.list .dist { grid-column: 2; grid-row: 1 / span 3; align-self: center; font-weight: 700; color: #9cc6ff; font-size: 14px; }
.list .addr { font-size: 13px; color: var(--dim); }
.list .chain { font-size: 9px; text-transform: uppercase; color: var(--dim); letter-spacing: 0.3px; }

.foot { font-size: 9px; color: var(--dim); text-transform: uppercase; line-height: 1.5; }

#map { height: 100%; background: #dfe7f3; }

/* Jelölő: a valódi villám-logó sötétkék körben */
.pin {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--navy); border: 2px solid var(--white); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  display: grid; place-items: center;
}
.leaflet-marker-icon .pin img { width: 15px !important; height: auto !important; transform: rotate(45deg); }
.pin.on { background: var(--blue); }
.me { width: 18px; height: 18px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(37, 124, 225, 0.3); }
.cluster {
  display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800;
  background: var(--navy); border: 3px solid rgba(255, 255, 255, 0.95); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-family: 'Druk Wide', sans-serif; font-size: 13px;
}

.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 14px 16px; color: var(--ink); font-size: 14px; min-width: 210px; }
.pop h3 { margin: 0 0 2px; font-size: 17px; }
.pop .chain { font-size: 11px; text-transform: uppercase; color: var(--blue); font-weight: 700; }
.pop p { margin: 6px 0; }
.pop .note { color: #555; font-style: italic; }
.pop .actions { display: flex; gap: 8px; margin-top: 10px; }
.pop a.go {
  flex: 1; text-align: center; background: var(--navy); color: #fff !important; text-decoration: none;
  padding: 9px 10px; border-radius: 10px; font-weight: 700;
}
.pop button.bad { border: 0; background: #eef2fb; color: var(--navy); border-radius: 10px; padding: 9px 10px; cursor: pointer; }

dialog {
  border: 0; border-radius: 18px; padding: 20px; width: min(420px, calc(100vw - 32px));
  color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
dialog::backdrop { background: rgba(1, 22, 137, 0.55); }
dialog h2 { margin: 0 0 4px; font-family: 'Druk', Impact, sans-serif; text-transform: uppercase; font-size: 30px; color: var(--navy); font-weight: 700; letter-spacing: 1.4px; line-height: 1.05; }
dialog fieldset { border: 0; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
dialog textarea { width: 100%; border-radius: 10px; border: 1px solid #c9d3ea; padding: 10px; font: inherit; resize: vertical; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
dialog button { border: 0; border-radius: 10px; padding: 10px 16px; background: var(--navy); color: #fff; cursor: pointer; text-transform: uppercase; font-size: 12px; }
dialog button.ghost { background: #eef2fb; color: var(--navy); }
.muted { color: #5a6380; font-size: 13px; margin: 4px 0; }

.suggest-btn {
  width: 100%; padding: 13px 16px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.1); color: var(--white);
  font-family: 'Druk Wide', -apple-system, sans-serif; font-size: 12px; letter-spacing: 0.3px; text-transform: uppercase;
  -webkit-appearance: none; appearance: none;
}
.suggest-btn:hover { background: rgba(255, 255, 255, 0.18); }
.suggest-btn:active { transform: scale(0.98); }

dialog.wide { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
dialog .lbl { display: block; font-weight: 700; font-size: 13px; margin-bottom: 4px; color: var(--navy); }
dialog .field { display: block; margin: 12px 0; }
dialog .field input:not([type=file]), dialog .field textarea {
  width: 100%; border-radius: 10px; border: 1px solid #c9d3ea; padding: 10px; font: inherit; font-size: 16px;
}
dialog .small { font-size: 12px; display: block; margin-top: 4px; }
dialog .seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
dialog .seg label { position: relative; }
dialog .seg input { position: absolute; opacity: 0; }
dialog .seg span {
  display: block; text-align: center; padding: 12px 8px; border-radius: 12px; border: 1.5px solid #c9d3ea;
  font-weight: 700; cursor: pointer; color: var(--navy);
}
dialog .seg input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
dialog .seg input:focus-visible + span { outline: 2px solid var(--blue); }
dialog .checks { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
dialog .checks .lbl { width: 100%; margin: 0; }
.pick-map { height: 230px; border-radius: 12px; overflow: hidden; border: 1px solid #c9d3ea; }
.pick-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.photo-preview { max-width: 100%; max-height: 180px; border-radius: 10px; display: block; }
.photo-preview[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: #5a6380; margin-top: 8px; }
.consent input { margin-top: 2px; flex: none; }

/* Telefon: fent a vezérlők, középen a térkép, alatta a lista */
@media (max-width: 820px) {
  body { display: flex; flex-direction: column; height: auto; min-height: 100dvh; overflow: auto; }
  .panel { display: contents; }
  .brand { order: 1; padding: calc(14px + env(safe-area-inset-top)) 16px 0; }
  .logo { height: 54px; }
  h1 { font-size: 32px; }
  .nearest { order: 2; margin: 0 16px; width: auto; }
  .search { order: 3; padding: 0 16px; }
  .chips { order: 4; padding: 0 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chip { flex: none; }
  #map { order: 5; height: 58dvh; min-height: 320px; flex: none; }
  .suggest-btn { order: 6; margin: 0 16px; width: auto; }
  .status { order: 6; margin: 0; padding: 0 16px; }
  .list { order: 7; margin: 0; padding: 0 16px; overflow: visible; }
  .foot { order: 8; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
  .brand, .nearest, .search, .chips { margin-bottom: 0; }
  body > * + * { margin-top: 0; }
  body { gap: 12px; }
}
