
    :root {
      --ink: #17251e;
      --muted: #68766f;
      --line: #e3e9e4;
      --paper: #ffffff;
      --canvas: #f4f7f4;
      --green: #246b4b;
      --green-dark: #174d35;
      --green-pale: #eaf5ee;
      --lime: #d6ebae;
      --gold: #9e6a10;
      --gold-pale: #fff5dc;
      --red: #a64238;
      --red-pale: #fff0ee;
      --blue: #3b6f9b;
      --blue-pale: #edf5fb;
      --shadow: 0 18px 60px rgba(24, 49, 35, .07);
      --radius: 18px;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }
    * { box-sizing: border-box; }
    body { margin: 0; color: var(--ink); background: var(--canvas); min-height: 100vh; }
    button, input, select { font: inherit; }
    button { cursor: pointer; }
    .topbar { height: 78px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 5vw, 76px); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px); }
    .brand { display:flex; align-items:center; gap:12px; font-weight:750; letter-spacing:-.03em; }
    .brand-mark { width:39px; height:39px; border-radius:13px; background:var(--green); color:white; display:grid; place-items:center; font-size:19px; box-shadow:0 6px 18px #246b4b33; }
    .brand small { display:block; color:var(--muted); font-size:11px; letter-spacing:.09em; text-transform:uppercase; font-weight:700; margin-top:2px; }
    .view-switch { display:flex; gap:4px; padding:4px; background:#f0f3f0; border:1px solid var(--line); border-radius:12px; }
    .view-switch button { border:0; background:transparent; color:var(--muted); font-size:13px; font-weight:650; padding:9px 14px; border-radius:9px; }
    .view-switch button.active { background:white; color:var(--ink); box-shadow:0 2px 8px #182e2412; }
    main { max-width:1180px; padding:38px 24px 72px; margin:0 auto; }
    .demo-banner { display:flex; align-items:center; gap:10px; background:#fff8df; border:1px solid #f0dfaa; color:#74500b; border-radius:12px; padding:11px 15px; font-size:12px; margin-bottom:22px; }
    .demo-dot { width:8px; height:8px; border-radius:50%; background:#d29a25; flex:none; }
    .eyebrow { color:var(--green); text-transform:uppercase; letter-spacing:.13em; font-size:11px; font-weight:800; margin:0 0 10px; }
    h1 { font-size:clamp(29px, 4vw, 43px); line-height:1.08; letter-spacing:-.05em; margin:0; }
    h2 { font-size:24px; letter-spacing:-.04em; margin:0; }
    h3 { font-size:16px; letter-spacing:-.02em; margin:0; }
    p { line-height:1.55; }
    .muted { color:var(--muted); }
    .small { font-size:12px; }
    .hero { display:grid; grid-template-columns:1.25fr .75fr; gap:22px; margin-bottom:24px; }
    .hero-copy { background:linear-gradient(125deg,#e8f2e8 0%,#f2f7ed 56%,#f8f6ec 100%); padding:36px; border-radius:24px; min-height:220px; position:relative; overflow:hidden; }
    .hero-copy:after { content:""; position:absolute; width:230px; height:230px; right:-70px; bottom:-115px; border:1px solid #246b4b25; border-radius:50%; box-shadow:0 0 0 25px #246b4b08,0 0 0 52px #246b4b06; }
    .hero-copy p { max-width:530px; color:#52645a; margin:14px 0 0; }
    .event-card { background:var(--green-dark); color:white; padding:28px; border-radius:24px; display:flex; flex-direction:column; justify-content:space-between; min-height:220px; }
    .event-card .eyebrow { color:#bdd9bd; }
    .event-meta { display:flex; align-items:center; gap:12px; margin-top:20px; color:#e3eee5; font-size:13px; }
    .event-meta strong { display:block; font-size:16px; color:white; margin-bottom:3px; }
    .calendar-icon { width:42px; height:42px; background:#ffffff19; border:1px solid #ffffff20; display:grid; place-items:center; border-radius:14px; font-size:18px; }
    .card { background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
    .booking-layout { display:grid; grid-template-columns:330px 1fr; gap:20px; align-items:start; }
    .login-card { padding:25px; }
    .step-label { color:var(--green); font-size:11px; text-transform:uppercase; letter-spacing:.1em; font-weight:800; }
    .login-card h2 { font-size:22px; margin:8px 0 8px; }
    .login-card p { font-size:13px; color:var(--muted); margin:0 0 19px; }
    .field-label { display:block; font-size:12px; font-weight:750; margin:15px 0 7px; }
    .field { width:100%; min-height:45px; border:1px solid #d7e0d9; border-radius:10px; padding:10px 12px; outline:none; background:white; color:var(--ink); }
    .field:focus { border-color:#6a9c7b; box-shadow:0 0 0 3px #246b4b16; }
    textarea.field { min-height:86px; resize:vertical; }
    .pin-field { letter-spacing:.4em; font-size:18px; font-weight:750; }
    .btn { border:0; border-radius:10px; font-weight:750; font-size:13px; padding:12px 16px; transition:.16s ease; }
    .btn:hover { transform:translateY(-1px); }
    .btn-primary { background:var(--green); color:white; box-shadow:0 5px 14px #246b4b26; }
    .btn-primary:hover { background:#1d5c3f; }
    .btn-secondary { background:#eff4ef; color:var(--green-dark); }
    .btn-outline { background:white; border:1px solid var(--line); color:var(--ink); }
    .btn-danger { background:var(--red-pale); color:var(--red); }
    .btn-block { width:100%; margin-top:15px; }
    .hint { font-size:11px; color:#7a887f; margin-top:10px; line-height:1.45; }
    .help-link { display:block; text-align:center; margin-top:16px; color:var(--green); font-size:12px; font-weight:650; text-decoration:none; }
    .booking-main { padding:26px; min-height:350px; }
    .section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:20px; }
    .section-head p { margin:7px 0 0; font-size:13px; color:var(--muted); }
    .step-pill { border-radius:999px; background:#f0f4f1; padding:8px 11px; font-size:11px; color:#53645a; font-weight:750; white-space:nowrap; }
    .children { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
    .child-option { text-align:left; border:1px solid var(--line); background:white; border-radius:14px; padding:17px; display:flex; align-items:center; gap:13px; color:var(--ink); transition:.15s ease; }
    .child-option:hover, .child-option.selected { border-color:#7ca98b; background:#f4faf5; box-shadow:0 0 0 3px #246b4b0c; }
    .avatar { width:42px; height:42px; display:grid; place-items:center; border-radius:14px; background:#e9f2e9; color:var(--green); font-weight:800; }
    .child-option strong { display:block; font-size:14px; }
    .child-option small { display:block; margin-top:4px; color:var(--muted); font-size:11px; }
    .slot-toolbar { display:flex; justify-content:space-between; align-items:center; gap:14px; margin:5px 0 18px; padding:13px 15px; background:#f7f9f7; border:1px solid var(--line); border-radius:13px; }
    .teacher-info { display:flex; align-items:center; gap:10px; font-size:12px; }
    .teacher-avatar { width:34px;height:34px;border-radius:12px;background:#e9f0fb;color:#456e98;display:grid;place-items:center;font-weight:800; }
    .teacher-info strong { display:block; font-size:13px; margin-bottom:2px; }
    .legend { display:flex; gap:12px; flex-wrap:wrap; font-size:10px; color:var(--muted); }
    .legend span { display:flex; align-items:center; gap:5px; }
    .legend i { width:10px; height:10px; border-radius:3px; background:#fff; border:1px solid #82a88b; }
    .legend .unavailable i { background:#e7eae7; border-color:#e7eae7; }
    .slots { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
    .slot { min-height:42px; border-radius:9px; border:1px solid #b9cfbe; background:white; color:var(--green-dark); font-weight:700; font-size:12px; }
    .slot:hover:not(:disabled), .slot.selected { background:var(--green); color:white; border-color:var(--green); }
    .slot:disabled { background:#eef0ee; color:#a2aaa4; border-color:#e7eae7; cursor:not-allowed; text-decoration:line-through; }
    .current-booking { border:1px solid #dce8de; background:#f7faf7; border-radius:12px; padding:13px 15px; margin-bottom:16px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
    .current-booking small { display:block; color:var(--muted); font-size:10px; margin-bottom:4px; }
    .current-booking strong { font-size:13px; }
    .deadline-note { font-size:11px; color:#795417; background:var(--gold-pale); border-radius:9px; padding:8px 10px; }
    .timeline-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px; padding:14px; }
    .appointment-block { text-align:left; min-height:83px; padding:11px 11px 10px; border-radius:11px; border:1px solid transparent; display:flex; flex-direction:column; justify-content:space-between; color:var(--ink); }
    .appointment-block .time { color:#56665b; font-size:10px; font-weight:750; }
    .appointment-block strong { font-size:11px; line-height:1.25; }
    .appointment-block small { font-size:9px; color:#77847b; }
    .appointment-block.available { background:#eef7ef; border-color:#d5e8d8; color:#246b4b; }
    .appointment-block.booked-new { background:#fff5e9; border-color:#f3e2c8; }
    .appointment-block.booked-old { background:#eef5fb; border-color:#d8e5f2; }
    .appointment-block.blocked { background:#f0f2f0; border-color:#e5e9e5; color:#7c857e; }
    .appointment-block.unresolved-block { background:#fff0ee; border-color:#f2d6d2; }
    .appointment-block:hover:not(:disabled) { outline:2px solid #246b4b50; outline-offset:1px; }
    .appointment-block:disabled { cursor:default; }
    .block-key { display:flex; gap:13px; flex-wrap:wrap; padding:0 15px 15px; font-size:10px; color:var(--muted); }
    .block-key span { display:flex; align-items:center; gap:6px; }
    .block-key i { width:11px; height:11px; border-radius:3px; display:inline-block; }
    .block-key .k-green { background:#dceedd; }.block-key .k-orange { background:#f8e7cb; }.block-key .k-blue { background:#dce9f6; }.block-key .k-grey { background:#e5e9e5; }
    .modal-backdrop { position:fixed; inset:0; z-index:40; background:#14231d70; display:grid; place-items:center; padding:18px; }
    .modal-card { width:min(450px,100%); background:white; border-radius:18px; padding:23px; box-shadow:0 24px 80px #10251c40; }
    .modal-card h3 { font-size:20px; margin:6px 0; }
    .modal-card p { margin:0 0 16px; font-size:12px; color:var(--muted); }
    .modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
    .actions-row { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:20px; }
    .selection-note { font-size:12px; color:var(--muted); }
    .confirmation { border:1px solid #c9e2d0; background:linear-gradient(135deg,#f0faf2,#fff); border-radius:18px; padding:24px; }
    .success-mark { width:45px; height:45px; border-radius:50%; display:grid; place-items:center; background:#dcefe1; color:var(--green); font-size:22px; font-weight:900; margin-bottom:16px; }
    .confirm-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; margin:20px 0; }
    .confirm-cell { padding:13px; background:white; border:1px solid #e1eee3; border-radius:12px; }
    .confirm-cell small { display:block; text-transform:uppercase; color:#7a8a7e; letter-spacing:.08em; font-size:9px; font-weight:800; margin-bottom:5px; }
    .confirm-cell strong { font-size:13px; }
    .staff-shell { display:grid; grid-template-columns:225px minmax(0,1fr); gap:20px; align-items:start; }
    .staff-side { padding:18px 12px; position:sticky; top:100px; }
    .staff-profile { display:flex; align-items:center; gap:10px; padding:7px 10px 18px; border-bottom:1px solid var(--line); margin-bottom:12px; }
    .staff-profile .avatar { width:36px;height:36px; }
    .staff-profile strong { font-size:12px; display:block; }
    .staff-profile small { font-size:10px; color:var(--muted); display:block; margin-top:2px; }
    .nav-item { border:0; width:100%; text-align:left; background:transparent; border-radius:10px; padding:11px 12px; font-size:12px; font-weight:650; color:#637168; margin:2px 0; display:flex; align-items:center; gap:10px; }
    .nav-item:hover { background:#f4f7f4; color:var(--ink); }
    .nav-item.active { color:var(--green-dark); background:#eaf4ec; }
    .nav-icon { width:18px; text-align:center; font-size:14px; }
    .side-note { margin:16px 8px 0; padding:12px; border-radius:12px; background:#f6f8f6; color:var(--muted); font-size:10px; line-height:1.5; }
    .staff-main { padding:24px; min-width:0; }
    .staff-toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:20px; }
    .subpanel.secondary-evenings { border:0; }
    .secondary-evenings > summary { cursor:pointer; font-weight:750; padding:12px 15px; }
    #otherClassEvenings { background:#edf2f7; }
    #pastEvenings { background:#fbefef; }
    .toolbar-controls button[aria-pressed="true"] { background:var(--green-pale); color:var(--green-dark); }
    #setupClasses:not(:empty) { margin-bottom:15px; }
    .staff-page .subpanel { scroll-margin-top:96px; }
    .secondary-evenings > .subpanel { margin:0 12px 12px; }
    .staff-toolbar h2 { margin:0; }
    .toolbar-controls { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
    .compact-select { min-height:38px; padding:7px 10px; border:1px solid var(--line); border-radius:9px; background:white; color:var(--ink); font-size:11px; font-weight:650; }
    .stat-row { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:11px; margin:15px 0 20px; }
    .stat { border:1px solid var(--line); border-radius:13px; padding:15px; background:white; }
    .stat small { display:block; color:var(--muted); font-size:10px; font-weight:700; }
    .stat strong { display:block; font-size:23px; letter-spacing:-.05em; margin-top:7px; }
    .stat .stat-note { margin-top:4px; font-size:10px; color:#7f8b83; }
    .stat.green strong { color:var(--green); }
    .stat.gold strong { color:var(--gold); }
    .subpanel { border:1px solid var(--line); border-radius:14px; background:white; overflow:hidden; margin-top:16px; }
    .subpanel-head { padding:15px 17px; display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--line); }
    .subpanel-head strong { font-size:13px; }
    .subpanel-head span { font-size:10px; color:var(--muted); }
    .table-wrap { overflow-x:auto; }
    table { width:100%; border-collapse:collapse; min-width:590px; }
    th { text-align:left; color:#78847c; font-size:9px; text-transform:uppercase; letter-spacing:.08em; padding:11px 16px; background:#fafbfa; }
    td { border-top:1px solid #eef1ee; padding:12px 16px; font-size:11px; color:#435147; }
    td strong { color:var(--ink); font-size:11px; }
    .status { display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:6px 8px; font-size:9px; font-weight:750; white-space:nowrap; }
    .status:before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
    .status.open { color:#26704b; background:#e8f5ec; }
    .status.closed { color:#8b6021; background:#fff3dc; }
    .status.booked { color:#3c6f99; background:#eaf3fb; }
    .status.blocked { color:#747d77; background:#eef0ee; }
    .status.unresolved { color:#a64238; background:#fff0ee; }
    .tag { font-size:9px; color:#6f7b73; background:#f1f4f1; border-radius:999px; padding:5px 7px; }
    .settings-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; padding:17px; }
    .settings-grid .field-label { margin-top:0; }
    .settings-grid .field { min-height:40px; font-size:12px; }
    .panel-footer { padding:14px 17px; border-top:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
    .pupil-list { display:flex; flex-wrap:wrap; gap:8px; padding:16px; }
    .pupil-chip { border:1px solid var(--line); background:#fbfcfb; border-radius:10px; padding:9px 11px; font-size:11px; }
    .pupil-chip small { display:block; color:var(--muted); margin-top:3px; font-size:9px; }
    .conflict-card { display:flex; align-items:flex-start; gap:12px; padding:15px 16px; border-bottom:1px solid var(--line); }
    .conflict-card:last-child { border-bottom:0; }
    .conflict-symbol { width:30px;height:30px;border-radius:10px;background:var(--red-pale);color:var(--red);display:grid;place-items:center;font-weight:900;flex:none; }
    .conflict-card strong { display:block; font-size:12px; }
    .conflict-card p { margin:4px 0 0; color:var(--muted); font-size:10px; }
    .conflict-card .btn { margin-left:auto; padding:8px 10px; font-size:10px; }
    .info-callout { padding:13px 15px; border-radius:11px; background:var(--blue-pale); color:#426788; font-size:11px; line-height:1.5; margin-top:15px; }
    .warning-callout { padding:13px 15px; border-radius:11px; background:var(--gold-pale); color:#755012; font-size:11px; line-height:1.5; margin-top:15px; }
    .toast { position:fixed; bottom:22px; left:50%; transform:translate(-50%,20px); opacity:0; pointer-events:none; z-index:30; background:#17251e; color:white; padding:12px 17px; border-radius:11px; font-size:12px; box-shadow:var(--shadow); transition:.25s ease; }
    .toast.show { opacity:1; transform:translate(-50%,0); }
    .hidden { display:none !important; }
    .spacer { height:10px; }
    .empty { color:var(--muted); font-size:12px; text-align:center; padding:28px; }
    @media (max-width:900px) {
      .hero { grid-template-columns:1fr; }
      .hero-copy,.event-card { min-height:180px; }
      .booking-layout { grid-template-columns:1fr; }
      .login-card { order:2; }
      .staff-shell { grid-template-columns:1fr; }
      .staff-side { position:static; display:flex; align-items:center; overflow:auto; padding:10px; }
      .staff-profile,.side-note { display:none; }
      .nav-item { width:auto; white-space:nowrap; margin:0 2px; }
    }
    @media (max-width:620px) {
      .topbar { height:auto; min-height:70px; padding:12px 15px; gap:10px; flex-wrap:wrap; }
      .brand { font-size:13px; }
      .brand-mark { width:34px;height:34px; }
      .view-switch button { padding:8px 10px; font-size:11px; }
      main { padding:22px 14px 48px; }
      .hero-copy,.event-card { padding:24px; }
      .booking-main,.login-card,.staff-main { padding:19px; }
      .children { grid-template-columns:1fr; }
      .slots { grid-template-columns:repeat(3,minmax(0,1fr)); }
      .timeline-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
      .slot-toolbar { align-items:flex-start; flex-direction:column; }
      .confirm-grid { grid-template-columns:1fr 1fr; }
      .stat-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .timeline-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .settings-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .section-head { flex-direction:column; }
      .actions-row { align-items:stretch; flex-direction:column; }
      .actions-row .btn { width:100%; }
      .conflict-card { flex-wrap:wrap; }
      .conflict-card .btn { margin-left:42px; }
    }
  
    .workspace { max-width:1000px; margin:0 auto; }
    .workspace > .card { padding:24px; margin-bottom:16px; }
    .workspace section + section { margin-top:14px; }
    nav, .form-actions { display:flex; gap:8px; flex-wrap:wrap; margin:14px 0; }
    form { max-width:500px; }
    #status:empty { display:none; }
    #status { padding:12px; margin:12px 0; border-radius:10px; background:var(--green-pale); }
    #status[data-error] { background:var(--red-pale); color:var(--red); }
    details > summary { padding:14px; cursor:pointer; font-weight:700; }
    details > section { margin:12px; }
    dialog { border:0; border-radius:18px; width:min(520px,95%); padding:24px; }
    dialog::backdrop { background:#14231d70; }
    .secondary-evenings { border:0; }
    .other-evenings { background:#edf2f7; }
    .past-evenings { background:#fbefef; }
    .appointment-block.slot-selected { outline:2px solid var(--green); outline-offset:2px; }
    .slot-owned { display:grid; place-content:center; gap:3px; text-align:center; min-height:56px;
      padding:6px 4px; background:var(--green-pale); border:2px solid var(--green); color:var(--green-dark); }
    .slot-owned-label { font-size:11px; font-weight:700; }
    .parent-booking-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:16px; }
    .parent-booking-actions .btn:disabled { background:#e8ece8; color:#627269; box-shadow:none; cursor:default; transform:none; }
    .booking-summary { display:grid; grid-template-columns:auto 1fr; gap:8px 16px;
      padding:14px; background:var(--canvas); border-radius:12px; }
    .booking-summary dt { color:var(--muted); }
    .booking-summary dd { margin:0; font-weight:650; }
    #status { scroll-margin-top:105px; }
    .evening-class-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
    .evening-class-heading .btn { flex:none; }
    .evening-day { min-width:0; border:1px solid var(--line); border-radius:12px; margin:12px 0; padding:0 12px 12px; }
    .evening-day legend { font-weight:750; padding:0 5px; }
    .evening-day button { margin-top:12px; }
    .booking-day-title { margin:16px 0 8px; }
    @media (max-width:420px) {
      .evening-class-heading { align-items:center; }
      .evening-class-heading .btn { white-space:normal; flex:0 1 auto; }
    }
    .class-tools { align-items:center; justify-content:flex-end; }
    .class-tools #edit-groups { margin-right:auto; }
    .class-tools #edit-groups[aria-pressed="true"] { background:var(--green-pale); border-color:var(--green); }
    .class-group { background:#f0f4f0; padding:16px; border-radius:16px; }
    .class-group-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
    .class-group .card + .card { margin-top:12px; }
    .class-group .card > .evening-class-heading { margin-bottom:10px; }
    .temporary-password { overflow-wrap:anywhere; font-family:monospace; user-select:all; }
    .pupil-evening-notes { margin:20px 0; border-top:1px solid var(--line); padding-top:16px; }
    .pupil-evening-note { margin-top:10px; padding:12px; border-radius:10px; background:var(--canvas); }
    .pupil-evening-note p { margin:5px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
    .editable-title { font:inherit; color:var(--green-dark); border:0; background:none;
      cursor:pointer; padding:0; text-align:left; text-decoration:underline dotted; text-underline-offset:.18em; }
    .editable-title:hover { text-decoration-style:solid; }
    .editable-title:focus-visible { outline:2px solid var(--green); outline-offset:4px; border-radius:3px; }
    .evening-link { display:block; padding:0; border:0; background:none; color:var(--ink); font:inherit; text-align:left; }
    .evening-link-day { display:block; }
    .evening-link strong { color:var(--green-dark); }
    .evening-link:hover strong { color:var(--green); }
    .evening-link:focus-visible { outline:2px solid var(--green); outline-offset:4px; border-radius:3px; }
    .workspace [id^="evening-"] { scroll-margin-top:96px; }
    .password-change-option { display:flex; gap:8px; align-items:center; cursor:pointer; }
