:root {
  --ink: #15171C;
  --ground: #F4F5F7;
  --surface: #FFFFFF;
  --line: #E2E4E9;
  --line-soft: #EEF0F3;
  --line-strong: #D5D8DF;
  --input-line: #C9CDD5;
  --muted: #5A606B;
  --body-text: #3A3F48;
  --faint: #868C97;
  --accent: #1F3FD1;
  --accent-hover: #152C99;
  --accent-soft: #EEF1FD;
  --danger: #B42318;
  --danger-line: #F1C4BF;
  --danger-soft: #FDECEA;
  --danger-text: #8E1A10;
  --ok-soft: #E7F5EF;
  --ok-text: #0B6B50;
  --warn-soft: #FFF4E5;
  --warn-text: #7A3E00;
  --chip-soft: #F0F1F4;
  --closed-text: #4A505A;
  --accent-text: #1A35B0;
  --solid-sub: #D5D8DF;
  --window-bg: #15171C;
  --window-line: #15171C;
  --raise: 0 1px 2px rgba(21, 23, 28, 0.12);
  --todo-line: #F2C98A;
  --todo-bg: #FFFBF4;

  --font-heading: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
}

/* Admin dark mode. Light is the default; the server puts data-theme="dark"
   on <html> only when staff chose it, so there's no flash on load. The
   parent page never gets the attribute. "Solid" things (booked slots,
   selected chips) invert to light-on-dark so booked vs open stays obvious. */
:root { color-scheme: light; }
.language-switch {display:inline-flex;align-items:center;flex:none;margin:0}
.language-switch button {cursor:pointer;background:transparent;border:1px solid var(--line-strong);border-radius:6px;padding:4px 9px;color:var(--ink);font:600 12px/1.5 system-ui}
.site-header .language-switch {order:3;margin-inline-start:auto}
[dir=rtl] body {font-family:Tahoma, sans-serif}
[dir=rtl] .studio-admin {--font-body:Tahoma,sans-serif;--font-heading:Tahoma,sans-serif;--display:Tahoma,sans-serif}
[dir=rtl] .studio-admin .a-title,[dir=rtl] .studio-hero h1 {letter-spacing:0;font-size:clamp(26px,3.6vw,48px)}
[dir=rtl] .studio-hero::before {transform:scaleX(-1)}
[dir=rtl] .p-booker-field,[dir=rtl] .a-table td,[dir=rtl] .a-table th {text-align:start}
[dir=rtl] .studio-dropdown {left:0;right:auto}
[dir=rtl] .studio-nav-count {margin-left:0;margin-right:auto}
[dir=rtl] .studio-panel h2 {font-size:22px;line-height:1.6}
[dir=rtl] .studio-crumb {flex-wrap:wrap}
@media(max-width:500px){[dir=rtl] .studio-crumb i,[dir=rtl] .studio-crumb-mobile{display:none}.studio-top-actions {flex-shrink:0}}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #E8EAEE;
  --ground: #0F1114;
  --surface: #181B20;
  --line: #2A2E36;
  --line-soft: #22262D;
  --line-strong: #3A3F48;
  --input-line: #4A505A;
  --muted: #9AA0AB;
  --body-text: #C3C8D0;
  --faint: #7A808B;
  --accent: #7C93FF;
  --accent-hover: #A3B3FF;
  --accent-soft: #1D2442;
  --accent-text: #B4C1FF;
  --danger: #F97066;
  --danger-line: #6B2A25;
  --danger-soft: #3A1715;
  --danger-text: #FDA29B;
  --ok-soft: #10302A;
  --ok-text: #6CE0B5;
  --warn-soft: #382A12;
  --warn-text: #F7C66B;
  --chip-soft: #23272E;
  --closed-text: #A6ACB6;
  --solid-sub: #4A505A;
  --window-bg: #1D2129;
  --window-line: #2E333C;
  --raise: 0 1px 2px rgba(0, 0, 0, 0.5);
  --todo-line: #6B4A1A;
  --todo-bg: #1F1A10;
}
:root[data-theme="dark"] .a-dialog { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); }
:root[data-theme="dark"] .a-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }

.a-theme { display: inline-flex; align-items: center; gap: 8px; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3 { margin: 0; font-family: var(--font-heading); font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
button { font: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.dot {
  display: inline-block; flex: none;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dot, var(--muted));
}
.dot--lg { width: 9px; height: 9px; }

/* What a teacher teaches ("PIANO"), right after their name. */
.tag {
  display: inline-block; flex: none; margin-left: 2px; padding: 2px 7px;
  border-radius: 999px; background: var(--ink); color: var(--surface);
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; line-height: 1.35;
  text-transform: uppercase; vertical-align: 1px; white-space: nowrap;
}
.chip[aria-current="true"] .tag, .a-slot.is-booked .tag { background: var(--surface); color: var(--ink); }

.logo {
  width: 32px; height: 32px; flex: none;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
  padding: 6px 5px 5px; border-radius: 8px; background: var(--ink);
}
.logo span { background: var(--surface); border-radius: 1px; }
.logo--lg { width: 36px; height: 36px; border-radius: 9px; padding: 7px 6px 6px; }

/* Chips: teacher / day filters */
.chips { display: flex; gap: 8px; }
.chips--scroll { overflow-x: auto; margin: 0 -20px; padding: 2px 20px 6px; scrollbar-width: none; }
.chips--wrap { flex-wrap: wrap; }
.chip {
  flex: none; min-height: 40px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: var(--faint); }
.chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* ======================================================================
   Parent page (phone-first)
   ====================================================================== */

.p-body { display: flex; flex-direction: column; }

.site-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.site-header__text { display: flex; flex-direction: column; }
.site-header__title { font-family: var(--font-heading); font-weight: 700; font-size: 17px; line-height: 1.3; }
.site-header__sub { font-size: 12px; color: var(--muted); }

.p-main {
  flex: 1; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 32px 20px 28px; display: flex; flex-direction: column; gap: 24px;
}
.p-main--slots { padding: 20px 20px 32px; gap: 18px; }
.p-main--result { padding: 40px 20px 28px; gap: 22px; }

.p-intro { display: flex; flex-direction: column; gap: 10px; }
.p-title { font-size: 32px; line-height: 1.1; letter-spacing: -0.02em; }
.p-title--result { font-size: 28px; line-height: 1.15; }
.p-title--zero { font-size: 26px; line-height: 1.2; }
.p-lead { font-size: 16px; line-height: 1.5; color: var(--body-text); }
.p-note { font-size: 14px; line-height: 1.5; color: var(--muted); }
.p-push { margin-top: auto; }

.p-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 15px; font-weight: 600; }
.p-input {
  height: 52px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--input-line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 17px; width: 100%;
}
.p-input:focus { outline: none; border-color: var(--accent); }
.p-input--error { border-color: var(--danger); }

.p-alert {
  display: flex; gap: 10px; padding: 14px; border-radius: 12px;
  font-size: 15px; line-height: 1.45;
}
.p-alert svg { flex: none; margin-top: 1px; }
.p-alert--error { background: var(--danger-soft); color: var(--danger-text); }
.p-alert--warn { background: var(--warn-soft); color: var(--warn-text); font-weight: 600; }

.p-btn {
  height: 54px; width: 100%; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; text-decoration: none;
}
.p-btn--primary { border: none; background: var(--accent); color: var(--surface); font-weight: 700; }
.p-btn--primary:hover { background: var(--accent-hover); color: var(--surface); }
.p-btn--secondary { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; }
.p-btn--secondary:hover { color: var(--ink); border-color: var(--faint); }
.p-actions { display: flex; flex-direction: column; gap: 10px; }

.p-who {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.p-who__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.p-who__label { font-size: 13px; color: var(--muted); font-weight: 500; display: block; }
.p-who__name { font-family: var(--font-heading); font-size: 22px; font-weight: 700; line-height: 1.2; }
.p-link-btn {
  min-height: 44px; padding: 0 4px; border: none; background: transparent;
  color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer;
}
.p-usage { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.pips { display: inline-flex; gap: 4px; }
.pips span { width: 28px; height: 8px; border-radius: 4px; background: var(--line-strong); }
.pips span.on { background: var(--ink); }

.p-pick { display: flex; flex-direction: column; gap: 4px; }
.p-pick h1 { font-size: 24px; }
.p-filters { display: flex; flex-direction: column; gap: 4px; }

.p-day { display: flex; flex-direction: column; gap: 8px; }
.p-day h2 {
  margin-top: 4px; font-family: var(--font-body); font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.p-slot {
  width: 100%; min-height: 68px; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none;
}
.p-slot:hover { color: var(--ink); border-color: var(--faint); }
.p-slot__time { display: flex; flex-direction: column; min-width: 92px; }
.p-slot__time strong { font-family: var(--font-heading); font-size: 20px; font-weight: 700; line-height: 1.3; }
.p-slot__sub { font-size: 13px; color: var(--muted); }
.p-slot__who { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.p-slot__teacher { font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.p-slot svg { flex: none; }

.p-empty {
  padding: 20px; border-radius: 14px; background: var(--surface);
  border: 1px dashed var(--input-line); font-size: 15px; line-height: 1.5;
  color: var(--body-text); text-align: center;
}

.p-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; }
.p-icon--ok { background: var(--ok-soft); }
.p-icon--lock { background: var(--ink); }
.p-icon--none { background: var(--chip-soft); }
.p-status { display: flex; flex-direction: column; gap: 8px; }
.p-status--zero { gap: 10px; }
.p-remaining { font-size: 18px; font-weight: 600; color: var(--accent); }
.p-student { font-size: 15px; color: var(--muted); font-weight: 500; }

.p-booked-list { display: flex; flex-direction: column; gap: 10px; }
.p-booked {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
}
.p-booked__n { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.p-booked__when { font-family: var(--font-heading); font-size: 20px; font-weight: 700; }
.p-booked__where { font-size: 15px; color: var(--body-text); display: inline-flex; align-items: center; gap: 7px; }

/* Confirm step: bottom sheet */
.sheet {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(21, 23, 28, 0.5);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
}
.sheet__backdrop { position: absolute; inset: 0; }
.sheet__panel {
  position: relative; width: 100%; max-width: 560px;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 12px 20px 28px; display: flex; flex-direction: column; gap: 16px;
  max-height: 100vh; overflow-y: auto;
}
.sheet__grip { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.sheet__panel h2 { font-size: 24px; }
.sheet__grid {
  border-radius: 14px; background: var(--ground); padding: 16px;
  display: grid; grid-template-columns: 80px 1fr; gap: 10px; font-size: 15px;
}
.sheet__grid dt { color: var(--muted); }
.sheet__grid dd { margin: 0; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.sheet form { display: contents; }

/* Second confirmation: centered card, deliberately different from the
   bottom sheet so it reads as a new question, not the same screen. */
.sheet--center { justify-content: center; padding: 20px; }
.sheet--center .sheet__panel { max-width: 400px; border-radius: 22px; padding: 28px 20px 20px; }
.p-sure { text-align: center; gap: 12px; }
.p-sure h2 { font-size: 26px; }
.p-sure__when { font-family: var(--font-heading); font-size: 24px; font-weight: 700; line-height: 1.25; }
.p-sure .p-note { margin-bottom: 8px; }

/* ======================================================================
   Admin
   ====================================================================== */

.a-layout { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; }

.a-nav {
  flex: 1 1 232px; max-width: 100%;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 28px 18px; display: flex; flex-direction: column; gap: 28px;
}
.a-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.a-brand__name { display: block; font-family: var(--font-heading); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; line-height: 1.3; }
.a-brand__sub { display: block; font-size: 12px; color: var(--muted); }
.a-links { display: flex; flex-direction: column; gap: 4px; }
.a-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: 10px; color: var(--body-text); font-weight: 500; font-size: 15px; text-decoration: none;
}
.a-link:hover { background: var(--ground); color: var(--ink); }
.a-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.a-term {
  margin-top: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 16px; border-radius: 12px; background: var(--ground);
}
.a-term a, .a-term button { font-size: 14px; font-weight: 600; }
.a-term button { padding: 0; border: none; background: none; color: var(--accent); cursor: pointer; text-align: left; }
.a-term__label, .a-eyebrow-caps {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.a-term__name { font-weight: 600; font-size: 15px; }

.a-main {
  flex: 999 1 560px; min-width: 0;
  padding: 32px 36px 48px; display: flex; flex-direction: column; gap: 24px;
}
@media (max-width: 640px) { .a-main { padding: 24px 16px 40px; } }

.a-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.a-head--center { align-items: center; }
.a-head__text { display: flex; flex-direction: column; gap: 4px; }
.a-eyebrow { font-size: 14px; color: var(--muted); font-weight: 500; }
.a-title { font-size: 34px; letter-spacing: -0.02em; line-height: 1.15; }
.a-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.a-btn {
  height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.a-btn:hover { color: var(--ink); border-color: var(--faint); }
.a-btn--primary { border-color: var(--accent); background: var(--accent); color: var(--surface); }
.a-btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--surface); }
.a-btn--danger { border-color: var(--danger-line); color: var(--danger); }
.a-btn--danger:hover { color: var(--danger); border-color: var(--danger); }
.a-btn--danger-solid { border-color: var(--danger); background: var(--danger); color: var(--surface); font-weight: 700; }
.a-btn--danger-solid:hover { color: var(--surface); }
.a-btn--sm { height: auto; min-height: 36px; padding: 0 12px; border-radius: 8px; font-size: 13px; }
.a-btn--icon { width: 44px; padding: 0; }
.a-btn--block { width: 100%; min-height: 48px; font-size: 15px; font-weight: 700; }
.a-btn--grow { flex: 1 1 120px; }
.a-inline { display: inline; }

.a-flash {
  display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; background: var(--ok-soft); color: var(--ok-text);
}
.a-flash--error { background: var(--danger-soft); color: var(--danger-text); }
/* app.js moves messages here so a saved scroll position isn't shifted by them */
.a-toasts {
  position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: min(420px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 8px;
}
@media (max-width: 640px) { .a-toasts { right: 16px; left: 16px; bottom: 16px; } }
.a-flash--toast { cursor: pointer; box-shadow: 0 10px 30px rgba(21, 23, 28, 0.18); border: 1px solid var(--line); }

.a-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.a-card--pad { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.a-card__bar {
  padding: 18px 24px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  border-bottom: 1px solid var(--line);
}
.a-card__bar h2 { font-size: 20px; margin-right: auto; }
.a-card__foot { padding: 16px 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.a-count { margin-left: auto; font-size: 14px; color: var(--muted); }

.a-search { position: relative; flex: 1 1 260px; max-width: 360px; }
.a-search svg { position: absolute; left: 12px; top: 14px; color: var(--muted); }
.a-search input {
  width: 100%; height: 44px; padding: 0 12px 0 36px; border-radius: 10px;
  border: 1px solid var(--input-line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px;
}
.a-select, .a-input {
  height: 44px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--input-line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; min-width: 0;
}
.a-select--sm { height: 40px; }
.a-search input:focus, .a-select:focus, .a-input:focus { outline: none; border-color: var(--accent); }

/* relative: keeps absolutely placed .sr-only labels inside the scroller, not widening the page */
.a-scroll { overflow-x: auto; position: relative; }
.a-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.a-table th {
  padding: 12px; text-align: left; color: var(--muted); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
.a-table td { padding: 12px; border-top: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
.a-table th:first-child, .a-table td:first-child { padding-left: 24px; }
.a-table th:last-child, .a-table td:last-child { padding-right: 24px; }
.a-table .right { text-align: right; }
.a-table .strong { font-weight: 600; }
.a-table .muted { color: var(--muted); }
.a-table tr.is-cancelled { color: var(--muted); }
.a-table td.wrap { white-space: normal; }
.a-table td.tight { padding-top: 8px; padding-bottom: 8px; }
.a-table .actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.a-empty-row td { padding: 32px 24px; text-align: center; color: var(--muted); white-space: normal; }

.a-teacher { display: inline-flex; align-items: center; gap: 8px; }

.a-pill {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid transparent;
}
.a-pill--open { background: var(--surface); color: var(--ink); border: 1px dashed var(--faint); }
.a-pill--booked { background: var(--ink); color: var(--surface); }
.a-pill--closed { background: var(--chip-soft); color: var(--closed-text); }
.a-pill--cancelled { background: var(--danger-soft); color: var(--danger-text); }
.a-pill--ok { background: var(--ok-soft); color: var(--ok-text); gap: 6px; height: 30px; }
.a-pill--pending { background: var(--warn-soft); color: var(--warn-text); gap: 6px; height: 30px; }

/* Shared bits of the v1.4 pages (Today, Students, Schedule) */
.a-h3 { font-size: 20px; }
.a-help { color: var(--muted); font-size: 15px; }
.a-gap { margin-top: 8px; }
.a-note { padding: 12px 14px; border-radius: 10px; background: var(--ground); font-size: 15px; color: var(--body-text); }
.a-label { display: block; font-size: 14px; font-weight: 600; }
.a-empty { color: var(--muted); padding: 40px 20px; text-align: center; }
.a-btn--lg { min-height: 48px; padding: 0 20px; font-size: 15px; }
.a-btn--link { border: none; background: none; color: var(--accent); padding: 0 4px; height: auto; min-height: 36px; }
.a-btn--link:hover { color: var(--accent-hover); text-decoration: underline; }
.a-btn--danger-link, .a-btn--danger-link:hover { color: var(--danger); }
.a-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.a-more summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 600; margin-top: 6px; }

.a-status {
  display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap; flex: none;
}
.a-status--todo { background: var(--warn-soft); color: var(--warn-text); }
.a-status--booked { background: var(--accent-soft); color: var(--accent); }
.a-status--done { background: var(--ok-soft); color: var(--ok-text); }
.a-status--none { background: var(--chip-soft); color: var(--muted); }
.a-status--cancelled { background: var(--danger-soft); color: var(--danger-text); }

/* Page tabs (Students filter, Schedule Week / All bookings) */
.a-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.a-tabs a {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px;
  font-size: 14px; font-weight: 600; color: var(--body-text); text-decoration: none;
}
.a-tabs a:hover { color: var(--ink); border-color: var(--faint); }
.a-tabs a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* Today */
.a-window2 { padding: 22px 26px; display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; }
.a-window2 strong { font-family: var(--font-heading); font-size: 22px; }
.a-window2 p { color: var(--muted); margin-top: 2px; }
.a-window2__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.a-today { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.a-today .a-card--pad { gap: 0; padding: 22px 24px; }
.a-today .a-help { margin: 4px 0 6px; }
.a-item { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.a-h3 + .a-item, .a-help + .a-item, .a-daylabel + .a-item { border-top: 0; }
.a-item__when { width: 80px; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.a-item__grow { flex: 1; min-width: 0; }
.a-item small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.a-daylabel { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 2px; }

/* Students */
.a-cols { display: flex; gap: 24px; align-items: flex-start; }
.a-list { flex: 0 0 380px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.a-list__search { padding: 16px; border-bottom: 1px solid var(--line); }
.a-list__search input {
  width: 100%; height: 50px; border: 1px solid var(--input-line); border-radius: 10px; padding: 0 16px;
  background: var(--surface); color: var(--ink); font: inherit;
}
.a-list__search input:focus { outline: none; border-color: var(--accent); }
.a-list .a-tabs { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.a-rows { max-height: 640px; overflow-y: auto; }
.a-srow {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  color: var(--ink); text-decoration: none;
}
.a-srow[hidden] { display: none; }
.a-srow:hover { background: var(--ground); color: var(--ink); }
.a-srow[aria-current] { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.a-srow__grow { flex: 1; min-width: 0; }
.a-srow strong { display: block; font-size: 16px; }
.a-srow small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.a-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.a-who h2 { font-size: 28px; }
.a-who p { color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.a-lesson {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
}
.a-lesson.is-todo { border-color: var(--todo-line); background: var(--todo-bg); }
.a-lesson.is-done { background: var(--ground); }
.a-lesson__grow { flex: 1; min-width: 220px; }
.a-lesson__missed { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.a-lesson__what { font-size: 17px; font-weight: 700; margin-top: 2px; }
.a-lesson__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.a-lesson__actions form { display: contents; }
.a-add-missed {
  width: 100%; min-height: 54px; border: 2px dashed var(--input-line); border-radius: 12px; background: none;
  font-weight: 700; color: var(--accent); font-size: 16px; cursor: pointer;
}
.a-add-missed:hover { border-color: var(--accent); background: var(--accent-soft); }
.a-danger-zone { text-align: right; }

/* Booking picker */
.a-days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.a-days button {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px;
  padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.a-days button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.a-times { display: grid; gap: 8px; max-height: 300px; overflow-y: auto; }
.a-times[hidden] { display: none; }
.a-time {
  position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 56px;
  border: 1.5px dashed var(--input-line); border-radius: 10px; padding: 0 16px; cursor: pointer;
}
.a-time:hover { border-color: var(--accent); }
.a-time:has(input:checked) { border: 1.5px solid var(--accent); background: var(--accent-soft); }
.a-time input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.a-time:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.a-time b { font-size: 17px; }
.a-time small { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }

/* Schedule */
.a-weekbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.a-weekbar h2 { font-size: 22px; margin-right: auto; }
.a-weekbar form { display: contents; }
.a-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 14px; color: var(--body-text); }
.a-legend span { display: inline-flex; align-items: center; gap: 8px; }
.a-legend i { width: 22px; height: 14px; border-radius: 4px; }
.a-legend .booked { background: var(--ink); }
.a-legend .open { border: 1.5px dashed var(--input-line); background: var(--surface); }
.a-legend .closed { background: var(--chip-soft); border: 1px solid var(--line-strong); }
.a-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.a-day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px; min-width: 0; }
.a-day.is-today { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.a-day h3 { font-size: 16px; }
.a-day h3 span { display: block; font-family: var(--font-body); font-weight: 500; font-size: 14px; color: var(--muted); }
.a-day__hidden { font-size: 12px; color: var(--warn-text); background: var(--warn-soft); border-radius: 6px; padding: 2px 6px; display: inline-block; margin-top: 4px; }
.a-day__slots { display: grid; gap: 6px; margin-top: 10px; }
.a-day__none { color: var(--muted); font-size: 14px; margin-top: 10px; }
.a-slot {
  display: block; border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.35; text-decoration: none;
  border: 1.5px dashed var(--input-line); background: var(--surface); color: var(--ink); min-width: 0; overflow-wrap: anywhere;
}
.a-slot b { display: block; font-size: 15px; }
.a-slot small { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.a-slot .dot { width: 7px; height: 7px; }
.a-slot:hover { border-color: var(--accent); color: var(--ink); }
.a-slot.is-booked { background: var(--ink); border: 1.5px solid var(--ink); color: var(--surface); }
.a-slot.is-booked small { color: var(--solid-sub); }
.a-slot.is-closed { background: var(--chip-soft); border-style: solid; border-color: var(--line); color: var(--muted); text-decoration: line-through; }
.a-slot.is-past { opacity: .5; }

@media (max-width: 1180px) {
  .a-week { grid-template-columns: 1fr; }
  .a-day__slots { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 900px) {
  .a-cols { flex-direction: column; align-items: stretch; }
  .a-list { flex-basis: auto; }
  .a-rows { max-height: 360px; }
  .a-window2__actions { align-items: flex-start; }
}

/* Forms */
.a-form { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.a-form h2 { font-size: 20px; }
.a-field { display: flex; flex-direction: column; gap: 6px; }
.a-field label, .a-field legend { font-size: 14px; font-weight: 600; }
.a-field .a-select, .a-field .a-input { height: 46px; padding: 0 12px; font-size: 15px; width: 100%; }
.a-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
fieldset.a-field { margin: 0; padding: 0; border: none; }
fieldset.a-field legend { padding: 0; margin-bottom: 6px; }
.a-durs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px; border-radius: 12px; background: var(--chip-soft); }
.a-labels { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.a-labels ~ .a-input { margin-top: 8px; }
.a-labels ~ .a-input[hidden] { display: none; }
.a-durs label { position: relative; }
.a-durs input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.a-durs span {
  min-height: 40px; border-radius: 9px; display: grid; place-items: center;
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.a-durs input:checked + span { background: var(--surface); font-weight: 700; box-shadow: var(--raise); }
.a-durs input:focus-visible + span { outline: 2px solid var(--accent); }
.a-hint { font-size: 13px; line-height: 1.5; color: var(--muted); }

/* Modals */
.a-dialog {
  width: calc(100% - 32px); max-width: 440px; padding: 28px; border: none; border-radius: 18px;
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 50px rgba(21, 23, 28, 0.25);
}
.a-dialog::backdrop { background: rgba(21, 23, 28, 0.45); }
.a-dialog form.a-dialog__body { display: flex; flex-direction: column; gap: 16px; }
.a-dialog h2 { font-size: 22px; }
.a-dialog__summary {
  padding: 14px 16px; border-radius: 12px; background: var(--ground);
  display: flex; flex-direction: column; gap: 4px; font-size: 14px;
}
.a-dialog__summary span { color: var(--body-text); }
.a-dialog ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--body-text); }
.a-dialog__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.a-dialog__actions form { display: contents; }
.a-dialog--wide { max-width: 560px; }
.a-dialog__sub { color: var(--muted); font-size: 15px; margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.a-push-left { margin-right: auto; }

/* Login */
.a-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.a-login__card { width: 100%; max-width: 380px; padding: 28px; display: flex; flex-direction: column; gap: 20px; }

.family-receipt { max-width: 40rem; margin: 1.25rem auto; padding: 1rem 1.25rem; border: 1px solid #abd1c0; border-radius: 14px; background: #f0f8f4; color: #174936; }
.family-receipt header { display: flex; justify-content: space-between; gap: 1rem; }
.family-receipt p { margin: .65rem 0; }
@media (max-width: 42rem) { .family-receipt { margin-inline: 1rem; } }

.p-booker-field { display: grid; gap: 6px; text-align: left; margin: 14px 0; }
.p-booker-field label { font-weight: 700; }
.p-booker-field small { color: var(--muted); line-height: 1.4; }
.p-booker-field [role="alert"] { color: var(--danger-text); }
.sheet--center .p-sure { max-height: 92dvh; overflow-y: auto; }
