/* RiderShare iPhone webapp */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1b2430;
  --muted: #667085;
  --border: #d9dde3;
  --primary: #1f6feb;
  --accent: #f5a623;
  --danger: #d1242f;
  --nav: #1b7f3b;
  --nav-text: #ffffff;
  --shadow: 0 4px 16px rgba(0, 0, 0, .18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --tabbar-h: 58px;
  color-scheme: light;
}

body.night {
  --bg: #0f141b;
  --card: #1a2230;
  --text: #e6e9ef;
  --muted: #9aa4b2;
  --border: #2c3647;
  --primary: #4c8dff;
  --nav: #145c2b;
  --shadow: 0 4px 16px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
a { color: var(--primary); }
h1, h2, h3 { margin: .2rem 0 .6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; margin-top: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--danger); }
.grow { flex: 1; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

button, .button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button, .button {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: .6rem 1rem;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}
button:active { filter: brightness(.92); }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
button.danger { color: var(--danger); }
button.small { min-height: 36px; padding: .35rem .7rem; font-size: .9rem; }
button.link { border: 0; background: none; color: var(--primary); padding: .3rem 0; min-height: 0; }
button.wide { width: 100%; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .65rem .75rem;
  background: var(--card);
  font-size: 16px; /* iOS: így nem nagyít rá a mezőre */
}
label { display: block; margin-bottom: .7rem; color: var(--muted); font-size: .9rem; }
label input { margin-top: .25rem; color: var(--text); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

/* Belépés */
.login {
  height: 100%;
  overflow-y: auto;
  padding: calc(var(--safe-top) + 2rem) 1rem calc(var(--safe-bottom) + 1rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.login .card { width: 100%; max-width: 400px; }
.login h1 { display: flex; align-items: center; gap: .5rem; }
.install-hint p { margin: .4rem 0 0; }
.install-steps { margin: .4rem 0 0; padding-left: 1.3rem; }
.install-steps li { margin: .2rem 0; }
.share-ico { display: inline-block; border: 1px solid var(--border); border-radius: 6px; padding: 0 .3rem; }

/* Térkép */
#app { position: fixed; inset: 0; }
#map-wrap { position: absolute; inset: 0; overflow: hidden; background: #dfe3e8; }
body.night #map-wrap { background: #111; }
#map { position: absolute; inset: 0; }
#map.rotating { transition: transform var(--rot-dur, .5s) linear; }
body.night .leaflet-tile-pane .osm-tiles { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
.leaflet-control-attribution { font-size: 9px; }
.leaflet-bottom.leaflet-right { margin-bottom: calc(var(--tabbar-h) + var(--safe-bottom)); }
body.navigating .leaflet-bottom.leaflet-right { margin-bottom: var(--safe-bottom); }
.leaflet-control-zoom { display: none; }

.marker-rot { transform: rotate(var(--counter-rot, 0deg)); transition: transform var(--rot-dur, .5s) linear; }
.rider-icon {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .45);
  color: #fff; font-weight: 700; font-size: 13px;
  background-size: cover; background-position: center;
}
.rider-label {
  position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(0, 0, 0, .65); color: #fff;
  font-size: 11px; border-radius: 6px; padding: 0 5px; margin-top: 2px;
}
.rider-icon.roaming { border-color: var(--accent); }
.me-icon {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #1f6feb;
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(31, 111, 235, .25), 0 1px 4px rgba(0, 0, 0, .4);
}
.me-arrow { width: 100%; height: 100%; transition: transform .6s linear; }
.poi-icon {
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #d1242f; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.poi-icon span { display: grid; place-items: center; width: 100%; height: 100%; transform: rotate(45deg); font-size: 13px; }
.wp-icon {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  border-radius: 50%; background: var(--accent); color: #1b2430;
  font-weight: 700; font-size: 12px; border: 2px solid #fff;
}

/* Felső sáv */
.topbar {
  position: absolute;
  top: calc(var(--safe-top) + 8px); left: calc(var(--safe-left) + 10px); right: calc(var(--safe-right) + 10px);
  display: flex; gap: 8px; z-index: 1000;
}
.topbar select {
  flex: 1; min-width: 0;
  box-shadow: var(--shadow);
  border-radius: 12px;
  font-weight: 600;
  -webkit-appearance: none; appearance: none;
}
.icon-btn {
  width: 46px; padding: 0; font-size: 20px;
  box-shadow: var(--shadow);
}
body.navigating .topbar { display: none; }
/* a paneleken a felső sáv háttere eltakarja az alatta görgetett tartalmat */
body:not([data-tab="map"]) .topbar {
  top: 0; left: 0; right: 0;
  padding: calc(var(--safe-top) + 8px) calc(var(--safe-right) + 10px) 8px calc(var(--safe-left) + 10px);
  background: var(--bg);
}

/* Gombok a térképen */
.fabs {
  position: absolute;
  right: calc(var(--safe-right) + 10px);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  display: flex; flex-direction: column; gap: 10px;
  z-index: 1000;
}
.fab {
  width: 50px; height: 50px; padding: 0;
  border-radius: 50%; font-size: 21px;
  box-shadow: var(--shadow);
}
.fab.big { width: 58px; height: 58px; font-size: 26px; background: var(--primary); color: #fff; border-color: var(--primary); }
.fab.on { background: var(--primary); color: #fff; border-color: var(--primary); }
body.navigating .fabs { top: calc(var(--safe-top) + 10px); bottom: auto; }
body:not([data-tab="map"]):not(.navigating) .fabs,
body:not([data-tab="map"]):not(.navigating) .leaflet-control-container { display: none; }

/* Navigációs panel */
.nav {
  position: absolute;
  top: calc(var(--safe-top) + 8px);
  left: calc(var(--safe-left) + 8px);
  width: calc(100% - var(--safe-left) - var(--safe-right) - 82px);
  z-index: 1001;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav-panel {
  background: var(--nav); color: var(--nav-text);
  border-radius: 18px; box-shadow: var(--shadow);
  padding: 12px 14px;
}
.nav-main { display: flex; gap: 12px; align-items: center; }
.nav-icon { font-size: 46px; line-height: 1; width: 56px; text-align: center; flex: none; }
.nav-dist { font-size: 30px; font-weight: 800; line-height: 1.1; }
.nav-text { font-size: 18px; font-weight: 600; line-height: 1.25; }
.nav-then { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .25); font-size: 15px; }
.nav-bottom { margin-top: 8px; font-size: 15px; opacity: .95; }
.nav-bottom b { font-size: 17px; }
.nav-chip {
  display: table; margin-top: 6px; padding: 1px 8px; border-radius: 10px;
  background: rgba(255, 255, 255, .2); font-size: 13px; font-weight: 600; white-space: nowrap;
}

/* Fekvő tájolás (pl. tartóban): a panel balra, legfeljebb a szélesség harmada */
@media (orientation: landscape) {
  .nav { width: calc(33.3% - 8px); min-width: 260px; bottom: 8px; }
  .nav-icon { font-size: 40px; width: 48px; }
  .nav-dist { font-size: 26px; }
  .nav-text { font-size: 16px; }
  .msg-card .text { font-size: 18px; }
}

/* Beérkező üzenet: 30 mp-ig látszik */
.msg-card {
  position: absolute; z-index: 1002;
  left: calc(var(--safe-left) + 8px); right: calc(var(--safe-right) + 8px);
  top: calc(var(--safe-top) + 64px);
  background: var(--card); color: var(--text);
  border-radius: 16px; box-shadow: var(--shadow);
  border-left: 6px solid var(--accent);
  padding: 10px 12px;
  display: flex; gap: 10px; align-items: flex-start;
}
.msg-card .rider-icon { width: 44px; height: 44px; flex: none; }
.msg-card .who { font-weight: 700; font-size: 15px; }
.msg-card .text { font-size: 20px; font-weight: 600; line-height: 1.25; word-break: break-word; }
.msg-card .acts { display: flex; flex-direction: column; gap: 6px; }
.msg-card .acts button { min-height: 40px; padding: .3rem .6rem; }

/* Panelek */
.panel {
  position: absolute; inset: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  background: var(--bg);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + 64px) calc(var(--safe-right) + 14px) 1.5rem calc(var(--safe-left) + 14px);
  z-index: 999;
}
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: .7rem .8rem; display: flex; gap: .7rem; align-items: center;
}
.list li .rider-icon { width: 40px; height: 40px; flex: none; border-width: 2px; }
.list .title { font-weight: 600; }
.list .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.list li.clickable:active { filter: brightness(.95); }
.points { padding-left: 1.4rem; }
.points li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.profile { display: flex; gap: .9rem; align-items: center; margin-bottom: 1rem; }
.profile .rider-icon { width: 64px; height: 64px; font-size: 22px; }
.profile .title { font-weight: 700; font-size: 1.15rem; margin-bottom: .3rem; }
.toggle-card { margin-bottom: .8rem; }
.toggle-card p { margin: .5rem 0 0; }
.switch-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin: 0; color: var(--text); font-size: 1rem; }
.switch {
  -webkit-appearance: none; appearance: none;
  width: 52px; height: 32px; flex: none; padding: 0;
  border-radius: 16px; background: #c5cad3; border: 0;
  position: relative; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .2s;
}
.switch:checked { background: #34c759; }
.switch:checked::after { left: 23px; }
.messages { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: .55rem .75rem; }
.messages li.mine { border-left: 4px solid var(--primary); }
.messages .meta { font-size: .8rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.messages .meta .grow { flex: 1; }

/* Alsó fülsáv */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
  display: flex; z-index: 1003;
  background: var(--card); border-top: 1px solid var(--border);
}
.tabbar button {
  flex: 1; border: 0; border-radius: 0; background: none;
  flex-direction: column; gap: 0; font-size: 11px; color: var(--muted);
  position: relative; padding: 4px 0 0;
}
.tabbar button span { font-size: 22px; line-height: 1.1; }
.tabbar button.active { color: var(--primary); font-weight: 600; }
.badge {
  position: absolute; top: 4px; left: calc(50% + 8px);
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--danger); color: #fff; font-size: 11px; font-style: normal; line-height: 18px;
}
body.navigating .tabbar { display: none; }
body.navigating .fabs { bottom: auto; }

/* Menü-lap */
.sheet {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, .35);
  display: flex; align-items: flex-end;
}
.sheet-body {
  width: 100%; max-height: 85%; overflow-y: auto;
  background: var(--card); color: var(--text);
  border-radius: 18px 18px 0 0;
  padding: .5rem 0 calc(var(--safe-bottom) + .5rem);
}
.sheet-body button {
  width: 100%; border: 0; border-radius: 0; justify-content: flex-start;
  min-height: 52px; padding: .6rem 1.2rem; gap: .8rem; background: none; font-size: 17px;
}
.sheet-body button .ico { width: 1.6rem; text-align: center; }
.sheet-body hr { border: 0; border-top: 1px solid var(--border); margin: .3rem 0; }
.sheet-body .sheet-title { padding: .6rem 1.2rem .2rem; font-weight: 700; color: var(--muted); font-size: .9rem; }

/* Párbeszédablak */
dialog { border: 0; padding: 0; background: transparent; color: var(--text); width: min(94vw, 460px); max-height: 90dvh; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog .card { max-height: 88dvh; overflow-y: auto; }
#dlg-body p { margin: .3rem 0 .7rem; }
.progress { height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; margin: .5rem 0; }
.progress > div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }

.update-banner {
  position: absolute; z-index: 1500;
  left: 10px; right: 10px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px);
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: .5rem .8rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.install-banner { top: calc(var(--safe-top) + 64px); bottom: auto; }
body:not([data-tab="map"]) .install-banner { display: none; }
.toasts {
  position: absolute; z-index: 2500; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 80px);
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.toast {
  background: rgba(20, 26, 36, .92); color: #fff;
  border-radius: 12px; padding: .55rem .9rem; max-width: 90%;
  font-size: .95rem; box-shadow: var(--shadow);
}

.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.login .link { display: block; margin: .3rem auto; }
.code-input { font-size: 28px !important; letter-spacing: .4em; text-align: center; }

.fuel-icon {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  border-radius: 50%; background: #0f8a3c; color: #fff;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  font-size: 16px;
}

/* profil ikon: a quad saját SVG-je a szöveg méretéhez igazodik */
.mode-ico svg { width: 1.3em; height: 1em; vertical-align: -.1em; display: inline-block; }

/* Profil */
.pf-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .4rem; }
.pf-head > .rider-icon { flex: none; width: 56px; height: 56px; font-size: 1.2rem; }
.pf-mode { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin: .15rem 0; }
.pf-mode #pf-mode-val { display: inline-flex; align-items: center; gap: .25rem; color: var(--text); font-weight: 600; }
.pf-mode .mode-ico { font-size: 18px; line-height: 1; }
.pf-mode button.small { min-height: 0; padding: .2rem .6rem; }
.pf-bio { white-space: pre-wrap; }
.pf-total { display: flex; align-items: baseline; gap: .45rem; margin: .6rem 0 .5rem; }
.pf-total b { font-size: 2.3rem; line-height: 1; color: var(--primary); }
.pf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.pf-stats div { border: 1px solid var(--border); border-radius: 10px; padding: .4rem .55rem; }
.pf-stats b { display: block; font-size: 1.15rem; }
.pf-stats span { font-size: .8rem; color: var(--muted); }
.pf-field { display: block; margin-bottom: .6rem; }
.pf-field input, .pf-field textarea { width: 100%; box-sizing: border-box; }
#message-list .meta b { cursor: pointer; }

/* Ötletláda */
#dlg-body textarea, #dlg-body input:not([type=file]) { width: 100%; box-sizing: border-box; margin-bottom: .4rem; }
.idea-previews { display: flex; gap: .4rem; flex-wrap: wrap; margin: .4rem 0; }
.idea-previews figure { position: relative; margin: 0; }
.idea-previews img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.idea-previews button { position: absolute; top: 2px; right: 2px; padding: 0 .35rem; }
.idea-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.idea-list li { border: 1px solid var(--border); border-radius: 10px; padding: .5rem .6rem; }
.idea-head { display: flex; gap: .4rem; align-items: center; }
.idea-text { white-space: pre-wrap; margin: .3rem 0; }
.idea-text.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.idea-imgs { display: flex; gap: .3rem; flex-wrap: wrap; }
.idea-imgs img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; }
.idea-status { font-size: .75rem; padding: .1rem .45rem; border-radius: 999px; background: var(--border); }
.idea-status.planned { background: #fff1c2; color: #333; } .idea-status.done { background: #d5f5dc; color: #333; } .idea-status.rejected { background: #f8d7da; color: #333; }
.idea-previews button { width: auto; min-height: 0; font-size: .75rem; padding: .1rem .4rem; border-radius: 999px; }

/* Túratervező */
.tour-new { margin-bottom: .8rem; font-size: 17px; min-height: 50px; }
body.planning .topbar, body.planning .fabs, body.planning .tabbar, body.planning .panel,
body.planning .install-banner, body.planning .update-banner { display: none !important; }
body.planning .leaflet-bottom.leaflet-right { margin-bottom: var(--pl-bottom, 0px); }
body.planning .toasts { bottom: auto; top: calc(var(--safe-top) + 66px); }
.planner { position: absolute; inset: 0; z-index: 1001; pointer-events: none; }
.planner > * { pointer-events: auto; }
.pl-bar {
  position: absolute;
  top: calc(var(--safe-top) + 8px); left: calc(var(--safe-left) + 10px); right: calc(var(--safe-right) + 10px);
  display: flex; gap: 6px;
}
.pl-bar .icon-btn { flex: none; }
.pl-bar button:disabled { opacity: .45; }
.pl-chip {
  flex: none; min-width: 52px; padding: 0 .6rem; box-shadow: var(--shadow);
  font-weight: 600; font-size: 15px; gap: .35rem;
}
.pl-chip #pl-profile-ico { font-size: 20px; line-height: 1; flex: none; }
.pl-save { flex: none; box-shadow: var(--shadow); padding: 0 .9rem; margin-left: auto; }
.pl-me {
  position: absolute;
  right: calc(var(--safe-right) + 10px);
  bottom: calc(var(--pl-bottom, 0px) + 12px);
  min-height: 48px; border-radius: 24px; box-shadow: var(--shadow); font-weight: 600;
}
.wp-icon.pl-first { background: #1b7f3b; color: #fff; }
.wp-icon.pl-last { background: #d1242f; color: #fff; }
.pl-wp { font-size: 14px; box-shadow: 0 1px 5px rgba(0, 0, 0, .45); }

/* kézi szakaszok: mód gomb, jelző sáv, kis alakpontok */
.pl-bar .pl-manual.active { background: #f97316; border-color: #f97316; }
.pl-manual-banner {
  position: absolute;
  top: calc(var(--safe-top) + 62px); left: calc(var(--safe-left) + 10px); right: calc(var(--safe-right) + 10px);
  display: flex; align-items: center; gap: .6rem; padding: .45rem .45rem .45rem .8rem;
  background: #f97316; color: #fff; border-radius: 14px; box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600; line-height: 1.25;
}
.pl-manual-banner span { flex: 1; min-width: 0; }
.pl-manual-banner button { flex: none; min-height: 40px; background: #fff; color: #c2410c; border: 0; font-weight: 700; }
body.pl-manual.planning .toasts { top: calc(var(--safe-top) + 128px); }
.wp-shape-hit { width: 30px; height: 30px; display: grid; place-items: center; }
.wp-shape {
  width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%;
  background: #f97316; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.pl-list .pl-num.pl-shape { background: #fde3cf; font-size: 14px; }
body.night .pl-list .pl-num.pl-shape { background: #4a2a12; }
.sheet-form .pl-manual-btn { color: #c2410c; font-weight: 600; }

.pl-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 55%;
  display: flex; flex-direction: column;
  background: var(--card); color: var(--text);
  border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  padding: 0 calc(var(--safe-right) + 12px) calc(var(--safe-bottom) + 6px) calc(var(--safe-left) + 12px);
}
.pl-handle {
  width: 100%; border: 0; background: none; border-radius: 0;
  flex-direction: column; align-items: stretch; gap: 6px;
  min-height: 58px; padding: 6px 2px 8px; flex: none;
}
.pl-handle .grip { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--border); }
.pl-sumrow { display: flex; gap: .5rem; align-items: center; text-align: left; font-weight: 600; }
.pl-sheet.collapsed .pl-body { display: none; }
.pl-body { overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; }
.pl-warn { margin: 0 0 .5rem; padding: .45rem .6rem; border-radius: 10px; background: #fff1c2; color: #5c4300; font-size: .9rem; }
body.night .pl-warn { background: #3d3214; color: #ffe08a; }
.pl-list { list-style: none; margin: 0; padding: 0 0 .3rem; display: flex; flex-direction: column; gap: 6px; }
.pl-list li { display: flex; gap: 6px; align-items: center; }
.pl-list .pl-num {
  flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; color: #1b2430; font-weight: 700; font-size: 14px;
}
.pl-list .pl-num.pl-first { background: #1b7f3b; color: #fff; }
.pl-list .pl-num.pl-last { background: #d1242f; color: #fff; }
.pl-list input { flex: 1; min-width: 0; padding: .55rem .6rem; }
.pl-list .pl-act { flex: none; width: 44px; padding: 0; font-size: 18px; }
.pl-list .pl-act:disabled { opacity: .35; }
.pl-empty { color: var(--muted); padding: .4rem 0 .8rem; }

/* tartalom a menü-lapon (útpont, profil): rendes gombok, nem menüsorok */
.sheet-body .sheet-form { padding: .4rem calc(var(--safe-right) + 1rem) .4rem calc(var(--safe-left) + 1rem); }
.sheet-body .sheet-form button {
  width: auto; border: 1px solid var(--border); border-radius: 12px; justify-content: center;
  min-height: 48px; padding: .5rem .8rem; font-size: 16px; gap: .4rem; background: var(--card);
}
.sheet-body .sheet-form button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.sheet-body .sheet-form button.danger { color: var(--danger); }
.sheet-body .sheet-form button:disabled { opacity: .4; }
.sheet-body .sheet-form .row > button { flex: 1; }
.sheet-body .sheet-form .row { margin-bottom: .5rem; }
.sheet-form h3 { margin: .3rem 0 .6rem; }
.sheet-form .sheet-title { padding: .6rem 0 .3rem; }
.pl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pl-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.sheet-body .sheet-form .pl-prof {
  flex-direction: column; gap: 2px; padding: .4rem .2rem; min-height: 64px; font-size: 13px; position: relative;
}
.sheet-body .sheet-form .pl-prof b { font-size: 24px; line-height: 1.1; }
.sheet-body .sheet-form .pl-prof.active { border: 2px solid var(--primary); background: rgba(31, 111, 235, .12); font-weight: 600; }
.pl-prof.approx::after { content: "≈"; position: absolute; top: 2px; right: 6px; font-size: .75rem; color: var(--muted); }
/* regisztráció: „Mivel akarod használni?” */
.reg-mode { margin: .2rem 0 .6rem; }
.reg-mode-q { display: block; color: var(--muted); margin-bottom: .2rem; }
.reg-mode .sheet-title { padding: .4rem 0 .25rem; font-size: .72rem; font-weight: 700; color: var(--muted); }
.reg-mode .pl-prof { flex-direction: column; gap: 2px; padding: .35rem .2rem; min-height: 58px; font-size: 12px; }
.reg-mode .pl-prof b { font-size: 22px; line-height: 1.1; font-weight: 400; }
.reg-mode .pl-prof.active { border: 2px solid var(--primary); background: rgba(31, 111, 235, .12); font-weight: 600; }
.pl-desc { margin: .5rem 0; color: var(--muted); font-size: .9rem; }
.pl-opt { display: flex; align-items: center; gap: .7rem; min-height: 46px; margin: 0; color: var(--text); font-size: 16px; }
.pl-opt input { width: 24px; height: 24px; margin: 0; flex: none; }
.pl-opt input:disabled + span { opacity: .45; }
.pl-form label textarea, .pl-form label input { margin-top: .25rem; color: var(--text); }

/* „Hogyan menjünk?” – útvonalstílus úti cél felé */
.style-profile { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; color: var(--muted); }
.style-profile .mode-ico { font-size: 22px; line-height: 1; }
.sheet-body .sheet-form .style-profile button.link { width: auto; min-height: 0; border: 0; padding: .3rem 0; background: none; color: var(--primary); font-size: 15px; }
.sheet-body .sheet-form .style-opt {
  width: 100%; justify-content: flex-start; gap: .9rem; min-height: 68px; margin-bottom: .5rem; text-align: left;
}
.sheet-body .sheet-form .style-opt b { font-size: 30px; line-height: 1; width: 2.2rem; text-align: center; flex: none; }
.sheet-body .sheet-form .style-opt.active { border: 2px solid var(--primary); background: rgba(31, 111, 235, .12); }
.style-opt .style-label { display: block; font-size: 17px; font-weight: 600; }
.style-opt .style-hint { display: block; font-size: 14px; color: var(--muted); }

/* Fekvő tájolás: a pontok listája bal oldali panel (legfeljebb a szélesség harmada) */
@media (orientation: landscape) {
  .pl-sheet {
    top: calc(var(--safe-top) + 62px); bottom: calc(var(--safe-bottom) + 8px);
    left: calc(var(--safe-left) + 8px); right: auto;
    width: 33.3%; min-width: 260px; max-width: 400px; max-height: none;
    border-radius: 16px; padding: 0 10px 8px;
  }
  .pl-sheet.collapsed { bottom: auto; }
  /* keskeny panel: a név kapja a sort, a gombok alá kerülnek */
  .pl-list li { flex-wrap: wrap; justify-content: flex-end; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
  .pl-list input { flex-basis: calc(100% - 50px); }
  body.planning .toasts { left: 34%; }
  .pl-manual-banner { left: calc(var(--safe-left) + min(max(33.3%, 260px), 400px) + 18px); }
  .sheet-body { max-width: 560px; margin: 0 auto; }
}

/* Járt utak */
.ride-list { margin-top: .3rem; }
.ride-live { color: var(--danger); font-size: .8rem; font-weight: 600; }
.ride-chip {
  position: absolute; z-index: 1000;
  left: calc(var(--safe-left) + 10px); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  background: #8b3fd9; border-color: #8b3fd9; color: #fff; font-weight: 600;
  border-radius: 22px; box-shadow: var(--shadow);
}
body:not([data-tab="map"]) .ride-chip, body.navigating .ride-chip, body.planning .ride-chip { display: none; }

/* Ranglista */
.seg { display: flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: .7rem; }
.seg button { flex: 1; border: 0; border-radius: 0; background: transparent; min-height: 40px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--primary); color: #fff; font-weight: 600; }
.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-list li { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border-radius: 12px; }
.lb-list li .rider-icon { width: 38px; height: 38px; flex: none; border-width: 2px; font-size: 13px; }
.lb-list li.lb-me { background: rgba(245, 166, 35, .2); font-weight: 600; }
.lb-rank { width: 2rem; text-align: center; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-km { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ride-tools { margin: .2rem 0 .3rem; }
.ride-list li.ride-day { background: none; border: 0; padding: .5rem .2rem 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.ride-list li.ride-day button { font-weight: 400; color: var(--text); }
.ride-list li.selected { border-color: #8b3fd9; background: rgba(139, 63, 217, .1); }
.ride-check { font-size: 1.4rem; line-height: 1; color: #8b3fd9; }

/* Törlés megerősítése */
.confirm-del p { margin: .3rem 0 .7rem; }
.confirm-del #confirm-what { font-weight: 600; }
.confirm-del button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Helymegosztás csapatonként */
.share-summary { display: flex; gap: .5rem; align-items: center; font-weight: 600; color: var(--text); }
.share-list { list-style: none; padding: 0; margin: .6rem 0 0; }
.share-list li { padding: .6rem 0; border-top: 1px solid var(--border); }
.share-list li p { margin: .4rem 0 0; }

/* privát zónák */
.zone-banner {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 64px); transform: translateX(-50%);
  z-index: 1200; display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem .5rem 1rem;
  background: #455a64; color: #fff; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.3);
  font-size: .9rem; width: max-content; max-width: calc(100vw - 24px);
}
.zone-banner[hidden] { display: none; }
.zone-banner button { background: #fff; color: #455a64; border: 0; border-radius: 999px; font-weight: 700; padding: .35rem .8rem; }
.zone-row { display: flex; align-items: center; gap: .4rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }

/* helyek kategóriái: ⭐ Móka, 🍔 Büfé, ⚠️ Veszély */
.poi-cat-icon { width: 32px; height: 32px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.poi-cat-icon svg, .poi-cat-dot svg { width: 100%; height: 100%; display: block; }
.poi-cat-dot { display: inline-block; width: 28px; height: 28px; flex: none; }
.poi-cats { display: flex; gap: .5rem; margin-top: .7rem; }
.poi-cat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .55rem .3rem;
  border: 2px solid var(--border); border-radius: 12px; background: none; color: inherit; font-weight: 600; }
.poi-cat.on { border-color: #1f6feb; background: rgba(31,111,235,.1); }
.poi-cat .poi-cat-dot { width: 34px; height: 34px; }
.zone-ask { margin: .2rem 0 0; padding-left: 1.2rem; }
.zone-ask li { margin: .3rem 0; }

/* más túrájának módosítása / javaslat */
.owner-note { background: #fff4e5; color: #8a4b00; border-left: 3px solid #f57c00; padding: .45rem .6rem; border-radius: 8px; font-size: .85rem; }
.change-list { margin: .3rem 0 .2rem; padding-left: 1.1rem; color: #e65100; font-weight: 600; font-size: .9em; }
.compare-banner { background: #263238; }
.compare-banner .cmp-old { color: #64a8ff; }
.compare-banner .cmp-new { color: #ffa040; margin-left: .3rem; }
.compare-banner button { color: #263238; }

/* madár nézet (navigáció közben): a jobb oldali gombsorban, a benzinkút alatt */
.bird-fab { font-size: 26px; }
.bird-fab[hidden] { display: none; }

/* nyelvválasztó (belépés, saját profil) */
.lang-picker { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; }
.lang-picker select { width: auto; flex: 0 0 auto; padding: .3rem .5rem; }
.auth-lang { justify-content: center; }

/* ország-kapcsoló (saját profil) */
.country-picker { display: grid; gap: .3rem; margin: .5rem 0; }
.country-picker label.country-row {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: .6rem; cursor: pointer; margin: 0;
}
#dlg-body .country-picker input[type=checkbox], .country-picker label.country-row input { flex: 0 0 auto; width: 1.2em; height: 1.2em; margin: 0; padding: 0; }
