/* Hol vagyok most? – stíluslap */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2");
}

:root {
  --bg: #F3F5F9;
  --card: #FFFFFF;
  --bar: rgba(255, 255, 255, 0.92);
  --line: #E2E7EF;
  --text: #0F172A;
  --muted: #566175;
  --chip: #EEF1F6;
  --accent: #F5A524;
  --accent-hover: #E6951A;
  --accent-text: #B45309;
  --on-accent: #1A1204;
  --good: #047857;   --good-bg: #D1FAE5;
  --ok: #1D4ED8;     --ok-bg: #DBEAFE;
  --fair: #B45309;   --fair-bg: #FEF3C7;
  --poor: #B91C1C;   --poor-bg: #FEE2E2;
  --danger: #DC2626; --danger-hover: #B91C1C;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
  --radius: 20px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0B1220;
  --card: #131C2E;
  --bar: rgba(14, 22, 38, 0.92);
  --line: #22304A;
  --text: #E8EDF5;
  --muted: #9AA8BD;
  --chip: #18233A;
  --accent-text: #F5A524;
  --good: #34D399;   --good-bg: rgba(52, 211, 153, 0.14);
  --ok: #7FB0FF;     --ok-bg: rgba(127, 176, 255, 0.14);
  --fair: #FBBF24;   --fair-bg: rgba(251, 191, 36, 0.14);
  --poor: #F87171;   --poor-bg: rgba(248, 113, 113, 0.15);
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent-text); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ic { flex: none; display: block; }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 14px; border-radius: 10px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Fejléc ---------- */
.topbar { padding-top: max(12px, env(safe-area-inset-top)); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; flex: none; border-radius: 12px;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: flex; padding: 3px; border-radius: 12px; background: var(--chip); border: 1px solid var(--line); }
.lang-switch a {
  display: flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 9px;
  color: var(--muted); font-size: 12.5px; font-weight: 700; text-decoration: none;
}
.lang-switch a[aria-current] { background: var(--card); color: var(--text); box-shadow: var(--shadow); pointer-events: none; }

.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  border: 1px solid var(--line); background: var(--chip); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s;
}
.icon-btn:hover { border-color: var(--muted); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn-sm { width: 36px; height: 36px; border-radius: 10px; background: transparent; color: var(--muted); }
.icon-btn.is-done { color: var(--good); border-color: var(--good); }
/* Témaváltó: a gomb a választást mutatja, a menü a három lehetőséget */
.theme-wrap { position: relative; }
#themeToggle > span { display: none; }
[data-pref="auto"] #themeToggle .i-auto, [data-pref="light"] #themeToggle .i-sun, [data-pref="dark"] #themeToggle .i-moon { display: inline-flex; }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 1200; min-width: 220px; padding: 6px; white-space: nowrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .14);
}
.theme-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--text); font: inherit; font-size: 14.5px; font-weight: 600; text-align: left; cursor: pointer;
}
.theme-menu button:hover, .theme-menu button:focus-visible { background: var(--chip); outline: none; }
.theme-menu button[aria-checked="true"] { background: var(--fair-bg); }
.theme-menu .tm-ck { margin-left: auto; color: var(--accent-text); visibility: hidden; display: inline-flex; }
.theme-menu button[aria-checked="true"] .tm-ck { visibility: visible; }
[data-theme="dark"] .theme-menu { box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }

.lang-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 12px; background: var(--chip); border-bottom: 1px solid var(--line); font-size: 14px;
}
.lang-banner a { font-weight: 700; text-decoration: none; }
.lang-banner-close { border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px; }

/* ---------- Kártyák és alap elemek ---------- */
main { padding-top: 8px; padding-bottom: 40px; }
.view-home main { padding-bottom: 140px; }
.app, .shared { display: flex; flex-direction: column; gap: 14px; }
.intro { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 4px; }
.intro h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.lead { color: var(--muted); font-size: 15px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--accent-text); }
.label { font-size: 12px; font-weight: 600; color: var(--muted); }
.section-label { font-size: 12px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--chip); color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.chip-acc { font-weight: 700; }
.chip-acc[data-level="excellent"] { background: var(--good-bg); color: var(--good); }
.chip-acc[data-level="good"]      { background: var(--ok-bg);   color: var(--ok); }
.chip-acc[data-level="fair"]      { background: var(--fair-bg); color: var(--fair); }
.chip-acc[data-level="poor"]      { background: var(--poor-bg); color: var(--poor); }
.chip-warn { background: var(--fair-bg); color: var(--fair); font-weight: 700; }

/* ---------- Gombok ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent;
  font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--line); }
.btn-danger { background: var(--danger); color: #FFFFFF; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; border-radius: 18px; font-size: 17px; font-weight: 800; }

/* ---------- Állapotkártya ---------- */
.status { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.status-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.status-label { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.status[data-state="locating"] .dot,
.status[data-state="jump"] .dot,
.status[data-state="improving"] .dot { background: var(--accent); animation: pulse 1.4s ease-out infinite; }
.status[data-state="ready"] .dot { background: var(--good); box-shadow: 0 0 0 4px var(--good-bg); }
.status[data-state="error"] .dot { background: var(--poor); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 165, 36, .55); }
  100% { box-shadow: 0 0 0 10px rgba(245, 165, 36, 0); }
}
.coords { font-size: 24px; font-weight: 600; letter-spacing: -0.5px; line-height: 1.25; word-break: break-word; }
.status[data-state="idle"] .coords, .status[data-state="error"] .coords { color: var(--muted); opacity: .6; }
.status-error { display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; color: var(--poor); }
.help { color: var(--text); background: var(--chip); border-radius: 12px; padding: 10px 12px; }
.help summary { cursor: pointer; font-weight: 700; color: var(--accent-text); }
.help-body { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.help-body strong { color: var(--text); }

/* ---------- Térkép ---------- */
.map-card { position: relative; height: 220px; overflow: hidden; padding: 0; isolation: isolate; }
.map-card-lg { height: 300px; }
.map { position: absolute; inset: 0; background: var(--chip); z-index: 0; }
.map-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); opacity: .5; pointer-events: none; z-index: 1;
}
.map-center { position: absolute; right: 10px; bottom: 10px; z-index: 500; background: var(--card); width: 40px; height: 40px; }
.leaflet-container { font-family: var(--font); background: var(--chip); }
.leaflet-control-attribution { font-size: 10px; }
[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.6); }
[data-theme="dark"] .leaflet-control-attribution { background: rgba(19, 28, 46, .8) !important; color: var(--muted); }
[data-theme="dark"] .leaflet-control-attribution a { color: var(--accent-text); }
.leaflet-touch .leaflet-bar { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.leaflet-touch .leaflet-bar a { background: var(--card); color: var(--text); border-bottom-color: var(--line); width: 38px; height: 38px; line-height: 38px; }
.leaflet-touch .leaflet-bar a:hover { background: var(--chip); }
.hvm-pin { background: none; border: 0; }
.hvm-pin span {
  display: block; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); border: 4px solid #FFFFFF; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

/* ---------- Cím ---------- */
.addr-card { padding: 14px 14px 14px 16px; display: flex; align-items: center; gap: 12px; }
.addr-icon {
  width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--chip); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
}
.addr-body, .info-body { flex: 1; min-width: 0; }
.addr-text { font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }

/* ---------- Csempék ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  min-height: 94px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  box-shadow: var(--shadow); padding: 14px; text-align: left; text-decoration: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px;
  font-size: 14.5px; font-weight: 700; line-height: 1.25;
  transition: border-color .15s, transform .1s, background .15s;
}
.tile .ic { color: var(--accent-text); }
.tile:hover { border-color: var(--accent); }
.tile:active { transform: scale(0.97); }
.tile:disabled, .tile.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.tile.is-done, .pill.is-done, .share-opt.is-done { border-color: var(--good); }
.tile.is-done .ic { color: var(--good); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--chip); color: var(--text);
  font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.pill .mono { font-size: 12.5px; color: var(--muted); }
.pill:disabled, .pill.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ---------- Fogadó nézet ---------- */
.info-list { padding: 4px 14px 4px 16px; }
.info-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.info-row + .info-row { border-top: 1px solid var(--line); }
.coords-sm { font-size: 15px; font-weight: 600; }
.nav-actions { display: flex; flex-direction: column; gap: 10px; }
.nav-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.footnote { text-align: center; color: var(--muted); font-size: 13px; }
.footnote a { font-weight: 700; text-decoration: none; }
.view-shared .intro h1 { font-size: 24px; }

/* ---------- Tartalmi szekciók (SEO) ---------- */
.content { margin-top: 40px; }
.content h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li {
  display: flex; gap: 14px; padding: 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
}
.step-n {
  width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--chip); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.steps h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 4px; }
.steps p { font-size: 14.5px; color: var(--muted); }
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.faq summary {
  list-style: none; cursor: pointer; padding: 15px 16px; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--muted); transition: transform .2s; }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq details p { padding: 0 16px 16px; color: var(--muted); font-size: 14.5px; }

/* ---------- Statikus oldal ---------- */
.prose { padding-top: 16px; padding-bottom: 48px; }
.prose h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 6px; }
.prose h2 { font-size: 18px; font-weight: 800; margin: 28px 0 8px; }
.prose p { margin: 0 0 10px; color: var(--muted); }
.prose p .btn, .prose .btn { margin-top: 20px; color: var(--text); }

/* ---------- Lábléc ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 32px; font-size: 13.5px; color: var(--muted); }
.view-home .site-footer { padding-bottom: 130px; }
.footer-inner { display: flex; flex-direction: column; gap: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { font-weight: 700; text-decoration: none; }
.site-footer .muted a { color: inherit; }

/* ---------- Alsó sáv ---------- */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  background: var(--bar); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: 12px 0 max(16px, env(safe-area-inset-bottom));
}
.bottombar-inner { display: flex; gap: 12px; }
.btn-share { flex: 1; }
.btn-112 { width: 84px; flex: none; padding: 0 12px; gap: 6px; }

/* ---------- Megosztás lap (tartalék) ---------- */
.sheet { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .55); }
.sheet-panel {
  position: relative; width: 100%; max-width: 640px; background: var(--card); color: var(--text);
  border-radius: 24px 24px 0 0; padding: 18px 20px max(24px, env(safe-area-inset-bottom));
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { font-size: 18px; font-weight: 800; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.share-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 84px; padding: 10px 4px; border-radius: 16px; border: 1px solid var(--line); background: var(--chip);
  color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 600; text-align: center; cursor: pointer;
}
.share-opt .ic { color: var(--accent-text); }

/* ---------- Értesítés ---------- */
.toast {
  position: fixed; left: 50%; bottom: 110px; z-index: 3000; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 700; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: calc(100% - 40px); text-align: center;
}
.view-shared .toast, .view-page .toast { bottom: 24px; }
.noscript { position: fixed; top: 0; left: 0; right: 0; padding: 12px; background: var(--poor); color: #fff; text-align: center; z-index: 4000; font-weight: 700; }


/* =================== v2 =================== */
.chip-acc[data-level="manual"] { background: var(--ok-bg); color: var(--ok); }
.chip-offline { gap: 6px; align-self: flex-start; }
.btn-sm { min-height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn-danger-text { color: var(--poor); }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; margin: -6px -10px -6px 0;
  border: 0; background: transparent; color: var(--accent-text); font-size: 14px; font-weight: 700; cursor: pointer; border-radius: 10px;
}
.link-btn:hover { background: var(--chip); }

/* Mezők */
.field { display: flex; flex-direction: column; gap: 6px; }
.field input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: 500 16px var(--font); /* 16px: iOS ne nagyítson */
}
.field input::placeholder { color: var(--muted); opacity: .8; }
.dir-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dir-seg button { min-height: 48px; padding: 10px 8px; border-radius: 14px; border: 1.5px solid var(--line); background: transparent; color: var(--text); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; line-height: 1.2; }
.dir-seg button[aria-pressed="true"] { border-color: var(--accent); background: rgba(245, 165, 36, .14); color: var(--accent-text); }
.dir-note { margin: 0; font-size: 13px; color: var(--muted); }
.dir-note.is-auto { color: var(--good, #059669); }
.dir-other { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px dashed #CBD3DF; border-color: color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 14px; background: transparent; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.dir-other:hover, .dir-other:focus-visible { border-color: var(--accent); color: var(--text); }
.dir-other[hidden] { display: none; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 165, 36, .25); }
.field input[aria-invalid="true"] { border-color: var(--poor); }

/* Út kártya */
.road-card { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.road-row { display: flex; align-items: center; gap: 12px; }

/* Kézi pontosítás */
.map-refine {
  position: absolute; left: 10px; bottom: 10px; z-index: 500;
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.map-refine[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.map-hint {
  position: absolute; left: 10px; right: 10px; top: 10px; z-index: 500; margin-left: 48px;
  padding: 8px 12px; border-radius: 12px; background: var(--accent); color: var(--on-accent);
  font-size: 13px; font-weight: 700; text-align: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}
.map-card.is-refining { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 165, 36, .3); }
.map-card.is-refining .leaflet-marker-icon { cursor: grab; }
.map-card.is-refining .hvm-pin span { transform: scale(1.15); }

/* Telepítés */
/* Telepítési sáv (PWA): a kezdőképernyőn a nagy gomb alatt; mérés közben csak a lábléc linkjére jelenik meg */
.install-strip { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px; padding: 14px 10px 14px 16px; }
.install-strip[hidden] { display: none; }
.install-ic { width: 44px; height: 44px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--fair-bg); color: var(--accent-text); }
.install-body { flex: 1; min-width: 0; }
.install-title { font-weight: 800; font-size: 15px; }
.install-text { font-size: 13.5px; line-height: 1.45; color: var(--muted); margin: 2px 0 0; }
.install-btn { margin-top: 10px; }
.app.hero-mode[data-phase="active"] .install-strip:not(.is-forced) { display: none; }

/* Ellenőrzőlista */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist label {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  font-size: 14.5px; line-height: 1.45;
}
.checklist input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  width: 24px; height: 24px; flex: none; border-radius: 8px; border: 2px solid var(--line); margin-top: -1px;
  display: flex; align-items: center; justify-content: center; color: transparent; transition: background .15s, border-color .15s;
}
.checklist input:checked + .check-box { background: var(--good); border-color: var(--good); color: #FFFFFF; }
.checklist input:checked ~ span:last-child { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.checklist input:focus-visible + .check-box { outline: 3px solid var(--accent); outline-offset: 2px; }
.check-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 10px; }
.note { font-size: 13px; color: var(--muted); }

/* QR */
.qr-box { display: flex; justify-content: center; padding: 16px; background: #FFFFFF; border-radius: 18px; margin: 0 auto; width: min(300px, 100%); }
.qr-box svg { width: 100%; height: auto; display: block; }
.qr-coords { text-align: center; margin-top: 12px; font-size: 16px; font-weight: 600; }
.qr-hint { text-align: center; margin-top: 8px; font-size: 13.5px; color: var(--muted); }

/* ---------- Kisebb képernyő / nagyobb képernyő ---------- */
@media (max-width: 359px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  .coords { font-size: 20px; }
  .brand-name { font-size: 15px; }
  .sheet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 720px) {
  .intro h1 { font-size: 32px; }
  .map-card { height: 280px; }
  .map-card-lg { height: 360px; }
  .coords { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Google Maps jelölő: az AdvancedMarker alul-középre horgonyoz, a kör közepét a pontra igazítjuk */
.hvm-pin-g { transform: translateY(50%); }
.hvm-pin-g span {
  display: block; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); border: 4px solid #FFFFFF; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.map.is-google { background: var(--chip); }

.status-tip { font-size: 13.5px; line-height: 1.45; color: var(--fair); background: var(--fair-bg); padding: 10px 12px; border-radius: 12px; }
.progress { height: 4px; border-radius: 4px; background: var(--chip); overflow: hidden; margin-top: -2px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .25s linear; }

/* ===== Kétállapotú főoldal: mérés előtt letisztult kezdőnézet ===== */
.hero-visual { display: none; }
.app[data-phase="idle"] .hero-visual {
  display: block; position: relative; height: 190px; margin: 6px 0 2px;
}
.hero-visual .ring {
  position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%);
  border: 2px solid rgba(245, 165, 36, .55); background: rgba(245, 165, 36, .07);
}
.hero-visual .r1 { width: 92px; height: 92px; background: rgba(245, 165, 36, .14); }
.hero-visual .r2 { width: 140px; height: 140px; border-color: rgba(245, 165, 36, .3); }
.hero-visual .r3 { width: 186px; height: 186px; border-color: rgba(245, 165, 36, .15); background: rgba(245, 165, 36, .04); animation: ringPulse 2.4s ease-out infinite; }
@keyframes ringPulse { 0% { transform: translate(-50%, -50%) scale(.75); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.08); opacity: 0; } }
.hero-pin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 20px; background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 28px rgba(245, 165, 36, .35);
}
.app[data-phase="idle"] .intro { text-align: center; align-items: center; }
.app[data-phase="idle"] .status { background: transparent; border: 0; box-shadow: none; padding: 0; gap: 10px; }
.app[data-phase="idle"] .status-head,
.app[data-phase="idle"] .coords,
.app[data-phase="idle"] .map-card,
.app[data-phase="idle"] .addr-card,
.app[data-phase="idle"] .road-card,
.app[data-phase="idle"] .tiles,
.app[data-phase="idle"] .more { display: none !important; }
.app[data-phase="idle"] #btnStart { min-height: 64px; font-size: 18px; font-weight: 800; border-radius: 20px; box-shadow: 0 12px 30px rgba(245, 165, 36, .28); }
.hero-note { display: none; }
.app[data-phase="idle"] .hero-note { display: block; text-align: center; font-size: 13.5px; color: var(--muted); }
.is-idle .btn-share { display: none; }
.is-idle .bottombar-inner { justify-content: flex-end; }
.is-idle .btn-112 { width: auto; padding: 0 22px; }
.btn-112-long { display: none; }
.is-idle .btn-112 { gap: 0; }
.is-idle .btn-112 .ic { margin-right: 8px; }
.is-idle .btn-112-long { display: inline; font-weight: 700; }

/* Összecsukható „Lerobbantál? Ezt tedd” kártya */
.check-details { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.check-details > summary {
  list-style: none; cursor: pointer; padding: 16px; display: flex; align-items: center; gap: 10px;
}
.check-details > summary::-webkit-details-marker { display: none; }
.check-details > summary h2 { margin: 0 !important; font-size: 18px; flex: 1; min-width: 0; }
.check-count { font-size: 12.5px; font-weight: 700; color: var(--accent-text); background: var(--chip); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.check-details > summary .ic { color: var(--muted); transition: transform .2s; }
.check-details[open] > summary .ic { transform: rotate(180deg); }
.check-details .checklist { padding: 0 12px; }
.check-details .checklist label { box-shadow: none; background: var(--bg); }
.check-details .check-foot { padding: 0 16px 16px; }

/* ===== Reszponzív finomítások ===== */
/* Nagyon keskeny telefonok (pl. 320 px) */
@media (max-width: 359px) {
  .topbar-inner { gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-name { font-size: 14px; }
  .lang-switch a { padding: 0 7px; height: 30px; }
  .icon-btn { width: 40px; height: 40px; }
  .btn-share { font-size: 15px; gap: 8px; padding: 0 12px; }
  .btn-share .ic { display: none; }
  .btn-112 { width: 76px; }
  .tile { min-height: 86px; font-size: 14px; padding: 12px; }
}
@media (max-width: 339px) {
  .brand-name { display: none; }
}
/* Fekvő telefon / alacsony képernyő: a kezdőgomb férjen el görgetés nélkül */
@media (max-height: 500px) and (orientation: landscape) {
  .app[data-phase="idle"] .hero-visual { display: none; }
  .topbar { padding-top: 6px; }
  .topbar-inner { height: 52px; }
  .intro h1 { font-size: 22px; }
  .lead { font-size: 14px; }
  /* A biztonsági hely legfeljebb 48 px: a Facebook böngészője ennél jóval többet kér (saját eszköztárát is beleszámolja) */
.bottombar { padding: 8px 0 max(8px, min(env(safe-area-inset-bottom), 48px)); }
  .btn-lg { min-height: 48px; font-size: 16px; border-radius: 14px; }
  .app[data-phase="idle"] #btnStart { min-height: 54px; }
  .view-home main { padding-bottom: 90px; }
  .map-card { height: 200px; }
}


/* Hozzájárulás-sáv (Google Analytics) */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1100;
  max-width: 560px; margin: 0 auto; padding: 14px 16px;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.consent[hidden] { display: none; }
.consent-text { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
.consent-text a { color: inherit; text-decoration: underline; }
.consent-actions { display: flex; gap: 10px; }
.consent-actions .btn { flex: 1; min-height: 42px; }

/* Google térkép: a saját gombok a Google logó és a jogi sor fölé kerülnek */
.map-card.has-google .map-refine,
.map-card.has-google .map-center { bottom: 30px; }

.nowrap { white-space: nowrap; }

/* Facebook / Messenger / Instagram beépített böngésző figyelmeztetés */
.inapp { margin: 0 0 18px; padding: 14px 16px; border-radius: 16px; background: #FEF3C7; border: 1px solid #F5C451; color: #422006; }
.inapp[hidden] { display: none; }
.inapp p { margin: 0; }
.inapp-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; color: #92400E; }
.inapp-text { margin-top: 4px !important; font-size: 14.5px; line-height: 1.45; }
.inapp-btn { display: flex; justify-content: center; margin-top: 12px; min-height: 46px; background: #1F2937; color: #fff; border-radius: 12px; font-weight: 700; text-decoration: none; }
.inapp-manual { margin-top: 8px !important; font-size: 13px; line-height: 1.45; color: #78350F; }
[data-theme="dark"] .inapp { background: #3A2A06; border-color: #7C5A12; color: #FDE68A; }
[data-theme="dark"] .inapp-title { color: #FCD34D; }
[data-theme="dark"] .inapp-manual { color: #FCD34D; }
[data-theme="dark"] .inapp-btn { background: #F5A524; color: #1F1300; }
.help-inapp { display: none; }
.is-inapp .help-inapp { display: block; }
.is-inapp .help-std { display: none; }

/* Vékonyabb alsó sáv (a navigációs gombok miatti biztonsági sáv marad) */
.bottombar { padding: 8px 0 max(8px, env(safe-area-inset-bottom)); }
.bottombar .btn-lg { min-height: 48px; border-radius: 14px; font-size: 16px; }

/* Androidos Facebook/Instagram böngésző: a téves alsó biztonsági helyet nem vesszük figyelembe */
.is-inapp-android .bottombar { padding-bottom: 8px; }

.footer-links .adm-link { color: var(--accent-text); font-weight: 700; }

/* Megosztott nézet széles képernyőn: balra az adatok, jobbra a teljes magasságú, helyben maradó térkép */
@media (min-width: 1000px) {
  .view-shared .wrap { max-width: 1180px; }
  .view-shared .shared {
    display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    column-gap: 24px; row-gap: 14px; align-items: start;
  }
  .view-shared .shared > * { grid-column: 1; }
  .view-shared .shared > .map-card {
    grid-column: 2; grid-row: 1 / span 20; position: sticky; top: 16px;
    height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 420px; max-height: 900px;
  }
  .view-shared .footnote { text-align: left; }
}
