/* =========================================================================
   SPEEDUP INFOTECH · Classroom Utilization — design system
   1. Tokens   2. Base   3. Components   4. Layout   5. Screens   6. Motion
   Icons live in icons.css (npm run icons). Change colours, type, spacing
   and radii here, in the tokens, never per screen.
   ========================================================================= */

/* ----------------------------------------------------------- 1. Tokens --- */
/* Inter 4.1 (variable, weights 100–900), self-hosted: no third-party font request.
   SIL Open Font License, see fonts/LICENSE.txt. Italics are slanted by the browser. */
@font-face {
  font-family: "InterVariable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/InterVariable.woff2") format("woff2");
}

:root {
  /* Neutrals */
  --gray-0: #ffffff;
  --gray-25: #fbfbfc;
  --gray-50: #f7f7f8;
  --gray-100: #f1f1f3;
  --gray-150: #e9e9ec;
  --gray-200: #e3e3e7;
  --gray-300: #d1d1d6;
  --gray-400: #a1a1aa;
  --gray-500: #68686f;   /* muted text: 4.5:1 or better on white, gray-50, gray-100 and gray-150 */
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;
  --gray-950: #0a0a0a;

  /* Roles */
  --bg: var(--gray-50);
  --surface: var(--gray-0);
  --surface-2: var(--gray-100);
  --surface-3: var(--gray-150);
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --text: var(--gray-900);
  --text-2: var(--gray-600);
  --text-muted: var(--gray-500);
  --text-faint: var(--gray-400);
  --primary: var(--gray-900);
  --primary-hover: var(--gray-800);
  --primary-active: var(--gray-950);
  --on-primary: #ffffff;
  --brand: #fd1e16;          /* SPEEDUP logo red: marks and indicators */
  --accent: #e3170f;         /* brand red for text and small fills (AA on white) */
  --accent-soft: #fef2f2;
  --focus: #2563eb;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, .18);

  /* Semantic */
  --success: #15803d; --success-text: #166534; --success-bg: #f0fdf4; --success-border: #bbf7d0;
  --warning: #b45309; --warning-text: #92400e; --warning-bg: #fffbeb; --warning-border: #fde68a; --warning-line: #f59e0b;
  --danger: #c81e1e;  --danger-text: #991b1b;  --danger-bg: #fef2f2;  --danger-border: #fecaca; --danger-hover: #a51818;
  --info: #1d4ed8;    --info-text: #1e40af;    --info-bg: #eff6ff;    --info-border: #bfdbfe;
  --data: #2a78d6;    --data-track: #dbe8fb;   /* single hue for quantities */

  /* Type: one family (self-hosted Inter), system fallback while it loads */
  --font: "InterVariable", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --fs-2xs: 11px; --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-base: 15px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 32px;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600;

  /* Space (4 px grid) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* Shape */
  --r-xs: 4px;   /* badges, chips, small controls */
  --r-sm: 6px;   /* buttons, inputs */
  --r-md: 8px;   /* menus, inner panels, alerts */
  --r-lg: 10px;  /* cards */
  --r-xl: 12px;  /* dialogs, sheets */
  --r-full: 999px;
  --bw: 1px;

  /* Elevation: borders first, shadows only for things that float */
  --shadow-xs: 0 1px 2px rgba(16, 16, 20, .05);
  --shadow-md: 0 1px 3px rgba(16, 16, 20, .06), 0 8px 20px rgba(16, 16, 20, .08);
  --shadow-lg: 0 2px 6px rgba(16, 16, 20, .06), 0 20px 48px rgba(16, 16, 20, .18);

  /* Controls */
  --ctl-sm: 32px; --ctl-md: 36px; --ctl-lg: 44px;
  --icon-sm: 14px; --icon-md: 16px; --icon-lg: 18px; --icon-xl: 20px; --icon-nav: 24px;

  /* Motion */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --dur-1: 120ms; --dur-2: 160ms; --dur-3: 200ms;

  /* Layout */
  --topbar: 56px;
  --sidebar-w: 240px;
  --card-pad: 20px;
}

/* ------------------------------------------------------------- 2. Base --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: var(--fs-md); line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-feature-settings: "liga" 1, "calt" 1; /* Inter's contextual alternates (needed explicitly in Chrome) */
}
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; -webkit-tap-highlight-color: transparent; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { margin: 0 0 var(--sp-2); color: var(--text); font-weight: var(--fw-semibold); line-height: 1.3; letter-spacing: -.011em; }
h1 { font-size: var(--fs-xl); letter-spacing: -.017em; }
h2 { font-size: var(--fs-base); }
h3 { font-size: var(--fs-md); }
p { margin: 0 0 var(--sp-3); }
b, strong { font-weight: var(--fw-semibold); }
dl, dd { margin: 0; }
::selection { background: #dbeafe; color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: 0; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.spacer { flex: 1; }
.num, .elapsed, .big-timer, .chip-count { font-variant-numeric: tabular-nums; }
.warn-text { color: var(--warning); font-weight: var(--fw-semibold); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------- 3. Components --- */

/* Icons (shapes in icons.css). Default 16 px; take the text colour. */
.icon {
  display: inline-block; flex: none; width: var(--icon-md); height: var(--icon-md); vertical-align: -3px;
  background-color: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.icon-sm { width: var(--icon-sm); height: var(--icon-sm); vertical-align: -2px; }
.icon-lg { width: var(--icon-lg); height: var(--icon-lg); vertical-align: -4px; }
.icon-xl { width: var(--icon-xl); height: var(--icon-xl); vertical-align: -5px; }

/* Buttons
   Variants: primary (default, .btn-primary/.btn-blue/.btn-start) · secondary (.btn-outline)
             ghost (.btn-ghost) · destructive (.btn-end/.btn-danger) · destructive secondary (.btn-danger-outline)
   Sizes: .btn-sm 32 · default 36 · .btn-lg 44. Icon: data-icon="name" adds a leading icon. */
.btn {
  --btn-bg: var(--primary); --btn-fg: var(--on-primary); --btn-bd: transparent;
  --btn-bg-hover: var(--primary-hover); --btn-bg-active: var(--primary-active); --btn-shadow: none;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--ctl-md); padding: 0 14px; margin: 0;
  border: var(--bw) solid var(--btn-bd); border-radius: var(--r-sm);
  background: var(--btn-bg); color: var(--btn-fg); box-shadow: var(--btn-shadow);
  font: inherit; font-size: var(--fs-md); font-weight: var(--fw-medium); line-height: 1.2; letter-spacing: 0; text-align: center;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.btn:hover { background: var(--btn-bg-hover); }
.btn:active { background: var(--btn-bg-active); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover, .btn:disabled:active { background: var(--btn-bg); }
.btn[data-icon]::before {
  content: ""; flex: none; width: var(--icon-md); height: var(--icon-md); background-color: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}

.btn-outline, .btn-secondary {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong);
  --btn-bg-hover: var(--gray-50); --btn-bg-active: var(--surface-2); --btn-shadow: var(--shadow-xs);
}
.btn-ghost {
  --btn-bg: transparent; --btn-fg: var(--text-2); --btn-bg-hover: var(--surface-2); --btn-bg-active: var(--surface-3);
}
.btn-ghost:hover { color: var(--text); }
.btn-end, .btn-danger {
  --btn-bg: var(--danger); --btn-fg: #fff; --btn-bg-hover: var(--danger-hover); --btn-bg-active: #8f1414;
}
.btn-danger-outline {
  --btn-bg: var(--surface); --btn-fg: var(--danger); --btn-bd: var(--danger-border);
  --btn-bg-hover: var(--danger-bg); --btn-bg-active: #fde4e4; --btn-shadow: var(--shadow-xs);
}
.btn-sm { min-height: var(--ctl-sm); padding: 0 10px; gap: 6px; font-size: var(--fs-sm); }
.btn-sm[data-icon]::before { width: var(--icon-sm); height: var(--icon-sm); }
.btn-lg { min-height: var(--ctl-lg); padding: 0 18px; font-size: var(--fs-base); }
.btn-lg[data-icon]::before { width: var(--icon-lg); height: var(--icon-lg); }
.btn-block { width: 100%; }
.btn-icon { width: var(--ctl-md); padding: 0; }
.btn-icon.btn-sm { width: var(--ctl-sm); }
.btn[data-icon=""]::before, .btn.is-busy[data-icon]::before { display: none; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::after {
  content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.btn-row > .btn { flex: 1 1 160px; }
.btn-row.end { justify-content: flex-end; }
.form-actions { margin-top: var(--sp-5); }
.btn-row + p { margin-top: var(--sp-2); }
.btn-row.end > .btn { flex: 0 0 auto; }

/* Icon-only button (dialog close, overflow menus). Always has aria-label + title. */
.icon-btn {
  display: inline-grid; place-items: center; flex: none; width: var(--ctl-sm); height: var(--ctl-sm); padding: 0; margin: 0;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .icon { width: var(--icon-lg); height: var(--icon-lg); }

/* Text link button */
.linklike {
  padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: var(--fw-semibold); text-align: left; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px;
}
.linklike:hover { text-decoration-color: currentColor; }

/* Forms */
label { display: block; margin: var(--sp-4) 0 6px; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text); }
input, select, textarea {
  display: block; width: 100%; min-height: var(--ctl-md); padding: 7px 10px; margin: 0;
  border: var(--bw) solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs);
  font: inherit; font-size: var(--fs-md); line-height: 1.4;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--gray-400); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: var(--focus-ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-muted); box-shadow: none; cursor: not-allowed; }
input[readonly] { background: var(--surface-2); color: var(--text-2); box-shadow: none; }
input[readonly]:hover { border-color: var(--border-strong); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
textarea { min-height: 84px; resize: vertical; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
input[type="checkbox"], input[type="radio"] {
  display: inline-block; width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex: none;
  box-shadow: none; accent-color: var(--primary); cursor: pointer; vertical-align: -3px;
}
input[type="date"], input[type="time"], input[type="datetime-local"] { min-width: 0; }
.hint { margin-top: 6px; font-size: var(--fs-xs); color: var(--text-muted); }
.check-row { display: flex; margin-top: var(--sp-4); }
.check { display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--text-2); cursor: pointer; }
.grid-2, .grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp-3); }
.time-pair { display: flex; align-items: center; gap: var(--sp-2); }
.time-pair input { min-width: 0; }
.seg { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-1) 0; }
.seg label {
  display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0; padding: 8px 12px;
  border: var(--bw) solid var(--border-strong); border-radius: var(--r-sm); font-weight: var(--fw-regular); cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.seg label:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days .day { padding: 6px 10px; border: var(--bw) solid var(--border-strong); border-radius: var(--r-sm); color: var(--text); }
.days .day:has(input:checked) { border-color: var(--primary); background: var(--surface-2); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* Alerts and toast. Icon by kind; content may contain inline markup. */
.alert {
  --i: var(--i-info);
  position: relative; display: block; margin: var(--sp-3) 0; padding: 10px 12px 10px 38px;
  border: var(--bw) solid var(--info-border); border-radius: var(--r-md); background: var(--info-bg); color: var(--info-text);
  font-size: var(--fs-sm); line-height: 1.5;
}
.alert::before {
  content: ""; position: absolute; left: 12px; top: 12px; width: 16px; height: 16px; background-color: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.alert p:last-child { margin-bottom: 0; }
.alert-ok { --i: var(--i-circle-check); border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); }
.alert-warn { --i: var(--i-triangle-alert); border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning-text); }
.alert-error { --i: var(--i-circle-alert); border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }
.alert-info { --i: var(--i-info); }
.alert.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 80; width: max-content; max-width: min(92vw, 480px); margin: 0;
  transform: translateX(-50%); padding: 12px 16px 12px 40px; border-color: var(--gray-900); background: var(--gray-900); color: #fff;
  box-shadow: var(--shadow-md); font-size: var(--fs-md);
}
.alert.toast::before { left: 14px; top: 14px; color: #93c5fd; }
.alert.toast.alert-ok::before { color: #4ade80; }
.alert.toast.alert-error::before { color: #f87171; }
.alert.toast.alert-warn::before { color: #fbbf24; }

/* Cards and section headers */
.card {
  margin: 0 0 var(--sp-4); padding: var(--card-pad);
  background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r-lg);
}
.card-head, .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); min-height: var(--ctl-sm); margin: 0 0 var(--sp-4); }
.card-head h2, .toolbar h2 { margin: 0; }
.toolbar > h2 { margin-right: auto; }
.toolbar-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-2); min-width: 0; margin-right: auto; }
.section-title { margin: var(--sp-6) 0 0; }
.card > h2:first-child { margin-bottom: var(--sp-4); }
.card-head + p, .toolbar + p { margin-top: calc(-1 * var(--sp-2)); }
.step {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: var(--bw) solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold);
}
.step.is-done { --i: var(--i-check); border-color: var(--success); background: var(--success); color: #fff; font-size: 0; }
.step.is-done::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }

/* Key–value list */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--sp-4); margin: var(--sp-3) 0 0; font-size: var(--fs-sm); }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; color: var(--text); font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.kv-lg { font-size: var(--fs-md); }
.list { margin: var(--sp-2) 0; padding-left: 18px; }
.list li { margin: 4px 0; }
.list li.clash { color: var(--danger); font-weight: var(--fw-medium); }
.clash-note { margin-top: var(--sp-1); color: var(--danger); font-weight: var(--fw-medium); }

/* Status badges: tinted background, dot, sentence-case text */
.pill {
  --c: var(--text-2); --pill-bg: var(--surface-2);
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-xs);
  background: var(--pill-bg); color: var(--c); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1; white-space: nowrap; vertical-align: middle;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 16%, transparent);
}
.pill::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-available, .pill-confirmed { --c: var(--success); --pill-bg: var(--success-bg); }
.pill-in_use, .pill-active, .pill-in_progress { --c: var(--danger); --pill-bg: var(--danger-bg); }
.pill-overdue, .pill-no_show, .pill-expired, .pill-maintenance { --c: var(--warning); --pill-bg: var(--warning-bg); }
.pill-reserved, .pill-pending { --c: var(--info); --pill-bg: var(--info-bg); }
.pill-completed, .pill-admin_closed, .pill-cancelled, .pill-rejected, .pill-overridden, .pill-inactive, .pill-archived { --c: var(--text-2); --pill-bg: var(--surface-2); }

/* Flags inside table cells (late, overdue, guessable QR) */
.flag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: var(--r-xs);
  font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: .01em; vertical-align: middle;
}
.flag-late, .flag-overdue { background: var(--warning-bg); color: var(--warning-text); box-shadow: inset 0 0 0 1px var(--warning-border); }
.flag-legacy { background: var(--surface-2); color: var(--text-2); }

/* Tags and filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--sp-2) 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border: 0; border-radius: var(--r-xs);
  background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap;
}
.chip .icon { width: var(--icon-sm); height: var(--icon-sm); }
.chip-btn {
  height: var(--ctl-sm); padding: 0 12px; border: var(--bw) solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.chip-btn:hover { background: var(--gray-50); color: var(--text); }
.chip-btn.on { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.chip-btn .icon { opacity: .8; }
.chip-count { opacity: .7; }
.chip-filter { margin: 0 0 var(--sp-4); }
.chip-entry { height: auto; padding: 0; background: none; color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-regular); }
.chip-entry .icon { color: var(--text-muted); }
.chip-wait { background: var(--warning-bg); color: var(--warning-text); }
.chip-bad { background: var(--danger-bg); color: var(--danger-text); }

/* Tables */
.table-wrap {
  overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  border: var(--bw) solid var(--border); border-radius: var(--r-md); background: var(--surface);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); background: var(--surface); }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: var(--bw) solid var(--border); }
th {
  position: sticky; top: 0; z-index: 1; background: var(--gray-25); color: var(--text-muted);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; letter-spacing: .01em;
}
td { color: var(--text); }
td .muted.small, td .small.muted { margin-top: 2px; font-size: var(--fs-xs); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color var(--dur-1) var(--ease); }
tbody tr:hover { background: var(--gray-25); }
td.num, th.num { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable.on, tr.clickable.on:hover { background: var(--surface-2); }
tr.is-archived td { color: var(--text-muted); }
td.cell-icon .icon { margin-right: var(--sp-2); color: var(--text-muted); }
td.cell-wrap { max-width: 420px; overflow-wrap: anywhere; }
th.col-meter { min-width: 160px; }
th.col-wide { min-width: 220px; }
th.col-actions { width: 1%; }
.table-wrap select { min-height: var(--ctl-sm); padding-top: 4px; padding-bottom: 4px; font-size: var(--fs-sm); }
.table-wrap.compact th, .table-wrap.compact td { padding: 8px 10px; }
.table-wrap.compact th.col-meter { min-width: 120px; }
.table-wrap.compact { margin-bottom: var(--sp-4); }
.room-table td { vertical-align: middle; }
.act-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.table-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); padding: 10px 12px;
  border-top: var(--bw) solid var(--border); color: var(--text-muted); font-size: var(--fs-sm);
}
.table-foot .pager { display: flex; align-items: center; gap: var(--sp-1); margin-left: auto; }
.table-foot .pager-label { min-width: 5.5em; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-2); }
/* Full-width tables inside a card run edge to edge */
.card .table-wrap:not(.compact):not(.heatmap-wrap) {
  margin: var(--sp-4) calc(-1 * var(--card-pad)) calc(-1 * var(--card-pad));
  border-width: var(--bw) 0 0; border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px);
}
.card .table-wrap:not(.compact):not(.heatmap-wrap):has(+ .table-foot) { margin-bottom: 0; border-radius: 0; }
.card .table-foot { margin: 0 calc(-1 * var(--card-pad)) calc(-1 * var(--card-pad)); padding: 10px var(--card-pad); background: var(--gray-25); border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px); }

/* Empty and loading states */
.empty {
  --i: var(--i-inbox);
  display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-8) var(--sp-4); color: var(--text-muted); font-size: var(--fs-sm); text-align: center;
}
.empty::before { content: ""; width: 24px; height: 24px; background: var(--text-faint); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.empty.is-loading { --i: var(--i-loader); }
.empty.is-loading::before { animation: spin .8s linear infinite; }
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0, var(--gray-50) 50%, var(--surface-2) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* Dropdown menu (row actions, export) — positioned by common.js */
.menu { position: relative; display: inline-flex; }
.menu-pop {
  position: fixed; z-index: 90; min-width: 200px; max-width: 280px; padding: var(--sp-1);
  background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-md);
  animation: menuIn var(--dur-1) var(--ease);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--ctl-sm); padding: 0 10px; margin: 0;
  border: 0; border-radius: var(--r-xs); background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer;
}
.menu-item[data-icon]::before {
  content: ""; flex: none; width: var(--icon-md); height: var(--icon-md); background-color: var(--text-muted);
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.menu-item:hover, .menu-item:focus-visible { outline: none; background: var(--surface-2); }
.menu-item.is-danger { color: var(--danger); }
.menu-item.is-danger::before { background-color: currentColor; }
.menu-item.is-danger:hover, .menu-item.is-danger:focus-visible { background: var(--danger-bg); }
.menu-sep { height: 1px; margin: var(--sp-1) -4px; background: var(--border); }

/* Dialogs: centred on desktop, bottom sheet on phones */
dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; overflow: hidden;
  border: var(--bw) solid var(--border); border-radius: var(--r-xl); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.dlg-wide { width: min(880px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 10, 12, .48); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 14px 14px 10px var(--sp-5); }
.dialog-head h2 { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; margin: 0; font-size: var(--fs-lg); }
.dialog-head h2 .icon { color: var(--text-muted); }
.dialog-body { max-height: calc(100vh - 200px); padding: 0 var(--sp-5) var(--sp-5); overflow: auto; }
.dialog-body > :first-child:not(label) { margin-top: var(--sp-1); }
.dialog-foot {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); padding: 12px var(--sp-5);
  border-top: var(--bw) solid var(--border); background: var(--gray-25);
}

/* Progress meters (single data hue, value always shown as text) */
.bar, .meter { flex: 1; min-width: 60px; height: 6px; border-radius: var(--r-full); background: var(--data-track); overflow: hidden; }
.bar > span, .meter > span { display: block; height: 100%; border-radius: inherit; background: var(--data); }
.meter-row { display: flex; align-items: center; gap: var(--sp-2); }
.meter-row b { min-width: 3.4em; text-align: right; font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }

/* KPI strip: one bordered block, hairline dividers */
.kpis {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bw); margin: 0 0 var(--sp-4);
  background: var(--border); border: var(--bw) solid var(--border); border-radius: var(--r-lg); overflow: hidden;
}
.kpis:empty { display: none; }
.kpi { min-width: 0; padding: 14px var(--sp-4) var(--sp-4); background: var(--surface); }
.kpi .label { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); }
.kpi .value {
  margin-top: 6px; font-size: var(--fs-2xl); font-weight: var(--fw-semibold); line-height: 1.15; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.kpi .sub { margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--text-muted); }
.kpi.kpi-text .value { margin-top: 8px; font-size: var(--fs-lg); line-height: 1.35; letter-spacing: -.01em; }
.kpi.warn .value { color: var(--warning); }
.kpi.bad .value { color: var(--danger); }

/* Filter bar */
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); align-items: end; padding: var(--sp-4); }
.filters label { margin: 0 0 6px; font-size: var(--fs-xs); color: var(--text-2); }
.filters .btn { width: 100%; }

/* ----------------------------------------------------------- 4. Layout --- */

/* Top bar (logo needs the black ground) */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--sp-3);
  height: calc(var(--topbar) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(var(--sp-4), env(safe-area-inset-right)) 0 max(var(--sp-4), env(safe-area-inset-left));
  background: var(--gray-950); color: #fff; border-bottom: var(--bw) solid #1d1d21;
}
.brand { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; color: inherit; text-decoration: none; }
.brand-logo { display: block; width: auto; height: 22px; }
.brand-tag {
  padding-left: var(--sp-3); border-left: var(--bw) solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .7); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap;
}
.userbox { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; margin-left: auto; }
.user-chip { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; margin-right: var(--sp-1); line-height: 1.25; }
.user-chip .name { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.user-chip .role { font-size: var(--fs-2xs); color: rgba(255, 255, 255, .6); }
.topbar .btn-ghost { --btn-fg: rgba(255, 255, 255, .78); --btn-bg-hover: rgba(255, 255, 255, .1); --btn-bg-active: rgba(255, 255, 255, .16); }
.topbar .btn-ghost:hover { color: #fff; }
.topbar .icon-btn { color: rgba(255, 255, 255, .72); }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.topbar :focus-visible { outline-color: #fff; }

/* Global loading indicator (set by common.js while a request runs) */
.loading-bar { position: fixed; top: calc(var(--topbar) + env(safe-area-inset-top, 0px) - 2px); left: 0; right: 0; z-index: 45; height: 2px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity var(--dur-2) var(--ease); }
.loading-bar::before { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--brand); animation: loadSlide 1.1s var(--ease) infinite; }
html.is-loading .loading-bar { opacity: 1; }

.container { max-width: 760px; margin: 0 auto; padding: var(--sp-6) var(--sp-4) var(--sp-10); }
.container.wide { max-width: none; }
.footer { padding: var(--sp-4); color: var(--text-muted); font-size: var(--fs-xs); text-align: center; }
.whoami { margin: 0 0 var(--sp-4); color: var(--text-muted); font-size: var(--fs-sm); }

/* Page header (admin) */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-5); }
.page-head h1 { margin: 0; }
.page-head p { margin: var(--sp-1) 0 0; color: var(--text-muted); font-size: var(--fs-sm); }

/* Split / multi-column helpers */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp-4); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2) var(--sp-6); margin-top: var(--sp-3); }
.detail-grid h3 { margin: var(--sp-4) 0 var(--sp-2); }

/* ---------------------------------------------------------- 5. Screens --- */

/* Sign-in */
.signin { max-width: 420px; margin: 6vh auto var(--sp-6); padding: 0 0 var(--sp-6); overflow: hidden; text-align: center; }
.signin > *:not(.signin-hero) { margin-left: var(--sp-6); margin-right: var(--sp-6); }
.signin-hero { display: grid; justify-items: center; gap: 10px; margin: 0 0 var(--sp-6); padding: 28px var(--sp-6) 24px; background: var(--gray-950); }
.signin-logo { display: block; width: min(72%, 240px); height: auto; }
.signin-app { color: rgba(255, 255, 255, .62); font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .06em; text-transform: uppercase; }
.signin h1 { margin-bottom: var(--sp-1); }
.signin .alert { text-align: left; }
.signin > .signin-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: var(--sp-8) auto var(--sp-4); border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.signin-icon .icon { width: var(--icon-xl); height: var(--icon-xl); }
#gsiButton, .gsi-slot { display: flex; justify-content: center; min-height: 44px; margin: var(--sp-5) auto var(--sp-2); }

/* Start options */
.method-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.method-btn {
  --i: var(--i-chevron-right);
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 16px; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-items: center;
  width: 100%; padding: var(--sp-4); border: var(--bw) solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow-xs);
  -webkit-tap-highlight-color: transparent; transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.method-btn:hover { border-color: var(--gray-400); background: var(--gray-25); }
.method-btn::after { content: ""; grid-column: 3; grid-row: 1 / 3; width: 16px; height: 16px; background: var(--text-faint); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.method-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text); }
.method-icon .icon { width: var(--icon-xl); height: var(--icon-xl); }
.method-btn:first-child .method-icon { background: var(--primary); color: var(--on-primary); }
.method-title { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.method-grid + p { margin: var(--sp-3) 0 0; }
.method-sub { grid-column: 2; color: var(--text-muted); font-size: var(--fs-sm); }

/* Active session */
.active-session .card-head h2 { display: inline-flex; align-items: center; gap: var(--sp-2); }
.active-session .card-head h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: livePulse 2s var(--ease) infinite; }
.active-session.is-overdue { border-color: var(--warning-line); box-shadow: 0 0 0 3px rgba(245, 158, 11, .14); }
.active-session.is-overdue .card-head h2::before { background: var(--warning-line); }
.active-session .room-id { font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -.015em; }
.scan-result { display: flex; align-items: flex-start; gap: var(--sp-3); }
.scan-result > div:first-child { flex: 1; min-width: 0; }
.timer-block { flex: none; text-align: right; }
.scan-result .spacer { display: none; }
.active-session .card-head { flex-wrap: nowrap; gap: var(--sp-2); }
.active-session .card-head h2 { white-space: nowrap; }
.big-timer { font-size: var(--fs-3xl); font-weight: var(--fw-medium); line-height: 1.1; letter-spacing: -.02em; }

/* Scanner */
.scanner-box { position: relative; max-width: 480px; margin: var(--sp-3) auto; overflow: hidden; border-radius: var(--r-lg); background: #000; }
.scanner-box::after {
  content: ""; position: absolute; left: 16%; right: 16%; top: 18%; z-index: 3; height: 2px; border-radius: 2px; pointer-events: none;
  background: var(--brand); opacity: .85; animation: scanLine 2.4s ease-in-out infinite alternate;
}
#reader { width: 100%; }
#reader video { display: block; width: 100% !important; height: auto !important; max-height: 70vh; object-fit: cover; }
.fallback { margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: var(--bw) solid var(--border); border-radius: var(--r-md); background: var(--gray-25); }
.fallback p { margin-top: 0; }

/* Room in the start form */
.room-hero { display: flex; align-items: flex-start; gap: var(--sp-3); margin: 0 0 var(--sp-2); padding: var(--sp-3); border: var(--bw) solid var(--border); border-radius: var(--r-md); background: var(--gray-25); }
.hero-photo { flex: 0 0 104px; width: 104px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-2); }
.identity { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp-3); }
.start-time { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) 10px; margin-top: var(--sp-4); padding: 10px var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); }

/* Room cards (trainer board, live monitor) */
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.room-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden; cursor: pointer;
  border: var(--bw) solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.room-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.room-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.room-card.room-overdue { border-color: var(--warning-line); }
.room-card.room-inactive .room-photo, .room-card.room-archived .room-photo, .room-card.room-maintenance .room-photo { filter: grayscale(1); opacity: .7; }
.room-photo { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); border-bottom: var(--bw) solid var(--border); }
.room-photo-empty { display: grid; place-items: center; color: var(--text-faint); }
.room-photo-empty .icon { width: var(--icon-nav); height: var(--icon-nav); }
.room-photo-empty.big { aspect-ratio: 16 / 6; border: var(--bw) solid var(--border); border-radius: var(--r-md); }
.img-missing { visibility: hidden; }
.room-card-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: var(--sp-3) 14px 14px; }
.room-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }
.room-title { min-width: 0; }
.room-id { font-weight: var(--fw-semibold); }
.room-title .room-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); }
.room-name, .room-facts { color: var(--text-muted); font-size: var(--fs-xs); }
.room-note { color: var(--text-2); font-size: var(--fs-sm); }
.note-free { color: var(--success); }
.note-reserved { color: var(--info); }
.room-card .kv { margin-top: 2px; font-size: var(--fs-xs); gap: 2px var(--sp-3); }
.room-usage { display: flex; align-items: center; gap: var(--sp-2); margin-top: auto; padding-top: var(--sp-2); }
.room-card.skeleton { min-height: 236px; cursor: default; border-color: var(--border); }
.floor-head { display: flex; align-items: baseline; gap: var(--sp-2); margin: var(--sp-6) 0 var(--sp-3); padding-bottom: var(--sp-2); border-bottom: var(--bw) solid var(--border); font-size: var(--fs-sm); }
.floor-head:first-child { margin-top: 0; }
.board-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin: 0 0 var(--sp-3); }

/* Bookings */
.booking-list { margin: 0; padding: 0; list-style: none; }
.booking { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); padding: 14px 0; border-top: var(--bw) solid var(--border); }
.booking:first-child { padding-top: 0; border-top: 0; }
.booking.is-now { margin: 0 0 var(--sp-2); padding: var(--sp-3) 14px; border: var(--bw) solid var(--success-border); border-radius: var(--r-md); background: var(--success-bg); }
.booking.is-now + .booking { border-top: 0; }
.booking-when { min-width: 112px; }
.booking-day { color: var(--text-muted); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.booking-time { font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.booking-what { flex: 1 1 200px; min-width: 0; }
.booking-hint { margin-top: var(--sp-1); color: var(--success-text); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.booking-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.day-slots { margin: var(--sp-2) 0 0; padding: 10px var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); }
.day-slots:empty { display: none; }

/* Drafts and the offline queue */
.draft-card { border-style: dashed; border-color: var(--border-strong); }
.queue-list { margin: 0; padding: 0; list-style: none; }
.queue-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3); padding: 14px 0; border-top: var(--bw) solid var(--border); }
.queue-item:first-child { padding-top: 0; border-top: 0; }
.queue-main { flex: 1 1 220px; min-width: 0; }
.queue-kind { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-1); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.queue-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.queue-error { margin-top: var(--sp-2); padding: 8px 10px; border-radius: var(--r-sm); background: var(--danger-bg); color: var(--danger-text); font-size: var(--fs-sm); }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: var(--sp-3); }
.avatar { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: var(--fs-xl); font-weight: var(--fw-semibold); }
.profile-who { min-width: 0; }
.profile-name { font-size: var(--fs-lg); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.setting-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: var(--bw) solid var(--border); }
.card h2 + .setting-row { border-top: 0; padding-top: 0; }
.setting-row > div { flex: 1; min-width: 0; }
.setting-row strong { font-weight: var(--fw-medium); }
.net-ok { color: var(--success); }
.net-bad { color: var(--danger); }
.help summary { --i: var(--i-chevron-down); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); list-style: none; cursor: pointer; font-size: var(--fs-base); }
.help summary::-webkit-details-marker { display: none; }
.help summary strong { font-weight: var(--fw-semibold); }
.help summary::after { content: ""; flex: none; width: 16px; height: 16px; background: var(--text-muted); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; transition: transform var(--dur-2) var(--ease); }
.help[open] summary::after { transform: rotate(180deg); }
.help-list { margin: var(--sp-3) 0 var(--sp-4); padding-left: 20px; color: var(--text-2); font-size: var(--fs-sm); }
.help-list li { margin-bottom: var(--sp-2); }
.help-list strong, .help-list em { color: var(--text); }

/* Gallery and room detail */
.gallery { margin: var(--sp-1) 0 var(--sp-2); }
.gallery-main { margin: 0; overflow: hidden; border-radius: var(--r-md); background: var(--gray-950); }
.gallery-main img { display: block; width: 100%; min-height: 180px; max-height: 44vh; object-fit: contain; }
.gallery-main figcaption { padding: 8px 12px; color: rgba(255, 255, 255, .78); font-size: var(--fs-xs); }
.gallery-strip { display: flex; gap: var(--sp-2); padding: var(--sp-2) 0 2px; overflow-x: auto; }
.gallery-thumb { flex: 0 0 auto; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: var(--r-sm); background: none; cursor: pointer; }
.gallery-thumb.on { border-color: var(--primary); }
.gallery-thumb img { display: block; width: 88px; height: 58px; object-fit: cover; background: var(--surface-2); }

/* Admin: room thumbnails, photos, categories */
.thumb { display: block; width: 56px; height: 38px; object-fit: cover; border-radius: var(--r-xs); background: var(--surface-2); }
.thumb.room-photo-empty .icon { width: var(--icon-md); height: var(--icon-md); }
.upload-box { margin: var(--sp-1) 0 var(--sp-4); padding: var(--sp-1) var(--sp-4) var(--sp-3); border: var(--bw) dashed var(--border-strong); border-radius: var(--r-md); background: var(--gray-25); }
.btn.file-btn { margin: 0; }
.btn.upload-btn { width: 100%; margin-top: var(--sp-3); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.photo-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: var(--bw) solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.photo-card > img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--surface-2); }
.cover-badge { position: absolute; top: var(--sp-2); left: var(--sp-2); height: 22px; padding: 0 8px; border-radius: var(--r-xs); background: var(--gray-900); color: #fff; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); line-height: 22px; }
.photo-meta { display: grid; gap: var(--sp-2); padding: 10px; }
.photo-meta input, .photo-meta select { min-height: var(--ctl-sm); padding-top: 4px; padding-bottom: 4px; font-size: var(--fs-sm); }
.photo-meta .act-row { flex-wrap: wrap; }

/* Utilisation */
.rank { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.rank li { display: grid; gap: 6px; }
.rank-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-1) 10px; font-size: var(--fs-sm); }
.heatmap { border-collapse: separate; border-spacing: 2px; font-size: var(--fs-xs); }
.heatmap th, .heatmap td { padding: 5px 6px; border-bottom: 0; background: var(--surface); }
.heatmap td.hm { min-width: 32px; border-radius: 3px; text-align: center; font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; cursor: default; }
.heatmap td.hm-0 { background: var(--gray-50); color: var(--text-faint); font-weight: var(--fw-regular); }
.heatmap th.hm-day { padding: 4px 2px; line-height: 1.15; text-align: center; }
.heatmap th.hm-day span { display: block; font-size: var(--fs-2xs); }
.heatmap thead th:first-child { left: 0; z-index: 2; }
.heatmap tbody td:first-child { position: sticky; left: 0; z-index: 1; }
.heatmap tbody tr:hover { background: transparent; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--sp-3); color: var(--text-muted); font-size: var(--fs-xs); }
.hm-key { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }

/* QR labels */
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-4); }
.qr-card { break-inside: avoid; padding: var(--sp-5); border: var(--bw) solid var(--border-strong); border-radius: var(--r-lg); background: #fff; text-align: center; }
.qr-card .qr-brand { color: var(--text-2); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: .14em; }
.qr-card .qr-room { margin: var(--sp-1) 0 2px; font-size: 22px; font-weight: var(--fw-semibold); letter-spacing: -.015em; }
.qr-card svg { width: 100%; max-width: 220px; height: auto; margin: var(--sp-3) auto; }
.qr-card .qr-note { color: var(--text-muted); font-size: var(--fs-xs); }

/* App banners (pwa.js) */
.pwa-bar { position: sticky; top: var(--topbar-h, var(--topbar)); z-index: 35; }
.pwa-banner {
  display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm);
  padding: 10px max(var(--sp-4), env(safe-area-inset-right)) 10px max(var(--sp-4), env(safe-area-inset-left));
  animation: fadeIn var(--dur-2) var(--ease);
}
.pwa-banner > div { flex: 1; min-width: 0; }
.pwa-banner .icon { flex: none; }
.pwa-offline { background: var(--gray-900); color: rgba(255, 255, 255, .86); }
.pwa-offline strong { color: #fff; }
.pwa-online { background: var(--success-bg); color: var(--success-text); border-bottom: var(--bw) solid var(--success-border); }
.pwa-update { background: var(--surface); color: var(--text); border-bottom: var(--bw) solid var(--border); box-shadow: var(--shadow-xs); }
.pwa-dot { display: none; }
.install-banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); }
.install-banner img { flex: 0 0 40px; width: 40px; height: 40px; border-radius: var(--r-md); }
.install-text { flex: 1 1 220px; min-width: 0; }
.install-actions { display: flex; gap: var(--sp-2); }

/* Launch splash (installed app only) */
.splash { display: none; }
@media (display-mode: standalone) {
  .splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; pointer-events: none; background: var(--gray-950); animation: splashOut var(--dur-3) var(--ease) .9s forwards; }
}
.splash-inner { display: grid; justify-items: center; gap: var(--sp-6); }
.splash-logo { width: min(60vw, 260px); height: auto; }
.splash-bar { width: 96px; height: 2px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .12); }
.splash-bar span { display: block; width: 40%; height: 100%; background: var(--brand); animation: loadSlide 1s var(--ease) infinite; }

/* Trainer app navigation: bottom bar on phones, tab bar under the top bar on desktop */
body.has-nav .container { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
body.has-nav .footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
body.has-nav .alert.toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: rgba(255, 255, 255, .96); border-top: var(--bw) solid var(--border);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
}
.bottom-nav a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px;
  color: var(--text-muted); font-size: var(--fs-2xs); font-weight: var(--fw-medium); text-decoration: none;
  -webkit-tap-highlight-color: transparent; transition: color var(--dur-1) var(--ease);
}
.bottom-nav a:hover { color: var(--text); }
.bottom-nav .icon { width: var(--icon-nav); height: var(--icon-nav); }
.bottom-nav a.on { color: var(--accent); }
.bottom-nav a.on::before { content: ""; position: absolute; top: 0; left: 50%; width: 28px; height: 2px; margin-left: -14px; border-radius: 0 0 2px 2px; background: var(--brand); }
.bottom-nav .nav-badge {
  position: absolute; top: 6px; left: calc(50% + 6px); display: grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-full); background: var(--gray-900); color: #fff; font-size: 10px; font-weight: var(--fw-semibold); line-height: 1;
}
.bottom-nav .nav-badge.alert-badge { background: var(--accent); }
.nav-badge[hidden] { display: none !important; }

/* Admin shell: sidebar + content */
body[data-app="admin"] .container.wide { padding: 0; }
body[data-app="admin"] .signin { margin-top: 8vh; }
#dashboard:not([hidden]) { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h, var(--topbar))); }
.sidebar {
  position: sticky; top: var(--topbar-h, var(--topbar)); display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h, var(--topbar)));
  padding: var(--sp-4) var(--sp-3); overflow-x: hidden; overflow-y: auto; background: var(--surface); border-right: var(--bw) solid var(--border);
}
.side-nav { display: flex; flex-direction: column; gap: var(--sp-5); }
.nav-group { display: grid; gap: 2px; }
.nav-group-label { padding: 0 10px 6px; color: var(--text-muted); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.tab {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--ctl-md); padding: 0 10px; margin: 0;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); font: inherit; font-size: var(--fs-md); font-weight: var(--fw-medium);
  text-align: left; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.tab .icon { width: var(--icon-lg); height: var(--icon-lg); color: var(--text-muted); transition: color var(--dur-1) var(--ease); }
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: var(--fw-semibold); }
.tab[aria-current="page"] .icon { color: var(--text); }
.tab[aria-current="page"]::before { content: ""; position: absolute; left: calc(-1 * var(--sp-3)); top: 8px; bottom: 8px; width: 2px; border-radius: 0 2px 2px 0; background: var(--brand); }
.tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tab-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: auto;
  border-radius: var(--r-full); background: var(--accent); color: #fff; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); line-height: 1;
}
.side-foot { margin-top: auto; padding-top: var(--sp-3); border-top: var(--bw) solid var(--border); }
.side-foot .tab { color: var(--text-muted); font-size: var(--fs-sm); }
.dash-main { min-width: 0; width: 100%; max-width: 1440px; padding: var(--sp-6) var(--sp-8) var(--sp-10); }
.dash-main .footer { margin-top: var(--sp-6); padding: 0; text-align: left; }
#dashboard.is-collapsed { --sidebar-w: 64px; }
#dashboard.is-collapsed .tab-label, #dashboard.is-collapsed .nav-group-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#dashboard.is-collapsed .tab { justify-content: center; padding: 0; }
#dashboard.is-collapsed .side-nav { gap: var(--sp-3); }
#dashboard.is-collapsed .nav-group + .nav-group { padding-top: var(--sp-3); border-top: var(--bw) solid var(--border); }
#dashboard.is-collapsed .tab-badge { position: absolute; top: 5px; right: 8px; min-width: 8px; height: 8px; padding: 0; font-size: 0; }
#dashboard.is-collapsed .side-foot .tab .icon { transform: scaleX(-1); }

/* Batch planner */
.plan-form { padding: var(--sp-4); }
.plan-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.plan-fields label, .field-label { display: block; margin: 0 0 6px; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-2); }
.field-label-form { margin: var(--sp-4) 0 6px; font-size: var(--fs-sm); color: var(--text); }
.plan-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3) var(--sp-5); margin-top: var(--sp-4); }
.plan-days { flex: 1 1 320px; }
.plan-check { display: flex; align-items: flex-end; padding-bottom: 10px; }
.plan-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp-4); }
.plan-row > .btn { margin-left: auto; min-width: 140px; }
.plan-summary { margin: 0 0 var(--sp-4); }
.plan-summary p { margin: 0; }
.plan-summary .plan-title { margin-bottom: 2px; font-size: var(--fs-base); }
.plan-notes { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-xs); line-height: 1.4; }
.plan-notes li { display: flex; align-items: flex-start; gap: 6px; color: var(--text-2); }
.plan-notes .icon { flex: none; width: 14px; height: 14px; margin-top: 1px; color: var(--text-muted); }
.plan-notes .note-ok .icon { color: var(--success); }
.plan-notes .note-warn { color: var(--warning-text); }
.plan-notes .note-warn .icon { color: var(--warning); }
.status-list { margin: 0; padding: 0; list-style: none; }
.status-list li { padding: var(--sp-2) 0; border-top: var(--bw) solid var(--border); }
.status-list li:first-child { border-top: 0; padding-top: 0; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.status-name { min-width: 0; font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.section-label { margin: var(--sp-5) 0 var(--sp-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted); }
.card-head + .section-label { margin-top: 0; }
.plain-list { margin: 0; padding: 0; list-style: none; }
.plain-list li { padding: 3px 0; }
.empty-plan { --i: var(--i-calendar-clock); }
@media (max-width: 599px) {
  /* Long selects get the full row on phones; dense packing keeps the short fields in pairs. */
  .plan-fields { grid-auto-flow: row dense; }
  .plan-fields .plan-wide { grid-column: 1 / -1; }
  /* Suggestions: one block per option (time and fit on top) instead of a wide table. */
  .plan-table thead { display: none; }
  .plan-table table, .plan-table tbody { display: block; }
  .plan-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: var(--bw) solid var(--border); }
  .plan-table tbody tr:last-child { border-bottom: 0; }
  .plan-table td { display: block; padding: 0; border: 0; }
  .plan-table td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  .plan-table td:nth-child(n+2):not(:nth-child(4)) { grid-column: 1 / -1; }
  .plan-table td:nth-child(6) .btn { width: 100%; }
}
@media (min-width: 600px) { .plan-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .plan-split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .plan-fields { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* -------------------------------------------------------- Breakpoints --- */
@media (min-width: 600px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .identity { grid-template-columns: 1fr 1.4fr 1fr; }
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .btn.upload-btn { margin-top: 28px; }
  .btn-row > .btn { flex: 0 0 auto; min-width: 140px; }
}
@media (min-width: 900px) {
  .container.wide .room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* trainer app: tab bar under the top bar */
  body.has-nav { display: flex; flex-direction: column; }
  body.has-nav > .topbar { order: -3; }
  body.has-nav > .bottom-nav { order: -2; }
  body.has-nav > .pwa-bar { order: -1; top: calc(var(--topbar-h, var(--topbar)) + 48px); }
  body.has-nav > .container { width: 100%; }
  .bottom-nav {
    position: sticky; top: var(--topbar-h, var(--topbar)); bottom: auto; display: flex; justify-content: center; gap: var(--sp-1);
    height: 48px; padding: 0 var(--sp-4); background: var(--surface); border-top: 0; border-bottom: var(--bw) solid var(--border);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .bottom-nav a { flex-direction: row; gap: var(--sp-2); min-height: 48px; padding: 0 14px; font-size: var(--fs-md); }
  .bottom-nav .icon { width: var(--icon-lg); height: var(--icon-lg); }
  .bottom-nav a.on { color: var(--text); }
  .bottom-nav a.on .icon { color: var(--accent); }
  .bottom-nav a.on::before { top: auto; bottom: -1px; left: 10px; right: 10px; width: auto; margin: 0; border-radius: 2px 2px 0 0; }
  .bottom-nav .nav-badge { position: static; margin-left: 2px; }
  body.has-nav .container { padding-bottom: var(--sp-10); }
  body.has-nav .footer { padding-bottom: var(--sp-4); }
  body.has-nav .alert.toast { bottom: 24px; }
}
@media (min-width: 1280px) {
  .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}
@media (min-width: 1100px) {
  .container.wide .room-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body[data-app="admin"] .card .table-wrap:not(.compact):not(.heatmap-wrap) { max-height: min(70vh, 760px); }
}
/* Admin room cards: as many ~240 px columns as the content area allows */
#dashboard .room-grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
/* Tablet: icon sidebar */
@media (min-width: 768px) and (max-width: 1099px) {
  #dashboard { --sidebar-w: 64px; }
  #dashboard .tab-label, #dashboard .nav-group-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #dashboard .tab { justify-content: center; padding: 0; }
  #dashboard .side-nav { gap: var(--sp-3); }
  #dashboard .nav-group + .nav-group { padding-top: var(--sp-3); border-top: var(--bw) solid var(--border); }
  #dashboard .tab-badge { position: absolute; top: 5px; right: 8px; min-width: 8px; height: 8px; padding: 0; font-size: 0; }
  #dashboard .side-foot { display: none; }
  .dash-main { padding: var(--sp-6); }
}
/* Phone: sidebar becomes a scrolling tab strip */
@media (max-width: 767px) {
  :root { --card-pad: 16px; }
  #dashboard:not([hidden]) { display: block; }
  .sidebar {
    top: var(--topbar-h, var(--topbar)); z-index: 30; flex-direction: row; height: auto; padding: 0 var(--sp-2);
    overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: var(--bw) solid var(--border); scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .side-nav { flex-direction: row; gap: 0; }
  .nav-group { display: flex; gap: 0; }
  .nav-group-label, .side-foot { display: none; }
  .tab { width: auto; min-height: 46px; padding: 0 var(--sp-3); border-radius: 0; font-size: var(--fs-sm); }
  .tab:hover { background: transparent; }
  .tab .icon { display: none; }
  .tab[aria-current="page"] { background: transparent; }
  .tab[aria-current="page"]::before { top: auto; bottom: 0; left: var(--sp-2); right: var(--sp-2); width: auto; height: 2px; border-radius: 2px 2px 0 0; }
  .tab-badge { margin-left: 6px; }
  .dash-main { padding: var(--sp-4) var(--sp-4) var(--sp-8); }
  .page-head { margin-bottom: var(--sp-4); }
  body[data-app="admin"] .signin { margin: var(--sp-4); }
}
@media (max-width: 600px) {
  body { font-size: var(--fs-base); }
  /* Filter chips: one swipeable row instead of a tall stack */
  .chips[role="group"] { flex: 1 1 100%; flex-wrap: nowrap; min-width: 0; margin-right: calc(-1 * var(--card-pad)); padding-right: var(--card-pad); overflow-x: auto; scrollbar-width: none; }
  .chips[role="group"]::-webkit-scrollbar { display: none; }
  .chips[role="group"] .chip-btn { flex: none; }
  .container { padding: var(--sp-4) var(--sp-3) var(--sp-8); }
  .user-chip { display: none; }
  dialog, dialog.dlg-wide { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-width: var(--bw) 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .dialog-body { max-height: calc(92vh - 136px); }
  .dialog-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .dialog-foot .btn { flex: 1; }
  .signin { margin-top: var(--sp-4); }
}
@media (max-width: 420px) {
  .brand-tag { display: none; }
  .brand-logo { height: 20px; }
  .topbar .btn-ghost .label-long { display: none; }
}
/* Touch: larger targets, 16 px inputs (no zoom on focus) */
@media (pointer: coarse) {
  .btn { min-height: var(--ctl-lg); }
  .btn-sm { min-height: 38px; }
  .btn-icon, .btn-icon.btn-sm { width: 40px; }
  .icon-btn { width: 40px; height: 40px; }
  input, select, textarea { min-height: var(--ctl-lg); font-size: 16px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; }
  .chip-btn { height: 38px; }
  .menu-item { min-height: 44px; font-size: var(--fs-md); }
  .table-wrap select { min-height: 38px; }
}

/* ----------------------------------------------------------- 6. Motion --- */
/* Opacity only: a transform here would trap the fixed-position menus inside the panel while it animates. */
.view:not([hidden]), section[data-panel]:not([hidden]) { animation: fadeIn var(--dur-3) var(--ease); }
dialog[open] { animation: dlgIn var(--dur-2) var(--ease); }
dialog[open]::backdrop { animation: fadeIn var(--dur-2) var(--ease); }
@media (max-width: 600px) { dialog[open] { animation: sheetIn var(--dur-3) var(--ease); } }
.alert.toast:not([hidden]) { animation: toastIn var(--dur-2) var(--ease); }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes dlgIn { from { opacity: 0; transform: translateY(6px) scale(.99); } }
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes scanLine { to { top: 82%; } }
@keyframes loadSlide { from { left: -35%; } to { left: 100%; } }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .splash { display: none !important; }
}

/* ------------------------------------------------------------- Print --- */
@media print {
  body { background: #fff; }
  .topbar, .sidebar, .page-head, .no-print, .footer, .alert.toast, .bottom-nav, .pwa-bar, .install-banner, .splash, .loading-bar { display: none !important; }
  #dashboard:not([hidden]) { display: block; }
  .dash-main, .container { max-width: none; padding: 0; }
  .card { padding: 0; border: 0; }
  .print-only-section ~ * { display: none; }
}
