:root {
  --bg: #f6f9fb; --ink: #0f2b3d; --muted: #5a7385; --line: #e2ebf0; --card: #fff;
  --brand: #0e7c86; --brand-d: #0a5a62; --brand-l: #e6f4f5;
  --ok: #1a7a3e; --ok-l: #e6f6ec; --warn: #b26b00; --warn-l: #fff4e0; --bad: #b3261e; --bad-l: #fdecec;
  --field: #fff; --field-line: #cbd8e0; --info: #1a5fb2; --info-l: #e6f0f6; --violet: #6b3fa0; --violet-l: #f1e8fb; --neutral-l: #eef1f3;
  --s1: #2e9e5b; --s2a: #e0b100; --s2b: #e07b00; --s3a: #d9531e; --s3b: #b3261e;
}
/* jszakai mddd (alaprtelmezett): <html data-theme="sotet"> */
[data-theme="sotet"] {
  color-scheme: dark;
  --bg: #0d1419; --ink: #dbe6ec; --muted: #8aa1b0; --line: #22313b; --card: #141e25; --field: #0f181e; --field-line: #2c3e4a;
  --brand: #2bb3bd; --brand-d: #7fd6dc; --brand-l: #123238;
  --ok: #5fcf8a; --ok-l: #12291c; --warn: #f0b04a; --warn-l: #2e2410; --bad: #f07a72; --bad-l: #331615;
  --info: #7fb4f0; --info-l: #14243a; --violet: #c3a0ef; --violet-l: #251b35; --neutral-l: #1c262d;
}
[data-theme="sotet"] .btn { color: #06181b; }
[data-theme="sotet"] .btn:hover { color: #06181b; }
[data-theme="sotet"] .btn.danger { color: #fff; }
[data-theme="sotet"] .note-warn { border-color: #5a4418; }
[data-theme="sotet"] .flash.warn { color: var(--warn); }
[data-theme="sotet"] .tile.hot { border-color: #6b4a14; }
[data-theme="sotet"] .qr svg { background: #fff; border-radius: 6px; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); }
h1 { font-size: 24px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 17px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 14px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
code { background: var(--brand-l); padding: 1px 6px; border-radius: 5px; word-break: break-all; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 24px; padding-bottom: 40px; min-height: calc(100vh - 120px); }

/* fejléc */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 58px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 17px; color: var(--ink); text-decoration: none; }
.brand span { color: var(--brand); font-weight: 600; }
.top nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.top nav a { padding: 7px 11px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.top nav a:hover { background: var(--bg); color: var(--ink); }
.top nav a.on { background: var(--brand-l); color: var(--brand-d); }
.me { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.me form { margin: 0; }
@media (max-width: 640px) {
  .top .wrap { gap: 6px 16px; padding-top: 10px; padding-bottom: 8px; }
  .top nav { order: 3; flex-basis: 100%; margin: 0 -11px; }
  .me { margin-left: auto; }
}
.foot { color: var(--muted); font-size: 12px; padding-bottom: 24px; }

/* dobozok */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
details.card > summary, details.sub > summary { cursor: pointer; font-weight: 600; color: var(--brand-d); }
details.card[open] > summary { margin-bottom: 12px; }
details.sub { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.narrow { max-width: 420px; margin: 40px auto; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin-bottom: 16px; min-width: 0; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.report { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; max-height: 480px; overflow: auto; }
.count { background: var(--bg); color: var(--muted); border-radius: 20px; padding: 1px 9px; font-size: 13px; }
.note-warn { background: var(--warn-l); border-color: #f1d9a6; }

/* üzenetek */
.flash { background: var(--ok-l); color: var(--ok); border-radius: 10px; padding: 11px 15px; margin-bottom: 16px; font-weight: 500; }
.flash.warn { background: var(--warn-l); color: #7a4a00; }
.alert { background: var(--bad-l); color: var(--bad); border-radius: 10px; padding: 11px 15px; margin-bottom: 14px; font-weight: 500; }

/* űrlapok */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.opt { color: var(--muted); font-weight: 400; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; font-weight: 400; background: var(--field); color: var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-l); border-color: var(--brand); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 4px; margin: 0 0 16px; }
legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
label.radio, label.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; margin-bottom: 10px; cursor: pointer; }
label.radio input, label.check input { width: auto; margin: 3px 0 0; flex: none; }
.inline { display: flex; gap: 18px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; max-width: 360px; }
.inline-form label { flex: 1; margin: 0; }
.narrow-form { max-width: 420px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions form { margin: 0; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.filters label { margin: 0; min-width: 170px; }

/* gombok */
.btn { display: inline-block; padding: 9px 18px; border-radius: 9px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn.light { background: var(--card); color: var(--brand-d); }
.btn.light:hover { background: var(--brand-l); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.wide { width: 100%; }
button.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }

/* táblázatok */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.dim td { opacity: .5; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.distcell { min-width: 160px; }
.late { color: var(--bad); font-weight: 600; }
.soon { color: var(--warn); font-weight: 600; }

/* jelvények, pontszámok */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.b-leletezendo { background: var(--brand-l); color: var(--brand-d); }
.b-nyitott { background: var(--info-l); color: var(--info); }
.b-visszaadott { background: var(--warn-l); color: var(--warn); }
.b-ertekelt { background: var(--violet-l); color: var(--violet); }
.b-vitatott { background: var(--bad-l); color: var(--bad); }
.b-lezart { background: var(--ok-l); color: var(--ok); }
.b-visszavont { background: var(--neutral-l); color: var(--muted); }
.score { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 13px; }
.s1 { background: var(--s1); } .s2a { background: var(--s2a); color: #3d3000; } .s2b { background: var(--s2b); } .s3a { background: var(--s3a); } .s3b { background: var(--s3b); }
.scoreline .score { vertical-align: 1px; margin-right: 4px; }
.dist { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--bg); margin-top: 10px; }
.dist span { display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; overflow: hidden; white-space: nowrap; min-width: 2px; }
.dist span.s2a { color: #3d3000; }
td .dist { margin: 0; height: 18px; }

/* mutatók */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.metric { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.metric b { display: block; font-size: 24px; }
.metric span { color: var(--muted); font-size: 12.5px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--muted); display: flex; gap: 12px; align-items: center; }
.tile b { font-size: 28px; color: var(--ink); }
.tile.hot { border-color: #f1c38a; background: var(--warn-l); }
.tile.hot b { color: var(--warn); }

/* egyéb */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--brand-d); border-color: var(--brand); }
dl.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
dl.facts dd { margin: 2px 0 0; font-weight: 600; }
.history { margin: 0; padding-left: 20px; font-size: 14px; }
.history li { margin-bottom: 6px; }
.history time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 12px; }
.qr { width: 200px; margin: 10px 0; }
.qr svg { width: 100%; height: auto; display: block; }
.pager { display: flex; justify-content: space-between; }
fieldset.subs { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 4px; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; }
fieldset.subs legend { font-weight: 600; padding: 0 6px; }
.theme-toggle { color: var(--muted); text-decoration: none; font-size: 13px; }
