:root {
  color-scheme: light;
  --bg: #f3f2ed;
  --surface: #ffffff;
  --surface-2: #f8f7f3;
  --ink: #19221e;
  --muted: #626b65;
  --line: #dedfd9;
  --line-soft: #ebece7;
  --green: #263e34;
  --sage: #e2ead6;
  --sage-ink: #536745;
  --blue: #e2ebf3;
  --blue-ink: #435f73;
  --peach: #f3ded3;
  --peach-ink: #87533c;
  --yellow: #f4e9bb;
  --red: #b9544e;
  --shadow: 0 18px 48px rgba(32, 43, 37, 0.1);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: #e8e7e1; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #e8e7e1;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; touch-action: manipulation; }
button:not(:disabled) { transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease; }
button:not(:disabled):active { opacity: .78; }

.app-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(142px + env(safe-area-inset-bottom));
  background: var(--bg);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar h1,
.page-title {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.overline {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.avatar-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 15px;
  color: white;
  background: var(--green);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.calendar-toolbar { position: relative; z-index: 20; }
.calendar-toolbar .period-row { margin-bottom: 14px; }

.today-button,
.quiet-button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

.today-button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 800;
}

.segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  flex: 1;
  max-width: 300px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #e9e9e4;
}

.segment button {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.segment button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2px 9px rgba(30, 42, 35, 0.08);
}

.period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.period-row h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.period-arrows { display: flex; gap: 6px; }
.period-row h2 { min-width: 0; }
.period-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 8px; }
.calendar-live-clock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #efd5d3;
  border-radius: 11px;
  color: #ac4845;
  background: #fff3f2;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.calendar-live-clock i { width: 6px; height: 6px; border-radius: 50%; background: #d95656; }
.calendar-live-clock time { font-size: 12px; font-weight: 850; font-variant-numeric: tabular-nums; }
.calendar-clock-zone { font-size: 8px; font-weight: 800; opacity: 0.75; }

/* Live current-time marker; floats over event cards without blocking taps. */
.calendar-now-line {
  position: absolute;
  z-index: 6;
  height: 2px;
  background: #df5759;
  pointer-events: none;
}
.calendar-now-line[hidden] { display: none; }
.calendar-now-line::before {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #df5759;
  content: "";
}
.calendar-now-line time {
  position: absolute;
  top: -12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 22px;
  padding: 0 4px;
  border-radius: 7px;
  color: white;
  background: #df5759;
  font-size: 10px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.month-now-clock {
  display: block;
  margin-top: 3px;
  color: #cc5757;
  font-size: 9px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  font-size: 17px;
}

.legend {
  display: flex;
  gap: 14px;
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--blue); }
.legend i.open { background: var(--sage); }
.legend i.group { background: var(--peach); }

.gesture-hint {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.calendar-card,
.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(31, 42, 36, 0.045);
}

.calendar-card { position: relative; overflow: hidden; }
.calendar-card::after { position: absolute; top: 0; right: 0; bottom: 0; width: 18px; content: ""; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(25,34,30,.08)); }
.calendar-scroll { overflow-x: auto; scrollbar-width: none; }
.calendar-scroll::-webkit-scrollbar { display: none; }

.mobile-week-overview,
.mobile-week-mode,
.mobile-week-hint { display: none; }

.week-head {
  display: grid;
  grid-template-columns: 42px repeat(7, minmax(62px, 1fr));
  min-width: 492px;
  padding: 11px 8px 9px;
  border-bottom: 1px solid var(--line-soft);
}

.week-head div { text-align: center; }
.week-head div:first-child { color: transparent; }
.week-head span,
.week-head strong { display: block; }
.week-head span { margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.week-head strong { font-size: 13px; }
.week-head .is-today strong { display: grid; width: 25px; height: 25px; margin: -4px auto -4px; place-items: center; border-radius: 9px; color: white; background: var(--green); }

.week-grid {
  position: relative;
  display: grid;
  grid-template-columns: 42px repeat(7, minmax(62px, 1fr));
  grid-template-rows: repeat(24, 24px);
  min-width: 492px;
  padding: 12px 8px 20px;
}

.week-grid::before {
  position: absolute;
  inset: 12px 8px 20px 50px;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 47px, var(--line-soft) 47px, var(--line-soft) 48px),
    repeating-linear-gradient(to right, transparent 0, transparent calc(14.2857% - 1px), var(--line-soft) calc(14.2857% - 1px), var(--line-soft) 14.2857%);
  pointer-events: none;
  content: "";
}

.hour {
  z-index: 1;
  grid-column: 1;
  color: #939a95;
  font-size: 8px;
  transform: translateY(-5px);
}

.calendar-event {
  z-index: 2;
  min-width: 0;
  margin: 2px;
  padding: 6px 6px 5px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.calendar-event strong,
.calendar-event span,
.calendar-event small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event strong { font-size: 9px; line-height: 1.15; }
.calendar-event span { margin-top: 3px; font-size: 8px; opacity: 0.76; }
.calendar-event small { margin-top: 2px; font-size: 7px; opacity: 0.68; }
.calendar-event.open { position: relative; color: var(--sage-ink); background: var(--sage); outline: 1px dashed #9ead89; outline-offset: -2px; touch-action: none; }
.calendar-event.lesson { color: var(--blue-ink); background: var(--blue); }
.calendar-event.pending-event { color: #705d24; background: #f5ecc7; outline: 1px dashed #c8af59; outline-offset: -2px; }
.calendar-event em { display: inline-flex; margin-top: 4px; padding: 2px 5px; border-radius: 6px; background: rgba(255,255,255,0.5); font-size: 6px; font-style: normal; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.calendar-event.group { color: var(--peach-ink); background: var(--peach); }
.calendar-event.personal { color: #705d24; background: var(--yellow); }
.calendar-event.is-dragging,
.calendar-event.is-resizing { z-index: 20; opacity: 0.9; box-shadow: 0 10px 24px rgba(38, 62, 52, 0.23); transition: none; }
.resize-handle { position: absolute; right: 6px; bottom: 3px; left: 6px; height: 7px; border-bottom: 2px solid rgba(83, 103, 69, 0.55); border-radius: 5px; cursor: ns-resize; }

.day-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.day-calendar-head span,
.day-calendar-head strong { display: block; }
.day-calendar-head span { margin-bottom: 3px; color: var(--muted); font-size: 9px; text-transform: capitalize; }
.day-calendar-head strong { font-size: 14px; }
.day-calendar-head > b { padding: 7px 9px; border-radius: 10px; color: var(--sage-ink); background: var(--sage); font-size: 8px; }
.day-timeline { position: relative; display: grid; grid-template-columns: 52px minmax(0,1fr); grid-template-rows: repeat(24, 28px); padding: 16px 14px 24px; }
.day-timeline::before { position: absolute; inset: 16px 14px 24px 66px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 55px, var(--line-soft) 55px, var(--line-soft) 56px); pointer-events: none; content: ""; }
.day-timeline .calendar-event { margin: 3px 2px; padding: 9px 12px; }
.day-timeline .calendar-event strong { font-size: 11px; }
.day-timeline .calendar-event span { font-size: 9px; }
.day-timeline .calendar-event small { position: absolute; top: 9px; right: 10px; font-size: 8px; }

.day-list { display: grid; gap: 9px; }

.day-event {
  display: grid;
  grid-template-columns: 52px 5px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 78px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.day-event .time { font-size: 12px; font-weight: 850; }
.day-event .bar { width: 5px; height: 44px; border-radius: 99px; background: var(--blue); }
.day-event.open .bar { background: #a7b991; }
.day-event.group .bar { background: #d3a68e; }
.day-event strong { display: block; margin-bottom: 5px; font-size: 13px; }
.day-event span { color: var(--muted); font-size: 10px; }
.day-event .chevron { color: #a2a9a4; font-size: 18px; }

.day-empty {
  padding: 28px 18px;
  border: 1px dashed #cfd2ca;
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
}

.month-head,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.month-head {
  padding: 12px 10px 7px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.month-grid { padding: 0 10px 12px; }

.month-day {
  min-height: 74px;
  padding: 8px 6px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.month-day:nth-child(7n) { border-right: 0; }
.month-day > span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 8px; font-size: 10px; font-weight: 800; }
.month-day.today > span { color: white; background: var(--green); }
.month-day.other { color: #b3b7b3; }
.month-dots { display: grid; gap: 3px; margin-top: 7px; }
.month-dots i { height: 5px; border-radius: 99px; background: var(--blue); }
.month-dots i.open { background: var(--sage); }
.month-dots i.group { background: var(--peach); }

.fab {
  position: fixed;
  z-index: 35;
  right: max(calc(50% - 260px), 20px);
  bottom: calc(91px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 17px;
  border: 0;
  border-radius: 15px;
  color: white;
  background: var(--green);
  box-shadow: 0 12px 28px rgba(38, 62, 52, 0.22);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.fab b { font-size: 18px; font-weight: 500; }

.dashboard-hero {
  padding: 20px;
  border-radius: 24px;
  color: white;
  background: var(--green);
  box-shadow: 0 14px 34px rgba(38, 62, 52, 0.18);
}

.attention-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; margin-bottom: 12px; padding: 15px; border: 1px solid #ddc889; border-radius: 22px; background: #fbf1cf; box-shadow: 0 10px 26px rgba(105,82,19,.08); }
.attention-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: white; background: #9d7620; font-size: 17px; font-weight: 900; }
.attention-copy { min-width: 0; }
.attention-copy span { color: #80651f; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.attention-copy h2 { margin: 3px 0 2px; font-size: 17px; letter-spacing: -.03em; }
.attention-copy p { margin: 0; overflow: hidden; color: #75682f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.attention-card > button:not(.attention-link) { min-height: 38px; padding: 0 12px; border: 0; border-radius: 12px; color: white; background: var(--green); font-size: 9px; font-weight: 850; }
.attention-link { grid-column: 2 / 4; justify-self: start; padding: 2px 0; border: 0; color: #765c15; background: transparent; font-size: 9px; font-weight: 850; }

.attention-stack { margin-bottom: 12px; overflow: hidden; border: 1px solid #ddc889; border-radius: 22px; background: #fbf1cf; box-shadow: 0 10px 26px rgba(105,82,19,.06); }
.attention-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px 9px; }
.attention-heading h2 { margin: 2px 0 0; font-size: 17px; letter-spacing: -.025em; }
.attention-heading > b { display: grid; min-width: 30px; height: 30px; padding: 0 8px; place-items: center; border-radius: 99px; color: white; background: #9d7620; font-size: 12px; }
.attention-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 11px; width: calc(100% - 16px); min-height: 62px; margin: 0 8px 8px; padding: 9px 11px; border: 0; border-radius: 15px; color: var(--ink); background: rgba(255,255,255,.72); cursor: pointer; text-align: left; }
.attention-row .attention-icon { width: 42px; height: 42px; font-size: 11px; }
.attention-row .attention-copy strong, .attention-row .attention-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-row .attention-copy strong { font-size: 12px; }
.attention-row .attention-copy small { margin-top: 4px; color: #75682f; font-size: 10px; }
.attention-row > span:last-child { color: #80651f; font-size: 20px; }
.attention-all { width: 100%; min-height: 44px; border: 0; border-top: 1px solid rgba(128,101,31,.14); color: #765c15; background: transparent; cursor: pointer; font-size: 11px; font-weight: 850; }
.status-clear { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 11px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid #ccd8c1; border-radius: 19px; background: #f0f5eb; }
.status-clear > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; color: var(--sage-ink); background: white; font-weight: 900; }
.status-clear strong, .status-clear small { display: block; }
.status-clear strong { font-size: 12px; }
.status-clear small { margin-top: 4px; color: var(--muted); font-size: 10px; }

.dashboard-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dashboard-hero-top span { color: rgba(255,255,255,0.67); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.dashboard-hero-top h2 { margin: 7px 0 0; font-size: 21px; line-height: 1.1; letter-spacing: -0.035em; }
.dashboard-hero-top > b { display: grid; min-width: 40px; height: 40px; padding: 0 9px; place-items: center; border-radius: 13px; color: var(--green); background: var(--sage); font-size: 10px; text-transform: uppercase; }
.dashboard-hero > p { margin: 10px 0 18px; color: rgba(255,255,255,0.7); font-size: 10px; }
.dashboard-hero > button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 40px; padding: 0 13px; border: 0; border-radius: 13px; color: white; background: rgba(255,255,255,0.12); cursor: pointer; font-size: 10px; font-weight: 800; }

.dashboard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 11px 0 22px; }
.dashboard-stats button { min-width: 0; min-height: 78px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); cursor: pointer; text-align: left; }
.dashboard-stats strong,
.dashboard-stats span { display: block; }
.dashboard-stats strong { margin-bottom: 5px; font-size: 21px; letter-spacing: -0.04em; }
.dashboard-stats span { color: var(--muted); font-size: 8px; line-height: 1.3; }

.dashboard-section { margin-bottom: 22px; }
.dashboard-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dashboard-section-head h2 { margin: 0; font-size: 16px; letter-spacing: -0.025em; }
.dashboard-section-head > div { min-width: 0; }
.section-kicker { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.dashboard-section-head button { padding: 5px 0; border: 0; color: var(--sage-ink); background: transparent; cursor: pointer; font-size: 9px; font-weight: 850; }

.mini-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 7px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.mini-week button { display: grid; min-width: 0; min-height: 59px; padding: 7px 2px 5px; place-items: center; border: 0; border-radius: 13px; background: transparent; cursor: pointer; }
.mini-week button > span { color: var(--muted); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.mini-week button > strong { font-size: 11px; }
.mini-week button > i { display: grid; min-width: 14px; height: 14px; padding: 0 3px; place-items: center; border-radius: 7px; color: var(--sage-ink); background: var(--sage); font-size: 7px; font-style: normal; }
.mini-week button > i:empty { background: transparent; }
.mini-week button.today { color: white; background: var(--green); }
.mini-week button.today > span { color: rgba(255,255,255,0.68); }
.mini-week button.today > i { color: var(--green); background: var(--sage); }

.today-preview { display: grid; gap: 6px; margin-top: 9px; }
.today-preview > button { display: grid; grid-template-columns: 43px 5px minmax(0,1fr) auto auto; align-items: center; gap: 9px; min-height: 49px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); cursor: pointer; text-align: left; }
.today-preview > button > span { font-size: 10px; font-weight: 850; }
.today-preview > button > i { width: 5px; height: 29px; border-radius: 9px; background: var(--blue); }
.today-preview > button > i.open { background: #a7b991; }
.today-preview > button > i.group { background: #d3a68e; }
.today-preview > button > strong { min-width: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.today-preview > button > small { color: var(--muted); font-size: 8px; }
.today-preview > button > b { color: #a2a9a4; }
.today-preview > p { margin: 0; padding: 14px; border-radius: 15px; color: var(--muted); background: var(--surface); font-size: 10px; text-align: center; }

.today-agenda { display: grid; gap: 7px; }
.today-agenda > button { display: grid; grid-template-columns: 48px 5px minmax(0,1fr) auto; align-items: center; gap: 11px; width: 100%; min-height: 66px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); cursor: pointer; text-align: left; }
.agenda-time strong, .agenda-time small, .agenda-copy strong, .agenda-copy small { display: block; }
.agenda-time { font-size: 13px; font-weight: 900; }
.agenda-time small { margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 700; }
.today-agenda > button > i { width: 5px; height: 38px; border-radius: 99px; background: var(--blue); }
.today-agenda > button > i.open { background: #9fb785; }
.today-agenda > button > i.group { background: #d19c7d; }
.agenda-copy { min-width: 0; }
.agenda-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-copy small { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.today-agenda > button > b { padding: 5px 7px; border-radius: 8px; color: var(--sage-ink); background: var(--sage); font-size: 7px; text-transform: uppercase; }
.today-agenda > button > em { color: var(--muted); font-size: 16px; font-style: normal; }
.empty-action { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; padding: 14px; border: 1px dashed var(--line); border-radius: 18px; background: rgba(255,255,255,.45); }
.empty-action > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; color: var(--sage-ink); background: var(--sage); }
.empty-action strong, .empty-action small { display: block; }
.empty-action strong { font-size: 11px; }
.empty-action small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.empty-action button { border: 0; color: var(--sage-ink); background: transparent; font-size: 9px; font-weight: 850; }
.secondary-summary { display: grid; grid-template-columns: 37px 1fr auto; align-items: center; gap: 10px; width: 100%; margin-top: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); text-align: left; }
.secondary-summary > span { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 12px; color: var(--sage-ink); background: var(--sage); font-size: 15px; font-weight: 900; }
.secondary-summary strong, .secondary-summary small { display: block; }
.secondary-summary strong { font-size: 10px; }
.secondary-summary small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.secondary-summary > b { color: var(--muted); }

.week-summary-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: 100%; min-height: 94px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); cursor: pointer; text-align: left; }
.week-summary-row > span { padding: 14px; }
.week-summary-row > span + span { border-left: 1px solid var(--line-soft); }
.week-summary-row strong, .week-summary-row small { display: block; }
.week-summary-row strong { font-size: 22px; letter-spacing: -.04em; }
.week-summary-row small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.week-summary-row > b { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 14px; border-top: 1px solid var(--line-soft); color: var(--sage-ink); font-size: 11px; }
.week-summary-row > b i { font-size: 18px; font-style: normal; }

.dashboard-request { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.dashboard-request div { min-width: 0; }
.dashboard-request div strong,
.dashboard-request div small { display: block; }
.dashboard-request div strong { font-size: 11px; }
.dashboard-request div small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-request > button { min-height: 32px; padding: 0 11px; border: 0; border-radius: 11px; color: white; background: var(--green); cursor: pointer; font-size: 8px; font-weight: 850; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  display: grid;
  width: min(calc(100% - 28px), 524px);
  min-height: 67px;
  padding: 6px;
  border: 1px solid rgba(34, 50, 42, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 38px rgba(32, 43, 37, 0.13);
  backdrop-filter: blur(20px);
  transform: translateX(-50%);
}

.nav-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 3px;
  border: 0;
  border-radius: 15px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}

.nav-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-button.active { color: var(--green); background: var(--sage); }
.nav-button.nav-main { align-self: center; height: 58px; margin: -17px 2px 0; border-radius: 19px; color: white; background: var(--green); box-shadow: 0 10px 22px rgba(38, 62, 52, 0.24); }
.nav-button.nav-main.active { color: white; background: var(--green); }
.nav-button.nav-main svg { width: 21px; height: 21px; }
.nav-button.nav-main span { font-size: 8px; }
.nav-badge { position: absolute; top: 5px; left: calc(50% + 5px); display: grid; min-width: 15px; height: 15px; padding: 0 4px; place-items: center; border: 2px solid white; border-radius: 99px; color: white; background: var(--red); font-size: 7px; }

.section-intro { margin-bottom: 18px; }
.section-intro p { max-width: 420px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.list { display: grid; gap: 10px; }
.list-card { padding: 15px; }
.list-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.list-card h3 { margin: 0; font-size: 14px; }
.list-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag, .status { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 99px; font-size: 9px; font-weight: 800; }
.tag { color: #59635c; background: #eef0eb; }
.status.pending { color: #785d16; background: var(--yellow); }
.status.confirmed { color: var(--sage-ink); background: var(--sage); }
.status.cancel { color: #90453f; background: #f6dedb; }

.student-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.student-row:last-child { border-bottom: 0; }
.student-avatar { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 14px; color: var(--blue-ink); background: var(--blue); font-size: 12px; font-weight: 900; }
.student-copy { flex: 1; min-width: 0; }
.student-copy strong, .student-copy span { display: block; }
.student-copy strong { font-size: 12px; }
.student-copy span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.telegram-pill { display: grid; min-width: 31px; height: 26px; place-items: center; border-radius: 10px; color: #237a9d; background: #e2f3fa; font-size: 8px; font-weight: 900; }

.parent-contact { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: #eef8fc; }
.telegram-avatar { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 15px; color: white; background: #2998c6; font-size: 18px; }
.parent-contact div { min-width: 0; }
.parent-contact div span,
.parent-contact div strong,
.parent-contact div small { display: block; }
.parent-contact div span { color: var(--muted); font-size: 8px; }
.parent-contact div strong { margin-top: 3px; font-size: 13px; }
.parent-contact div small { margin-top: 4px; color: #4d7e91; font-size: 8px; }
.telegram-button { min-height: 45px; margin-top: 8px; border: 0; border-radius: 14px; color: white; background: #2998c6; cursor: pointer; font-size: 11px; font-weight: 850; }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.metric { padding: 17px; }
.metric span, .metric strong { display: block; }
.metric span { color: var(--muted); font-size: 9px; }
.metric strong { margin-top: 8px; font-size: 22px; letter-spacing: -0.04em; }

.parent-hero { margin-bottom: 22px; }
.parent-hero h1 { max-width: 390px; margin: 8px 0 9px; font-size: 33px; line-height: 1; letter-spacing: -0.045em; }
.parent-hero p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.duration-select { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.duration-select button { min-width: 62px; }
.duration-select button { flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); font-size: 10px; font-weight: 800; cursor: pointer; }
.duration-select button.active { color: white; border-color: var(--green); background: var(--green); }

.slot-day { margin-bottom: 20px; }
.slot-day-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.slot-day-head h2 { margin: 0; font-size: 16px; }
.slot-day-head span { color: var(--muted); font-size: 9px; }
.slot-list { display: grid; gap: 8px; }
.slot-button { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 65px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); cursor: pointer; text-align: left; }
.slot-button > strong { font-size: 13px; }
.slot-button div strong, .slot-button div span { display: block; }
.slot-button div strong { font-size: 11px; }
.slot-button div span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.slot-button > span { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 10px; color: var(--sage-ink); background: var(--sage); font-size: 15px; }

.parent-topbar { margin-bottom: 24px; }
.parent-topbar h1 { font-size: 25px; }
.parent-nav .nav-button { min-width: 0; }
.parent-nav .nav-button span { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }

.parent-next-card {
  margin-bottom: 11px;
  padding: 20px;
  border-radius: 24px;
  color: white;
  background: var(--green);
  box-shadow: 0 15px 34px rgba(38, 62, 52, 0.18);
}
.parent-next-card.waiting { color: var(--ink); background: #f0e5b8; box-shadow: 0 15px 34px rgba(83, 67, 24, 0.1); }
.parent-next-card.empty { color: var(--ink); background: var(--blue); box-shadow: none; }
.parent-next-card > span { color: rgba(255,255,255,0.65); font-size: 9px; font-weight: 750; }
.parent-next-card.empty > span { color: var(--blue-ink); }
.parent-next-card > strong { display: block; margin-top: 11px; font-size: 19px; line-height: 1.2; letter-spacing: -0.025em; }
.parent-next-card > p { margin: 8px 0 17px; color: rgba(255,255,255,0.68); font-size: 10px; line-height: 1.55; }
.parent-next-card.waiting > p, .parent-next-card.empty > p { color: var(--muted); }
.parent-next-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.parent-next-head > span:first-child { color: rgba(255,255,255,0.62); font-size: 9px; font-weight: 750; }
.parent-next-card.waiting .parent-next-head > span:first-child { color: #766326; }
.parent-card-button { min-height: 39px; padding: 0 13px; border: 1px solid rgba(255,255,255,0.22); border-radius: 12px; color: white; background: rgba(255,255,255,0.08); cursor: pointer; font-size: 9px; font-weight: 850; }
.parent-card-button.primary { border-color: white; color: var(--green); background: white; }
.parent-next-card.waiting .parent-card-button { border-color: rgba(25,34,30,0.12); color: var(--ink); background: rgba(255,255,255,0.36); }
.parent-next-card.waiting .parent-card-button.primary { color: white; background: var(--green); }
.parent-next-card.empty .parent-card-button.primary { color: white; border-color: var(--green); background: var(--green); }

.parent-focus-card { margin-bottom: 12px; padding: 20px; border-radius: 25px; color: white; background: var(--green); box-shadow: 0 15px 36px rgba(38,62,52,.18); }
.parent-focus-card.waiting { color: var(--ink); background: #f5e7b7; box-shadow: 0 12px 28px rgba(91,70,15,.1); }
.parent-focus-card.empty { color: var(--ink); background: var(--blue); box-shadow: none; }
.focus-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.focus-card-head > span:first-child, .parent-focus-card.empty > span { color: rgba(255,255,255,.62); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.parent-focus-card.waiting .focus-card-head > span:first-child, .parent-focus-card.empty > span { color: var(--muted); }
.focus-date { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; }
.focus-date strong { font-size: 36px; line-height: 1; letter-spacing: -.055em; }
.focus-date span { color: rgba(255,255,255,.72); font-size: 11px; }
.parent-focus-card.waiting .focus-date span { color: #6f642e; }
.parent-focus-card h2 { margin: 14px 0 5px; font-size: 19px; }
.parent-focus-card.empty h2 { margin: 11px 0 7px; font-size: 23px; }
.parent-focus-card p { margin: 0 0 17px; color: rgba(255,255,255,.66); font-size: 11px; line-height: 1.45; }
.parent-focus-card.waiting p, .parent-focus-card.empty p { color: var(--muted); }
.parent-focus-card > button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 0 13px; border: 0; border-radius: 13px; color: white; background: rgba(255,255,255,.13); font-size: 10px; font-weight: 850; }
.parent-focus-card.waiting > button, .parent-focus-card.empty > button { color: white; background: var(--green); }
.parent-primary-action { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 69px; margin-bottom: 27px; padding: 11px 14px; border: 0; border-radius: 20px; color: white; background: var(--green); box-shadow: 0 10px 24px rgba(38,62,52,.14); text-align: left; }
.parent-primary-action > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; color: var(--green); background: var(--sage); font-size: 21px; }
.parent-primary-action strong, .parent-primary-action small { display: block; }
.parent-primary-action strong { font-size: 13px; }
.parent-primary-action small { margin-top: 4px; color: rgba(255,255,255,.65); font-size: 9px; }
.parent-primary-action > b { font-size: 19px; }
.all-bookings-link { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: -14px 0 25px; padding: 5px 2px; border: 0; color: var(--sage-ink); background: transparent; font-size: 10px; font-weight: 850; }
.hierarchy-section { margin-bottom: 25px; }
.hierarchy-section.secondary { opacity: .94; }
.quiet-empty { padding: 16px; border: 1px dashed var(--line); border-radius: 17px; color: var(--muted); background: rgba(255,255,255,.4); font-size: 10px; line-height: 1.45; }

.parent-quick-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 27px; }
.parent-quick-stats button { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; min-height: 62px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); cursor: pointer; text-align: left; }
.parent-quick-stats strong { font-size: 22px; letter-spacing: -0.04em; }
.parent-quick-stats span { color: var(--muted); font-size: 8px; line-height: 1.35; }

.parent-section { margin: 0 0 27px; }
.parent-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.parent-section-head h2 { margin: 4px 0 0; font-size: 17px; letter-spacing: -0.025em; }
.parent-section-head button { padding: 5px 0; border: 0; color: var(--sage-ink); background: transparent; cursor: pointer; font-size: 9px; font-weight: 850; }

.parent-how { padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,0.55); }
.parent-how > strong { display: block; margin-bottom: 13px; font-size: 13px; }
.parent-how > div, .help-steps > div { display: grid; grid-template-columns: 27px 1fr; align-items: start; gap: 10px; margin-top: 10px; }
.parent-how > div > span, .help-steps > div > span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 9px; color: var(--sage-ink); background: var(--sage); font-size: 8px; font-weight: 900; }
.parent-how p, .help-steps p { margin: 0; }
.parent-how b, .parent-how small, .help-steps strong, .help-steps small { display: block; }
.parent-how b, .help-steps strong { font-size: 10px; }
.parent-how small, .help-steps small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; }

.parent-hero.compact { margin-bottom: 16px; }
.parent-hero.compact h1 { margin-top: 0; font-size: 29px; }
.booking-intro { margin-bottom: 17px; }
.booking-intro > span { color: var(--sage-ink); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.booking-intro h1 { max-width: 360px; margin: 7px 0 8px; font-size: 30px; line-height: 1.03; letter-spacing: -.045em; }
.booking-intro p { max-width: 440px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.booking-preferences { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 11px; width: 100%; margin-bottom: 22px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-align: left; }
.booking-preferences > div { min-width: 0; }
.booking-preferences strong, .booking-preferences small { display: block; }
.booking-preferences strong { font-size: 11px; }
.booking-preferences small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.booking-preferences > b { color: var(--sage-ink); font-size: 9px; }
.available-dates { margin-bottom: 17px; padding: 13px 14px 1px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); overflow: hidden; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.section-label strong { font-size: 11px; }
.section-label button { border: 0; color: var(--sage-ink); background: transparent; font-size: 9px; font-weight: 850; }
.show-all-slots { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; margin: 7px 0 4px; padding: 0 15px; border: 1px solid var(--line); border-radius: 15px; color: var(--sage-ink); background: var(--surface); font-size: 10px; font-weight: 850; }
.parent-filter-card { margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); overflow: hidden; }
.reschedule-banner { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 11px; margin-bottom: 12px; padding: 12px; border-radius: 17px; background: #f5ecc7; }
.reschedule-banner > span { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 12px; color: #766326; background: rgba(255,255,255,0.55); font-size: 16px; }
.reschedule-banner p { margin: 0; }
.reschedule-banner strong, .reschedule-banner small { display: block; }
.reschedule-banner strong { font-size: 10px; }
.reschedule-banner small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.reschedule-banner button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 10px; background: rgba(255,255,255,0.55); cursor: pointer; }
.parent-filter-card > label, .form-section-label { display: block; margin: 2px 0 8px; color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: 0.065em; }
.parent-filter-card .duration-select { margin-bottom: 15px; }
.filter-scroll { display: flex; gap: 7px; margin: 0 -14px 15px; padding: 0 14px 2px; overflow-x: auto; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip { min-height: 35px; flex: 0 0 auto; padding: 0 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; font-size: 9px; font-weight: 750; white-space: nowrap; }
.filter-chip.active { color: white; border-color: var(--green); background: var(--green); }
.parent-result-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 1px 18px; }
.parent-result-line strong { font-size: 12px; }
.parent-result-line span { color: var(--muted); font-size: 8px; text-align: right; }

.slot-button { grid-template-columns: 57px 1fr auto; min-height: 73px; padding: 11px 12px; }
.slot-button.compact { min-height: 68px; }
.slot-button > .slot-time { display: block; width: auto; height: auto; color: var(--ink); background: transparent; }
.slot-button > .slot-copy { display: block; width: auto; height: auto; color: var(--ink); background: transparent; }
.slot-time strong, .slot-time small, .slot-copy strong, .slot-copy span, .slot-copy small { display: block; }
.slot-time strong { font-size: 14px; }
.slot-time small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.slot-copy { min-width: 0; }
.slot-copy strong, .slot-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-copy strong { font-size: 11px; }
.slot-copy span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.slot-copy small { margin-top: 5px; color: var(--sage-ink); font-size: 8px; font-weight: 800; }
.slot-button > .slot-arrow { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 11px; color: var(--sage-ink); background: var(--sage); font-size: 16px; }

.parent-empty { display: grid; justify-items: center; padding: 28px 20px; border: 1px dashed #cfd2ca; border-radius: 21px; text-align: center; }
.parent-empty > span { display: grid; width: 43px; height: 43px; place-items: center; margin-bottom: 12px; border-radius: 15px; color: var(--sage-ink); background: var(--sage); font-weight: 900; }
.parent-empty strong { font-size: 13px; }
.parent-empty p { max-width: 280px; margin: 6px 0 14px; color: var(--muted); font-size: 9px; line-height: 1.5; }

.booking-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 15px; background: #e8e8e2; }
.booking-tabs button { min-height: 39px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.booking-tabs button.active { color: var(--ink); background: white; box-shadow: 0 3px 10px rgba(33,43,37,0.08); }
.booking-tabs span { display: inline-grid; min-width: 20px; height: 20px; margin-left: 5px; padding: 0 5px; place-items: center; border-radius: 99px; background: rgba(83,103,69,0.12); font-size: 8px; }
.parent-booking-list { display: grid; gap: 9px; }
.parent-booking-card { display: grid; grid-template-columns: 49px 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 91px; padding: 13px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); cursor: pointer; text-align: left; }
.parent-booking-date { display: grid; min-height: 55px; place-content: center; border-radius: 14px; background: var(--surface-2); text-align: center; }
.parent-booking-date strong { font-size: 19px; letter-spacing: -0.04em; }
.parent-booking-date small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.parent-booking-copy { min-width: 0; }
.parent-booking-copy > strong, .parent-booking-copy > span:not(.status) { display: block; }
.parent-booking-copy > strong { margin-top: 7px; font-size: 12px; }
.parent-booking-copy > span:not(.status) { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.profile-identity { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 13px; margin-bottom: 26px; padding: 15px; border-radius: 21px; color: white; background: var(--green); }
.profile-identity > span { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 17px; color: var(--green); background: var(--sage); font-size: 17px; font-weight: 900; }
.profile-identity h2 { margin: 0; font-size: 17px; }
.profile-identity p { margin: 5px 0 0; color: rgba(255,255,255,0.63); font-size: 9px; }
.profile-identity > b { display: grid; min-width: 38px; height: 25px; padding: 0 7px; place-items: center; border-radius: 9px; color: var(--green); background: var(--sage); font-size: 7px; text-transform: uppercase; letter-spacing: 0.04em; }
.child-card { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.child-card strong, .child-card p, .child-card small { display: block; }
.child-card strong { font-size: 12px; }
.child-card p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.child-card small { margin-top: 5px; color: var(--sage-ink); font-size: 8px; }
.settings-card { padding: 2px 14px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.settings-card > button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 65px; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; cursor: pointer; text-align: left; }
.settings-card > button:last-child { border-bottom: 0; }
.settings-card strong, .settings-card small { display: block; }
.settings-card strong { font-size: 11px; }
.settings-card small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.switch { position: relative; width: 38px; height: 23px; flex: 0 0 auto; border-radius: 99px; background: #d9ddd6; transition: 160ms ease; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(20,30,24,0.18); content: ""; transition: 160ms ease; }
.switch.on { background: #78936c; }
.switch.on::after { transform: translateX(15px); }
.action-chevron { margin-left: auto; color: var(--muted); font-size: 16px; }

.booking-summary, .child-confirm, .warning-card, .booking-note { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; padding: 13px; border-radius: 17px; background: var(--surface-2); }
.booking-summary-icon { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: var(--sage-ink); background: var(--sage); }
.booking-summary div, .child-confirm div { flex: 1; min-width: 0; }
.booking-summary strong, .booking-summary p, .child-confirm small, .child-confirm strong { display: block; }
.booking-summary strong, .child-confirm strong { font-size: 11px; }
.booking-summary p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.booking-summary > b { color: var(--sage-ink); font-size: 9px; }
.start-time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 17px; }
.start-time-grid label { cursor: pointer; }
.start-time-grid input { position: absolute; opacity: 0; pointer-events: none; }
.start-time-grid span { display: grid; min-height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 10px; font-weight: 850; }
.start-time-grid input:checked + span { color: white; border-color: var(--green); background: var(--green); }
.child-confirm { margin-bottom: 13px; }
.child-confirm small { margin-bottom: 4px; color: var(--muted); font-size: 8px; }
.child-confirm > b { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 9px; color: var(--sage-ink); background: var(--sage); font-size: 9px; }
.optional { color: var(--muted); font-weight: 500; }
.booking-note { align-items: flex-start; padding: 12px; background: #edf3e7; }
.booking-note > span, .warning-card > span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: var(--sage-ink); background: var(--sage); font-size: 9px; font-weight: 900; }
.booking-note p, .warning-card p { margin: 0; }
.booking-note strong, .booking-note small, .warning-card strong, .warning-card small { display: block; }
.booking-note strong, .warning-card strong { font-size: 9px; }
.booking-note small, .warning-card small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.parent-submit { min-height: 49px; }

.booking-status-block { display: grid; gap: 9px; margin-bottom: 13px; padding: 14px; border-radius: 17px; background: var(--sage); }
.booking-status-block.pending { background: #f5ecc7; }
.booking-status-block.cancel { background: #f6e5e2; }
.booking-status-block > strong { font-size: 10px; line-height: 1.45; }
.pending-change { margin-bottom: 10px; padding: 13px 14px; border: 1px solid #ded19f; border-radius: 16px; background: #faf3d9; }
.pending-change span, .pending-change strong, .pending-change small { display: block; }
.pending-change span { color: #766326; font-size: 8px; font-weight: 850; }
.pending-change strong { margin-top: 6px; font-size: 11px; }
.pending-change small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.booking-detail-grid { display: grid; grid-template-columns: 65px 1fr; gap: 12px; margin-bottom: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; }
.booking-detail-grid > span { color: var(--muted); font-size: 9px; }
.booking-detail-grid > strong { font-size: 10px; text-align: right; }
.booking-detail-grid small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 500; }
.booking-actions { display: grid; gap: 8px; margin-top: 10px; }
.danger-link { min-height: 42px; border: 0; color: var(--red); background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.warning-card { align-items: flex-start; background: #f8ece9; }
.warning-card > span { color: var(--red); background: #f1d5d0; }
.help-steps { display: grid; gap: 8px; }
.help-steps > div { margin-top: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; }

.backdrop { position: fixed; z-index: 90; inset: 0; background: rgba(20, 29, 24, 0.36); backdrop-filter: blur(3px); }
.sheet { position: fixed; z-index: 100; right: 50%; bottom: 0; width: min(100%, 560px); max-height: 90vh; overflow: auto; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--surface); box-shadow: 0 -20px 60px rgba(26, 37, 31, 0.2); transform: translateX(50%); animation: rise 180ms ease-out; }
@keyframes rise { from { transform: translate(50%, 18px); opacity: 0; } }
.sheet-handle { width: 36px; height: 4px; margin: 0 auto 17px; border-radius: 99px; background: #d9dbd5; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.sheet-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.sheet-head p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.close-button { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 14px; background: #eeefeb; cursor: pointer; font-size: 19px; }

.sheet-summary { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin-bottom: 18px; padding: 14px; border-radius: 17px; background: var(--surface-2); font-size: 10px; }
.sheet-summary span { color: var(--muted); }
.sheet-summary strong { text-align: right; }

.primary-button,
.secondary-button,
.danger-button { min-height: 45px; padding: 0 15px; border-radius: 14px; cursor: pointer; font-size: 11px; font-weight: 850; }
.primary-button { border: 0; color: white; background: var(--green); }
.secondary-button { border: 1px solid var(--line); background: var(--surface); }
.danger-button { border: 0; color: var(--red); background: #f6e5e2; }
.full { width: 100%; }
.button-row { display: flex; gap: 8px; }
.button-row > * { flex: 1; }

.action-list { display: grid; gap: 8px; }
.action-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 61px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; text-align: left; }
.action-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: var(--sage); font-size: 16px; }
.action-option strong, .action-option span { display: block; }
.action-option strong { font-size: 11px; }
.action-option span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.action-icon.telegram { color: #237a9d; background: #e2f3fa; }
.integration-status { margin-left: auto; padding: 6px 8px; border-radius: 9px; color: #765f20; background: var(--yellow); font-size: 7px; }

.request-slot { padding: 15px; border-radius: 18px; color: white; background: var(--green); }
.request-slot span,
.request-slot strong,
.request-slot small { display: block; }
.request-slot span { color: rgba(255,255,255,0.65); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.request-slot strong { margin-top: 7px; font-size: 13px; }
.request-slot small { margin-top: 5px; color: rgba(255,255,255,0.7); font-size: 9px; }
.request-previous { margin-bottom: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.request-previous span, .request-previous strong, .request-previous small { display: block; }
.request-previous span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.request-previous strong { margin-top: 6px; font-size: 11px; }
.request-previous small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.request-comment { margin-top: 9px; padding: 12px 14px; border-radius: 15px; background: #eef3e9; }
.request-comment span { color: var(--sage-ink); font-size: 8px; font-weight: 850; }
.request-comment p { margin: 6px 0 0; font-size: 10px; line-height: 1.45; }
.request-context-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 19px 0 9px; }
.request-context-head h3 { margin: 0; font-size: 13px; }
.request-context-head span { color: var(--muted); font-size: 8px; }
.request-context { display: grid; gap: 6px; }
.request-context-event { display: grid; grid-template-columns: 62px 5px minmax(0,1fr); align-items: center; gap: 10px; min-height: 54px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.request-context-event > strong { font-size: 9px; }
.request-context-event > i { width: 5px; height: 31px; border-radius: 9px; background: var(--blue); }
.request-context-event.open > i { background: #a7b991; }
.request-context-event.group > i { background: #d3a68e; }
.request-context-event.personal > i { background: #d7c46c; }
.request-context-event div { min-width: 0; }
.request-context-event b,
.request-context-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-context-event b { font-size: 10px; }
.request-context-event span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.request-context-event.overlap { border-color: #bcc9ad; background: #f1f6eb; }
.request-decision { margin-top: 16px; }
.request-decision > p { margin: 0 0 10px; color: var(--muted); font-size: 9px; line-height: 1.45; }

.integration-card { display: grid; grid-template-columns: 35px 1fr; align-items: center; gap: 11px; margin-bottom: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; }
.integration-card > span { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 12px; color: var(--muted); background: #eeefeb; font-size: 11px; font-weight: 900; }
.integration-card.ready > span { color: var(--sage-ink); background: var(--sage); }
.integration-card strong,
.integration-card small { display: block; }
.integration-card strong { font-size: 10px; }
.integration-card small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.integration-note { margin: 15px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.field { display: grid; gap: 7px; margin-bottom: 13px; }
.field label { color: #556059; font-size: 9px; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; outline: none; color: var(--ink); background: var(--surface-2); font-size: 11px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #7d9187; box-shadow: 0 0 0 3px rgba(74, 99, 87, 0.1); }
.field textarea { min-height: 70px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.field.span-2 { grid-column: 1 / -1; }

.onboarding-shell { min-height: calc(100vh - 40px); padding: max(20px, env(safe-area-inset-top)) 2px 28px; }
.onboarding-brand { display: flex; align-items: center; gap: 11px; }
.onboarding-brand > span { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 15px; color: white; background: var(--green); font-size: 11px; font-weight: 900; }
.onboarding-brand b, .onboarding-brand small { display: block; }
.onboarding-brand b { font-size: 13px; }
.onboarding-brand small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.onboarding-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 25px 0 28px; }
.onboarding-progress i { height: 4px; border-radius: 99px; background: #dde0da; }
.onboarding-progress i:first-child,
.onboarding-progress i.active { background: var(--green); }
.onboarding-copy { margin-bottom: 24px; }
.onboarding-copy h1 { max-width: 330px; margin: 8px 0 9px; font-size: clamp(29px, 9vw, 40px); line-height: 1.02; letter-spacing: -0.055em; }
.onboarding-copy p { max-width: 410px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.onboarding-form { padding: 16px; border: 1px solid var(--line); border-radius: 23px; background: var(--surface); box-shadow: 0 15px 35px rgba(34,45,38,0.06); }
.onboarding-child-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 20px 0 13px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.onboarding-child-title span { font-size: 13px; font-weight: 900; }
.onboarding-child-title small { color: var(--muted); font-size: 9px; }
.consent-line { display: flex; align-items: flex-start; gap: 9px; margin: 3px 0 16px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.consent-line input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--green); }
.onboarding-submit { min-height: 51px; }
.primary-button:disabled { cursor: wait; opacity: 0.65; }

.booking-child-picker { margin-bottom: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.booking-child-picker > label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: 0.06em; }
.booking-child-picker > div { display: flex; gap: 7px; overflow-x: auto; }
.booking-child-picker button { display: flex; align-items: center; gap: 7px; min-height: 39px; flex: 0 0 auto; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); font-size: 10px; font-weight: 800; }
.booking-child-picker button span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 9px; background: var(--sage); }
.booking-child-picker button.active { color: white; border-color: var(--green); background: var(--green); }
.booking-child-picker button.active span { color: var(--green); background: white; }
.sheet-step { display: block; margin-bottom: 5px; color: var(--sage-ink); font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }

.parent-calendar-strip { display: grid; grid-template-columns: repeat(8, minmax(42px, 1fr)); gap: 5px; margin: 0 -14px 17px; padding: 0 14px 3px; overflow-x: auto; scrollbar-width: none; }
.parent-calendar-strip::-webkit-scrollbar { display: none; }
.parent-calendar-strip button { position: relative; display: grid; min-width: 43px; min-height: 62px; padding: 7px 4px 5px; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.parent-calendar-strip small { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.parent-calendar-strip strong { font-size: 14px; }
.parent-calendar-strip i { display: grid; min-width: 15px; height: 15px; padding: 0 3px; place-items: center; border-radius: 99px; color: transparent; font-size: 7px; font-style: normal; }
.parent-calendar-strip button.has-slots i { color: var(--sage-ink); background: var(--sage); }
.parent-calendar-strip button.active { color: white; border-color: var(--green); background: var(--green); }
.parent-calendar-strip button.active small { color: rgba(255,255,255,0.72); }
.parent-calendar-strip button.active i { color: var(--green); background: white; }

.children-list { display: grid; gap: 8px; }
.children-list .child-card { width: 100%; cursor: pointer; text-align: left; }
.children-list .child-card > div { flex: 1; }
.children-list .child-card > b { color: var(--muted); font-size: 18px; }

.preview-banner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; margin: -2px 0 14px; padding: 11px 12px; border: 1px solid #ded19f; border-radius: 15px; background: #faf3d9; }
.demo-banner { display: flex; align-items: center; gap: 9px; margin: -2px 0 14px; padding: 10px 12px; border: 1px solid #cbd6e0; border-radius: 15px; color: var(--blue-ink); background: #edf4f9; font-size: 9px; line-height: 1.35; }
.demo-banner strong { flex: 0 0 auto; }
.student-search { margin-bottom: 12px; }
.student-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.student-section-head > div { min-width: 0; }
.student-section-head > button { flex: 0 0 auto; padding-inline: 12px; }
.student-copy small { display: block; margin-top: 4px; overflow: hidden; color: var(--sage-ink); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.telegram-pill.muted { color: var(--sage-ink); background: var(--sage); }

.student-picker-list { display: grid; max-height: 222px; margin-top: 2px; overflow-y: auto; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.student-picker-option { display: grid; grid-template-columns: 34px minmax(0,1fr) 20px; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.student-picker-option:last-child { border-bottom: 0; }
.student-picker-option > span:nth-child(2) { min-width: 0; }
.student-picker-option strong, .student-picker-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-picker-option strong { font-size: 10px; }
.student-picker-option small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.student-picker-option > b { visibility: hidden; color: var(--green); }
.student-picker-option.active { background: #eef3e9; }
.student-picker-option.active > b { visibility: visible; }
.create-inline { min-height: 42px; margin-top: 7px; border: 1px dashed #b9c5b0; border-radius: 13px; color: var(--sage-ink); background: #f1f5ed; cursor: pointer; font-size: 9px; font-weight: 850; }

.link-requests { margin-bottom: 17px; padding: 15px; border: 1px solid #d9c88e; border-radius: 20px; background: #fbf4dc; }
.link-requests h2 { margin: 5px 0 10px; font-size: 17px; }
.link-requests > button { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 8px; border: 0; border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.72); cursor: pointer; text-align: left; }
.link-requests > button span:nth-child(2) { min-width: 0; }
.link-requests strong, .link-requests small { display: block; }
.link-requests strong { font-size: 10px; }
.link-requests small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.link-requests b { color: #755e1a; font-size: 8px; }
.link-attention .attention-icon { font-size: 8px; }
.parent-contact.unlinked { background: #f6f2e6; }
.invite-safe { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 11px; margin-bottom: 12px; padding: 13px; border-radius: 16px; background: #eef3e9; }
.invite-safe > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: white; }
.invite-safe strong, .invite-safe small { display: block; }
.invite-safe strong { font-size: 10px; }
.invite-safe small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.invite-link { margin-bottom: 10px; padding: 11px; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: var(--surface-2); font-size: 8px; line-height: 1.45; }
.link-review { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 11px; margin-bottom: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; }
.link-review span:not(.student-avatar):not(.telegram-avatar), .link-review strong, .link-review small { display: block; }
.link-review span:not(.student-avatar):not(.telegram-avatar) { color: var(--muted); font-size: 8px; }
.link-review strong { margin-top: 3px; font-size: 11px; }
.link-review small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.student-upcoming { margin: 14px 0; padding: 13px; border-radius: 16px; background: var(--surface-2); }
.student-upcoming > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 9px; }
.student-upcoming strong { font-size: 9px; }
.student-upcoming div span { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.link-pending-shell { display: grid; align-content: start; }
.link-pending-card { margin-top: 38px; padding: 26px 20px; border: 1px solid var(--line); border-radius: 25px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.link-pending-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 17px; place-items: center; border-radius: 20px; color: white; background: var(--green); font-size: 22px; font-weight: 900; }
.link-pending-card h1 { margin: 8px 0 10px; font-size: 27px; }
.link-pending-card p { margin: 0 0 20px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.preview-banner span { color: #766326; font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: 0.06em; }
.preview-banner strong { grid-column: 1; font-size: 11px; }
.preview-banner button { grid-row: 1 / span 2; grid-column: 2; min-height: 34px; padding: 0 11px; border: 0; border-radius: 11px; color: #574817; background: rgba(255,255,255,0.72); cursor: pointer; font-size: 9px; font-weight: 850; }

.admin-switcher { margin-bottom: 20px; padding: 16px; border-radius: 22px; color: white; background: var(--green); }
.admin-switcher h2 { margin: 7px 0 5px; font-size: 18px; }
.admin-switcher p { margin: 0; color: rgba(255,255,255,0.64); font-size: 9px; line-height: 1.45; }
.admin-switcher .overline { color: rgba(255,255,255,0.58); }
.admin-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.admin-profile-grid button { display: grid; min-width: 0; padding: 12px; border: 1px solid rgba(255,255,255,0.14); border-radius: 16px; color: white; background: rgba(255,255,255,0.08); cursor: pointer; text-align: left; }
.admin-profile-grid button > span { display: grid; width: 34px; height: 34px; margin-bottom: 10px; place-items: center; border-radius: 11px; color: var(--green); background: var(--sage); font-size: 9px; font-weight: 900; }
.admin-profile-grid strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.admin-profile-grid small { margin-top: 4px; color: rgba(255,255,255,0.6); font-size: 8px; }

.toast { position: fixed; z-index: 200; top: max(16px, env(safe-area-inset-top)); left: 50%; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px; color: white; background: var(--green); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, -10px); transition: 160ms ease; font-size: 10px; font-weight: 800; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
[hidden] { display: none !important; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(67, 95, 115, 0.28); outline-offset: 2px; }

body[data-app="parent"] .overline { font-size: 12px; }
body[data-app="parent"] .parent-next-card > span,
body[data-app="parent"] .parent-next-head > span:first-child { font-size: 11px; }
body[data-app="parent"] .parent-next-card > p { font-size: 12px; }
body[data-app="parent"] .parent-card-button { min-height: 44px; font-size: 11px; }
body[data-app="parent"] .parent-quick-stats span { font-size: 10px; }
body[data-app="parent"] .parent-section-head button { min-height: 44px; font-size: 11px; }
body[data-app="parent"] .parent-how b,
body[data-app="parent"] .help-steps strong { font-size: 12px; }
body[data-app="parent"] .parent-how small,
body[data-app="parent"] .help-steps small { font-size: 10px; }
body[data-app="parent"] .filter-chip { min-height: 42px; font-size: 11px; }
body[data-app="parent"] .parent-result-line strong { font-size: 14px; }
body[data-app="parent"] .parent-result-line span,
body[data-app="parent"] .slot-day-head span { font-size: 10px; }
body[data-app="parent"] .slot-time small,
body[data-app="parent"] .slot-copy span,
body[data-app="parent"] .slot-copy small { font-size: 10px; }
body[data-app="parent"] .slot-copy strong { font-size: 13px; }
body[data-app="parent"] .parent-booking-copy > strong { font-size: 14px; }
body[data-app="parent"] .parent-booking-copy > span:not(.status),
body[data-app="parent"] .parent-booking-date small,
body[data-app="parent"] .child-card p,
body[data-app="parent"] .child-card small,
body[data-app="parent"] .settings-card small { font-size: 10px; }
body[data-app="parent"] .settings-card strong,
body[data-app="parent"] .child-card strong { font-size: 13px; }
body[data-app="parent"] .duration-select button,
body[data-app="parent"] .booking-tabs button { min-height: 44px; font-size: 11px; }

@media (min-width: 700px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100vh - 48px); border-radius: 30px; }
  .bottom-nav { bottom: 34px; }
  .sheet { bottom: 24px; border-radius: 26px; }
}

@media (max-width: 699px) {
  .app-shell { min-height: 100dvh; padding: max(14px, env(safe-area-inset-top)) 14px calc(104px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 16px; }
  .topbar h1, .page-title { font-size: 27px; }
  .overline { font-size: 12px; line-height: 1.35; }
  .demo-banner { margin-bottom: 12px; padding: 11px 12px; font-size: 11px; }
  .demo-banner span { line-height: 1.35; }
  .dashboard-hero { padding: 18px; border-radius: 22px; }
  .dashboard-hero-top span, .section-kicker { font-size: 10px; }
  .dashboard-hero-top h2 { font-size: 22px; }
  .dashboard-hero > p { font-size: 13px; line-height: 1.45; }
  .dashboard-hero > button { min-height: 48px; padding-inline: 14px; font-size: 13px; }
  .dashboard-section { margin-bottom: 24px; }
  .dashboard-section-head { margin-bottom: 11px; }
  .dashboard-section-head h2 { font-size: 18px; }
  .dashboard-section-head button { min-height: 44px; padding: 0 4px; font-size: 12px; }
  .today-agenda > button { min-height: 72px; padding: 11px 12px; }
  .agenda-time { font-size: 14px; }
  .agenda-time small { font-size: 10px; }
  .agenda-copy strong { font-size: 14px; }
  .agenda-copy small { font-size: 11px; }
  .today-agenda > button > b { font-size: 9px; }
  .empty-action { grid-template-columns: 40px minmax(0,1fr); }
  .empty-action strong { font-size: 13px; }
  .empty-action small { font-size: 11px; line-height: 1.4; }
  .empty-action button { grid-column: 2; min-height: 44px; justify-self: start; font-size: 12px; }
  .week-summary-row small { font-size: 11px; }
  .week-summary-row > b { min-height: 48px; font-size: 12px; }
  .calendar-toolbar {
    position: sticky;
    top: 0;
    width: calc(100% + 28px);
    margin: -4px -14px 12px;
    padding: 6px 14px 11px;
    background: rgba(243, 242, 237, 0.96);
    box-shadow: 0 8px 18px rgba(32, 43, 37, 0.055);
    backdrop-filter: blur(16px);
  }
  .calendar-toolbar .calendar-controls { margin-bottom: 12px; }
  .calendar-toolbar .period-row { margin-bottom: 0; flex-wrap: wrap; }
  .calendar-toolbar .period-actions { margin-left: auto; }
  .calendar-now-line time { min-width: 32px; height: 20px; top: -11px; font-size: 8px; padding: 0 3px; }
  .month-now-clock { margin-left: -1px; font-size: 8px; }
  .calendar-toolbar .today-button { min-height: 44px; font-size: 12px; }
  .calendar-toolbar .segment button { min-height: 44px; font-size: 12px; }
  .sheet-head p, .sheet-summary { font-size: 12px; }
  .period-row h2 { font-size: 18px; }
  .calendar-live-clock { min-height: 36px; padding-inline: 9px; }
  .calendar-clock-caption, .calendar-clock-zone { display: none; }
  .period-arrows { gap: 8px; }
  .icon-button { width: 44px; height: 44px; border-radius: 14px; font-size: 20px; }
  .mobile-week-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 12px; padding: 4px; border: 1px solid var(--line); border-radius: 15px; background: #e9e9e4; }
  .mobile-week-mode button { min-height: 44px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 850; }
  .mobile-week-mode button.active { color: var(--ink); background: white; box-shadow: 0 2px 9px rgba(30, 42, 35, 0.08); }
  .legend { gap: 12px; margin-bottom: 12px; overflow-x: auto; font-size: 11px; white-space: nowrap; }
  .legend i { width: 10px; height: 10px; }
  .desktop-week-hint { display: none; }
  .mobile-week-hint { display: block; margin: 0 0 12px; font-size: 12px; line-height: 1.45; }
  .mobile-week-overview.is-active { display: grid; gap: 8px; }
  .week-timeline { display: none; }
  .week-timeline.mobile-active { display: block; }
  .week-timeline::after { display: none; }
  .week-timeline .calendar-scroll { width: 100%; overflow-x: hidden; }
  .week-timeline .week-head,
  .week-timeline .week-grid { grid-template-columns: 30px repeat(7, minmax(0, 1fr)); width: 100%; min-width: 0; }
  .week-timeline .week-head { padding: 9px 2px 8px; }
  .week-timeline .week-head span { font-size: 8px; }
  .week-timeline .week-head strong { font-size: 12px; }
  .week-timeline .week-head .is-today strong { width: 23px; height: 23px; }
  .week-timeline .week-grid { grid-template-rows: repeat(24, 22px); padding: 10px 2px 18px; }
  .week-timeline .week-grid::before { inset: 10px 2px 18px 32px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 43px, var(--line-soft) 43px, var(--line-soft) 44px), repeating-linear-gradient(to right, transparent 0, transparent calc(14.2857% - 1px), var(--line-soft) calc(14.2857% - 1px), var(--line-soft) 14.2857%); }
  .week-timeline .hour { padding-left: 2px; font-size: 8px; transform: translateY(-4px); }
  .week-timeline .calendar-event { margin: 1px; padding: 3px 2px; border-radius: 6px; }
  .week-timeline .calendar-event.open { touch-action: pan-y; }
  .week-timeline .calendar-event.open .resize-handle { touch-action: none; }
  .week-timeline .calendar-event strong { font-size: 8px; line-height: 1.1; }
  .week-timeline .calendar-event span { display: none; }
  .week-timeline .calendar-event small { display: block; margin-top: 3px; font-size: 7px; }
  .week-timeline .calendar-event em { display: none; }
  .week-timeline .resize-handle { height: 6px; }
  .mobile-week-day { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 6px 18px rgba(31, 42, 36, 0.035); }
  .mobile-week-day.is-today { border-color: #a9b99c; box-shadow: 0 0 0 2px rgba(126, 151, 105, 0.1); }
  .mobile-week-day-head { display: grid; grid-template-columns: 32px 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 68px; padding: 10px 12px; border: 0; background: transparent; cursor: pointer; text-align: left; }
  .mobile-week-day-head > span { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
  .mobile-week-day-head > strong { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: var(--surface-2); font-size: 16px; }
  .mobile-week-day.is-today .mobile-week-day-head > strong { color: white; background: var(--green); }
  .mobile-week-day-head > div { min-width: 0; }
  .mobile-week-day-head b, .mobile-week-day-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-week-day-head b { font-size: 13px; }
  .mobile-week-day-head small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .mobile-week-day-head > em { color: #a2a9a4; font-size: 17px; font-style: normal; }
  .mobile-week-events { display: grid; gap: 1px; padding: 0 7px 7px; }
  .mobile-week-events > button { display: grid; grid-template-columns: 48px 5px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 62px; padding: 9px 10px; border: 0; border-top: 1px solid var(--line-soft); background: transparent; cursor: pointer; text-align: left; }
  .mobile-week-time { font-size: 13px; font-weight: 900; }
  .mobile-week-time small, .mobile-week-copy strong, .mobile-week-copy small { display: block; }
  .mobile-week-time small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
  .mobile-week-events > button > i { width: 5px; height: 31px; border-radius: 99px; background: var(--blue); }
  .mobile-week-events > button > i.open { background: #9fb785; }
  .mobile-week-events > button > i.group { background: #d19c7d; }
  .mobile-week-events > button > i.personal { background: #d7c46c; }
  .mobile-week-copy { min-width: 0; }
  .mobile-week-copy strong, .mobile-week-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-week-copy strong { font-size: 13px; }
  .mobile-week-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
  .mobile-week-events > button > b { padding: 5px 7px; border-radius: 8px; color: #80651f; background: #fbf1cf; font-size: 9px; text-transform: uppercase; }
  .mobile-week-events > button > em { color: #a2a9a4; font-size: 15px; font-style: normal; }
  .bottom-nav { bottom: 0; width: min(100%, 560px); min-height: calc(76px + env(safe-area-inset-bottom)); padding: 7px 8px max(7px, env(safe-area-inset-bottom)); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 22px 22px 0 0; background: rgba(255,255,255,.98); }
  .nav-button { min-height: 58px; font-size: 11px; }
  .nav-button span { font-size: 11px; }
  .nav-button svg { width: 22px; height: 22px; }
  .nav-badge { top: 4px; min-width: 18px; height: 18px; font-size: 9px; }
  .fab { right: 14px; bottom: calc(88px + env(safe-area-inset-bottom)); min-height: 48px; font-size: 12px; }
}

@media (max-width: 380px) {
  .app-shell { padding-inline: 14px; }
  .calendar-toolbar { width: calc(100% + 28px); margin-inline: -14px; padding-inline: 14px; }
  .calendar-controls { align-items: center; flex-direction: row; }
  .segment { max-width: none; }
  .today-button { align-self: auto; padding-inline: 10px; }
  .segment button { padding-inline: 6px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .fab { right: 16px; }
  .attention-card { grid-template-columns: 38px 1fr; }
  .attention-card > button:not(.attention-link) { grid-column: 2; justify-self: start; }
  .attention-link { grid-column: 2; }
  .focus-date { align-items: flex-start; flex-direction: column; gap: 5px; }
}

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


