:root {
  --wall: #f5f6f3;       /* ασβέστης */
  --wall-2: #ffffff;
  --ink: #14233f;        /* μελάνι */
  --muted: #4f5b6e;
  --sign: #1d4f91;       /* μπλε πινακίδας */
  --sign-ink: #ffffff;
  --rule: #d5d9d1;
  --soft: #eceee8;
  --off: #9aa3b2;
  --asphalt: #2b3140;    /* οδόστρωμα στα διαγράμματα λωρίδων */
  --radius: 12px;
  /* βαθμίδες κίνησης */
  --l1: #2a9d8f; --l2: #e9b824; --l3: #e8702a; --l4: #b3152a;
  --nodata: #dfe3dc;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --wall: #0f1a2c; --wall-2: #14213a; --ink: #e9ecf2; --muted: #a7b0c0;
    --sign: #2a63b0; --rule: #26344f; --soft: #1a2944; --off: #5d6880; --asphalt: #0a1220;
    --l1: #3dbfae; --l2: #f2c744; --l3: #f58a45; --l4: #e0354b; --nodata: #1d2b47;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--wall);
  color: var(--ink);
  font-family: 'Commissioner', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sign); }
@media (prefers-color-scheme: dark) { a { color: #8fb4ea; } }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }

.envbar { background: #b45309; color: #fff; text-align: center; font-weight: 600; padding: 4px 16px; font-size: 13px; }

/* ---------- κεφαλίδα ---------- */
.top {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 14px 24px 12px;
  max-width: 1600px; margin: 0 auto;
}
.brand { text-decoration: none; display: inline-flex; }
.sign {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--sign); color: var(--sign-ink);
  border-radius: 8px; padding: 6px 16px 5px;
  box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 4px var(--sign-ink);
  line-height: 1.05; letter-spacing: .06em;
}
.sign-gr { font-weight: 700; font-size: 22px; }
.sign-en { font-weight: 600; font-size: 10px; letter-spacing: .18em; opacity: .9; }
.views { display: flex; gap: 4px; flex: 1 1 auto; }
.views a {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 16px;
  padding: 8px 14px; border-radius: 999px;
}
.views a:hover { color: var(--ink); background: var(--soft); }
.views a[aria-current="page"] { color: var(--ink); background: var(--wall-2); box-shadow: inset 0 0 0 1px var(--rule); }
.status {
  font-size: 13px; color: var(--muted);
  background: var(--wall-2); border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px;
}
.status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--l1); margin-right: 6px; vertical-align: 1px; }
.status.err .dot { background: var(--l4); }

/* ---------- κουμπιά επιλογής ---------- */
.seg { display: inline-flex; background: var(--wall-2); border: 1px solid var(--rule); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 6px 13px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--sign); color: var(--sign-ink); }

/* ---------- διάταξη ανάλυσης ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 16px;
  max-width: 1600px; margin: 0 auto; padding: 0 24px 24px;
  height: calc(100vh - 78px); min-height: 620px;
}
.mapwrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); background: var(--soft); }
#map { position: absolute; inset: 0; background: var(--soft); }
.leaflet-container { font: inherit; }
.leaflet-tile { filter: saturate(.18) contrast(.92) brightness(1.04); }
@media (prefers-color-scheme: dark) {
  .leaflet-tile { filter: invert(.92) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.3); }
  .leaflet-control-attribution { background: rgba(15,26,44,.75) !important; color: var(--muted) !important; }
  .leaflet-bar a { background: var(--wall-2); color: var(--ink); border-color: var(--rule); }
}
.mapbar { position: absolute; top: 12px; left: 54px; right: 12px; z-index: 500; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.mapbar > * { pointer-events: auto; box-shadow: 0 2px 10px rgba(20,35,63,.14); }
.legend {
  position: absolute; left: 12px; bottom: 24px; z-index: 500;
  background: var(--wall-2); border: 1px solid var(--rule); border-radius: 10px; padding: 9px 12px;
  font-size: 12.5px; color: var(--muted); box-shadow: 0 2px 10px rgba(20,35,63,.14);
  display: grid; gap: 4px;
}
.legend b { color: var(--ink); font-weight: 600; font-size: 12.5px; }
.legend .row { display: flex; align-items: center; gap: 7px; }
.sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.lv1 { background: var(--l1); } .lv2 { background: var(--l2); } .lv3 { background: var(--l3); } .lv4 { background: var(--l4); } .lv0 { background: var(--nodata); }

/* σταθμοί στον χάρτη */
.st { background: none; border: 0; }
.st svg { display: block; overflow: visible; }
.st path { stroke: var(--wall-2); stroke-width: 1.4; paint-order: stroke; stroke-linejoin: round; }
.st.l1 path { fill: var(--l1); } .st.l2 path { fill: var(--l2); } .st.l3 path { fill: var(--l3); } .st.l4 path { fill: var(--l4); }
.st.l0 path { fill: var(--off); }
.st.off circle { fill: var(--wall-2); stroke: var(--off); stroke-width: 1.5; }
.st.dim { opacity: .13; }
.st.minor { opacity: .7; }
.st.minor.dim { opacity: .08; }
.st.sel path { stroke: var(--ink); stroke-width: 2.4; }
.klabel { background: none; border: 0; color: var(--sign); font-weight: 700; font-size: 13px; text-align: center; text-shadow: 0 0 3px var(--wall-2), 0 0 3px var(--wall-2), 0 0 3px var(--wall-2); pointer-events: none; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .klabel { color: #9cc0f2; } }

/* ---------- πλαίσιο ---------- */
.panel { overflow-y: auto; padding: 2px 4px 24px 2px; display: grid; gap: 18px; align-content: start; scrollbar-width: thin; }
.card { background: var(--wall-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
.lead { font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
h2.h { font-size: 15px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
h2.h small { font-weight: 400; color: var(--muted); font-size: 13px; }
.back { border: 0; background: none; padding: 0; color: var(--sign); font-weight: 600; cursor: pointer; font-size: 14px; }
@media (prefers-color-scheme: dark) { .back { color: #8fb4ea; } }
.back:hover { text-decoration: underline; }

/* Το δρομάκι: δύο λωρίδες, μία προς Αθήνα και μία από Αθήνα */
.road { background: var(--asphalt); border-radius: 10px; padding: 10px 12px; margin-top: 14px; display: grid; gap: 0; color: #fff; }
.lane { display: grid; grid-template-columns: 96px 1fr 74px; align-items: center; gap: 12px; padding: 8px 0; }
.lane + .lane { border-top: 2px dashed rgba(255,255,255,.35); }
.lane-name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.lane-name small { display: block; font-weight: 400; opacity: .7; font-size: 12px; }
.lane-speed { text-align: right; font-weight: 700; font-size: 22px; line-height: 1; }
.lane-speed small { display: block; font-weight: 400; font-size: 11.5px; opacity: .7; margin-top: 3px; }
.dist { display: flex; height: 18px; gap: 2px; border-radius: 4px; overflow: hidden; }
.dist i { display: block; min-width: 2px; }
.dist.thin { height: 10px; border-radius: 3px; }
.dist-empty { height: 18px; border-radius: 4px; background: rgba(255,255,255,.12); }
.note { color: var(--muted); font-size: 13px; margin-top: 10px; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px 14px; margin-top: 14px; }
.kv div { border-top: 2px solid var(--rule); padding-top: 6px; }
.kv b { display: block; font-size: 20px; line-height: 1.15; }
.kv span { color: var(--muted); font-size: 12.5px; }

/* άξονες */
.rows { display: grid; }
.rowbtn {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: center;
  width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 10px 6px; border-top: 1px solid var(--rule); border-radius: 6px;
}
.rowbtn:first-child { border-top: 0; }
.rowbtn:hover { background: var(--soft); }
.plate {
  display: inline-block; background: var(--sign); color: var(--sign-ink); font-weight: 700; font-size: 12.5px; letter-spacing: .04em;
  padding: 3px 9px 2px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--sign), inset 0 0 0 2px rgba(255,255,255,.85);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.plate.big { font-size: 18px; padding: 6px 14px 5px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 4px var(--sign-ink); white-space: normal; }
.rowmeta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.minilanes { display: grid; gap: 4px; }
.minilane { display: grid; grid-template-columns: 14px 1fr 34px; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.minilane b { color: var(--ink); text-align: right; font-weight: 600; }
.minilane .dist-empty { height: 10px; background: var(--soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip .sw { width: 10px; height: 10px; border-radius: 50%; }

/* κοινότητες */
.krow { grid-template-columns: 54px minmax(0, 1fr) 62px; }
.krow .kid { font-weight: 700; color: var(--sign); font-size: 15px; }
@media (prefers-color-scheme: dark) { .krow .kid { color: #9cc0f2; } }
.krow .ksp { text-align: right; font-weight: 700; }
.krow .ksp small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }

/* λωρίδα σταθμών κατά μήκος του άξονα */
.strip { display: flex; gap: 2px; margin-top: 8px; }
.strip button { flex: 1 1 0; min-width: 6px; height: 26px; border: 0; padding: 0; border-radius: 3px; cursor: pointer; }
.strip button:hover, .strip button.hot { outline: 2px solid var(--ink); outline-offset: 1px; }
.strip-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 4px; }
.dirhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 16px; }
.dirhead:first-of-type { margin-top: 4px; }
.dirhead b { font-size: 15px; }
.dirhead span { color: var(--muted); font-size: 13px; }

/* γραφήματα */
.chart { width: 100%; height: auto; display: block; margin-top: 8px; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln-in { stroke: var(--sign); }
.chart .ln-out { stroke: #c4532d; }
@media (prefers-color-scheme: dark) { .chart .ln-in { stroke: #7fb0f0; } .chart .ln-out { stroke: #f0946e; } }
.key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.key i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.key .k-in { background: var(--sign); } .key .k-out { background: #c4532d; }
@media (prefers-color-scheme: dark) { .key .k-in { background: #7fb0f0; } .key .k-out { background: #f0946e; } }

/* πίνακας ημέρα × ώρα */
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.heat .hd { text-align: center; height: 16px; }
.heat .dw { display: flex; align-items: center; font-weight: 600; }
.heat .dw.today { color: var(--ink); }
.heat .c { aspect-ratio: 1 / 1; border-radius: 3px; background: var(--nodata); min-height: 12px; }
.heat .c.l1 { background: var(--l1); } .heat .c.l2 { background: var(--l2); } .heat .c.l3 { background: var(--l3); } .heat .c.l4 { background: var(--l4); }
.heat .c.some { background: var(--off); opacity: .55; }
.heat .c.now { outline: 2px solid var(--ink); outline-offset: 1px; }
.heat.pick .c, .heat.pick .dw { cursor: pointer; }

.tip {
  position: fixed; z-index: 2000; pointer-events: none; max-width: 260px;
  background: var(--ink); color: var(--wall); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; line-height: 1.4;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.tip b { font-weight: 700; }
.leaflet-tooltip.sttip { background: var(--ink); color: var(--wall); border: 0; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; line-height: 1.4; box-shadow: 0 6px 20px rgba(0,0,0,.25); white-space: normal; width: max-content; max-width: 250px; }
.leaflet-tooltip.sttip::before { display: none; }

/* ---------- Πότε να φύγω ---------- */
.when { max-width: 1040px; margin: 0 auto; padding: 14px 24px 40px; display: grid; gap: 22px; }
.when h1 { font-size: clamp(28px, 4.2vw, 44px); line-height: 1.08; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.when .intro { color: var(--muted); font-size: 17px; max-width: 62ch; margin-top: 10px; }
.q { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.plates { display: flex; flex-wrap: wrap; gap: 8px; }
.plates button {
  border: 0; cursor: pointer; background: var(--wall-2); color: var(--ink); font-weight: 700; font-size: 13.5px; letter-spacing: .04em;
  padding: 8px 13px 7px; border-radius: 7px; box-shadow: inset 0 0 0 1px var(--rule);
}
.plates button:hover { box-shadow: inset 0 0 0 2px var(--sign); }
.plates button[aria-pressed="true"] { background: var(--sign); color: var(--sign-ink); box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 4px var(--sign-ink); }
.plates .more { background: none; box-shadow: none; color: var(--sign); letter-spacing: 0; font-weight: 600; }
@media (prefers-color-scheme: dark) { .plates .more { color: #8fb4ea; } }
.choices { display: flex; gap: 22px 36px; flex-wrap: wrap; }
.answer { background: var(--wall-2); border: 1px solid var(--rule); border-radius: 16px; padding: 24px 26px; display: grid; gap: 22px; }
.answer .now { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.answer .bigsw { width: 14px; align-self: stretch; border-radius: 7px; min-height: 64px; }
.answer .nowtxt { font-size: clamp(20px, 2.6vw, 27px); font-weight: 700; line-height: 1.22; letter-spacing: -.01em; text-wrap: balance; }
.answer .nowsub { color: var(--muted); margin-top: 6px; font-size: 15px; }
.advice { font-size: 18px; line-height: 1.45; max-width: 66ch; }
.advice p + p { margin-top: 8px; }
.advice strong { font-weight: 700; }
.day { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; margin-top: 12px; }
.day .c { height: 54px; border-radius: 5px; background: var(--nodata); position: relative; }
.day .c.l1 { background: var(--l1); } .day .c.l2 { background: var(--l2); } .day .c.l3 { background: var(--l3); } .day .c.l4 { background: var(--l4); }
.day .c.some { background: var(--off); opacity: .55; }
.day .c.now::after { content: ''; position: absolute; left: 50%; top: -9px; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--ink); }
.day .c.now { outline: 2px solid var(--ink); outline-offset: 1px; }
.day .hl { text-align: center; font-size: 12px; color: var(--muted); }
.legendrow { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legendrow span { display: inline-flex; align-items: center; gap: 6px; }
.cover { color: var(--muted); font-size: 14px; border-left: 3px solid var(--rule); padding-left: 12px; max-width: 70ch; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--sign); font-weight: 600; cursor: pointer; font-size: 15px; text-align: left; }
@media (prefers-color-scheme: dark) { .linkbtn { color: #8fb4ea; } }
.linkbtn:hover { text-decoration: underline; }

/* ---------- σχετικά ---------- */
.about { border-top: 1px solid var(--rule); background: var(--wall-2); }
.about-grid { max-width: 1600px; margin: 0 auto; padding: 28px 24px 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.about h2 { font-size: 16px; margin-bottom: 8px; }
.about p { color: var(--muted); font-size: 14px; margin-bottom: 9px; max-width: 60ch; }
.about .sig { margin-top: 14px; }

.skeleton { color: var(--muted); padding: 24px 4px; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .mapwrap { height: 58vh; min-height: 360px; }
  .panel { overflow: visible; }
  .about-grid { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 600px) {
  .top { padding: 12px 14px 10px; gap: 10px; }
  .views a { padding: 7px 10px; font-size: 15px; }
  .status { order: 3; }
  .layout, .when { padding-left: 14px; padding-right: 14px; }
  .mapbar { left: 12px; top: 12px; }
  .leaflet-control-zoom { display: none; }
  .seg button { padding: 6px 10px; font-size: 13px; }
  .legend { font-size: 11.5px; padding: 7px 9px; }
  .answer { padding: 18px 16px; }
  .day { gap: 2px; } .day .c { height: 44px; border-radius: 3px; }
  .day .hl:nth-child(odd) { visibility: hidden; }
  .heat { gap: 1px; grid-template-columns: 28px repeat(24, minmax(0, 1fr)); }
  .heat .hd:nth-child(even) { visibility: hidden; }
  .lane { grid-template-columns: 78px 1fr 64px; gap: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .st svg { transition: opacity .2s; }
}
