/* Pegler Training and Resources: shared styles for the booking site and the console.
   Brand: near-black #101011, hi-vis orange #e5680d, Rubik. Content is light so it reads in daylight on a
   phone; the header and menu are dark. No inline styles anywhere (the CSP forbids them), so every look
   is a class here. */

@font-face {
  font-family: 'Rubik';
  src: url('/assets/fonts/rubik.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #101011;
  --ink-2: #26272b;
  --ink-3: #4b4f57;
  --mute: #5d636d;
  --line: #d9dbe0;
  --line-2: #e9eaee;
  --bg: #f3f4f6;
  --card: #ffffff;
  --dark: #101011;
  --dark-2: #1b1c1f;
  --dark-line: #34363b;
  --on-dark: #e7e7e7;
  --on-dark-mute: #b0b5bc;
  --orange: #e5680d;
  --orange-d: #a84700;
  --orange-soft: #fff1e6;
  --green: #176a3a;
  --green-soft: #e3f4ea;
  --amber: #8a5a00;
  --amber-soft: #fff3d6;
  --red: #a4262c;
  --red-soft: #fde8e9;
  --blue: #1b5fa8;
  --blue-soft: #e4effb;
  --grey-soft: #eceef2;
  --radius: 10px;
  --radius-s: 6px;
  --shadow: 0 1px 2px rgba(16, 16, 17, .06), 0 2px 8px rgba(16, 16, 17, .05);
  --focus: 0 0 0 3px #fff, 0 0 0 5px #1b5fa8;
  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--orange-d); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
html { scroll-padding-top: 80px; }
:focus-visible { outline: 3px solid #1b5fa8; outline-offset: 2px; }
[data-theme="dark"] :focus-visible { outline-color: #8cc0ff; }
.seg button:focus-visible, .tabs a:focus-visible, .tabs button:focus-visible, .tbl-wrap :focus-visible { outline-offset: -3px; }
.site-head :focus-visible, .site-foot :focus-visible, .topbar :focus-visible, .side :focus-visible, .btn-dark:focus-visible, .toast :focus-visible, .banner-demo :focus-visible { outline-color: #fff; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--orange); color: var(--ink); padding: 10px 14px; border-radius: var(--radius-s); z-index: 100; font-weight: 600; }
.skip:focus { top: 8px; }

/* ---------- layout helpers ---------- */
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap-s { max-width: 760px; }
.wrap-xs { max-width: 520px; }
.stack > * + * { margin-top: 16px; }
.stack-s > * + * { margin-top: 8px; }
.stack-l > * + * { margin-top: 28px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row-top { align-items: flex-start; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.grow { flex: 1 1 0; min-width: 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.w-full { width: 100%; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.muted { color: var(--mute); }
.small { font-size: .875rem; }
.xsmall { font-size: .8rem; }
.strong { font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }
.break { overflow-wrap: anywhere; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card-flush { padding: 0; overflow: hidden; }
.card-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-h h2, .card-h h3 { margin: 0; }
.card-tint { background: var(--orange-soft); border-color: #f3cfae; }
@media (min-width: 700px) { .card { padding: 20px; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-s);
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--grey-soft); color: var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn-primary:hover { background: #f27a22; border-color: #f27a22; color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); color: #fff; }
.btn-ghost { border-color: var(--line); background: transparent; }
.btn-danger { border-color: var(--red); color: var(--red); background: var(--card); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--orange-d); text-decoration: underline; font-weight: 500; cursor: pointer; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- forms ---------- */
.field { display: block; }
.field > .lbl { display: block; font-weight: 500; margin-bottom: 4px; font-size: .95rem; }
.field .opt { color: var(--mute); font-weight: 400; }
.field .help { color: var(--mute); font-size: .85rem; margin-top: 4px; }
.field .err { color: var(--red); font-size: .875rem; margin-top: 4px; font-weight: 500; }
.field.has-err .input, .field.has-err .select, .field.has-err .textarea { border-color: var(--red); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; background: #fff; border: 1.5px solid #8a8f99;
  border-radius: var(--radius-s); color: var(--ink);
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid transparent; outline-offset: 2px; box-shadow: var(--focus); border-color: var(--blue); }
.input[readonly] { background: var(--grey-soft); }
.input-money { text-align: right; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--orange-d); }
.check span { flex: 1; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 8px; }

.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: var(--radius-s); overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 10px 16px; min-height: 44px; font-weight: 600; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid #8a8f99; border-radius: var(--radius-s); background: #fff; }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.3rem; cursor: pointer; font-weight: 600; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 40px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--grey-soft); color: var(--ink-2); }
.b-green { background: var(--green-soft); color: var(--green); }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-blue { background: var(--blue-soft); color: var(--blue); }
.b-orange { background: var(--orange-soft); color: var(--orange-d); }
.b-dark { background: var(--ink); color: #fff; }

/* ---------- banners ---------- */
.banner { padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--grey-soft); font-size: .95rem; }
.banner strong { font-weight: 600; }
.banner-info { background: var(--blue-soft); border-color: #b7d2ef; }
.banner-warn { background: var(--amber-soft); border-color: #ecd18c; }
.banner-bad { background: var(--red-soft); border-color: #f0b4b7; }
.banner-ok { background: var(--green-soft); border-color: #a9d8bb; }
.banner-demo { background: var(--orange); color: var(--ink); border: 0; text-align: center; font-weight: 600; border-radius: 0; }

/* ---------- tables (turn into cards on a phone) ---------- */
.tbl-wrap { width: 100%; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); font-weight: 600; padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #fafafb; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td .sub { display: block; color: var(--mute); font-size: .85rem; }
@media (max-width: 699px) {
  .tbl-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tr { border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; margin-bottom: 10px; padding: 6px 4px; box-shadow: var(--shadow); }
  .tbl-cards td { border: 0; padding: 6px 12px; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
  .tbl-cards td::before { content: attr(data-label); font-weight: 600; color: var(--mute); text-align: left; flex: none; font-size: .85rem; }
  .tbl-cards td.lead { display: block; text-align: left; font-weight: 600; }
  .tbl-cards td.lead::before { display: none; }
  .tbl-cards td .sub { text-align: right; }
}

/* ---------- key/value lists ---------- */
.kv { display: grid; grid-template-columns: 1fr; gap: 2px 16px; margin: 0; }
.kv dt { color: var(--mute); font-size: .85rem; margin-top: 10px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 600px) { .kv { grid-template-columns: 170px 1fr; } .kv dt { margin-top: 0; padding: 6px 0; } .kv dd { padding: 6px 0; } }

/* ---------- tabs and filters ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 2px solid var(--line); margin-bottom: 16px; -webkit-overflow-scrolling: touch; }
.tabs a, .tabs button { flex: none; padding: 10px 14px; min-height: 44px; border: 0; background: none; font-weight: 500; color: var(--ink-3); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; }
.tabs [aria-current="true"], .tabs [aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { flex: 1 1 160px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; min-height: 36px; cursor: pointer; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- stat tiles and lists ---------- */
.stat { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line-2); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
a.stat:hover { background: #fafafb; }
.stat .n { font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--mute); font-size: .9rem; }
.stat.hot { border-left-color: var(--orange); }
.stat.bad { border-left-color: var(--red); }
.stat.good { border-left-color: var(--green); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.list > li:last-child { border-bottom: 0; }
.list a.item { display: block; text-decoration: none; color: inherit; }
.empty { text-align: center; padding: 32px 16px; color: var(--mute); }
.empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }

/* ---------- toasts and modal ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 300; pointer-events: none; padding: 0 var(--gutter); }
.toast { pointer-events: auto; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-s); box-shadow: 0 6px 24px rgba(0, 0, 0, .3); max-width: 460px; width: 100%; font-weight: 500; }
.toast.bad { background: var(--red); }
.toast.ok { background: var(--green); }
.modal-back { position: fixed; inset: 0; background: rgba(16, 16, 17, .6); display: flex; align-items: flex-end; justify-content: center; z-index: 200; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: var(--radius) var(--radius) 0 0; padding: 20px var(--gutter) 24px; }
.modal h2 { margin-bottom: 12px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@media (min-width: 700px) { .modal-back { align-items: center; } .modal { border-radius: var(--radius); padding: 24px; } }

/* ---------- loading ---------- */
.spin { display: inline-block; width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 32px; text-align: center; color: var(--mute); }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } * { scroll-behavior: auto !important; } }

/* ---------- public site shell ---------- */
.site-head { background: var(--dark); color: var(--on-dark); border-bottom: 4px solid var(--orange); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.site-head img { height: 52px; width: auto; display: block; }
.site-head a { color: var(--on-dark); }
.site-head .call { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1.5px solid var(--dark-line); border-radius: var(--radius-s); min-height: 44px; }
.site-main { padding: 22px 0 48px; }
.site-foot { background: var(--dark); color: var(--on-dark-mute); padding: 22px 0; font-size: .9rem; }
.site-foot a { color: var(--on-dark); }

/* ---------- console shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--dark); color: var(--on-dark); display: flex; align-items: center; gap: 12px; padding: 8px var(--gutter); position: sticky; top: 0; z-index: 50; border-bottom: 3px solid var(--orange); }
.topbar img { height: 38px; width: auto; display: block; }
.topbar .menu-btn { background: none; border: 1.5px solid var(--dark-line); color: var(--on-dark); border-radius: var(--radius-s); min-width: 44px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.topbar .menu-btn svg { width: 22px; height: 22px; }
.topbar .who { margin-left: auto; font-size: .9rem; color: var(--on-dark-mute); }
.side { background: var(--dark); color: var(--on-dark); position: fixed; top: 0; bottom: 0; left: 0; width: 270px; transform: translateX(-100%); transition: transform .18s ease; z-index: 120; overflow-y: auto; padding: 14px 10px 24px; }
.side.open { transform: none; }
.side-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 110; }
.side .brand { padding: 6px 8px 14px; }
.side .brand img { height: 44px; width: auto; max-width: 100%; object-fit: contain; }   /* width auto: the HTML width attribute alone squashed the logo to 150x44 */
.side .nav-group { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--on-dark-mute); margin: 18px 10px 6px; font-weight: 600; }
.side a.nav, .side button.nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-s); color: var(--on-dark); text-decoration: none; min-height: 44px; font-weight: 500; }
.side a.nav > span:not(.count), .side button.nav > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side a.nav svg, .side button.nav svg { width: 20px; height: 20px; flex: none; opacity: .85; }
.side a.nav:hover { background: var(--dark-2); }
.side a.nav[aria-current="page"] { background: var(--orange); color: var(--ink); font-weight: 600; }
.side a.nav .count { margin-left: auto; background: var(--orange); color: var(--ink); border-radius: 999px; padding: 0 8px; font-size: .78rem; font-weight: 700; line-height: 1.6; }
.side a.nav[aria-current="page"] .count { background: var(--ink); color: #fff; }
.main { flex: 1; padding: 18px 0 60px; }
.page-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-h h1 { margin: 0; }
.crumbs { font-size: .9rem; margin-bottom: 6px; }
@media (max-width: 959px) { .side:not(.open) { visibility: hidden; transition: transform .18s ease, visibility 0s .18s; } }
@media (min-width: 960px) {
  .app { --side-w: 292px; display: grid; grid-template-columns: var(--side-w) 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 2; }
  .topbar .menu-btn, .topbar .logo-mobile { display: none; }
  .side { position: sticky; top: 0; height: 100vh; transform: none; width: var(--side-w); grid-row: 1 / span 2; grid-column: 1; }
  .side-back { display: none; }
  .main-col { grid-column: 2; grid-row: 2; }
}
/* drag handle on the right edge of the sidebar (wide screens only) */
.side-resize { display: none; }
@media (min-width: 960px) {
  .side-resize { display: block; position: fixed; top: 0; bottom: 0; left: calc(var(--side-w) - 4px); width: 8px; cursor: col-resize; z-index: 121; touch-action: none; background: transparent; }
  .side-resize::after { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background-color .12s ease; }
  .side-resize:hover::after, .side-resize:focus-visible::after, .side-resize.is-drag::after { background: var(--orange); }
  .app.is-resizing { cursor: col-resize; user-select: none; }
}
.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main-col .main { flex: 1; }
.side button.nav { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.side button.nav:hover { background: var(--dark-2); }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--dark); padding: var(--gutter); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: var(--radius); padding: 28px 24px; }
.login-card img { height: 60px; margin-bottom: 14px; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: .75rem; text-transform: uppercase; color: var(--mute); font-weight: 600; text-align: center; padding: 4px 0; }
.cal .day { min-height: 72px; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 4px; font-size: .78rem; overflow: hidden; }
.cal .day.off { background: #f6f6f8; color: var(--mute); }
.cal .day.today { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.cal .day .dn { font-weight: 600; display: block; margin-bottom: 2px; }
.cal .ev { display: block; border-radius: 4px; padding: 1px 5px; margin-top: 2px; font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.inp { background: var(--ink); color: #fff; }
.cal .ev.onl { background: var(--blue-soft); color: var(--blue); }
.cal .ev.full { outline: 2px solid var(--red); }

/* ---------- misc ---------- */
.progress { height: 8px; border-radius: 4px; background: var(--grey-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--orange); }
.progress.full > span { background: var(--red); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 14px; font-size: .9rem; }
.timeline li::before { content: ''; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; }
.pre { white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; background: var(--grey-soft); padding: 12px; border-radius: var(--radius-s); overflow-x: auto; }
.price-total { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hide-sm { display: none; }
@media (min-width: 700px) { .hide-sm { display: revert; } .hide-lg { display: none; } }

@media print {
  .topbar, .side, .side-back, .site-head, .site-foot, .no-print, .btn, .toasts, .tabs, .filters { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .app { display: block; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: revert; }
  .tbl-cards thead { position: static; width: auto; height: auto; clip: auto; }
  .tbl-cards td::before { display: none; }
}

/* toasts: two live regions stacked */
.toast-list { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.toast .toast-x { color: #fff; margin-left: 8px; }
.btn-link[aria-disabled="true"], .btn[aria-disabled="true"] { opacity: .6; cursor: progress; }

/* ---------- skeleton loading (PT.ui.skeleton) ---------- */
.skel { padding: 4px 0; }
.skel > * + * { margin-top: 16px; }
.sk { display: block; background: var(--sk-base, #e4e6ea); border-radius: 6px; position: relative; overflow: hidden; }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--sk-shine, rgba(255, 255, 255, .55)), transparent); animation: sk-shimmer 1.4s ease-in-out infinite; }
@keyframes sk-shimmer { to { transform: translateX(100%); } }
.sk-card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.sk-card > * + * { margin-top: 10px; }
.sk-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sk-title { width: 220px; max-width: 60%; height: 30px; }
.sk-btn { width: 110px; height: 40px; }
.sk-line { height: 12px; width: 100%; }
.sk-line.sk-short { width: 55%; }
.sk-num { height: 30px; width: 60px; }
.sk-tile { border-left: 5px solid var(--line); }
.sk-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.sk-input { height: 44px; flex: 1 1 160px; }
.sk-row { display: grid; grid-template-columns: 3fr 2fr 1fr 1fr; gap: 14px; padding: 6px 0; }
.sk-cell { height: 14px; }
.sk-media { height: 120px; width: 100%; border-radius: var(--radius-s); }
.sk-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sk-day { min-height: 76px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 6px; }
.sk-day > * + * { margin-top: 6px; }
.sk-dn { width: 18px; height: 12px; }
.sk-ev { height: 14px; width: 80%; }
.sk-li { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.sk-dot { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.sk-block { padding: 16px 0; }
.sk-block > * + * { margin-top: 10px; }
@media (max-width: 699px) { .sk-row { grid-template-columns: 2fr 1fr; } .sk-row .sk-cell:nth-child(n+3) { display: none; } }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; display: none; } }

/* ---------- page entrance ---------- */
.page-in { animation: page-in .32s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* cinematic entrance: the page settles, then its sections and cards rise in a short cascade (under half a second
   in all, transform and opacity only, so nothing shifts layout) */
.page-in > .stack > *, .page-in .grid > *, .page-in .cu-course-grid > *, .page-in .fw-grid > * { animation: rise-in .42s cubic-bezier(.16, .84, .3, 1) both; }
.page-in > .stack > :nth-child(2), .page-in .grid > :nth-child(2), .page-in .cu-course-grid > :nth-child(2), .page-in .fw-grid > :nth-child(2) { animation-delay: .04s; }
.page-in > .stack > :nth-child(3), .page-in .grid > :nth-child(3), .page-in .cu-course-grid > :nth-child(3), .page-in .fw-grid > :nth-child(3) { animation-delay: .08s; }
.page-in > .stack > :nth-child(4), .page-in .grid > :nth-child(4), .page-in .cu-course-grid > :nth-child(4), .page-in .fw-grid > :nth-child(4) { animation-delay: .12s; }
.page-in > .stack > :nth-child(5), .page-in .grid > :nth-child(5), .page-in .cu-course-grid > :nth-child(5) { animation-delay: .16s; }
.page-in > .stack > :nth-child(n+6), .page-in .grid > :nth-child(n+6), .page-in .cu-course-grid > :nth-child(n+6) { animation-delay: .2s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px) scale(.995); } to { opacity: 1; transform: none; } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card, .stat, .cu-course { transition: transform .18s ease-out, box-shadow .18s ease-out; }
  a.stat:hover, .cu-course:hover, a.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 16, 17, .08); }
}
@media (prefers-reduced-motion: reduce) { .page-in, .page-in > .stack > *, .page-in .grid > *, .page-in .cu-course-grid > *, .page-in .fw-grid > * { animation: none; } }
:root[data-motion="reduced"] .page-in > .stack > *, :root[data-motion="reduced"] .page-in .grid > * { animation: none; }

/* ---------- themes: data-theme on <html> (dark), data-density (compact), accent via CSS variables ---------- */
:root[data-theme="dark"] {
  --ink: #eceef1; --ink-2: #d5d8dd; --ink-3: #b3b8c0; --mute: #9aa1ab; --line: #3a3d44; --line-2: #2c2f35;
  --bg: #0f1012; --card: #181a1e; --grey-soft: #23262b; --orange-soft: #33220f; --green-soft: #12301f; --green: #6fd19a;
  --amber-soft: #352a0e; --amber: #f0c25a; --red-soft: #3a1618; --red: #ff8a8f; --blue-soft: #142a44; --blue: #8cc0ff; --orange-d: #ff9a4d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3); --focus: 0 0 0 3px #0f1012, 0 0 0 5px #8cc0ff;
  --sk-base: #24272c; --sk-shine: rgba(255, 255, 255, .06);
  color-scheme: dark;
}
:root[data-theme="dark"] .input, :root[data-theme="dark"] .select, :root[data-theme="dark"] .textarea,
:root[data-theme="dark"] .seg, :root[data-theme="dark"] .stepper, :root[data-theme="dark"] .chip,
:root[data-theme="dark"] .modal, :root[data-theme="dark"] .sk-day { background: var(--card); color: var(--ink); }
:root[data-theme="dark"] .input, :root[data-theme="dark"] .select, :root[data-theme="dark"] .textarea { border-color: #5b616b; }
:root[data-theme="dark"] .input[readonly] { background: var(--grey-soft); }
:root[data-theme="dark"] .btn { background: var(--card); color: var(--ink); border-color: var(--ink-3); }
:root[data-theme="dark"] .btn:hover { background: var(--grey-soft); }
:root[data-theme="dark"] .btn-primary { background: var(--orange); border-color: var(--orange); color: #101011; }
:root[data-theme="dark"] .btn-danger { color: var(--red); border-color: var(--red); }
:root[data-theme="dark"] .seg button[aria-pressed="true"], :root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--ink); color: #101011; }
:root[data-theme="dark"] .tbl tr.clickable:hover td, :root[data-theme="dark"] a.stat:hover { background: var(--grey-soft); }
:root[data-theme="dark"] .cal .day { background: var(--card); }
:root[data-theme="dark"] .cal .day.off { background: #141518; }
:root[data-theme="dark"] .cal .ev.inp { background: #e7e7e7; color: #101011; }
:root[data-theme="dark"] .card-tint { border-color: #5a3a17; }
:root[data-theme="dark"] .b-dark { background: var(--ink); color: #101011; }
:root[data-theme="dark"] .timeline li::before { border-color: var(--card); }
:root[data-theme="dark"] a:hover { color: var(--ink); }
@media (max-width: 699px) { :root[data-theme="dark"] .tbl-cards tr { background: var(--card); } }
:root[data-density="compact"] .card { padding: 12px; }
:root[data-density="compact"] .tbl td { padding: 7px 10px; }
:root[data-density="compact"] .stack > * + * { margin-top: 10px; }
:root[data-density="compact"] .main { padding-top: 10px; }
:root[data-text="large"] { font-size: 112.5%; }
:root[data-text="large"] body { font-size: 1.06rem; }

/* Offline page of the installed console app (admin/offline.html). */
.offline-page { min-height: 100vh; background: var(--dark); color: #f3f4f6; }
.offline-main { padding-top: 14vh; padding-bottom: 40px; }
.offline-main img { height: 64px; width: auto; }
.offline-page :focus-visible { outline-color: #fff; }
