*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* Light Soft Daylight Theme Variables */
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface2: #fafaf8;
  --border: rgba(0, 0, 0, 0.06);
  --border2: #ececea;
  --border-focus: #d8d8d4;
  --text: #0a0a0a;
  --muted: #6e6e76;
  --primary: var(--accent);
  
  --accent: #5b5bd6;
  --accent-dim: rgba(91, 91, 214, 0.08);
  --accent-glow: rgba(91, 91, 214, 0.18);
  
  --green: #3dbd8b;
  --green-dim: rgba(61, 189, 139, 0.1);
  --green-border: rgba(61, 189, 139, 0.25);
  
  --red: #e05a5a;
  --red-dim: rgba(224, 90, 90, 0.08);
  --red-border: rgba(224, 90, 90, 0.3);
  
  --amber: #b56a1e;
  --amber-dim: rgba(230, 138, 58, 0.12);
  
  --main: #4747c4;
  --main-dim: rgba(91, 91, 214, 0.08);
  --speak: #b56a1e;
  --speak-dim: rgba(230, 138, 58, 0.12);
  
  --btn-primary-bg: #0a0a0a;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #1c1c1f;
  --btn-primary-shadow: rgba(0, 0, 0, 0.15);
  
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.04);
  --body-radial: none;
}

[data-theme="dark"] {
  /* Dark Soft Daylight Theme Variables */
  --bg: #0a0a0d;
  --surface: #14141a;
  --surface2: #16161d;
  --border: rgba(255, 255, 255, 0.06);
  --border2: #26262e;
  --border-focus: rgba(255, 255, 255, 0.12);
  --text: #f0f0f2;
  --muted: #9a9aa6;
  --primary: var(--accent);
  
  --accent: #8e8eff;
  --accent-dim: rgba(142, 142, 255, 0.12);
  --accent-glow: rgba(142, 142, 255, 0.2);
  
  --green: #3dbd8b;
  --green-dim: rgba(61, 189, 139, 0.15);
  --green-border: rgba(61, 189, 139, 0.3);
  
  --red: #f5b574;
  --red-dim: rgba(245, 180, 116, 0.14);
  --red-border: rgba(245, 180, 116, 0.3);
  
  --amber: #f5b574;
  --amber-dim: rgba(245, 180, 116, 0.14);
  
  --main: #8e8eff;
  --main-dim: rgba(142, 142, 255, 0.12);
  --speak: #f5b574;
  --speak-dim: rgba(245, 180, 116, 0.14);
  
  --btn-primary-bg: #fafafa;
  --btn-primary-text: #0a0a0d;
  --btn-primary-hover: #ffffff;
  --btn-primary-shadow: rgba(255, 255, 255, 0.14);
  
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px rgba(0, 0, 0, 0.5);
  --body-radial: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(142, 142, 255, 0.06) 0%, rgba(10, 10, 13, 0) 60%);
}

html, body { min-height: 100vh; }
body {
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 4rem;
  font-family: 'Geist', 'Outfit', sans-serif;
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: var(--body-radial);
  z-index: -1;
  pointer-events: none;
  transition: background 0.3s ease;
}
#app {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  padding: 36px;
  box-shadow: var(--card-shadow);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, max-width 0.3s ease, padding 0.3s ease;
  position: relative;
}
.header { text-align: center; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.header-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 9px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.header-eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  animation: pulseGlow 2s infinite ease-in-out;
}
@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 0 5px var(--accent-glow); }
}
.header-title { font-family: 'Geist', 'Outfit', sans-serif; font-size: 30px; font-weight: 600; color: var(--text); letter-spacing: -0.035em; line-height: 1.1; margin-bottom: 8px; transition: color 0.3s ease; }
.header-subtitle { font-size: 15px; color: var(--muted); line-height: 1.5; max-width: 380px; margin: 0 auto; transition: color 0.3s ease; }
    /* ========== PROGRESS BAR STYLE ========== */
    .dl-progress-wrap { margin-bottom: 28px; }
    .dl-progress-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
    .dl-progress-labels span.current { color: var(--text); font-weight: 600; }
    .dl-progress { height: 4px; background: var(--border2); border-radius: 100px; overflow: hidden; position: relative; }
    .dl-progress-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--text); border-radius: 100px; transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

    .section-label { font-size:11px; font-weight:600; letter-spacing:0.1em; text-transform:uppercase; color:var(--muted); margin-bottom:12px; transition: color 0.3s ease; }
    
    /* ========== TIME SLOTS CONTAINER ========== */
    .time-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1.5rem; }
    
    /* ========== TIME CARD LIST ITEM ========== */
    .time-card {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px;
      border: 1px solid var(--border2);
      border-radius: 12px;
      background: var(--surface);
      cursor: pointer;
      transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
      position: relative;
    }
    .time-card:hover:not(.full):not(.selected):not(.mine) {
      border-color: var(--border-focus);
      background: var(--surface2);
      transform: translateY(-1px);
    }
    .time-card.selected {
      border: 1.5px solid var(--text) !important;
      background: var(--surface2);
      box-shadow: 0 0 0 4px var(--accent-glow) !important;
      animation: none !important;
      padding: 15.5px;
    }
    .time-card.full { opacity:0.4; cursor:not-allowed; }
    .time-card.mine {
      border: 1.5px solid var(--green) !important;
      background: var(--green-dim);
      cursor: default;
      box-shadow: 0 0 0 4px rgba(61, 189, 139, 0.1);
      padding: 15.5px;
    }

    /* ========== RADIO BUTTON INDICATOR ========== */
    .time-card-radio {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      border: 1.5px solid var(--border-focus);
      flex-shrink: 0;
      transition: all 0.18s;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--surface);
    }
    .time-card.selected .time-card-radio {
      border-color: var(--text);
      background: var(--text);
    }
    .time-card.selected .time-card-radio::after {
      content: '';
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--surface);
    }
    .time-card.mine .time-card-radio {
      border-color: var(--green);
      background: var(--green);
    }
    .time-card.mine .time-card-radio::after {
      content: '';
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--surface);
    }

    /* ========== INNER CARD LAYOUT ========== */
    .time-card-content {
      flex: 1;
      min-width: 0;
      text-align: left;
    }
    .time-card-title-row {
      display: flex;
      align-items: baseline;
      gap: 8px;
    }
    .time-label {
      font-family: 'Geist', 'Outfit', sans-serif;
      font-size: 17px;
      font-weight: 600;
      color: var(--text);
      letter-spacing: -0.015em;
      margin-bottom: 0;
      transition: color 0.3s ease;
    }
    .time-card-badge {
      font-size: 10px;
      padding: 2px 6px;
      border-radius: 4px;
      background: var(--border2);
      color: var(--muted);
      font-weight: 600;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      transition: all 0.3s ease;
    }
    .session-type-badge {
      font-size: 11px;
      padding: 3px 8px;
      border-radius: 6px;
      font-weight: 600;
      letter-spacing: 0.01em;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: all 0.3s ease;
    }
    .session-type-badge.speaking {
      background: rgba(124, 58, 237, 0.12);
      color: #7c3aed;
      border: 1px solid rgba(124, 58, 237, 0.25);
    }
    .session-type-badge.lr-only {
      background: rgba(14, 165, 233, 0.12);
      color: #0284c7;
      border: 1px solid rgba(14, 165, 233, 0.25);
    }
    .time-card-badge.urgent {
      background: var(--speak-dim);
      color: var(--speak);
    }
    .time-card-badge.full {
      background: var(--red-dim);
      color: var(--red);
    }
    .time-card-badge.mine {
      background: var(--green-dim);
      color: var(--green);
    }
    .time-card-period {
      font-size: 13px;
      color: var(--muted);
      margin-top: 2px;
      text-align: left;
    }
    .time-card-meter {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 4px;
      flex-shrink: 0;
    }
    .time-card-count {
      font-size: 12px;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
      font-weight: 500;
    }
    .time-card-count strong {
      color: var(--text);
      font-weight: 600;
    }
    
    .seat-dots { display:flex; gap:3px; }
    .seat-dot {
      width: 5px;
      height: 14px;
      border-radius: 1.5px;
      transition: background 0.15s ease;
    }
    .seat-dot.taken { background: var(--text); }
    .time-card.urgent .seat-dot.taken { background: var(--amber); }
    .seat-dot.avail { background: var(--border2); }
    
    /* exam type step */
    .exam-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:1.5rem; }
    .exam-card {
      border: 1px solid var(--border2);
      border-radius: 12px;
      padding: 20px 16px;
      cursor: pointer;
      background: var(--surface);
      text-align: center;
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .exam-card:hover:not(.ec-full) {
      border-color: var(--border-focus);
      background: var(--surface2);
      transform: translateY(-2px);
    }
    .exam-card.ec-main {
      border: 1.5px solid var(--accent) !important;
      background: var(--accent-dim) !important;
      box-shadow: 0 0 0 4px var(--accent-glow);
    }
    .exam-card.ec-speaking {
      border: 1.5px solid var(--speak) !important;
      background: var(--speak-dim) !important;
      box-shadow: 0 0 0 4px rgba(230, 138, 58, 0.1);
    }
    .exam-card.ec-full { opacity:0.35; cursor:not-allowed; }
    .ec-icon { font-size:28px; margin-bottom:10px; }
    .ec-name { font-family:'Geist','Outfit',sans-serif; font-size:17px; font-weight:600; color:var(--text); margin-bottom:4px; transition: color 0.3s ease; }
    .ec-desc { font-size:12px; color:var(--muted); line-height:1.5; margin-bottom:10px; transition: color 0.3s ease; }
    .ec-seats { font-size:13px; font-weight:600; }
    .ec-seats.ms { color:var(--accent); }
    .ec-seats.ss { color:var(--speak); }
    .ec-seats.fs { color:var(--red); }
    
    /* schedule box */
    .sched-box { background:var(--surface2); border:1px solid var(--border2); border-radius:12px; padding:16px; margin-bottom:1.25rem; transition: background 0.3s ease, border-color 0.3s ease; }
    .sched-title { font-size:11px; font-weight:600; letter-spacing:0.1em; text-transform:uppercase; color:var(--muted); margin-bottom:10px; transition: color 0.3s ease; }
    .sched-row { display:flex; justify-content:space-between; align-items:center; padding:6px 0; font-size:13px; border-bottom:1px solid var(--border2); }
    .sched-row:last-of-type { border-bottom:none; }
    .sched-label { color:var(--muted); transition: color 0.3s ease; }
    .sched-val { font-weight:600; font-family:'Geist','Outfit',sans-serif; font-size:15px; color:var(--text); transition: color 0.3s ease; }
    .sched-val.mv { color:var(--accent); }
    .sched-val.sv { color:var(--speak); }
    .sched-note { font-size:11px; color:var(--muted); margin-top:8px; font-style:italic; line-height:1.5; transition: color 0.3s ease; }
    
    /* form */
    .field-group { margin-bottom:1rem; }
    .field-label { font-size:13px; font-weight:500; color:var(--muted); display:block; margin-bottom:6px; transition: color 0.3s ease; }
    .phone-wrap { display:flex; gap:8px; }
    .phone-prefix {
      height: 42px;
      padding: 0 12px;
      border: 1px solid var(--border2);
      border-radius: 8px;
      font-size: 15px;
      color: var(--text);
      background: var(--surface2);
      display: flex;
      align-items: center;
      white-space: nowrap;
      flex-shrink: 0;
      transition: all 0.2s;
    }
    .field-input {
      width: 100%;
      height: 42px;
      padding: 0 12px;
      border: 1px solid var(--border2);
      border-radius: 8px;
      font-size: 15px;
      font-family: 'Geist', 'Outfit', sans-serif;
      color: var(--text);
      background: var(--surface);
      outline: none;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .field-input:focus {
      border-color: var(--text);
      background: var(--surface);
      box-shadow: 0 0 0 4px var(--accent-glow);
    }
    .field-input.error { border-color:var(--red); }
    
    .radio-group { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
    .radio-card {
      border: 1px solid var(--border2);
      border-radius: 10px;
      padding: 14px 16px;
      cursor: pointer;
      background: var(--surface);
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .radio-card:hover {
      background: var(--surface2);
      border-color: var(--border-focus);
    }
    .radio-card.selected {
      border: 1.5px solid var(--text) !important;
      background: var(--surface2);
      box-shadow: 0 0 0 4px var(--accent-glow);
    }
    .radio-circle {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      border: 1.5px solid var(--border-focus);
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--surface);
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .radio-circle.on {
      border-color: var(--text);
      background: var(--text);
    }
    .radio-circle.on::after {
      content: '';
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--surface);
    }
    .radio-text { font-size:13px; font-weight:500; color:var(--text); line-height:1.3; transition: color 0.3s ease; }
    
    .selected-slot-recap { background:var(--surface2); border:1px solid var(--border2); border-radius:12px; padding:12px 16px; display:flex; align-items:center; justify-content:space-between; margin-bottom:1.25rem; transition: background 0.3s ease, border-color 0.3s ease; }
    .recap-time { font-family:'Geist','Outfit',sans-serif; font-size:17px; font-weight:600; color:var(--text); transition: color 0.3s ease; }
    .recap-pill { display:inline-block; padding:2px 10px; border-radius:99px; font-size:11px; font-weight:600; margin-left:8px; vertical-align:middle; text-transform: uppercase; }
    .recap-pill.pm { background:var(--accent-dim); color:var(--accent); border:1px solid rgba(91,91,214,0.2); }
    .recap-pill.ps { background:var(--speak-dim); color:var(--speak); border:1px solid rgba(230,138,58,0.2); }
    .recap-change { font-size:12px; color:var(--muted); cursor:pointer; text-decoration:underline; text-underline-offset:2px; transition: color 0.2s; }
    .recap-change:hover { color:var(--text); }
    .error-msg { font-size:12px; color:var(--red); margin-top:5px; font-weight: 500; }
    
    .btn-primary {
      width: 100%;
      height: 46px;
      border-radius: 10px;
      border: none;
      background: var(--btn-primary-bg);
      color: var(--btn-primary-text);
      font-family: 'Geist', 'Outfit', sans-serif;
      font-size: 15px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      margin-top: 1.25rem;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .btn-primary:hover:not(:disabled) {
      background: var(--btn-primary-hover);
      transform: translateY(-1px);
      box-shadow: 0 6px 18px var(--btn-primary-shadow);
    }
    .btn-primary:active:not(:disabled) { transform: translateY(0); }
    .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; background: var(--border2); color: var(--muted); }
    
    .btn-secondary {
      width: 100%;
      height: 42px;
      border-radius: 10px;
      border: 1px solid var(--border2);
      background: transparent;
      color: var(--muted);
      font-family: 'Geist', 'Outfit', sans-serif;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      margin-top: 8px;
    }
    .btn-secondary:hover:not(:disabled) {
      background: var(--surface2);
      color: var(--text);
      border-color: var(--border-focus);
    }
    .btn-secondary:disabled { opacity:0.4; cursor:not-allowed; }
    
    .btn-green {
      width: 100%;
      height: 46px;
      border-radius: 10px;
      border: none;
      background: var(--green);
      color: #fff;
      font-family: 'Geist', 'Outfit', sans-serif;
      font-size: 15px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      margin-top: 1.25rem;
    }
    .btn-green:hover:not(:disabled) {
      opacity: 0.9;
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(61, 189, 139, 0.2);
    }
    .btn-green:disabled { opacity:0.5; cursor:not-allowed; }
    
    .btn-danger {
      width: 100%;
      height: 42px;
      border-radius: 10px;
      border: 1px solid var(--red-border);
      background: var(--red-dim);
      color: var(--red);
      font-family: 'Geist', 'Outfit', sans-serif;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      margin-top: 8px;
    }
    .btn-danger:hover:not(:disabled) { background: var(--red-border); color: #fff; }
    .btn-danger:disabled { opacity:0.4; cursor:not-allowed; }
    .deadline-warning { display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border-radius:10px; background:var(--red-dim); border:1px solid var(--red-border); color:var(--red); font-size:13px; font-weight:500; line-height:1.5; margin-top:1.25rem; }
    .deadline-warning svg { margin-top:1px; }
    
    /* Loading Spinner Animations */
    .btn-spinner { width: 18px; height: 18px; animation: rotateSpinner 2s linear infinite; vertical-align: middle; margin-right: 8px; }
    .btn-spinner circle { stroke: currentColor; stroke-linecap: round; animation: dashSpinner 1.5s ease-in-out infinite; }
    @keyframes rotateSpinner { 100% { transform: rotate(360deg); } }
    @keyframes dashSpinner { 0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; } 100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; } }

    .booking-card { background:var(--green-dim); border:1px solid var(--green-border); border-radius:12px; padding:16px; text-align:left; margin-bottom:1rem; }
    .booking-row { display:flex; justify-content:space-between; align-items:center; padding:6px 0; border-bottom:1px solid rgba(61,189,139,0.1); font-size:14px; }
    .booking-row:last-child { border-bottom:none; }
    .booking-row-label { color:var(--green); opacity: 0.8; }
    .booking-row-val { font-weight:500; color:var(--text); }
    .success-screen { text-align:center; padding:1rem 0; }
    .success-icon { width:56px; height:56px; border-radius:50%; background:var(--green-dim); display:flex; align-items:center; justify-content:center; margin:0 auto 1.25rem; border:1px solid var(--green-border); }
    .manage-title { font-family:'Geist','Outfit',sans-serif; font-size:22px; font-weight:600; color:var(--text); margin-bottom:6px; transition: color 0.3s ease; }
    .manage-sub { font-size:14px; color:var(--muted); line-height:1.6; margin-bottom:1.5rem; transition: color 0.3s ease; }
    .change-slot-title { font-family:'Geist','Outfit',sans-serif; font-size:20px; font-weight:600; color:var(--text); margin-bottom:6px; text-align:center; transition: color 0.3s ease; }
    .change-slot-sub { font-size:14px; color:var(--muted); text-align:center; margin-bottom:1.5rem; transition: color 0.3s ease; }
    .loading-screen { text-align:center; padding:3rem 0; }
    .loading-dots { display:flex; justify-content:center; gap:6px; margin-bottom:1rem; }
    .loading-dot { width:8px; height:8px; border-radius:50%; background:var(--border2); animation:pulse 1.2s ease-in-out infinite; }
    .loading-dot:nth-child(2){animation-delay:0.2s;}
    .loading-dot:nth-child(3){animation-delay:0.4s;}
    @keyframes pulse{0%,80%,100%{transform:scale(0.8);opacity:0.5}40%{transform:scale(1.1);opacity:1}}
    .loading-text { font-size:14px; color:var(--muted); transition: color 0.3s ease; }
    .deadline-banner { background:var(--red-dim); border:1px solid var(--red-border); border-radius:8px; padding:14px 16px; font-size:14px; color:var(--red); text-align:center; margin-bottom:1.25rem; font-weight: 500; }
    .countdown-banner { background:var(--accent-dim); border:1px solid rgba(91,91,214,0.2); border-radius:8px; padding:10px 14px; font-size:13px; color:var(--accent); text-align:center; margin-bottom:1.25rem; font-weight: 500; }
    .err-banner { background:var(--red-dim); border:1px solid var(--red-border); border-radius:8px; padding:12px 16px; font-size:13px; color:var(--red); text-align:center; margin-bottom:1rem; font-weight: 500; }
    
    /* admin */
    #app.admin-mode { max-width: 720px; }
    .admin-panel { width:100%; animation: adminFadeIn 0.2s ease-out; }
    @keyframes adminFadeIn { from { opacity: 0; } to { opacity: 1; } }
    .admin-title { font-family:'Geist','Outfit',sans-serif; font-size:20px; font-weight:600; color:var(--text); margin-bottom:6px; transition: color 0.3s ease; }
    .admin-sub { font-size:13px; color:var(--muted); margin-bottom:1.5rem; transition: color 0.3s ease; }
    .admin-tabs { display:flex; border-bottom:1px solid var(--border2); margin-bottom:1.25rem; }
    .admin-tab { flex:1; padding:10px 0; font-size:13px; font-weight:500; color:var(--muted); text-align:center; cursor:pointer; border-bottom:2px solid transparent; transition:color 0.15s,border-color 0.15s; background:none; border-top:none; border-left:none; border-right:none; font-family:'Geist','Outfit',sans-serif; }
    .admin-tab.active { color:var(--text); border-bottom-color:var(--text); }
    .admin-tab:hover:not(.active) { color:var(--text); }
    .mode-card { border:1px solid var(--border2); border-radius:12px; padding:16px; cursor:pointer; margin-bottom:10px; transition:all 0.15s; background:var(--surface); }
    .mode-card:hover { border-color:var(--border-focus); background: var(--surface2); }
    .mode-card.mode-on { border-color:var(--accent); background:var(--accent-dim); }
    .mode-card-title { font-family:'Geist','Outfit',sans-serif; font-size:16px; font-weight:600; color:var(--text); margin-bottom:4px; display:flex; align-items:center; gap:8px; transition: color 0.3s ease; }
    .mode-badge { display:inline-block; padding:2px 8px; border-radius:4px; font-size:10px; font-weight:700; letter-spacing:0.06em; font-family:'Geist','Outfit',sans-serif; background:var(--accent); color:#fff; }
    .mode-card-desc { font-size:12px; color:var(--muted); line-height:1.5; transition: color 0.3s ease; }
    .session-row { display:flex; align-items:center; gap:8px; margin-bottom:10px; padding:10px 12px; background:var(--surface2); border-radius:8px; border:1px solid var(--border2); }
    .session-row-num { font-size:12px; font-weight:600; color:var(--muted); min-width:20px; }
    .session-input { height:36px; padding:0 10px; border:1px solid var(--border2); border-radius:6px; font-size:14px; font-family:'Geist','Outfit',sans-serif; color:var(--text); background:var(--surface); outline:none; flex:1; min-width:0; transition:border-color 0.15s, background-color 0.3s, color 0.3s; }
    .session-input:focus { border-color:var(--border-focus); }
    .session-input.seats-input { width:50px; flex:none; text-align:center; }
    .session-input.teach-input { width:44px; flex:none; text-align:center; }
    .tog { display:flex; align-items:center; gap:5px; cursor:pointer; flex-shrink:0; }
    .tog-track { width:34px; height:18px; border-radius:99px; background:var(--border2); position:relative; transition:background 0.2s; flex-shrink:0; }
    .tog-track.on { background:var(--speak); }
    .tog-thumb { position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#fff; transition:transform 0.2s; }
    .tog-track.on .tog-thumb { transform:translateX(16px); }
    .tog-label { font-size:10px; font-weight:600; color:var(--muted); white-space:nowrap; }
    .tog-track.on + .tog-label { color:var(--speak); }
    .session-del { width:28px; height:28px; border-radius:6px; border:1px solid var(--red-border); background:transparent; color:var(--red); font-size:14px; cursor:pointer; flex:none; display:flex; align-items:center; justify-content:center; transition:background 0.15s; }
    .session-del:hover { background:var(--red-dim); }
    .session-del:disabled { opacity:0.3; cursor:not-allowed; }
    .add-session-btn { width:100%; height:36px; border:1px dashed var(--border2); border-radius:8px; background:transparent; color:var(--muted); font-size:13px; font-family:'Geist','Outfit',sans-serif; cursor:pointer; margin-bottom:10px; transition:all 0.15s; }
    .add-session-btn:hover { border-color:var(--border-focus); color:var(--text); }
    .enable-all-btn { width:100%; height:34px; border:1px solid rgba(230,138,58,0.3); border-radius:8px; background:rgba(230,138,58,0.06); color:var(--speak); font-size:12px; font-family:'Geist','Outfit',sans-serif; cursor:pointer; font-weight:500; margin-bottom:12px; }
    .enable-all-btn:hover { background:rgba(230,138,58,0.12); }
    .admin-input { width:100%; height:42px; padding:0 12px; border:1px solid var(--border2); border-radius:8px; font-size:15px; font-family:'Geist','Outfit',sans-serif; color:var(--text); background:var(--surface); outline:none; margin-bottom:10px; transition: all 0.2s; }
    input[type='datetime-local'].admin-input { height:auto; padding:10px 12px; }
    textarea.admin-input { height:auto; }
    .admin-input:focus { border-color:var(--text); box-shadow: 0 0 0 4px var(--accent-glow); }
    .admin-row { display:flex; gap:8px; margin-bottom:10px; }
    .admin-row .admin-input { margin-bottom:0; }
    .admin-status { font-size:13px; margin-top:8px; }
    .admin-status.ok { color:var(--green); }
    .admin-status.err { color:var(--red); }
    .deadline-display { background:var(--surface2); border:1px solid var(--border2); border-radius:8px; padding:10px 14px; font-size:13px; color:var(--muted); margin-bottom:1rem; transition: background 0.3s ease, border-color 0.3s ease; }
    .deadline-display strong { color:var(--text); }

    /* ========== ANIMATIONS ========== */

    /* Initial load + step transition */
    @keyframes fadeSlideIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
    @keyframes staggerCard { from { opacity:0; transform:translateY(16px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }
    #app { animation: fadeSlideIn 0.5s cubic-bezier(0.22,1,0.36,1) both; }
    .time-card { transition: border-color 0.15s, background 0.15s, transform 0.15s; }
    .time-card.animate-in { animation: staggerCard 0.4s cubic-bezier(0.22,1,0.36,1) both; }
    .time-card.animate-in:nth-child(1) { animation-delay: 0.05s; }
    .time-card.animate-in:nth-child(2) { animation-delay: 0.12s; }
    .time-card.animate-in:nth-child(3) { animation-delay: 0.19s; }
    .time-card.animate-in:nth-child(4) { animation-delay: 0.26s; }

    /* Success checkmark draw */
    @keyframes checkDraw { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
    @keyframes scaleIn { from { transform:scale(0); opacity:0; } to { transform:scale(1); opacity:1; } }
    .success-icon { animation: scaleIn 0.45s cubic-bezier(0.34,1.56,0.64,1) 0.1s both; }
    .success-icon svg polyline { stroke-dasharray: 30; stroke-dashoffset: 30; animation: checkDraw 0.4s ease-out 0.45s forwards; }
    .booking-card { animation: fadeSlideIn 0.4s ease-out 0.25s both; }

    /* Confetti */
    @keyframes confettiRise { 0% { transform:translateY(0) rotate(0deg); opacity:1; } 100% { transform:translateY(-60px) rotate(720deg); opacity:0; } }
    .confetti-wrap { position:relative; width:100%; height:0; overflow:visible; display:flex; justify-content:center; pointer-events:none; }
    .confetti-dot { position:absolute; width:6px; height:6px; border-radius:50%; animation: confettiRise 1.2s cubic-bezier(0.25,0.46,0.45,0.94) forwards; }
    .confetti-dot:nth-child(1) { background:var(--green); left:20%; animation-delay:0s; }
    .confetti-dot:nth-child(2) { background:var(--accent); left:35%; animation-delay:0.1s; animation-duration:1s; }
    .confetti-dot:nth-child(3) { background:var(--speak); left:50%; animation-delay:0.05s; }
    .confetti-dot:nth-child(4) { background:var(--accent); left:65%; animation-delay:0.15s; animation-duration:1.1s; }
    .confetti-dot:nth-child(5) { background:var(--amber); left:80%; animation-delay:0.08s; }
    .confetti-dot:nth-child(6) { background:#fff; left:28%; animation-delay:0.18s; animation-duration:0.9s; }
    .confetti-dot:nth-child(7) { background:var(--green); left:72%; animation-delay:0.12s; }
    .confetti-dot:nth-child(8) { background:var(--accent); left:45%; animation-delay:0.2s; animation-duration:1.3s; }

    /* ========== SKELETON LOADING ========== */
    @keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
    .skeleton-row { display:flex; align-items:center; justify-content:space-between; padding:14px 12px; background:var(--surface2); border-radius:8px; border:1px solid var(--border2); margin-bottom:8px; }
    .skeleton-bar { height:12px; border-radius:4px; background:linear-gradient(90deg, var(--border2) 25%, var(--border-focus) 50%, var(--border2) 75%); background-size:400px 100%; animation:shimmer 1.5s ease-in-out infinite; }
    .skeleton-bar.sk-name { width:120px; margin-bottom:6px; }
    .skeleton-bar.sk-meta { width:180px; height:10px; }
    .skeleton-bar.sk-btn { width:52px; height:24px; border-radius:4px; }

    /* ========== TOAST NOTIFICATIONS ========== */
    @keyframes toastIn { from { transform:translateX(100%); opacity:0; } to { transform:translateX(0); opacity:1; } }
    @keyframes toastOut { from { transform:translateX(0); opacity:1; } to { transform:translateX(100%); opacity:0; } }
    .toast-container { position:fixed; top:20px; right:20px; z-index:9999; display:flex; flex-direction:column; gap:8px; pointer-events:none; }
    .toast { pointer-events:auto; padding:12px 18px; border-radius:10px; font-family:'Geist','Outfit',sans-serif; font-size:13px; font-weight:500; backdrop-filter:blur(12px); box-shadow:0 8px 32px rgba(0,0,0,0.1); border: 1px solid var(--border2); animation:toastIn 0.3s ease-out forwards; display:flex; align-items:center; gap:8px; max-width:320px; color: var(--text); background: var(--surface); }
    .toast.toast-out { animation:toastOut 0.3s ease-in forwards; }
    .toast.success { background:var(--green-dim); border:1px solid var(--green-border); color:var(--green); }
    .toast.error { background:var(--red-dim); border:1px solid var(--red-border); color:var(--red); }
    .toast.info { background:var(--accent-dim); border:1px solid rgba(91,91,214,0.3); color:var(--accent); }

    /* ========== ADMIN FAB ========== */
    .admin-fab { position:fixed; bottom:24px; right:24px; z-index:100; height:38px; padding:0 16px; border-radius:19px; border:1px solid var(--border2); background:var(--surface); color:var(--muted); font-family:'Geist','Outfit',sans-serif; font-size:13px; font-weight:500; cursor:pointer; display:flex; align-items:center; gap:6px; transition:all 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
    .admin-fab:hover { background:var(--surface2); color:var(--text); border-color:var(--border-focus); transform:translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }

    /* ========== STUDENT SEARCH ========== */
    .student-search { width:100%; height:36px; padding:0 12px 0 32px; border:1px solid var(--border2); border-radius:8px; font-size:13px; font-family:'Geist','Outfit',sans-serif; color:var(--text); background:var(--surface); outline:none; margin-bottom:12px; transition:all 0.15s; }
    .student-search:focus { border-color:var(--text); box-shadow: 0 0 0 4px var(--accent-glow); }
    .student-search-wrap { position:relative; }
    .student-search-icon { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--muted); pointer-events:none; }

    /* Admin tab badge */
    .admin-tab-badge { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 5px; border-radius:9px; font-size:10px; font-weight:700; background:var(--border2); color:var(--muted); margin-left:5px; }

    /* ========== UPGRADED ANIMATIONS & ACCESSIBILITY ========== */

    /* Pulse effect on selected card */
    @keyframes selectedPulse {
      0% { box-shadow: 0 0 0 0 var(--accent-glow); }
      70% { box-shadow: 0 0 0 6px rgba(91, 91, 214, 0); }
      100% { box-shadow: 0 0 0 0 rgba(91, 91, 214, 0); }
    }

    /* Horizontal shake for invalid fields */
    @keyframes shakeField {
      0%, 100% { transform: translateX(0); }
      20%, 60% { transform: translateX(-4px); }
      40%, 80% { transform: translateX(4px); }
    }
    .field-input.error-shake {
      animation: shakeField 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    }

    /* Dynamic page step transition container */
    @keyframes stepFadeIn {
      from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }
    .step-view-container {
      transition: opacity 0.4s, transform 0.4s;
    }
    .step-view-container.animate-step {
      animation: stepFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    /* ========== THEME TOGGLE FAB ========== */
    .theme-toggle-fab {
      position: fixed;
      top: 24px;
      right: 24px;
      z-index: 1000;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      border: 1px solid var(--border2);
      background: var(--surface);
      color: var(--text);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      outline: none;
    }
    .theme-toggle-fab:hover {
      transform: scale(1.08) rotate(15deg);
      border-color: var(--border-focus);
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
      background: var(--surface2);
    }
    .theme-toggle-fab:active {
      transform: scale(0.95);
    }
    .theme-toggle-fab svg {
      width: 20px;
      height: 20px;
      stroke: currentColor;
      transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .theme-toggle-fab:hover svg {
      transform: scale(1.1);
    }

    /* Accessibility standard: Respect user OS prefers-reduced-motion preferences */
    @media (prefers-reduced-motion: reduce) {
      *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
      }
    }

    /* ========== SPEAKING-GRID STEP ========== */
    .speak-hint {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 12px;
      line-height: 1.5;
    }
    .speak-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
      gap: 8px;
      margin-bottom: 14px;
    }
    .speak-cell {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 10px 8px;
      text-align: center;
      cursor: pointer;
      background: var(--surface);
      transition: all 0.18s ease;
      user-select: none;
    }
    .speak-cell:hover:not(.disabled) {
      border-color: var(--border-focus, var(--primary));
      transform: translateY(-1px);
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    }
    .speak-cell.selected {
      border-color: var(--primary);
      background: rgba(61, 189, 139, 0.08);
      box-shadow: 0 0 0 2px rgba(61, 189, 139, 0.25) inset;
    }
    .speak-cell.disabled {
      cursor: not-allowed;
      opacity: 0.45;
      background: var(--surface2, rgba(255, 255, 255, 0.02));
    }
    .speak-cell.blocked {
      background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 6px,
        rgba(224, 90, 90, 0.06) 6px,
        rgba(224, 90, 90, 0.06) 12px
      );
    }
    .speak-cell.full {
      border-color: rgba(224, 90, 90, 0.35);
    }
    .speak-time {
      font-size: 15px;
      font-weight: 600;
      letter-spacing: 0.02em;
      color: var(--text);
    }
    .speak-cell.disabled .speak-time {
      color: var(--muted);
    }
    .speak-seats {
      font-size: 11px;
      color: var(--muted);
      margin-top: 4px;
    }
    .speak-seats strong {
      color: var(--primary);
    }
    .speak-cell.selected .speak-seats strong {
      color: var(--primary);
    }
    .speak-cell.disabled .speak-seats strong {
      color: inherit;
    }
    @media (max-width: 520px) {
      .speak-grid {
        grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
        gap: 6px;
      }
      .speak-cell { padding: 8px 6px; }
      .speak-time { font-size: 13px; }

      .admin-tabs {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-bottom: 1px solid var(--border2);
        padding-bottom: 4px;
        margin-bottom: 1rem;
      }
      .admin-tabs::-webkit-scrollbar {
        display: none;
      }
      .admin-tab {
        flex: 0 0 auto;
        padding: 8px 12px;
        font-size: 12px;
      }
    }