/* Nova School: swatch colours confirmed by owner 2026-09-07 (PDF labels differ).
   Shared brand tokens; operational status colours retain their meaning. */
:root {
  --ink: #332f38;
  --muted: #625d68;
  --bg: #ffffff;
  --panel: #ffffff;
  --line: #dce4eb;
  --line-strong: #a6b5c1;
  --panel-hover: #faf0fc;
  --accent: #a700bd;
  --accent-hover: #870099;
  --on-accent: #ffffff;
  --brand-secondary: #fece00;
  --brand-alternative: #48b2ff;
  --brand-soft: #eef8ff;
  /* Canonical control tokens: every page's field/card/shadow rules resolve
     to these, since this file loads after each page's own <style> block. */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .08);
  --shadow-2: 0 3px 6px rgba(0, 0, 0, .16), 0 3px 6px rgba(0, 0, 0, .10);
  --field-pad-y: .5rem;
  --field-pad-x: .7rem;
  --field-font: .88rem;
  --control-pad-y: .4rem;
  --control-pad-x: .6rem;
  --control-font: .85rem;
}
body { color: var(--ink); background-color: var(--bg); }
a { color: var(--accent); }
button, input, select, textarea { accent-color: var(--accent); }
/* Canonical field baseline — a pure fallback for any input/select/textarea
   a page doesn't style itself. Specificity is kept at (0,0,1), the lowest
   possible (the type-exclusion is wrapped in :where(), which always
   contributes zero), so it never outranks a page's own selector — not
   even a bare two-element one like `header input` or `#toolbar select`.
   Pages should reference --field-pad-y/-x/-font, --control-pad-y/-x/-font
   and --radius-md directly instead of hardcoding new numbers. */
input:where(:not([type=hidden], [type=checkbox], [type=radio], [type=range])),
select, textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--field-pad-y) var(--field-pad-x);
  font-size: var(--field-font);
  background: var(--panel);
  color: var(--ink);
  box-sizing: border-box;
}
/* input[type=file]'s outer box gets the field baseline above like any
   other input, but its embedded native "Choose file" sub-button ignores
   the parent's border/padding/radius entirely — style it separately so it
   doesn't look like a stray browser-default control next to real fields. */
input[type=file]::file-selector-button {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--control-pad-y) var(--control-pad-x);
  font: inherit;
  font-size: var(--control-font);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  margin-right: .6rem;
}
input[type=file]::file-selector-button:hover { background: var(--panel-hover); }
/* Data tables on narrow screens scroll horizontally (existing per-page
   `table { display:block; overflow-x:auto }` mobile rule) with no visual
   cue that columns are hidden off-edge — a user can lose a whole column
   silently. This adds a shadow that only appears on the side there's
   still more to scroll, and fades out as that edge is reached, without
   JS: two gradients scroll with the content (masking the shadow near a
   true edge) layered under two gradients fixed to the viewport (the
   shadow itself). Every existing page's own `table` mobile rule already
   sets the background this composites onto. */
@media (max-width: 700px) {
  table {
    background-image:
      linear-gradient(to right, var(--panel) 50%, transparent),
      linear-gradient(to left, var(--panel) 50%, transparent),
      linear-gradient(to right, rgba(0, 0, 0, .16), transparent),
      linear-gradient(to left, rgba(0, 0, 0, .16), transparent);
    background-repeat: no-repeat;
    background-color: var(--panel);
    background-size: 24px 100%, 24px 100%, 10px 100%, 10px 100%;
    background-position: 0 0, 100% 0, 0 0, 100% 0;
    background-attachment: local, local, scroll, scroll;
  }
}
:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
::selection { color: #332f38; background: #fece00; }
/* Presence is distinct from lesson/payment status. */
#calendar-presence { background: var(--brand-soft); border-color: #b5e0ff; color: var(--ink); }
.presence-avatar { background: var(--brand-alternative); color: var(--ink); }
.presence-event { background: var(--brand-alternative); color: var(--ink); }
#presence-warning, #presence-stale { background: #fff5cc; color: #332f38; border-left: 3px solid var(--brand-secondary); }
/* Public booking: clear steps, warm introduction, readable feedback. */
.nova-booking #company-header { border-top: 5px solid var(--accent); box-shadow: 0 2px 12px #332f3810; }
.nova-booking #company-header h1 { font-size: 2rem; line-height: 1.15; }
.nova-booking #company-header .sub { font-size: .9rem; line-height: 1.5; margin-top: .5rem; }
.nova-booking .brand-intro { display:inline-block; margin:0 0 .7rem; padding:.25rem .5rem; background:var(--brand-secondary); color:var(--ink); border-radius:4px; font-size:.75rem; font-weight:600; }
.nova-booking .acc-section.active .acc-badge { background: var(--brand-secondary); color: var(--ink); }
.nova-booking .acc-section { border:1px solid var(--line); box-shadow:0 1px 4px #332f380a; }
.nova-booking #success-screen { border-top:5px solid var(--accent); }
.nova-booking #booking-summary { line-height:1.6; color:var(--ink); }
.nova-booking #error-box { padding:.7rem; background:#fff1f2; border-radius:8px; }
.nova-booking .btn:disabled { opacity:.55; cursor:not-allowed; }
.nova-login form { width:min(360px, calc(100vw - 32px)); padding:24px; border:1px solid var(--line); border-top:5px solid var(--accent); border-radius:12px; }
.nova-login h2 { margin:0 0 8px; font-size:2rem; }
.nova-login button[type=submit] { background:var(--accent); color:var(--on-accent); border:0; border-radius:8px; }
.nova-login input:not([type=hidden]) { width:100%; box-sizing:border-box; border:1px solid var(--line-strong); border-radius:6px; }
@media (max-width:600px) {
  .nova-booking { padding:1rem .75rem; }
  .nova-booking input, .nova-booking select, .nova-booking textarea { font-size:16px; }
  .nova-booking #company-header { padding:1rem; }
  .nova-booking .option-card { min-width:0; }
  .nova-booking .option-card .name { overflow-wrap:anywhere; }
  #calendar-presence { font-size:11px; }
  .presence-person { min-width:0; overflow-wrap:anywhere; }
}

/* Alternative dark theme. Bright brand fills keep their dark labels. */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2edf5;
  --muted: #bdb3c5;
  --bg: #17141c;
  --panel: #24202b;
  --panel-hover: #34283d;
  --line: #49404f;
  --line-strong: #75677f;
  --brand-soft: #172d40;
  --accent: #a700bd;
  --accent-hover: #bd00d5;
  --cancelled: #ff8b99;
  --danger: #ff8b99;
  --paid: #68d99e;
  --ok: #68d99e;
  --no-show: #ffc46b;
  --bg-a: #17141c;
  --bg-b: #24202b;
  --card-bg: #24202b;
  --sec-directions: #172d40;
  --sec-education: #332d19;
  --sec-approach: #1c3028;
}
html[data-theme="dark"] :is(input, select, textarea, dialog) { background-color:var(--panel); color:var(--ink); border-color:var(--line-strong); }
html[data-theme="dark"] button { color:var(--ink); }
html[data-theme="dark"] :is(a, .acc-edit, .option-card .price, #add-participant) { color:#e7a1f0; }
html[data-theme="dark"] :is(#toolbar button.primary, .btn.primary, .btn.save) { color:#ffffff; }
html[data-theme="dark"] :is(.nova-booking .brand-intro, .nova-booking .acc-section.active .acc-badge, .presence-avatar, .presence-event) { color:#332f38; }
html[data-theme="dark"] #calendar-presence { border-color:#315472; }
html[data-theme="dark"] :is(#presence-warning, #presence-stale) { background:#332d19; color:#ffdf70; }
html[data-theme="dark"] .nova-booking #error-box { background:#3a202a; color:#ffb1be; }
html[data-theme="dark"] #calendar-error { color:#ffb1be !important; }
html[data-theme="dark"] :focus-visible { outline-color:#48b2ff; }
html[data-theme="dark"] :is(.errorlist, .error) { color:#ffb1be; }
#theme-toggle { border:1px solid var(--line-strong); border-radius:8px; background:var(--panel); color:var(--ink); padding:9px 12px; font:500 13px var(--font-body); cursor:pointer; white-space:nowrap; }
#theme-toggle:hover { background:var(--panel-hover); }
#theme-toggle.theme-floating { position:fixed; bottom:16px; right:16px; z-index:35; box-shadow:0 2px 8px #0003; }
.nova-booking, .nova-login { padding-bottom:72px; }
@media print { #theme-toggle { display:none; } }
html[data-theme="dark"] :is(.lesson-count, .preview-frame-wrap, tr.reversal td) { background:var(--panel-hover); color:var(--ink); }
html[data-theme="dark"] .badge.expired { background:#3a202a; color:#ffb1be; }
html[data-theme="dark"] .btn.cancel-event { color:var(--cancelled); }
