:root {
  --wall: #f5f6f3;       /* ασβέστης */
  --wall-2: #ffffff;
  --ink: #14233f;        /* μελάνι */
  --muted: #4f5b6e;
  --sign: #1d4f91;       /* μπλε πινακίδας */
  --sign-ink: #ffffff;
  --rule: #d5d9d1;
  --soft: #eceee8;
  --off: #9aa3b2;
  --radius: 12px;
  /* EAQI, χρώματα ΕΟΠ */
  --q1: #50f0e6; --q2: #50ccaa; --q3: #f0e641; --q4: #ff5050; --q5: #960032; --q6: #7d2181;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall: #0f1a2c; --wall-2: #14213a; --ink: #e9ecf2; --muted: #a7b0c0;
    --sign: #2a63b0; --rule: #26344f; --soft: #1a2944; --off: #5d6880;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wall: #0f1a2c; --wall-2: #14213a; --ink: #e9ecf2; --muted: #a7b0c0;
  --sign: #2a63b0; --rule: #26344f; --soft: #1a2944; --off: #5d6880;
  color-scheme: dark;
}

* { box-sizing: border-box; }
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) { :root:not([data-theme="light"]) a { color: #8fb4ea; } }
:root[data-theme="dark"] a { color: #8fb4ea; }
button { font: inherit; color: inherit; }

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

/* ---------- κεφαλίδα ---------- */
.top {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px 24px 10px;
  max-width: 1440px; 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; }
.tagline { margin: 0; color: var(--muted); font-size: 15px; flex: 1 1 260px; }
.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(--q2); margin-right: 6px; vertical-align: 1px; }
.status.err .dot { background: var(--q4); }

/* ---------- επιλογές ---------- */
.controls {
  display: flex; gap: 10px 16px; flex-wrap: wrap;
  padding: 4px 24px 12px; max-width: 1440px; margin: 0 auto;
}
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px;
  background: var(--soft); border-radius: 10px; padding: 3px;
}
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--muted); font-weight: 600; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--wall-2); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg button:focus-visible { outline: 2px solid var(--sign); outline-offset: 1px; }

/* ---------- διάταξη ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr); gap: 16px;
  padding: 0 24px 24px; max-width: 1440px; margin: 0 auto;
  height: calc(100vh - 150px); min-height: 560px;
}
.mapwrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); background: var(--soft); }
#map { position: absolute; inset: 0; }
.panel {
  background: var(--wall-2); border: 1px solid var(--rule); border-radius: var(--radius);
  overflow-y: auto; padding: 18px 20px 24px;
}

/* ---------- υπόμνημα ---------- */
.legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 500;
  background: var(--wall-2); border: 1px solid var(--rule); border-radius: 10px;
  padding: 8px 10px; font-size: 12px; max-width: calc(100% - 24px);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.legend .t { font-weight: 600; margin-bottom: 4px; }
.legend .row { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.legend .it { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); }
.legend .ramp { height: 10px; width: 180px; border-radius: 5px; background: linear-gradient(90deg, #2c7bb6, #abd9e9, #ffffbf, #fdae61, #d7191c); }
.legend .ends { display: flex; justify-content: space-between; color: var(--muted); }
.legend .note { color: var(--muted); margin-top: 4px; }

/* ---------- χάρτης ---------- */
.leaflet-container { font-family: inherit; background: var(--soft); }
.leaflet-tooltip.klabel {
  background: transparent; border: 0; box-shadow: none; padding: 0;
  font-weight: 700; font-size: 13px; color: var(--ink);
  text-shadow: 0 0 3px var(--wall-2), 0 0 3px var(--wall-2), 0 0 6px var(--wall-2);
}
.leaflet-tooltip.klabel::before { display: none; }
.leaflet-tooltip.tip { font-family: inherit; font-size: 13px; border-radius: 8px; }
.tip b { display: block; }
.dark-tiles .leaflet-tile { filter: invert(.92) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.4); }

/* ---------- πάνελ ---------- */
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.crumbs button { border: 0; background: none; padding: 0; color: var(--sign); cursor: pointer; font-weight: 600; }
.crumbs span { color: var(--muted); }
.panel h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.panel .sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 8px; }

.hero { margin: 14px 0 12px; }
.hero .what { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.hero .dotq { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.hero .why { color: var(--muted); font-size: 13px; margin-top: 2px; }
.scale { margin-top: 12px; max-width: 360px; }
.scale .steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; align-items: end; height: 22px; }
.scale .step { height: 10px; border-radius: 3px; opacity: .35; }
.scale .step.on { height: 22px; opacity: 1; box-shadow: 0 0 0 2px var(--wall-2), 0 0 0 3.5px var(--ink); }
.scale .ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.notice { border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 10px 0; background: var(--soft); }
.notice.warn { background: #fff3cd; color: #5c4400; }
:root[data-theme="dark"] .notice.warn { background: #3a3013; color: #f5dc8a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .notice.warn { background: #3a3013; color: #f5dc8a; } }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpi { background: var(--wall); border: 1px solid var(--rule); border-radius: 10px; padding: 8px 10px; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.kpi .v small { font-size: 11px; color: var(--muted); font-weight: 600; }
.kpi .chip { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

.facts { display: grid; gap: 8px; }
.fact { display: flex; gap: 10px; align-items: baseline; }
.fact .big { font-size: 20px; font-weight: 700; min-width: 64px; }
.fact .txt { color: var(--muted); font-size: 13.5px; }

.chartbox { position: relative; height: 210px; }
.tabs { display: flex; gap: 2px; margin-bottom: 8px; }
.tabs button { border: 0; background: var(--soft); padding: 4px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button[aria-pressed="true"] { background: var(--sign); color: #fff; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--rule); }
.list li:first-child { border-top: 0; }
.list button {
  width: 100%; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px;
  text-align: left; border: 0; background: none; padding: 9px 4px; cursor: pointer; border-radius: 8px;
}
.list button:hover { background: var(--soft); }
.list .rk { color: var(--muted); font-weight: 700; text-align: center; }
.list .nm { font-weight: 600; }
.list .nm small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.list .val { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.list .val .chip { width: 12px; height: 12px; border-radius: 3px; }
.list .off { color: var(--off); }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.links a { font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid var(--rule); padding: 5px 10px; border-radius: 8px; }
.links a:hover { background: var(--soft); }

.empty { color: var(--muted); padding: 30px 0; text-align: center; }

/* ---------- πληροφορίες ---------- */
.about { border-top: 1px solid var(--rule); background: var(--wall-2); }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; max-width: 1440px; margin: 0 auto; padding: 28px 24px 36px; }
.about h2 { font-size: 16px; margin: 0 0 8px; }
.about p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.about .sig { font-weight: 600; color: var(--ink); }

/* ---------- κινητό ---------- */
@media (max-width: 900px) {
  .top { padding: 12px 16px 6px; gap: 10px; }
  .tagline { font-size: 13px; }
  .controls { padding: 4px 16px 10px; }
  .seg { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
  .seg button { padding: 6px 10px; font-size: 13px; }
  .layout { grid-template-columns: 1fr; height: auto; padding: 0 16px 16px; }
  .mapwrap { height: 58vh; min-height: 340px; }
  .panel { overflow: visible; }
  .about-grid { grid-template-columns: 1fr; gap: 12px; padding: 22px 16px 28px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.leaflet-control-attribution { background: color-mix(in srgb, var(--wall-2) 85%, transparent) !important; color: var(--muted); }
