:root {
  color-scheme: light;
  --ink: #0c0c0e;
  --muted: #68626e;
  --paper: #fefcfd;
  --surface: rgba(254, 252, 253, .84);
  --surface-solid: #fefcfd;
  --line: rgba(96, 26, 156, .12);
  --purple: #601a9c;
  --purple-deep: #42106f;
  --purple-soft: #f1e7f8;
  --lime: #96d51c;
  --lime-soft: #eef9d8;
  --shadow: 0 18px 50px rgba(66, 16, 111, .12);
  --radius-lg: 28px;
  --radius-md: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 0%, rgba(150, 213, 28, .22), transparent 25rem),
    radial-gradient(circle at 100% 18%, rgba(96, 26, 156, .13), transparent 23rem),
    linear-gradient(160deg, #fefcfd 0%, #f8f2fb 100%);
}

button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }

button:focus-visible { outline: 3px solid rgba(96, 26, 156, .34); outline-offset: 3px; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  opacity: .45;
}

.ambient-one { top: -130px; right: -100px; background: #c9a9df; }
.ambient-two { bottom: -160px; left: -110px; background: #ccec8b; }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(20px + var(--safe-top)) 16px calc(34px + var(--safe-bottom));
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.eyebrow, .section-kicker, .sheet-kicker { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: clamp(28px, 8vw, 38px); line-height: .98; letter-spacing: -.045em; }

.timezone-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 999px;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 8px 24px rgba(66, 16, 111, .09);
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.timezone-pill span:first-child { font-size: 18px; }
.timezone-pill span:nth-child(2) { font-weight: 800; font-size: 13px; }
.timezone-pill svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.intro-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 17px;
  min-height: 116px;
  margin-bottom: 18px;
  padding: 21px;
  overflow: hidden;
  color: white;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-deep) 100%);
  box-shadow: 0 16px 35px rgba(96, 26, 156, .27);
}

.intro-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -76px;
  top: -88px;
  border: 26px solid rgba(150, 213, 28, .18);
  border-radius: 50%;
}

.intro-card h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.025em; }
.intro-card p { max-width: 270px; margin: 0; color: rgba(255,255,255,.74); font-size: 13px; line-height: 1.45; }
.brand-lockup { position: relative; z-index: 1; width: 104px; aspect-ratio: 4 / 3; flex: 0 0 auto; overflow: hidden; border: 2px solid rgba(254,252,253,.68); border-radius: 18px; background: var(--surface-solid); box-shadow: 0 10px 28px rgba(12,12,14,.18); transform: rotate(2deg); }
.brand-lockup img { display: block; width: 100%; height: 100%; object-fit: cover; }

.day-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin: 0 0 9px;
}

.day-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  height: 54px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.66);
  font-weight: 850;
  font-size: 12px;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.day-tab strong { font-size: 12px; line-height: 1; }
.day-tab small { color: var(--muted); font-size: 8px; font-weight: 750; line-height: 1; }
.day-tab.active small { color: rgba(255,255,255,.72); }

.day-tab:active { transform: scale(.94); }
.day-tab.active { color: var(--lime); border-color: var(--purple); background: var(--purple); box-shadow: 0 8px 18px rgba(96,26,156,.22); }
.day-tab.empty:not(.active)::after { content: ""; position: absolute; width: 4px; height: 4px; left: 50%; bottom: 7px; border-radius: 50%; background: #c4c9c6; transform: translateX(-50%); }

.all-time-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 0 15px;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.66);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.all-time-button:active { transform: scale(.98); }
.all-time-button.active { color: white; background: var(--purple); }
.all-time-icon { display: grid; gap: 3px; width: 18px; }
.all-time-icon i { display: block; height: 2px; border-radius: 3px; background: currentColor; }
.all-time-icon i:nth-child(2) { width: 13px; }
.count-badge { min-width: 25px; margin-left: auto; padding: 4px 7px; color: var(--ink); border-radius: 999px; background: var(--lime); text-align: center; font-size: 11px; }

.schedule-section { margin-top: 25px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 3px 14px; }
.section-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.dated-heading-line { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.week-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 3px 7px; color: var(--purple); border: 1px solid rgba(96,26,156,.13); border-radius: 999px; background: var(--purple-soft); font-size: 8px; font-weight: 850; line-height: 1; white-space: nowrap; }
.slot-count { margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 700; }

.slots-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.slot-card {
  position: relative;
  min-height: 78px;
  padding: 15px 16px;
  overflow: hidden;
  border: 1px solid rgba(96,26,156,.10);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(66,16,111,.07);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.slot-card::after { content: "↗"; position: absolute; right: 12px; top: 11px; color: #a7afab; font-size: 13px; }
.slot-card:active { transform: scale(.97); }
.slot-card:hover { border-color: rgba(96,26,156,.34); box-shadow: 0 12px 30px rgba(66,16,111,.12); }
.slot-card strong { display: block; margin-top: 13px; font-size: 17px; letter-spacing: -.02em; }
.slot-card small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.empty-state { padding: 31px 22px; border: 1px dashed rgba(96,26,156,.22); border-radius: var(--radius-lg); background: rgba(254,252,253,.48); text-align: center; }
.empty-symbol { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 13px; border-radius: 16px; background: var(--lime-soft); color: var(--purple); box-shadow: 0 9px 24px rgba(66,16,111,.09); font-size: 21px; }
.empty-state h3 { margin: 0 0 6px; font-size: 17px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.all-list { display: grid; gap: 12px; }
.day-group { padding: 17px; border: 1px solid var(--line); border-radius: 23px; background: rgba(255,255,255,.62); }
.day-group-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.day-group-header h3 { margin: 0; font-size: 16px; }
.day-group-header span { color: var(--muted); font-size: 11px; font-weight: 750; }
.day-group .slots-grid { gap: 8px; }
.day-group .slot-card { min-height: 62px; padding: 11px 13px; border-radius: 16px; }
.day-group .slot-card strong { margin-top: 9px; font-size: 15px; }
.day-group-empty { margin: 0; padding: 12px; color: var(--muted); border-radius: 14px; background: var(--purple-soft); font-size: 12px; text-align: center; }

.timezone-note { margin: 20px 0 0; color: var(--muted); font-size: 11px; font-weight: 650; text-align: center; }

.skeleton-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.skeleton-grid div { height: 78px; border-radius: var(--radius-md); background: linear-gradient(100deg, rgba(255,255,255,.45) 20%, rgba(255,255,255,.9) 40%, rgba(255,255,255,.45) 60%); background-size: 220% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position-x: -220%; } }

.scrim { position: fixed; z-index: 20; inset: 0; background: rgba(12,12,14,.48); backdrop-filter: blur(4px); animation: fade-in .2s ease both; }
.bottom-sheet { position: fixed; z-index: 21; left: 50%; bottom: 0; width: min(100%, 620px); padding: 16px 19px calc(19px + var(--safe-bottom)); border-radius: 30px 30px 0 0; background: var(--paper); box-shadow: 0 -22px 60px rgba(66,16,111,.22); transform: translateX(-50%); animation: sheet-up .28s cubic-bezier(.2,.8,.25,1) both; }
.sheet-handle { width: 42px; height: 5px; margin: -5px auto 22px; border-radius: 99px; background: #d6d8d4; }
.sheet-close { position: absolute; top: 17px; right: 17px; width: 36px; height: 36px; padding: 0 0 3px; border: 0; border-radius: 50%; background: #ecece6; color: #65706b; font-size: 24px; cursor: pointer; }
.bottom-sheet h2 { margin: 0 40px 8px 0; font-size: 27px; letter-spacing: -.04em; }
.sheet-copy { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.timezone-options { display: grid; gap: 9px; }
.timezone-option { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 20px; background: white; text-align: left; cursor: pointer; }
.timezone-option.selected { border-color: var(--purple); box-shadow: inset 0 0 0 1px var(--purple); }
.flag-card { display: grid; place-items: center; width: 47px; height: 47px; border-radius: 14px; background: var(--purple-soft); font-size: 24px; }
.timezone-option strong, .timezone-option small { display: block; }
.timezone-option strong { margin-bottom: 3px; font-size: 15px; }
.timezone-option small { color: var(--muted); font-size: 11px; }
.radio-mark { width: 21px; height: 21px; margin-left: auto; border: 2px solid #c4c9c6; border-radius: 50%; }
.timezone-option.selected .radio-mark { border: 6px solid var(--purple); }

.confirm-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 15px; border-radius: 15px; background: var(--lime); color: var(--ink); font-size: 21px; font-weight: 900; transform: rotate(-4deg); }
.booking-summary { display: grid; gap: 1px; margin: 19px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--line); }
.booking-summary div { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 14px; gap: 20px; background: white; }
.booking-summary span { color: var(--muted); font-size: 12px; }
.booking-summary strong { font-size: 13px; text-align: right; }
.primary-button, .secondary-button { width: 100%; min-height: 54px; border-radius: 17px; font-weight: 850; cursor: pointer; }
.primary-button { border: 0; color: var(--ink); background: var(--lime); box-shadow: 0 10px 24px rgba(150,213,28,.28); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { margin-top: 7px; border: 0; color: var(--muted); background: transparent; }

.success-sheet { text-align: center; }
.success-orbit { display: grid; place-items: center; width: 84px; height: 84px; margin: 2px auto 17px; border: 1px solid rgba(96,26,156,.15); border-radius: 50%; box-shadow: inset 0 0 0 11px rgba(150,213,28,.24); }
.success-orbit span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: var(--ink); background: var(--lime); font-size: 24px; font-weight: 950; }
.success-sheet h2 { margin-right: 0; }
.success-summary div { min-height: 57px; }
.success-summary span { color: var(--ink); font-weight: 750; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(18px + var(--safe-bottom)); width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; color: white; border-radius: 14px; background: var(--purple-deep); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; transform: translateX(-50%); animation: toast-in .22s ease both; }

[hidden] { display: none !important; }
body.sheet-open { overflow: hidden; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { opacity: 0; transform: translate(-50%, 30px); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 390px) {
  .brand-lockup { width: 90px; border-radius: 15px; }
  .intro-card { gap: 12px; padding: 18px; }
  .intro-card h2 { font-size: 19px; }
}

@media (min-width: 560px) {
  .app-shell { padding-left: 24px; padding-right: 24px; }
  .day-tabs { gap: 8px; }
  .day-tab { height: 59px; font-size: 13px; }
  .slots-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .day-group .slots-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Navigation and shared views */
.main-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: -5px 0 20px; padding: 4px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.58); }
.main-nav button { min-width: 0; min-height: 42px; padding: 0 8px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.main-nav button.active { color: white; background: var(--purple); box-shadow: 0 6px 16px rgba(96,26,156,.2); }
.main-nav button[hidden] + button, .main-nav:has(#admin-nav-button[hidden]) { grid-template-columns: repeat(2, 1fr); }
.view { min-height: 280px; }
.student-schedule-content { margin-top: 24px; }
.loading-card { padding: 34px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-lg); text-align: center; font-size: 13px; font-weight: 750; }

/* Student lessons and reminders */
.lesson-list, .managed-lessons { display: grid; gap: 10px; }
.lesson-card { position: relative; display: flex; align-items: center; gap: 12px; min-height: 106px; padding: 18px 16px 18px 20px; overflow: hidden; border: 1px solid rgba(96,26,156,.11); border-radius: 23px; background: rgba(255,255,255,.77); box-shadow: 0 10px 28px rgba(66,16,111,.08); }
.lesson-card::after { content: ""; position: absolute; top: -35px; right: -28px; width: 90px; height: 90px; border: 18px solid rgba(150,213,28,.2); border-radius: 50%; }
.lesson-card-content { position: relative; z-index: 1; min-width: 0; flex: 1; }
.lesson-card .lesson-day { display: block; color: var(--purple); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.lesson-card strong { display: block; margin: 10px 0 5px; font-size: 21px; letter-spacing: -.025em; }
.lesson-card small { color: var(--muted); font-size: 12px; }
.lesson-date-meta { display: flex; align-items: center; gap: 7px; }
.lesson-date-meta .week-badge { font-size: 8px; }
.lesson-cancel { position: relative; z-index: 2; flex: 0 0 auto; width: 42px; height: 42px; padding: 0 0 3px; border: 0; border-radius: 14px; color: #b22035; background: #fae7e9; font-size: 25px; cursor: pointer; }
.lesson-cancel:disabled { color: #999d9a; background: #eceeeb; cursor: not-allowed; }
.same-day-note { position: absolute; z-index: 2; right: 14px; bottom: 8px; max-width: 155px; color: var(--muted); font-size: 8px; text-align: right; }
.reminder-card { display: flex; align-items: center; gap: 13px; width: 100%; margin-top: 17px; padding: 14px; border: 1px solid var(--line); border-radius: 21px; background: rgba(255,255,255,.72); text-align: left; cursor: pointer; }
.reminder-card.enabled { border-color: rgba(150,213,28,.65); background: var(--lime-soft); }
.reminder-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--purple-soft); font-size: 21px; }
.reminder-card.enabled .reminder-icon { background: var(--lime); }
.reminder-card strong, .reminder-card small { display: block; }
.reminder-card strong { margin-bottom: 3px; font-size: 15px; }
.reminder-card small { color: var(--muted); font-size: 11px; }
.chevron { margin-left: auto; color: var(--muted); font-size: 26px; }
.reminder-options { display: grid; gap: 8px; }
.reminder-option { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 51px; padding: 0 15px; border: 1px solid var(--line); border-radius: 16px; background: white; font-size: 13px; font-weight: 750; cursor: pointer; }
.reminder-option i { width: 20px; height: 20px; border: 2px solid #c9cbc8; border-radius: 50%; }
.reminder-option.selected { border-color: var(--purple); background: var(--purple-soft); }
.reminder-option.selected i { border: 6px solid var(--purple); }

/* Admin home */
.admin-hero { padding: 24px; color: white; border-radius: var(--radius-lg); background: linear-gradient(140deg, #42106f, #731fba); box-shadow: 0 17px 38px rgba(66,16,111,.25); }
.admin-hero h2 { margin: 16px 0 7px; max-width: 360px; font-size: 25px; line-height: 1.05; letter-spacing: -.04em; }
.admin-hero p { max-width: 420px; margin: 0; color: rgba(255,255,255,.7); font-size: 13px; line-height: 1.5; }
.admin-badge { display: inline-flex; padding: 7px 10px; color: var(--purple-deep); border-radius: 99px; background: var(--lime); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.admin-menu { display: grid; gap: 11px; margin-top: 3px; }
.admin-menu-card { position: relative; display: grid; grid-template-columns: 52px 1fr 20px; grid-template-rows: auto auto; align-items: center; column-gap: 13px; width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.75); text-align: left; cursor: pointer; }
.admin-menu-icon { display: grid; grid-row: 1 / 3; place-items: center; width: 52px; height: 52px; color: white; border-radius: 17px; background: var(--purple); font-size: 25px; }
.admin-menu-icon.lime { color: var(--ink); background: var(--lime); }
.admin-menu-card strong { align-self: end; font-size: 16px; }
.admin-menu-card small { align-self: start; margin-top: 3px; color: var(--muted); font-size: 11px; }
.admin-menu-card i { grid-column: 3; grid-row: 1 / 3; color: var(--muted); font-size: 25px; font-style: normal; }
.admin-page-header { display: flex; align-items: center; gap: 12px; margin: 3px 0 18px; }
.admin-page-header h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.back-button { width: 44px; height: 44px; padding: 0 0 4px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.75); font-size: 23px; cursor: pointer; }

/* Admin schedule */
.admin-legend { display: flex; flex-wrap: wrap; gap: 9px 14px; margin: 0 3px 13px; color: var(--muted); font-size: 10px; font-weight: 750; }
.admin-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.admin-legend .available::before { background: var(--lime); }.admin-legend .unavailable::before { background: #ced0cd; }
.admin-schedule-note { margin: -2px 3px 13px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.admin-week-list { display: grid; gap: 12px; }
.admin-day { padding: 16px; border: 1px solid var(--line); border-radius: 23px; background: rgba(255,255,255,.64); }
.admin-day-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.admin-day h3 { margin: 0 0 11px; font-size: 16px; }.admin-day-title h3 { margin: 0; }
.admin-day-title span { color: var(--muted); font-size: 10px; font-weight: 750; }
.admin-day-heading h3 { margin-bottom: 3px; }
.admin-day-heading small { display: block; color: var(--muted); font-size: 10px; font-weight: 750; }
.admin-day-meta { display: flex; align-items: center; gap: 6px; }
.admin-day-meta .week-badge { color: var(--purple); font-size: 8px; }
.admin-slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.admin-slot { position: relative; min-width: 0; min-height: 43px; padding: 0 5px; border: 1px solid transparent; border-radius: 12px; font-size: 11px; font-weight: 800; cursor: pointer; }
.admin-slot.enabled { border-color: rgba(150,213,28,.8); background: var(--lime-soft); color: #355207; }
.admin-slot.disabled { background: #e7e8e5; color: #8b908d; }
.admin-slot:disabled { opacity: .6; }

/* Student cancellation */
.cancel-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 15px; border-radius: 15px; color: #a51d32; background: #fae7e9; font-size: 28px; font-weight: 700; }
.cancel-summary { margin: 18px 0; padding: 15px; border: 1px solid #f0c9cf; border-radius: 17px; color: #6f1725; background: #fff3f4; font-size: 14px; font-weight: 800; text-align: center; }
.danger-button { width: 100%; min-height: 54px; border: 0; border-radius: 17px; color: white; background: #b22035; box-shadow: 0 10px 24px rgba(178,32,53,.2); font-weight: 850; cursor: pointer; }
.danger-button:disabled { opacity: .55; cursor: wait; }
.cancel-result-message { max-width: 430px; margin: 0 auto 22px; font-size: 14px; }

@media (max-width: 370px) {
  .admin-slot-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .main-nav button { font-size: 11px; }
}
