:root {
  --page: #005293;     /* GladFest / Swedish blue */
  --bg: #f4d46a;       /* GladFest yellow panel */
  --card: #fffdf5;
  --fg: #1f2937;
  --muted: #5b6270;
  --line: #e6d79c;
  --accent: #005293;
  --grid: #ece6cf;
  --lvl-calm: #1f8a5b;
  --lvl-normal: #2b6cb0;
  --lvl-loud: #b86e00;
  --lvl-veryloud: #c62828;
  --warn-line: #b86e00;
  --alarm-line: #c62828;
  --series-avg: #2563eb;
  --series-max: #9aa3b5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0b1f33;
    --bg: #12151c;
    --card: #1b202b;
    --fg: #eceff6;
    --muted: #a3acbf;
    --line: #2b3243;
    --accent: #6ea0ff;
    --grid: #262d3c;
    --lvl-calm: #43c58a;
    --lvl-normal: #6ea8e8;
    --lvl-loud: #f0b03a;
    --lvl-veryloud: #ff6b63;
    --warn-line: #f0b03a;
    --alarm-line: #ff6b63;
    --series-avg: #6ea0ff;
    --series-max: #6b7690;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  padding: 16px;
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 880px; margin: 0 auto; padding: 16px 18px; background: var(--bg); border-radius: 16px;
         box-shadow: 0 6px 12px -2px rgba(0,0,0,.16); }
@media (max-width: 480px) { body { padding: 8px; } .wrap { padding: 12px; } }
/* header: name, location and site on the left, logo on the right, one row */
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.head .titles { min-width: 0; }
.head h1 { overflow-wrap: anywhere; }
.head .sub { margin: 0; }
.head a.brand { flex: none; }
.head a.brand img { height: 120px; width: auto; display: block; }
@media (max-width: 560px) { .head a.brand img { height: 72px; } }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.top a.back { text-decoration: none; font-size: 15px; }
select {
  font: inherit; font-size: 14px; color: var(--fg); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
}
h1 { margin: 4px 0 2px; font-size: 26px; line-height: 1.2; }
.sub { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 10px; font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* szintek */
.lvl-calm { --lvl: var(--lvl-calm); }
.lvl-normal { --lvl: var(--lvl-normal); }
.lvl-loud { --lvl: var(--lvl-loud); }
.lvl-veryloud { --lvl: var(--lvl-veryloud); }
.lvl-none { --lvl: var(--muted); }

/* hero érték */
.hero { text-align: center; padding: 20px 16px 18px; border-left: 8px solid var(--lvl); }
.hero .num { font-size: clamp(56px, 18vw, 96px); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--lvl); }
.hero .unit { font-size: 22px; color: var(--muted); margin-left: 6px; font-weight: 500; }
.hero .label { margin-top: 6px; font-size: 20px; font-weight: 600; color: var(--lvl); }
.status { margin-top: 8px; font-size: 14px; color: var(--muted); display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--lvl-calm); }
.dot.off { background: var(--lvl-veryloud); }

.gauge { position: relative; height: 12px; border-radius: 6px; background: var(--grid); margin: 16px 6px 4px; overflow: visible; }
.gauge .fill { height: 100%; border-radius: 6px; background: var(--lvl); width: 0; transition: width .5s ease; }
.gauge .tick { position: absolute; top: -4px; width: 2px; height: 20px; background: var(--fg); opacity: .55; }
.gauge-labels { position: relative; height: 16px; margin: 0 6px; font-size: 11px; color: var(--muted); }
.gauge-labels span { position: absolute; transform: translateX(-50%); }

/* statisztikák */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 500; }

/* grafikon */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tabs button {
  font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--fg);
}
.tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .tabs button[aria-pressed="true"] { color: #0b1220; } }
.chartbox { position: relative; }
canvas { display: block; width: 100%; height: 280px; touch-action: pan-y; }
.tip {
  position: absolute; pointer-events: none; z-index: 2; min-width: 120px;
  background: var(--card); color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 9px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.18);
  display: none; white-space: nowrap;
}
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 5px; border-radius: 2px; }
.legend .avg { background: var(--series-avg); }
.legend .max { background: var(--series-max); }
.legend .warn { background: var(--warn-line); }
.legend .alarm { background: var(--alarm-line); }

/* események */
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 500; }
td.num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* áttekintő kártyák */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
a.dev { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line);
        border-left: 6px solid var(--lvl); border-radius: 12px; padding: 14px 16px; }
a.dev:hover, a.dev:focus-visible { border-color: var(--lvl); }
a.dev .n { font-weight: 650; }
a.dev .l { color: var(--muted); font-size: 13px; }
a.dev .big { font-size: 40px; font-weight: 700; color: var(--lvl); font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 8px; }
a.dev .big small { font-size: 16px; color: var(--muted); font-weight: 500; }
a.dev .lab { font-size: 14px; font-weight: 600; color: var(--lvl); }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.foot { margin: 18px 0 30px; font-size: 13px; color: var(--muted); text-align: center; }

.mt { margin-top: 14px; }
