:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #1b2430;
  --muted: #687385;
  --border: #dde2e8;
  --accent: #f5a623;
  --accent-text: #1b2430;
  --primary: #1f6feb;
  --danger: #d93025;
  --hover: #eef2f6;
  --sidebar: 380px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151c;
    --panel: #16202c;
    --text: #e6edf3;
    --muted: #8b98a8;
    --border: #2a3644;
    --primary: #4c8dff;
    --danger: #ff6b5e;
    --hover: #1e2a38;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { display: flex; align-items: center; gap: .5rem; font-size: 1.6rem; }
h2 { font-size: 1.15rem; }

input, select, textarea, button, .button {
  font: inherit;
  color: inherit;
  border-radius: 8px;
}
input, select, textarea {
  width: 100%;
  padding: .5rem .6rem;
  border: 1px solid var(--border);
  background: var(--panel);
}
label { display: block; margin-bottom: .6rem; font-size: .9rem; color: var(--muted); }
label > input, label > textarea, label > select { margin-top: .2rem; color: var(--text); }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: .45rem .8rem;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
button:hover, .button:hover { background: var(--hover); }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover { filter: brightness(1.1); }
button.danger { color: var(--danger); }
button.ghost, .button.ghost { background: transparent; }
button.link { border: 0; background: none; padding: 0; color: var(--primary); }
button.small { padding: .35rem .6rem; font-size: .85rem; }
button.wide { width: 100%; margin-bottom: .75rem; }

.muted { color: var(--muted); }
.small-text { font-size: .82rem; }
.error { color: var(--danger); margin: .3rem 0; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: .8rem; }
.row > select { flex: 1; min-width: 0; }

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

/* Belépés */
.auth { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .primary { width: 100%; margin: .4rem 0 .8rem; padding: .6rem; }

/* Elrendezés */
.layout { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100%; }
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.bar {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .4rem; }
.me { margin-left: auto; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
.block { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.block p { margin: .5rem 0 0; }
.empty { color: var(--muted); }
code { background: var(--hover); padding: .1rem .35rem; border-radius: 4px; letter-spacing: .08em; }

.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tabs button {
  flex: 1; border: 0; border-radius: 0;
  border-bottom: 2px solid transparent;
  background: none; padding: .7rem;
}
.tabs button.active { border-bottom-color: var(--accent); font-weight: 600; }
.badge { background: #2ea043; color: #fff; border-radius: 10px; padding: 0 .45rem; font-size: .75rem; }
.badge:empty { display: none; }
.tab { padding: 1rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .5rem;
  border-radius: 8px;
  cursor: pointer;
}
.list li:hover { background: var(--hover); }
.list .title { font-weight: 600; }
.list .sub { color: var(--muted); font-size: .82rem; }
.list .grow { flex: 1; min-width: 0; }
.list .empty-item { cursor: default; color: var(--muted); }
.list .empty-item:hover { background: none; }

.dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: .85rem;
  flex: none;
}
.dot.offline { opacity: .35; }
.dot.has-avatar, .rider-icon.has-avatar { background-size: cover; background-position: center; }
.dot.small { width: 22px; height: 22px; font-size: .65rem; }
.dot.large { width: 56px; height: 56px; font-size: 1.2rem; }
.profile { display: flex; gap: .75rem; align-items: center; padding-bottom: .9rem; margin-bottom: .9rem; border-bottom: 1px solid var(--border); }
.profile .row { margin-top: .4rem; }
button.me { display: flex; align-items: center; gap: .4rem; border: 0; padding: .25rem .4rem; }
.messages li { display: flex; gap: .5rem; align-items: flex-start; }

.waypoints { padding-left: 1.4rem; margin: .4rem 0; }
.waypoints li { margin: .25rem 0; }
.waypoints .wp { display: flex; gap: .3rem; align-items: center; }
.waypoints .wp input { padding: .3rem .45rem; font-size: .88rem; }
.waypoints .wp button { padding: .2rem .5rem; }
.summary { font-weight: 600; }
.desc { white-space: pre-wrap; }

.switch { display: flex; align-items: center; gap: .6rem; color: var(--text); font-size: 1rem; cursor: pointer; }
.switch input { width: 1.2rem; height: 1.2rem; }

/* Térkép */
.map-wrap { position: relative; }
#map { position: absolute; inset: 0; }
.map-btn {
  position: absolute; right: 12px; bottom: 28px; z-index: 500;
  width: 44px; height: 44px; border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  font-size: 1.2rem;
}
.rider-icon {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.45);
  color: #fff; font-weight: 700;
  display: grid; place-items: center;
}
.wp-icon {
  background: var(--accent); color: var(--accent-text);
  border: 2px solid #fff; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}

dialog { border: 0; padding: 0; background: transparent; color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog .card { min-width: 300px; }


/* POI-k */
.poi-icon {
  background: #7b3fe4; color: #fff;
  border: 2px solid #fff; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  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; }
.list .actions { display: flex; gap: .25rem; }
.list .actions button { padding: .2rem .45rem; font-size: .85rem; }

/* Üzenetek */
.badge.unread { background: var(--danger); margin-left: .25rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 1.2rem 0 .4rem; font-size: 1rem; }
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.messages li { background: var(--hover); border-radius: 10px; padding: .45rem .65rem; }
.messages li.mine { background: transparent; border: 1px solid var(--border); }
.messages .meta { font-size: .75rem; color: var(--muted); }
.messages .empty-item { background: none; color: var(--muted); padding: 0; }
.toasts {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: .5rem;
  width: min(420px, calc(100% - 32px));
}
.toast {
  background: var(--panel); color: var(--text);
  border-left: 5px solid var(--accent);
  border-radius: 10px; padding: .7rem .9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  cursor: pointer;
}
.toast strong { display: block; margin-bottom: .15rem; }

/* Admin */
.admin-list li { flex-wrap: wrap; }
.admin-detail { width: 100%; margin: .3rem 0 .2rem 2.4rem; font-size: .85rem; }
.admin-detail ul { list-style: none; padding: 0; margin: .2rem 0 .5rem; }
.admin-detail li { display: flex; align-items: center; gap: .4rem; padding: .15rem 0; cursor: default; }
.admin-detail li:hover { background: none; }
.admin-detail button { padding: .1rem .45rem; font-size: .8rem; }
.messages li .grow { flex: 1; min-width: 0; }

/* Android app letöltése */
.apk-card { max-width: 520px; max-height: calc(100dvh - 2rem); overflow-y: auto; }
.apk-top > div:last-child { flex: 1 1 220px; }
.apk-card h3, .apk-card h4 { margin: 0 0 .5rem; }
.apk-card h4 { margin-top: .8rem; }
.apk-top { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.apk-qr { width: 140px; height: 140px; flex: none; background: #fff; border-radius: 8px; padding: 4px; }
.apk-qr svg { width: 100%; height: 100%; display: block; }
.apk-top a.button { display: inline-block; margin-bottom: .4rem; }
.apk-steps { margin: 0; padding-left: 1.3rem; line-height: 1.45; }
.apk-steps li { margin-bottom: .3rem; }
.usb-install { margin: .4rem 0 .6rem; }
.usb-install progress { width: 100%; height: .6rem; }
#usb-install-status.error { color: #c62828; }
.auth-card hr { border: 0; border-top: 1px solid var(--border, rgba(127,127,127,.25)); margin: .4rem 0 .8rem; }
.auth-card .apk-open { width: 100%; }
.auth-card .iphone-open { width: 100%; margin-top: .5rem; }

/* Csapatlista és csatlakozási kérés */
.dir-card { width: min(92vw, 520px); max-height: calc(100dvh - 2rem); overflow-y: auto; }
.dir-card h3 { margin: 0 0 .4rem; }
.dir-list li { cursor: default; align-items: center; }
.dir-list li:hover { background: none; }
.dir-list .grow { flex: 1; min-width: 0; }
.dir-list .title { font-weight: 600; }
.join-actions { display: flex; gap: .4rem; margin-top: .35rem; flex-wrap: wrap; }
.join-status { font-size: .85em; color: var(--muted); margin-top: .25rem; }
.group-row { flex-wrap: wrap; }
.group-row select { flex: 1 1 100%; }
.group-row button { flex: 1 1 auto; }

/* robotcsapda mező */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.auth-card .link { display: block; margin: .2rem auto; }
#code-form input[name=code] { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }

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

/* ================================================================
   Tervező elrendezés (DMD2-stílus): teljes képernyős térkép, sötét
   felső sáv, lebegő, összecsukható bal panel, jobb oldali útvonal-
   beállítások, alsó eszköztár.
   ================================================================ */
:root {
  --bar: #11161d;
  --bar-2: #1b232e;
  --bar-text: #e8edf3;
  --bar-muted: #93a1b3;
  --appbar-h: 52px;
  --float-shadow: 0 6px 24px rgba(0, 0, 0, .28);
}
.layout { display: block; position: relative; height: 100%; overflow: hidden; }
.appbar {
  position: absolute; inset: 0 0 auto 0; height: var(--appbar-h); z-index: 1100;
  display: flex; align-items: center; gap: .6rem; padding: 0 .9rem;
  background: var(--bar); color: var(--bar-text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.appbar .brand { font-size: 1.05rem; gap: .5rem; letter-spacing: .01em; }
.appbar .grow { flex: 1; }
.project {
  display: flex; align-items: center; gap: .5rem; min-width: 0;
  margin-left: .6rem; padding: .35rem .8rem; border-radius: 8px;
  background: var(--bar-2); font-weight: 650; max-width: 40vw;
}
.project #project-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-status { font-weight: 400; color: var(--bar-muted); font-size: .8rem; white-space: nowrap; }
.project-status::before { content: "● "; color: #f5a623; }
.project-status.saved::before { color: #3fb950; }
.appbar-btn, .appbar .button {
  background: var(--bar-2); color: var(--bar-text); border: 1px solid #2a3542;
  border-radius: 8px; padding: .4rem .75rem; font-size: .88rem; cursor: pointer; text-decoration: none;
}
.appbar-btn:hover { background: #26303d; }
#me.appbar-btn { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.map-wrap { position: absolute; inset: var(--appbar-h) 0 0 0; }

/* bal panel */
.sidebar {
  position: absolute; z-index: 1000;
  top: calc(var(--appbar-h) + 12px); left: 64px; bottom: 12px; width: var(--sidebar);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--float-shadow);
  transition: transform .25s ease, opacity .25s ease;
}
.layout.side-collapsed .sidebar { transform: translateX(calc(-100% - 80px)); opacity: 0; pointer-events: none; }
.side-tab {
  position: absolute; z-index: 1001; left: 0; top: 45%;
  writing-mode: vertical-rl; transform: rotate(180deg);
  background: var(--bar); color: var(--bar-text); border: 0; border-radius: 0 10px 10px 0;
  padding: .9rem .45rem; font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  box-shadow: var(--float-shadow);
}
.side-tab span { display: inline-block; transform: rotate(90deg); margin-bottom: .4rem; }
.layout.side-collapsed .side-tab span { transform: rotate(-90deg); }

/* kerek térképgombok */
.map-tools { position: absolute; z-index: 900; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 10px; }
.round-btn {
  width: 42px; height: 42px; padding: 0; border-radius: 50%;
  background: var(--bar); color: var(--bar-text); border: 0; font-size: 1.15rem;
  box-shadow: var(--float-shadow);
}
.round-btn:hover { background: #26303d; }
.search-box {
  position: absolute; z-index: 1050; top: 12px; left: 64px; width: min(420px, calc(100% - 80px));
  background: var(--panel); border-radius: 12px; box-shadow: var(--float-shadow); padding: .5rem;
}
.layout:not(.side-collapsed) .search-box { left: calc(64px + var(--sidebar) + 12px); }
.search-results { list-style: none; margin: .3rem 0 0; padding: 0; max-height: 50vh; overflow: auto; }
.search-results li { padding: .45rem .5rem; border-radius: 8px; cursor: pointer; display: flex; gap: .5rem; align-items: center; }
.search-results li:hover { background: var(--hover); }
.search-results .grow { flex: 1; min-width: 0; font-size: .9rem; }
.search-results .sub { color: var(--muted); font-size: .78rem; }

.leaflet-top.leaflet-right { margin-top: 2px; }
.leaflet-control-layers { border-radius: 10px !important; }

/* jobb oldali útvonal-beállítások */
.route-panel {
  position: absolute; z-index: 1000; top: 64px; right: 12px; width: 330px; max-height: calc(100% - 160px); overflow-y: auto;
  background: var(--bar); color: var(--bar-text); border-radius: 14px; box-shadow: var(--float-shadow);
  padding: 0 0 .6rem;
}
.route-panel header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem .9rem; border-bottom: 1px solid #263140; font-weight: 700;
}
.icon-x { background: var(--bar-2); color: var(--bar-text); border: 1px solid #2a3542; border-radius: 8px; padding: .2rem .5rem; }
.rp-section { padding: .55rem .9rem 0; }
.rp-title { font-size: .7rem; font-weight: 800; letter-spacing: .12em; color: var(--bar-muted); margin: .2rem 0 .45rem; }
.rp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rp-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
.rp-btn {
  flex-direction: column; gap: .15rem; padding: .55rem .3rem; min-height: 62px;
  background: var(--bar-2); color: var(--bar-text); border: 1px solid #2a3542; border-radius: 10px;
  font-size: .76rem; font-weight: 650; line-height: 1.15; text-align: center; white-space: normal;
}
.rp-btn b { font-size: 1.3rem; font-weight: 400; }
.rp-btn:hover { background: #26303d; }
.rp-btn.active { background: #5b5bf0; border-color: #7c7cff; box-shadow: 0 0 0 1px #7c7cff inset; }
.rp-btn.approx::after { content: "≈"; font-size: .7rem; color: var(--bar-muted); }
.rp-desc { margin: .45rem 0 0; font-size: .78rem; color: var(--bar-muted); min-height: 1.1em; }
.rp-options { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .7rem; padding-bottom: .2rem; }
.rp-options label { display: flex; gap: .45rem; align-items: center; margin: 0; color: var(--bar-text); font-size: .82rem; cursor: pointer; }
.rp-options input { width: 1rem; height: 1rem; margin: 0; accent-color: #7c7cff; }

/* alsó tervező eszköztár */
.planner-bar {
  position: absolute; z-index: 1000; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: stretch; gap: 6px; padding: 6px;
  background: var(--bar); border-radius: 14px; box-shadow: var(--float-shadow);
  max-width: calc(100% - 24px);
}
.layout:not(.side-collapsed) .planner-bar { left: calc(50% + (var(--sidebar) + 64px) / 2); }
.planner-bar button {
  flex-direction: column; gap: 0; min-width: 62px; padding: .35rem .6rem;
  background: var(--bar-2); color: var(--bar-text); border: 1px solid #2a3542; border-radius: 10px; font-size: .74rem;
}
.planner-bar button b { font-size: 1.15rem; line-height: 1.1; }
.planner-bar button:hover { background: #26303d; }
.planner-bar button:disabled { opacity: .4; cursor: default; }
.planner-bar .pl-profile { flex-direction: row; gap: .35rem; font-size: .88rem; font-weight: 650; }
.planner-bar .pl-discard { color: #ff7b72; border-color: #5c2b2b; }
.planner-bar .pl-done { color: #3fb950; border-color: #23502f; }
.planner-bar .pl-manual.active { background: #f97316; border-color: #f97316; color: #fff; }

/* kézi szakaszok: mód-jelző sáv az eszköztár fölött, kis alakpontok, útpont-menü */
.manual-banner {
  position: absolute; z-index: 1000; left: 50%; bottom: 86px; transform: translateX(-50%);
  display: flex; align-items: center; gap: .7rem; padding: .45rem .5rem .45rem .9rem;
  background: #f97316; color: #fff; border-radius: 12px; box-shadow: var(--float-shadow);
  font-size: .88rem; font-weight: 600; max-width: calc(100% - 24px);
}
.layout:not(.side-collapsed) .manual-banner { left: calc(50% + (var(--sidebar) + 64px) / 2); }
.manual-banner button { background: #fff; color: #c2410c; border: 0; font-weight: 700; padding: .35rem .9rem; }
.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); cursor: pointer;
}
.wp-popup { display: flex; flex-direction: column; gap: .35rem; }
.wp-popup b { margin-bottom: .1rem; }
.wp-popup button { justify-content: flex-start; padding: .35rem .55rem; font-size: .85rem; text-align: left; }
.waypoints .wp-straight { font-size: .8rem; flex: none; }

.pl-summary {
  display: flex; align-items: center; padding: 0 .7rem; color: var(--bar-muted); font-size: .82rem;
  min-width: 140px; max-width: 280px; line-height: 1.25;
}

/* keskeny képernyő: a panel teljes szélességű, a jobb panel alulra kerül */
@media (max-width: 900px) {
  :root { --sidebar: calc(100vw - 76px); }
  .appbar .appbar-btn:not(#logout):not(#me):not(#lb-open), .appbar .button { display: none; }
  .project { max-width: 45vw; }
  .route-panel { top: auto; bottom: 86px; right: 8px; left: 8px; width: auto; max-height: 50%; }
  .planner-bar, .layout:not(.side-collapsed) .planner-bar { left: 50%; bottom: 10px; }
  .manual-banner, .layout:not(.side-collapsed) .manual-banner { left: 50%; bottom: 78px; }
  .pl-summary { display: none; }
}

/* 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 ablak */
.profile-card { width: min(440px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
.pf-head { display: flex; gap: .9rem; align-items: center; }
.pf-head h3 { margin: 0 0 .15rem; }
.pf-bio { white-space: pre-wrap; margin: .7rem 0 .2rem; }
.pf-bio:empty { display: none; }
.pf-total { display: flex; align-items: baseline; gap: .45rem; margin: .8rem 0 .5rem; }
.pf-total b { font-size: 2.2rem; line-height: 1; color: var(--primary, #1f6feb); }
.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .4rem; }
.pf-stats div { border: 1px solid var(--border, #ddd); border-radius: 10px; padding: .4rem .55rem; }
.pf-stats b { display: block; font-size: 1.1rem; }
.pf-stats span { font-size: .8rem; color: var(--muted, #667); }
.profile-card h4 { margin: .9rem 0 .3rem; }
.profile-card textarea { width: 100%; resize: vertical; }
.clickable { cursor: pointer; }
#admin-users select { width: auto; flex: none; }

/* Ötletláda */
.idea-card { width: min(640px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
.idea-card textarea { width: 100%; resize: vertical; min-height: 10rem; }
.idea-meta { justify-content: flex-end; margin-top: -.3rem; }
.idea-previews { display: flex; gap: .4rem; flex-wrap: wrap; margin: .4rem 0; }
.idea-previews figure { position: relative; margin: 0; }
.idea-previews img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border, #ddd); }
.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: .6rem; }
.idea-list li { border: 1px solid var(--border, #ddd); border-radius: 10px; padding: .6rem .7rem; }
.idea-list .idea-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.idea-list .idea-text { white-space: pre-wrap; margin: .4rem 0; }
.idea-list .idea-imgs { display: flex; gap: .4rem; flex-wrap: wrap; }
.idea-list .idea-imgs img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; }
.idea-status { font-size: .75rem; padding: .1rem .45rem; border-radius: 999px; background: #e7ecf3; color: #334; }
.idea-status.planned { background: #fff1c2; } .idea-status.done { background: #d5f5dc; } .idea-status.rejected { background: #f8d7da; }
.idea-head select, .idea-head button { width: auto; flex: none; }
.idea-list .idea-text.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }

/* járműprofil: sor a profilban, választó rács (regisztráció, ablak) */
.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: 1.05rem; line-height: 1; }
.pf-mode button { margin-left: .25rem; }
.reg-mode { margin: .2rem 0 .6rem; }
.reg-mode-q { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .3rem; }
.vp-card { width: min(460px, calc(100vw - 32px)); }
.vp-group { margin-bottom: .5rem; }
.vp-title { font-size: .68rem; font-weight: 800; letter-spacing: .12em; color: var(--muted); margin: .1rem 0 .3rem; }
.vp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.vp-btn {
  display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .4rem .2rem; min-height: 54px;
  background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  font-size: .74rem; font-weight: 600; line-height: 1.15; text-align: center; white-space: normal; cursor: pointer;
}
.vp-btn b { font-size: 1.25rem; font-weight: 400; line-height: 1.1; }
.vp-btn:hover { background: var(--hover); }
.vp-btn.active { border: 2px solid var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--panel)); }

/* Járt utak (saját profil) */
.ride-list li { cursor: default; align-items: flex-start; border-top: 1px solid var(--border); border-radius: 0; }
.ride-list li:hover { background: none; }
.ride-live { margin-left: .4rem; color: var(--danger); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.ride-actions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.ride-actions button { padding: .2rem .5rem; font-size: .8rem; }
.ride-tour-card { width: min(420px, calc(100vw - 2rem)); }
.ride-tour-card textarea, .ride-tour-card input, .ride-tour-card select { width: 100%; }
.ride-chip {
  position: absolute; z-index: 1000; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: #8b3fd9; color: #fff; border: 0; border-radius: 18px;
  padding: .45rem .9rem; font-weight: 600; box-shadow: var(--float-shadow);
}
.ride-chip:hover { background: #7a32c4; }
.layout:not(.side-collapsed) .ride-chip { left: calc(50% + (var(--sidebar) + 64px) / 2); }
.planner-bar:not([hidden]) ~ .ride-chip { bottom: 96px; }
@media (max-width: 900px) {
  .ride-chip, .layout:not(.side-collapsed) .ride-chip { left: 50%; }
}

/* Ranglista */
.lb-card { width: min(460px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: .7rem; }
.seg button { flex: 1; border: 0; border-radius: 0; background: transparent; }
.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; }
.lb-list li { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 8px; cursor: pointer; }
.lb-list li:hover { background: var(--hover); }
.lb-list li.lb-me { background: rgba(245, 166, 35, .18); font-weight: 600; }
.lb-list .empty-item { cursor: default; color: var(--muted); }
.lb-rank { width: 2rem; text-align: center; 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-head { margin: .9rem 0 .3rem; }
.ride-head h4 { margin: 0; flex: 1; }
.ride-list li.ride-day { border-top: 0; padding: .7rem .2rem .2rem; font-size: .85rem; font-weight: 600; color: var(--muted); align-items: center; }
.ride-list li.ride-day button { font-weight: 400; }
.ride-list li.ride-item.selected { background: rgba(139, 63, 217, .1); }
.ride-check { width: auto; margin-top: .25rem; }

/* Törlés megerősítése */
.confirm-del .card { max-width: 420px; }
.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-list li.share-item { cursor: default; }
.share-list li.share-item:hover { background: none; }
.share-list .switch-row { display: flex; gap: .8rem; align-items: center; width: 100%; margin: 0; color: var(--text); font-size: inherit; cursor: pointer; }
.switch {
  -webkit-appearance: none; appearance: none;
  width: 42px; height: 24px; flex: none; padding: 0; margin: 0;
  border-radius: 12px; background: #c5cad3; border: 0;
  position: relative; transition: background .2s; cursor: pointer;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; 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: 21px; }
.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* privát zóna kijelölése: szürke sáv a kézi mód helyén */
.zone-banner { background: #455a64; }
.zone-banner button { color: #455a64; }

/* helyek kategóriái: ⭐ Móka, 🍔 Büfé, ⚠️ Veszély */
.poi-cat-icon { width: 30px; height: 30px; 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: 26px; height: 26px; flex: none; }
.poi-cats { display: flex; gap: .5rem; margin: .6rem 0 .2rem; }
.poi-cats label { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .55rem .3rem;
  border: 2px solid var(--border, #d9dde3); border-radius: 10px; cursor: pointer; font-weight: 600; }
.poi-cats label:has(input:checked) { border-color: var(--accent, #1f6feb); background: rgba(31,111,235,.08); }
.poi-cats input { position: absolute; opacity: 0; pointer-events: none; }
.poi-cats .poi-cat-dot { width: 34px; height: 34px; }

.zone-ask { max-width: 460px; }
.zone-ask ul { margin: .4rem 0 .8rem; padding-left: 1.2rem; }
.zone-ask li { margin: .25rem 0; }

/* új túra: hogyan kösse össze a pontokat */
.style-card { max-width: 420px; }
.style-choices { display: grid; gap: .5rem; margin: .6rem 0 .8rem; }
.style-choice { display: flex; align-items: center; justify-content: flex-start; gap: .8rem; text-align: left; padding: .7rem .9rem; border-radius: 12px; }
.style-choice b { font-size: 1.6rem; font-weight: 400; }
.style-choice span { display: flex; flex-direction: column; }
.style-choice small { color: var(--muted); font-weight: 400; }
.rp-btn:disabled { opacity: .45; cursor: default; }

/* a túra neve alatt: melyik profillal tervez */
.tour-profile { color: var(--muted); font-size: .85rem; margin: -.2rem 0 .3rem; }
.list .sub.tour-profile { margin: 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: 6px; 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; }
.compare-banner button { color: #263238; }

/* 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;
}
.country-picker label.country-row input { flex: 0 0 auto; width: 1.2em; height: 1.2em; margin: 0; padding: 0; }

/* Szerverterhelés (admin) */
.load-card { width: min(860px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
.load-card h3 { margin: 0; }
.load-verdict { border-radius: 10px; padding: .6rem .8rem; margin-bottom: .8rem; border: 1px solid var(--border); background: var(--hover); }
.load-verdict ul { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .9rem; }
.load-verdict.ok { border-color: #2e9e5b; background: rgba(46, 158, 91, .12); }
.load-verdict.warn { border-color: var(--accent); background: rgba(245, 166, 35, .15); }
.load-verdict.upgrade { border-color: var(--danger); background: rgba(217, 48, 37, .12); }
.load-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; }
.load-stat { border: 1px solid var(--border); border-radius: 10px; padding: .5rem .65rem; min-width: 0; }
.load-stat strong { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.load-h { margin: 1.1rem 0 .3rem; font-size: .95rem; }
.load-chart { --c1: var(--primary); --c2: #e8890c; --c3: #2e9e5b; }
.chart { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--hover); opacity: .6; }
.chart .c1 { stroke: var(--c1); fill: var(--c1); }
.chart .c2 { stroke: var(--c2); fill: var(--c2); }
.chart .c3 { stroke: var(--c3); fill: var(--c3); }
.chart path.line { fill: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--muted); }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: .35rem; vertical-align: middle; }
.chart-legend i.c1 { background: var(--c1); }
.chart-legend i.c2 { background: var(--c2); }
.chart-legend i.c3 { background: var(--c3); }
.heat-grid { display: grid; grid-template-columns: 2.4rem repeat(24, 1fr); gap: 2px; font-size: .7rem; color: var(--muted); }
.heat-hour { text-align: left; }
.heat-day { align-self: center; }
.heat-cell { aspect-ratio: 1.3; border-radius: 3px; background: color-mix(in srgb, var(--primary) var(--heat, 6%), transparent); }
.heat-cell.empty { background: var(--hover); }
@media (prefers-color-scheme: dark) {
  .load-chart { --c2: #f5a623; --c3: #4cc27f; }
}
