/* NordicWarden: one design for every page (front page, map, account, admin).
   The accent colour comes from branding/site.json through /brand.css. */

:root {
  --accent: #0f5c8c;
  --accent-ink: #fff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --text: #17202b;
  --muted: #5a6573;
  --line: #d8dee5;
  --bad: #b42318; --bad-soft: #fdecea;
  --ok: #1d7a3a;  --ok-soft: #e8f5ec;
  --warn: #9a6200; --warn-soft: #fff4dc;
  /* risk bands, the same on the map, in lists and chips */
  --risk-none: #8a94a6; --risk-low: #d9a400; --risk-mid: #ee7a12; --risk-high: #d62a2f;
  --naval: #3557d6; --gov: #0b7a75;
  --radius: 10px; --radius-s: 6px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  --bar-h: 60px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141b; --surface: #161e27; --surface-2: #1d2733; --text: #e7ecf2; --muted: #9aa6b4; --line: #2b3745;
    --bad: #ff8a80; --bad-soft: #3a1d1d; --ok: #7ad69a; --ok-soft: #173326; --warn: #f2c063; --warn-soft: #3a2f16;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.55 var(--font); background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.01em; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
code { font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-s); }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar { height: var(--bar-h); display: flex; align-items: center; gap: 28px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.01em;
  color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 15px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--text); text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: var(--radius-s); }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* user menu: a <details> dropdown */
.usermenu { position: relative; }
.usermenu > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px;
  border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary::after { content: "▾"; color: var(--muted); font-size: 12px; }
.usermenu[open] > summary { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid;
  place-items: center; font-size: 13px; font-weight: 700; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 1100; }
.usermenu .menu .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-size: 14px; }
.usermenu .menu .who b { display: block; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: var(--radius-s);
  color: var(--text); text-decoration: none; font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--surface-2); }
.usermenu .menu form { margin: 6px 0 0; border-top: 1px solid var(--line); padding-top: 6px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: var(--radius-s); font: inherit; font-weight: 650; font-size: 15px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; line-height: 1.2; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-quiet { background: none; color: var(--accent); padding-left: 8px; padding-right: 8px; }
.btn-quiet:hover { background: var(--accent-soft); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 14px; }
.btn-lg { min-height: 48px; padding: 12px 22px; font-size: 17px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 20px; }

/* ---------- layout ---------- */
main { flex: 1; }
.page { max-width: 1120px; margin: 0 auto; padding: 40px 24px 56px; }
.page-narrow { max-width: 760px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.stack > * + * { margin-top: 16px; }
.section { margin-top: 48px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- auth pages (log in, apply, two-factor, password) ---------- */
.auth { max-width: 460px; margin: 48px auto; padding: 0 20px; }
.auth.wide { max-width: 620px; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head h1 { font-size: 26px; margin-bottom: 6px; }
.auth-head p { color: var(--muted); margin: 0; }
.auth .card { padding: 28px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 15px; }
.auth-foot a { font-weight: 600; }

/* ---------- forms ---------- */
.field { margin-top: 16px; }
.field:first-child { margin-top: 0; }
label, .label { display: block; font-weight: 650; font-size: 15px; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], textarea, select {
  width: 100%; padding: 10px 12px; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-s); min-height: 42px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); outline-offset: 0; }
.help, .helptext { color: var(--muted); font-size: 14px; margin-top: 6px; }
.help ul { margin: 4px 0 0; padding-left: 18px; }
.errorlist { color: var(--bad); margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.field.has-error input, .field.has-error textarea { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin: 12px 0 0; }
.check input { width: 18px; height: 18px; margin-top: 3px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.code-input { font-size: 22px; letter-spacing: .3em; text-align: center; max-width: 220px; }

/* ---------- messages and alerts ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li, .alert { padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid; font-size: 15px; }
.messages li + li { margin-top: 8px; }
.messages li.success, .alert-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.messages li.error, .alert-error, .alert { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.messages li.warning, .alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.messages li.info, .alert-info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); }

/* ---------- tables, badges, risk ---------- */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 650; background: var(--surface-2); color: var(--muted); }
.badge-ok { background: var(--ok-soft); color: var(--ok); } .badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.risk { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; padding: 2px 9px; border-radius: 999px;
  color: #fff; background: var(--risk-none); font-variant-numeric: tabular-nums; }
.risk-low { background: var(--risk-low); color: #241a00; } .risk-mid { background: var(--risk-mid); } .risk-high { background: var(--risk-high); }
.risk-naval { background: var(--naval); } .risk-gov { background: var(--gov); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--risk-none); vertical-align: baseline; }
.dot.receiving, .dot.ok, .dot.done { background: var(--ok); } .dot.connecting, .dot.old { background: var(--risk-low); }
.dot.no-data, .dot.error { background: var(--bad); } .dot.running { background: var(--accent); }
.bar { height: 8px; background: var(--accent); border-radius: 4px; min-width: 1px; }
.big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }

/* ---------- front page ---------- */
.hero { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 92%, #000) 0%, color-mix(in srgb, var(--accent) 70%, #021) 100%);
  color: #fff; }
.hero .page { padding-top: 72px; padding-bottom: 72px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); max-width: 760px; letter-spacing: -.02em; }
.hero p.lead { font-size: 20px; max-width: 680px; opacity: .92; }
.hero .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.hero .btn-secondary:hover { background: rgba(255,255,255,.1); }
.hero .btn-primary { background: #fff; color: var(--accent); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 40px; max-width: 900px; }
.figure { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius); padding: 14px 16px; }
.figure b { display: block; font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.figure span { font-size: 14px; opacity: .85; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(74,222,128,.25); }
.feature h3 { display: flex; gap: 10px; align-items: center; }
.feature .icon { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 18px; }
.eventlist { list-style: none; margin: 0; padding: 0; }
.eventlist li { display: flex; gap: 12px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.eventlist li:last-child { border-bottom: 0; }
.eventlist .when { color: var(--muted); font-size: 14px; white-space: nowrap; min-width: 64px; }
.prose { max-width: 720px; } .prose h2 { margin-top: 36px; } .prose li { margin-bottom: 6px; }
.note { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 var(--radius-s) var(--radius-s) 0; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; }
.footer .page { padding-top: 22px; padding-bottom: 22px; display: flex; gap: 16px 32px; flex-wrap: wrap; justify-content: space-between; }
.footer a { color: var(--muted); }

/* ---------- auth extras ---------- */
.steps { padding-left: 20px; margin: 0 0 8px; } .steps li { margin-bottom: 12px; }
.qr { display: block; margin: 10px 0 6px; background: #fff; border-radius: var(--radius-s); padding: 6px; }
.key, .codes { user-select: all; }
.codes { font-size: 18px; line-height: 1.8; background: var(--surface-2); padding: 12px 16px; border-radius: var(--radius-s); margin: 0; }
.auth .card + .card, .auth .card + p { margin-top: 16px; }
.auth .card h2 { font-size: 18px; }
.auth-head .badge { vertical-align: 1px; }

/* ---------- admin area ---------- */
.adminlayout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - var(--bar-h)); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 12px; }
.sidebar-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 0 12px 8px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; position: sticky; top: calc(var(--bar-h) + 20px); }
.sidebar a { display: block; padding: 9px 12px; border-radius: var(--radius-s); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.admincontent { padding: 28px 32px 56px; max-width: 1180px; min-width: 0; }
.adminhead { margin-bottom: 20px; } .adminhead h1 { font-size: 28px; margin-bottom: 4px; } .adminhead p { margin: 0; }
.admincontent > .alert, .admincontent > .messages { margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; } .card.flush table th:first-child, .card.flush table td:first-child { padding-left: 20px; }
.card h2 { font-size: 19px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--text); text-decoration: none; }
a.tile:hover { border-color: var(--accent); }
.tile b { display: block; font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 14px; }
.problems { list-style: none; margin: 0; padding: 0; }
.problem { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 14px; border-radius: var(--radius-s); margin-bottom: 8px;
  border-left: 4px solid var(--accent); background: var(--surface-2); }
.problem-error { border-left-color: var(--bad); } .problem-warn { border-left-color: var(--risk-low); }
.toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 9px; }
.segmented a { padding: 7px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 650; font-size: 14px; }
.segmented a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.segmented .count { color: var(--muted); font-weight: 500; margin-left: 2px; }
.searchform input { width: 280px; }
.facts th { width: 38%; text-transform: none; letter-spacing: 0; font-size: 14px; }
.actionlist { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
details.danger { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
details.danger summary { color: var(--bad); cursor: pointer; font-weight: 600; }
.keyrow { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(140px, .8fr) minmax(260px, 1.4fr); gap: 12px 20px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--line); }
.keyrow:last-child { border-bottom: 0; }
.keyrow label { margin-bottom: 2px; }
.keystate code { font-size: 13px; }
.keyedit { display: flex; gap: 8px; align-items: center; }
.keyedit input { min-height: 34px; padding: 6px 10px; }
.actions.top { margin: 0 0 6px; }
.feedrow, .switchrow { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feedrow:last-child, .switchrow:last-of-type { border-bottom: 0; }
.feedrow form, .switchrow > button { flex: none; }
.warn { color: var(--warn); }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.inline-form select { width: auto; max-width: 100%; }
.inline-form.compact select { min-height: 34px; padding: 4px 8px; }
.numgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }
.numgrid .field { margin-top: 16px; }
.weights td:last-child { width: 140px; } .weights input { width: 100px; text-align: right; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 16px; }
fieldset { border: 0; padding: 0; margin: 16px 0 0; }
.jobline { margin-top: 4px; }
.recgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 24px; margin-top: 14px; align-items: start; }
.recgrid input[type=number] { width: 110px; min-height: 34px; padding: 4px 8px; }
.recgrid .inline-form label { width: 100%; margin-bottom: 2px; }
meter.usage { width: 100%; height: 10px; }
.barcol { width: 30%; }

/* ---------- how membership works ---------- */
.joinsteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px;
  counter-reset: step; }
.joinsteps li { counter-increment: step; margin: 0; }
.joinsteps .card + .card { margin-top: 0; }
.joinsteps + p { margin-top: 14px; }
.joinsteps li > b { display: flex; gap: 10px; align-items: center; font-size: 17px; }
.joinsteps li > b::before { content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent);
  color: var(--accent-ink); display: grid; place-items: center; font-size: 15px; }
.joinsteps p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- what visitors and members can see ---------- */
.access th[scope=row] { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--text); font-weight: 400; width: 60%; }
.access th[scope=row] b { display: block; }
.access th[scope=row] .help { display: block; margin-top: 2px; }
.access .c { text-align: center; vertical-align: middle; white-space: nowrap; }
.access .yes { color: var(--ok); font-weight: 800; font-size: 18px; } .access .no { color: var(--muted); }
.access tr.extra td:last-child { background: var(--accent-soft); }
.access tbody tr:last-child th, .access tbody tr:last-child td { border-bottom: 0; }
.hero .small-lead { font-size: 17px; opacity: .85; }
.memberbox { background: var(--accent-soft); border-radius: var(--radius-s); padding: 14px 16px; margin-bottom: 20px; }
.memberbox h2 { font-size: 16px; margin-bottom: 8px; }
.extras { margin: 0; padding-left: 18px; } .extras li { margin-bottom: 8px; } .extras .help { display: block; margin-top: 1px; }

/* ---------- accessibility mode (the Aa button in the top bar) ---------- */
.a11ybtn { min-width: 40px; height: 36px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.a11ybtn:hover { background: var(--surface-2); }
.a11ybtn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
html.a11y { font-size: 112.5%; }
html.a11y body { font-size: 18px; line-height: 1.65; }
html.a11y { --muted: #3b4552; --line: #8792a0; --surface-2: #e3e8ee; }
@media (prefers-color-scheme: dark) { html.a11y { --muted: #d0d8e2; --line: #7a8796; --surface-2: #26313e; } }
html.a11y a { text-decoration: underline; text-underline-offset: 3px; }
html.a11y .btn, html.a11y a.btn { text-decoration: none; min-height: 46px; font-size: 16px; }
html.a11y .btn-sm { min-height: 40px; }
html.a11y :focus-visible { outline-width: 4px; outline-offset: 3px; }
html.a11y input, html.a11y select, html.a11y textarea { border-width: 2px; min-height: 48px; font-size: 17px; }
html.a11y .card, html.a11y .tile, html.a11y .usermenu > summary { border-width: 2px; }
html.a11y .nav a, html.a11y .sidebar a { padding-top: 11px; padding-bottom: 11px; }
html.a11y .small, html.a11y .help, html.a11y .badge, html.a11y th { font-size: 15px; }
html.a11y *, html.a11y *::before, html.a11y *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand span.brand-name { display: none; }
  .nav a { padding: 8px 8px; }
  .topbar-end .btn-quiet { display: none; }
  .page { padding: 28px 16px 40px; }
  .row2 { grid-template-columns: 1fr; }
  .adminlayout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; overflow-x: auto; }
  .sidebar-title { display: none; }
  .sidebar ul { display: flex; gap: 4px; position: static; }
  .sidebar a { white-space: nowrap; }
  .admincontent { padding: 20px 16px 40px; }
  .keyrow { grid-template-columns: 1fr; }
  .keyedit { flex-wrap: wrap; }
}
