:root {
  color-scheme: light;
  --ink: #182c24;
  --muted: #53655c;
  --green: #1c4936;
  --dark: #122a21;
  --red: #9b263c;
  --gold: #efc471;
  --paper: #fffcf4;
  --line: #e3dccb;
  --cream: #f5efe2;
  --radius: 25px;
  --shadow: 0 18px 45px #132e2311;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
[hidden] { display: none !important; }
.wrap { width: min(1216px, calc(100% - 56px)); margin-inline: auto; }
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--dark); color: var(--paper); }
.hero::before {
  position: absolute; z-index: -2; inset: 0; content: "";
  background:
    radial-gradient(ellipse at 95% 30%, #24513d 0%, transparent 60%),
    radial-gradient(circle at 68% 37%, #efc47648 0 1px, transparent 2px),
    radial-gradient(circle at 88% 58%, #efc47655 0 1px, transparent 2px),
    #122a21;
}
.family-page .hero::before, .demo-page .hero::before {
  background: url('/mesehinto-cover.webp') 86% 42% / cover no-repeat, var(--dark);
  left: 29%;
}
.family-page .hero::after, .demo-page .hero::after {
  position: absolute; z-index: -1; inset: 0; content: "";
  background: linear-gradient(90deg, #122a21 25%, #122a21f2 38%, #122a2180 58%, #122a2100 86%),
    linear-gradient(0deg, #122a21b8, transparent 24%);
}
.hero-inner { position: relative; padding-block: clamp(42px, 6vw, 88px) clamp(54px, 7vw, 100px); }
.identity {
  display: inline-flex; align-items: center; gap: 8px; color: var(--gold);
  font-weight: 750; letter-spacing: .13em; text-transform: uppercase; font-size: .76rem;
}
h1, h2, p { margin: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; text-wrap: balance; }
h1 { margin-block: 15px 18px; font-size: clamp(3.15rem, 8.4vw, 7.6rem); letter-spacing: -.075em; line-height: .91; }
h1 em { display: block; font-weight: inherit; color: #f1c674; }
h2 { font-size: clamp(1.55rem, 3.3vw, 2.05rem); letter-spacing: -.048em; line-height: 1.08; }
.hero p { color: #ebe4d3; font-weight: 550; }
.family-page .hero h1, .demo-page .hero h1 { max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 21px; margin-top: 26px; }
.hero-actions .button-link { background: var(--gold); color: #2a2519; box-shadow: 0 6px 22px #10130c32; }
.hero-actions .button-link span { font-size: 1.15em; }
.hero-secondary { color: #fff7e5; font-weight: 680; }
main { position: relative; margin-top: -25px; }
#kovetes { scroll-margin-top: 16px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.map-heading, .map-footer { padding: 19px 23px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.map-heading { min-height: 108px; align-items: flex-start; }
.map-heading h2 { margin-block: 7px 4px; max-width: 23ch; }
.map-footer { min-height: 65px; flex-wrap: wrap; }
.map-switch { display: flex; flex-wrap: nowrap; flex-shrink: 0; border-radius: 14px; background: #eeeade; padding: 4px; }
.map-switch button { color: #34453c; background: transparent; padding: .5rem .66rem; font-size: .83rem; min-height: 40px; border-radius: 10px; }
.map-switch button[aria-pressed="true"] { color: #fff; background: var(--green); box-shadow: 0 2px 5px #182c2433; }
.status { color: var(--red); font-size: .83rem; font-weight: 760; }
.status[data-state="live"] { color: #216348; }
.status[data-state="stale"] { color: #835324; }
.status::before { content: "●"; margin-right: .42rem; }
.status:empty::before { content: none; }
.stop-clock {
  display: inline-block; margin-top: 8px; padding: .38rem .65rem; border-radius: 8px;
  background: #e1eddf; color: #214e38; font-weight: 750; font-variant-numeric: tabular-nums;
}
.map { height: clamp(320px, 52vh, 550px); background: #e6eddf; }
.muted { color: var(--muted); font-size: .91rem; line-height: 1.5; }
.stops-card, .operator-card { padding: 23px; }
.timetable-heading { padding-bottom: 11px; }
.timetable-heading p { margin-top: 5px; }
.stops { list-style: none; margin: 0; padding: 0; }
.stops li {
  display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 9px;
  padding: .72rem .5rem .73rem .1rem; border-top: 1px solid var(--line);
}
.stops li[data-state="current"] { background: #eaf2e5; border-radius: 12px; border-top-color: transparent; }
.stop-timeline { display: flex; align-items: center; flex-direction: column; gap: 4px; }
.stop-pin {
  display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%;
  color: #365044; background: #ece9dc; font-size: .74rem; font-weight: 800;
}
[data-state="next"] .stop-pin { color: #5b3a12; background: #f4deb2; }
[data-state="current"] .stop-pin { color: #fff; background: var(--green); }
[data-state="visited"] .stop-pin { color: #206047; background: #e0eddf; }
.stops time { font-variant-numeric: tabular-nums; color: var(--red); font-size: .81rem; font-weight: 750; }
.stops strong { display: block; margin-bottom: 2px; }
.stops .stop-state { display: block; color: #24593f; font-size: .82rem; font-weight: 760; }
.stops .stop-state:empty { display: none; }
.stop-planned-arrival { color: #53655c; }
.stop-timing-facts, .stop-tooltip-facts { white-space: pre-line; font-variant-numeric: tabular-nums; }
.stop-timing-facts { color: #24593f; font-size: .88rem; font-weight: 720; }
.stop-timing-facts:empty, .stop-tooltip-facts:empty { display: none; }
.stop-links { display: flex; flex-wrap: wrap; column-gap: 12px; }
.stop-timing-tooltip.leaflet-tooltip { max-width: 230px; padding: 6px 9px; white-space: normal; color: #182c24; }
.stop-tooltip-facts { font-weight: 700; }
.route-legend { display: flex; flex-wrap: wrap; gap: 7px 18px; list-style: none; margin: 0; padding: 10px 18px; font-size: .82rem; }
.route-legend li { display: flex; align-items: center; gap: 6px; }
.route-legend li::before { content: ''; width: 23px; border-top: 4px solid; }
#legend-traveled::before { border-color: #207555; }
#legend-upcoming::before { border-color: #24495a; border-top-style: dashed; }
#legend-detour::before { border-color: #a94b03; }
#legend-previous::before { border-color: #626987; border-top-style: dotted; }
.reroute-notice.leaflet-tooltip { max-width: 230px; padding: 7px 11px; border-color: #ab540b; background: #fff3d4; color: #623006; white-space: normal; font-size: .82rem; font-weight: 750; text-align: center; }
.reroute-notice.leaflet-tooltip-top::before { border-top-color: #ab540b; }
.stops a, .source, .text-button { font-size: .84rem; }
.timetable-note { margin: 11px 0 3px; }
a { color: #24614a; text-underline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
button, .button-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  border: 0; border-radius: 12px; padding: .62rem .92rem; color: #fff; background: var(--green);
  font: inherit; font-weight: 750; cursor: pointer; text-decoration: none;
}
button:hover, .button-link:hover { filter: brightness(1.09); }
button:disabled { opacity: .5; cursor: default; }
button.quiet { background: #e8ede3; color: #224c38; }
button.danger { background: #f3e4e1; color: #892a32; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #b7721d; outline-offset: 3px; }
button.text-button { min-height: 32px; padding: 3px 0; margin-right: 12px; color: #245c43; background: none; text-decoration: underline; text-underline-offset: 3px; }
.leaflet-marker-icon.hint { font-size: 1.55rem; display: grid; place-items: center; border: 2px solid #fff6e6; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 5px #ab334845, 0 3px 12px #1c312b9c; }
.leaflet-marker-icon.hint.is-stale { background: #6c665e; box-shadow: 0 3px 12px #1c312b9c; }
.footer { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; padding-block: 22px; color: var(--muted); font-size: .82rem; }
.notice { padding: 14px 16px; border: 1px solid #d9b878; border-radius: 14px; background: #fff7df; margin-bottom: 12px; }

.operator-page .hero-inner, .admin-page .hero-inner { padding-block: 28px 53px; }
.operator-page h1, .admin-page h1 { font-size: clamp(2.5rem, 6.5vw, 4.2rem); margin-block: 10px 10px; }
.operator-page main { max-width: 660px; }
.operator-card form { display: grid; gap: 10px; margin-block: 17px; }
.operator-card input, .admin-toolbar input, .admin-toolbar select, .stop-fields input {
  font: inherit; min-width: 0; padding: .68rem; border: 1px solid #828f82; border-radius: 10px;
  color: var(--ink); background: #fffefa;
}
.operator-card input { text-align: left; font-size: 1.05rem; min-height: 52px; }
.operator-heading { display: grid; gap: 8px; }
.operator-heading h2 { font-size: clamp(1.65rem, 4vw, 2.35rem); }
.operator-page #start, #stop-action { width: 100%; min-height: 63px; font-size: 1.17rem; }
#stop-action { margin-top: 14px; }
#stop-action[data-action="arrive"] { background: var(--red); }
.operator-tip { margin-top: 16px; }
.operator-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block: 16px; }
.operator-message { border-radius: 10px; margin-block: 16px; padding: 11px 13px; background: #efebe0; font-weight: 620; }
.operator-message[data-tone="ok"] { background: #e3eddf; color: #24543d; }
.operator-message[data-tone="error"] { background: #f3e2df; color: #7b2832; }
.gps-health { padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; background: #f3ecdb; color: #63491e; }
.gps-health[data-health="ok"] { background: #e3eddf; color: #24543d; }
.gps-health[data-health="disconnected"], .gps-health[data-health="permission"] { background: #f3e2df; color: #7b2832; }
#operator-gps-status { font-weight: 780; }
#operator-gps-detail { margin-top: 3px; font-size: .86rem; }
.schedule-check { margin-block: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.schedule-check h3 { margin: 0 0 7px; font-size: 1rem; }
#schedule-pace { width: 4.5rem; min-height: 40px; padding-inline: 8px; font: inherit; }
#schedule-check-status { margin-top: 6px; }
#schedule-warnings { margin: 6px 0 0; padding-inline-start: 18px; color: #75461b; }
#schedule-warnings:empty { display: none; }
#schedule-warnings li { margin-top: 4px; }
#public-link { display: inline-block; margin-top: 8px; }

.admin-page { padding-bottom: 24px; }
.admin-layout { margin-top: 16px; }
.admin-toolbar { margin-bottom: 14px; padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-toolbar h2 { font-size: 1.55rem; }
.admin-toolbar .muted { margin-top: 4px; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-actions button[aria-pressed="true"], .stop-select[aria-pressed="true"] { background: var(--green); color: #fff; }
.admin-code-output { display: flex; align-items: center; flex-wrap: wrap; width: 100%; gap: 8px; }
.admin-toolbar label, .stop-fields label { display: grid; gap: 4px; font-size: .9rem; font-weight: 700; }
.admin-code-output input { width: min(100%, 430px); font-family: ui-monospace, monospace; }
.admin-stops { list-style: none; padding: 0; margin-block: 12px; }
.admin-stops li { border-top: 1px solid var(--line); padding: 8px 0; }
.admin-stops li[data-selected="true"] { padding: 10px; border: 1px solid #cbd8c8; border-radius: 13px; background: #f0f3e8; margin-block: 4px; }
.admin-stops .stop-select { text-align: left; justify-content: flex-start; width: 100%; margin-bottom: 3px; }
.stop-fields { display: grid; gap: 8px; margin-block: 5px 10px; }
.admin-stops .admin-actions { margin-bottom: 5px; }
.admin-page #admin-login p { margin-block: 10px 16px; }
.admin-page .map-card .map { height: clamp(320px, 52vh, 550px); }
.editor-note { margin-block: 8px 14px; }
.publish-bar { padding-top: 10px; border-top: 1px solid var(--line); }
.publish-bar p { padding-bottom: 7px; }
@media (min-width: 961px) {
  .admin-layout .map-card { position: sticky; top: 14px; }
}
@media (max-width: 950px) {
  .layout { grid-template-columns: 1fr; }
  .wrap { width: calc(100% - 34px); }
  .admin-page .map-card .map { height: clamp(260px, 45vh, 450px); }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 22px); }
  .hero .wrap { width: calc(100% - 40px); }
  .family-page .hero::before, .demo-page .hero::before { inset: 0 0 13% 0; background-position: 62% 42%; }
  .family-page .hero::after, .demo-page .hero::after {
    background: linear-gradient(0deg, #122a21 8%, #122a21eb 35%, #122a2166 68%, #122a2129 100%);
  }
  .family-page .hero-inner, .demo-page .hero-inner { padding-block: clamp(155px, 43vw, 215px) 53px; }
  h1 { font-size: clamp(3.05rem, 11.2vw, 4.45rem); }
  .hero-actions { gap: 10px 16px; margin-top: 18px; }
  .hero-secondary { font-size: .91rem; }
  .map-heading { flex-direction: column; align-items: stretch; min-height: auto; }
  .map-switch { width: fit-content; }
  .map-heading, .map-footer, .stops-card, .operator-card, .admin-toolbar { padding-inline: 16px; }
  .card { border-radius: 19px; }
  .operator-tools button { padding-inline: 8px; font-size: .92rem; }
  .admin-page .map-footer button { font-size: .83rem; min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
.routing-credit { padding: 0 23px 12px; font-size: .8rem; }
#street-preview-status { margin-top: 5px; color: #934133; }
#suggested-draft p { margin-block: 5px; }
.point-review { margin-block: 6px 10px; }
.hint-vector {
  position: absolute;
  inset: 0;
  display: none;
  transform: rotate(var(--heading, 0deg));
  pointer-events: none;
  filter: drop-shadow(0 1px 2px #342114);
}
.hint-vector::before {
  position: absolute;
  top: -20px;
  left: calc(50% - 9px);
  width: 18px;
  height: 23px;
  background: #ffd277;
  clip-path: polygon(50% 0, 100% 70%, 74% 67%, 74% 100%, 26% 100%, 26% 67%, 0 70%);
  content: "";
}
.hint.has-heading .hint-vector { display: block; }

#talalkozas { scroll-margin-top: 14px; }
.family-stop { display: grid; grid-template-columns: minmax(180px, .82fr) minmax(0, 1.35fr) auto; align-items: center; gap: 18px; padding: 21px 23px; margin-bottom: 18px; }
.family-stop label { display: block; margin-bottom: 8px; font-weight: 760; }
.family-stop select { width: 100%; min-height: 46px; padding: 8px 10px; border: 1px solid #828f82; border-radius: 10px; color: var(--ink); background: #fffefa; font: inherit; }
.family-stop-detail h2 { margin: 4px 0; }
#family-stop-arrival { margin: 5px 0; color: #835324; font-weight: 750; }
#family-stop-arrival[data-estimated="true"] { color: #216348; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
#family-stop-time { color: #34473b; font-size: .9rem; font-weight: 690; }
#family-stop-signal { margin-top: 4px; color: #87501c; font-weight: 650; }
.family-stop-action { display: grid; gap: 8px; justify-items: start; }
.attendance-card { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; }
.attendance-form, .stop-feedback { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.attendance-form label { margin: 0; }
.attendance-form input { width: 4.75rem; min-height: 46px; padding: 8px; font: inherit; }
.attendance-card a, #attendance-status { font-size: .9rem; }
#attendance-status:not(:empty) { margin-top: 6px; }
.attendance-card > a { display: inline-block; margin-top: 8px; }
#attendance-withdraw { margin: 6px 8px 0 0; }
.stop-feedback { margin-top: 12px; }
.stop-feedback button[aria-pressed="true"] { background: var(--green); color: white; }
.attendance-notice { margin-top: 18px; padding: 18px 22px; }
.attendance-notice summary { cursor: pointer; font-weight: 700; }
.attendance-notice p { margin-top: 8px; line-height: 1.5; }
.attendance-report { padding: 18px 22px; margin-bottom: 18px; }
.attendance-report-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.attendance-report-header p { margin-top: 5px; }
.attendance-table { overflow-x: auto; margin-top: 10px; }
.attendance-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.attendance-table th, .attendance-table td { border-bottom: 1px solid var(--line); padding: 10px 12px 10px 0; text-align: left; }
.attendance-table th { font-size: .88rem; }
.order-optimizer { padding: 18px 22px; scroll-margin-top: 12px; }
.event-cms { margin-bottom: 18px; padding: 18px 22px; }
.event-cms-form, .event-cms-form fieldset { display: grid; gap: 12px; }
.event-cms-form { max-width: 760px; margin-top: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.event-cms-form fieldset, .event-cms-form .admin-actions, .event-cms-form > p { grid-column: 1 / -1; }
.event-cms-form fieldset { margin: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); border: 1px solid var(--line); border-radius: 10px; }
.event-cms-form label { display: grid; gap: 5px; font-weight: 650; }
.event-cms-form input { width: 100%; min-height: 44px; padding: 8px; font: inherit; }
#network-form { border-top: 1px solid var(--line); padding-top: 12px; }
.order-optimizer summary { cursor: pointer; font-weight: 750; font-size: 1.1rem; }
.order-optimizer > p { margin-top: 8px; }
.optimizer-settings { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.optimizer-settings label { display: grid; gap: 5px; font-weight: 650; }
.optimizer-settings select { min-height: 44px; max-width: min(100%, 18rem); padding-inline: 8px; font: inherit; }
.opt-extra-points, .opt-result { margin: 10px 0; padding-inline-start: 1.6rem; }
.opt-extra-points:empty { display: none; }
.opt-extra-points li, .opt-result li { margin-top: 6px; }
.opt-extra-points button { margin-inline-start: 8px; padding: 4px 8px; min-height: 35px; }
#opt-add-via[aria-pressed="true"] { background: var(--green); color: white; }
.family-map-link { font-size: .88rem; }
@media (max-width: 950px) {
  .family-stop { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .family-stop-action { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; }
}
@media (max-width: 600px) {
  .family-stop { grid-template-columns: 1fr; gap: 13px; padding: 16px; }
  .family-stop-action { grid-column: auto; }
}
.admin-code-output #operator-code { width: 5.5rem; text-align: center; font-weight: 750; }
#undo-stop { margin-top: 9px; min-height: 48px; width: 100%; }
.stop-placement { display: grid; gap: 4px; margin-block: 8px; font-weight: 680; font-size: .9rem; }
.stop-placement select { padding: .5rem; border: 1px solid #828f82; border-radius: 9px; background: #fffefa; font: inherit; }
#speed-label { margin: 0 0 6px; }
#demo-rate-control { display: grid; gap: 4px; font-weight: 680; font-size: .85rem; }
#demo-rate { min-height: 42px; padding: .4rem .65rem; border: 1px solid #828f82; border-radius: 9px; background: #fffefa; font: inherit; }
.leg-panel { padding: 15px 23px; border-bottom: 1px solid var(--line); background: #f1f4e9; }
.leg-panel h3 { margin: 0 0 3px; font-size: 1.03rem; }
.leg-panel progress { appearance: none; width: 100%; height: 9px; margin: 8px 0 4px; border: 0; border-radius: 10px; overflow: hidden; background: #dce5d8; }
.leg-panel progress::-webkit-progress-bar { background: #dce5d8; }
.leg-panel progress::-webkit-progress-value { background: #247757; }
.leg-panel progress::-moz-progress-bar { background: #247757; }
.leg-facts { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: .88rem; font-weight: 650; }
@media (max-width: 600px) { .leg-panel { padding-inline: 16px; } }
