/* Medium text size, night colours and the two header buttons. Loaded last. */
:root{--z:.88}
body{zoom:var(--z)}
/* Zoom also shrinks viewport heights, so the full-height parts are scaled back. */
.shell{min-height:calc(100vh / var(--z))}
.side{height:calc(100vh / var(--z))}
@media(max-width:860px){
 .side{height:calc(100vh / var(--z));height:calc(100dvh / var(--z))}
 body input:not([type=checkbox]):not([type=radio]):not([type=file]),body textarea,body select{font-size:18.2px}
}
@media print{body{zoom:1}}
/* Phones: keep the menu button, both header buttons, the languages and the bell on one line. */
@media(max-width:430px){
 .topbar{gap:6px}
 .topbar .tools{gap:4px}
 .topbar .toolbtn{min-width:38px;padding:0 7px;font-size:13px}
 .topbar .lang button{padding:0 8px}
}

.toolbtn{border:0;border-radius:10px;min-height:44px;min-width:44px;padding:0 12px;background:#ffffff26;color:#fff;font-weight:800;font-size:15px;flex:none}
header .tools{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}
header .tools+.lang{margin-left:0}
.topbar .tools{display:flex;gap:8px}
.topbar .toolbtn{background:#fff;color:#333747}
.installhelp{border:0;border-radius:16px;padding:22px;width:min(420px,92vw);margin:auto}
.installhelp::backdrop{background:#0f172a99}
.installhelp p{margin:10px 0 16px}

/* Dashboard clock: time, day and date. */
.clock{display:flex;flex-direction:column;align-items:center;background:#fff;border-radius:10px;padding:5px 14px;line-height:1.3;font-variant-numeric:tabular-nums}
.clock b{font-size:18px}
.clock span{font-size:12px;font-weight:700;color:var(--muted)}
@media(max-width:860px){.topbar .clock{order:6;flex-basis:100%;flex-direction:row;justify-content:center;gap:10px}}
html[data-theme=dark] .clock{background:#172238}

/* ---------- night colours ---------- */
html[data-theme=dark]{color-scheme:dark;--light:#1d3050;--line:#33415c;--muted:#9fb0c8;--grey:#0d1424;--ink:#eef2ff}
html[data-theme=dark] body{background:#0d1424;color:#e2e8f0}
html[data-theme=dark] header{background:#07162f}
html[data-theme=dark] :is(.card,.item,.side,.boxes button,.tabs button,dialog,.installhelp,.place,.bell,.who,.xclose,.filterby div,.admin .lang,.topbar .toolbtn,.ring strong,.admin dialog .solved .entry){background:#172238;color:#e2e8f0}
html[data-theme=dark] :is(input[type=text],input[type=tel],input[type=email],input[type=password],input[type=search],select,textarea){background:#0f1a2f;color:#e2e8f0;border-color:#33415c}
html[data-theme=dark] .admin .topbar input[type=search]{background:#172238}
html[data-theme=dark] .admin .loginbody input:disabled{background:#1f2b44}
html[data-theme=dark] :is(.text,.bar div,.vcol .bar-up,.track,.deptrow .meter,.thumb,thead th,.corner .xclose){background:#0f1a2f}
html[data-theme=dark] :is(.side button,.admin .lang button,.snippet,.msg,.tile span.label,.vcol small,.deptrow small,.place small){color:#c3cde0}
html[data-theme=dark] .side button[aria-current],html[data-theme=dark] .admin .lang button[aria-pressed=true]{background:var(--indigo);color:#fff}
html[data-theme=dark] :is(.side button:hover:not([aria-current]),.vcol:hover,.deptrow:hover,.place:hover){background:#22304d}
html[data-theme=dark] :is(td,.deptrow,.side .out,.admin .scroll tr,.place){border-color:#2a3954}
html[data-theme=dark] .brand{color:#aab4ff}
html[data-theme=dark] :is(.btn.soft,.admin .btn.soft,.badge){background:#223558;color:#a9c9ff}
html[data-theme=dark] :is(.link,.contact a,.place .go){color:#8db9ff}
html[data-theme=dark] .badge.s-resolved{background:#0f3328;color:#6ee7b7}
html[data-theme=dark] :is(.badge.s-under_review,.badge.s-waiting){background:#3b2a14;color:#fdba74}
html[data-theme=dark] :is(.badge.s-closed,.badge.s-invalid){background:#273248;color:#b6c2d6}
html[data-theme=dark] .badge.repeat{background:#33214f;color:#d8b4fe}
html[data-theme=dark] .warn{background:#3a1a22;border-color:#7f2d3d;color:#fecaca}
html[data-theme=dark] :is(.leader,.place1){background:#3a1a28;border-color:#7f2d45}
html[data-theme=dark] .leader b{color:#fda4af}
html[data-theme=dark] .counters .remaining{background:#3b2a14;color:#fdba74}
html[data-theme=dark] :is(.counters .done,.admin dialog .solved){background:#0f2e24;color:#a7f3d0}
html[data-theme=dark] :is(.admin dialog .solved summary,.admin dialog section.solved h2){color:#6ee7b7}
/* The QR poster stays white so it can be printed and scanned. */
html[data-theme=dark] .poster{background:#fff;color:#0b2149}
