:root {
  color-scheme: light;
  --ink: #18352a;
  --ink-soft: #49605a;
  --muted: #778984;
  --line: #e1e8e5;
  --green: #2e6a4c;
  --lime: #c8ee65;
  --lime-strong: #b8e64e;
  --pale-green: #f1f9e9;
  --surface-soft: #f7faf8;
  --danger: #a34e42;
  --shadow: 0 18px 54px rgb(16 42 33 / 15%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
  background: #fff;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #fff; }
body { overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgb(119 171 45 / 42%);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.storage-status { display: grid; min-height: 100dvh; place-items: center; padding: 24px; color: var(--ink-soft); font-size: 14px; text-align: center; }
.storage-status-error { color: var(--danger); line-height: 1.7; }

.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 820px);
  height: 100dvh;
  min-height: 520px;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: max(11px, env(safe-area-inset-top)) 28px 10px;
}
.brand-button, .date-button {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.brand-button { gap: 8px; padding: 4px 0; font-size: clamp(18px, 5.2vw, 25px); font-weight: 760; letter-spacing: -.055em; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; fill: none; stroke: var(--lime-strong); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.brand-mark .brand-shuttle { fill: var(--lime-strong); stroke: none; }
.date-button { gap: 10px; padding: 9px 12px; color: var(--ink-soft); font-size: 14px; font-weight: 560; border: 1px solid var(--line); border-radius: 13px; }
.date-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.main-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 28px 28px;
  scrollbar-width: thin;
  scrollbar-color: #d5e1dc transparent;
}
.page-section { width: 100%; max-width: 740px; margin: 0 auto; }
.page-title { margin: 0 0 20px; color: var(--ink); font-size: clamp(29px, 8vw, 39px); line-height: 1.16; font-weight: 760; letter-spacing: -.055em; }
.page-title-row { display: flex; align-items: baseline; justify-content: space-between; }
.quiet-count { color: var(--muted); font-size: 14px; }

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  margin: 0 0 22px;
  border-radius: 17px;
  background: #f2f5f3;
}
.mode-switch button {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 620;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.mode-switch button[aria-selected="true"] { background: var(--lime); color: var(--ink); }

.period-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; margin-bottom: 18px; }
.period-main { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; }
.period-title { min-width: 0; color: var(--ink); font-size: 21px; line-height: 1.2; font-weight: 730; letter-spacing: -.035em; }
.period-summary { flex: 0 0 auto; color: var(--ink-soft); font-size: 13px; font-weight: 560; white-space: nowrap; }
.period-controls { display: inline-flex; gap: 4px; }
.month-toolbar { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 6px; }
.month-toolbar .period-title { text-align: center; }
.period-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.period-arrow:hover { background: var(--surface-soft); }
.period-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.agenda-list { display: flex; flex-direction: column; gap: 12px; padding: 2px 0 12px; }
.agenda-row { display: grid; grid-template-columns: 59px 15px minmax(0, 1fr); align-items: stretch; column-gap: 11px; min-height: 104px; }
.lesson-stack { position: relative; display: flex; min-width: 0; flex-direction: column; align-items: stretch; }
.lesson-item.has-confirm-action { padding-right: 42px; padding-bottom: 50px; }
.lesson-quick-action { position: absolute; z-index: 2; right: 10px; bottom: 10px; min-height: 30px; padding: 0 9px; border: 1px solid #dce8d3; border-radius: 10px; background: #fff; color: var(--green); font-size: 11px; font-weight: 650; cursor: pointer; }
.lesson-quick-action:hover { border-color: #b8d59d; background: #f8fcf4; }
.agenda-time { padding-top: 17px; color: var(--ink); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.025em; white-space: nowrap; }
.timeline-mark { position: relative; display: flex; justify-content: center; padding-top: 24px; }
.timeline-mark::after { position: absolute; top: 34px; bottom: -17px; width: 1px; background: #d9e2de; content: ""; }
.agenda-row:last-child .timeline-mark::after { display: none; }
.timeline-dot { z-index: 1; width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: var(--lime-strong); box-shadow: 0 0 0 1px var(--lime-strong); }
.timeline-dot.is-done { background: #9aaca5; box-shadow: 0 0 0 1px #9aaca5; }
.timeline-dot.is-cancelled { background: #fff; box-shadow: 0 0 0 1px #b4c1bc; }
.lesson-item {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 15px 42px 14px 17px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--pale-green);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, background-color 150ms ease;
}
.lesson-item:hover { border-color: #d6e9c5; transform: translateY(-1px); }
.lesson-item.is-cancelled { background: #f6f7f6; color: var(--muted); }
.lesson-head { display: flex; min-width: 0; align-items: center; justify-content: flex-start; gap: 8px; padding-right: 2px; }
.lesson-name { overflow: hidden; color: var(--ink); font-size: 18px; font-weight: 720; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.lesson-item.is-cancelled .lesson-name { color: var(--muted); text-decoration: line-through; }
.lesson-status { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.lesson-type-badge { flex: 0 0 auto; padding: 3px 7px; border-radius: 7px; background: #e4f1d6; color: var(--green); font-size: 10px; font-weight: 700; }
.lesson-meta { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.lesson-coach { display: block; margin-top: 4px; color: var(--green); font-size: 11px; line-height: 1.4; }
.lesson-participants { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.lesson-place { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: #647872; font-size: 12px; }
.lesson-place svg { width: 15px; height: 15px; fill: none; stroke: var(--green); stroke-width: 1.5; }
.lesson-chevron { position: absolute; top: 50%; right: 15px; width: 17px; height: 17px; fill: none; stroke: #61766e; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: translateY(-50%); }

.free-slot {
  position: relative;
  display: block;
  width: 100%;
  min-height: 69px;
  padding: 15px 16px;
  border: 1px dashed #d3dfd9;
  border-radius: 17px;
  background: #fff;
  color: #748681;
  font-size: 16px;
  font-weight: 620;
  text-align: left;
  cursor: pointer;
}
.free-slot:hover { border-color: #aacb8d; background: #fbfdf9; }
.free-slot .slot-time { display: inline-block; width: 59px; margin-right: 26px; color: var(--ink-soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.free-slot .lesson-chevron { right: 15px; }
.empty-state { padding: 38px 16px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 16px; }

.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin: 2px 0 22px; }
.week-day {
  min-width: 0;
  padding: 9px 2px 8px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
}
.week-day .day-name { display: block; color: var(--muted); font-size: 11px; }
.week-day .day-number { display: grid; width: 34px; height: 34px; margin: 5px auto 3px; place-items: center; border-radius: 50%; color: var(--ink); font-size: 15px; font-weight: 630; font-variant-numeric: tabular-nums; }
.week-day .day-dots { display: flex; min-height: 7px; justify-content: center; gap: 3px; }
.day-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--lime-strong); }
.week-day.is-selected .day-number { background: var(--lime); }
.week-day.is-today .day-number { box-shadow: inset 0 0 0 1px #a8d948; }
.selected-day-heading { margin: 20px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink); font-size: 19px; font-weight: 700; }
.selected-day-heading small { margin-left: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }

.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { margin-bottom: 7px; }
.calendar-weekdays span { padding: 4px 0; color: var(--muted); font-size: 12px; text-align: center; }
.calendar-grid { gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--line); }
.calendar-day {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 7px 1px 5px;
  border: 0;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.calendar-day.outside { color: #aeb9b5; }
.calendar-day.is-selected::before { position: absolute; top: 4px; width: 31px; height: 31px; border-radius: 50%; background: var(--lime); content: ""; }
.calendar-day .day-number { z-index: 1; font-size: 14px; line-height: 21px; font-weight: 610; font-variant-numeric: tabular-nums; }
.calendar-day .day-dots { display: flex; height: 6px; gap: 3px; }
.calendar-day .day-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--lime-strong); }
.calendar-day.is-selected .day-number { font-weight: 780; }
.calendar-day.is-today:not(.is-selected) .day-number { text-decoration: underline; text-decoration-color: var(--lime-strong); text-decoration-thickness: 2px; text-underline-offset: 4px; }

.month-summary { display: flex; align-items: center; margin: 12px 0 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.month-summary-cell { display: flex; min-width: 0; align-items: baseline; gap: 7px; padding-right: 14px; }
.month-summary-cell + .month-summary-cell { padding-left: 14px; border-left: 1px solid var(--line); }
.month-summary-cell:first-child { border-right: 0; }
.month-summary .summary-label { font-size: 11px; white-space: nowrap; }
.month-summary .summary-value { display: inline; margin: 0; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.month-summary .summary-value small { font-size: 11px; }
.summary-label { display: block; color: var(--muted); font-size: 12px; }
.summary-value { display: block; margin-top: 3px; color: var(--ink); font-size: 25px; line-height: 1.2; font-weight: 760; letter-spacing: -.045em; }
.summary-value small { margin-left: 4px; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.month-agenda .agenda-row { grid-template-columns: 58px minmax(0, 1fr); min-height: 61px; padding: 3px 0; border-top: 1px solid var(--line); }
.month-agenda .agenda-time { align-self: center; padding-top: 0; font-size: 13px; }
.month-agenda .lesson-stack { justify-content: center; }
.month-agenda .month-lesson-item { display: grid; grid-template-columns: minmax(0, 1fr) 16px; align-items: center; gap: 8px; min-height: 54px; padding: 7px 3px 7px 10px; border: 0; border-radius: 11px; background: transparent; }
.month-agenda .month-lesson-item:hover { border-color: transparent; background: var(--surface-soft); transform: none; }
.month-agenda .month-lesson-copy { display: block; min-width: 0; }
.month-agenda .month-lesson-head { display: flex; min-width: 0; align-items: center; gap: 7px; }
.month-agenda .month-lesson-title { min-width: 0; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.month-agenda .is-cancelled .month-lesson-title { color: var(--muted); text-decoration: line-through; }
.month-agenda .month-lesson-status { flex: 0 0 auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.month-agenda .month-lesson-meta { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.month-agenda .lesson-chevron { position: static; width: 15px; height: 15px; transform: none; }

.search-field { display: flex; align-items: center; gap: 10px; height: 47px; padding: 0 14px; margin: 1px 0 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.search-field svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: #71827d; stroke-width: 1.8; stroke-linecap: round; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.search-field input::placeholder { color: #91a09b; }
.student-filters { display: flex; gap: 8px; margin: -6px 0 14px; overflow-x: auto; padding: 1px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.student-filters::-webkit-scrollbar { display: none; }
.student-filter { flex: 0 0 auto; min-height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 600; cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; }
.student-filter.is-active { border-color: var(--green); background: var(--green); color: #fff; }
.student-list { display: flex; flex-direction: column; gap: 11px; }
.student-row { display: block; width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 3px 11px rgb(25 54 40 / 3%); transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease; }
.student-row:hover { border-color: #c9d9c8; box-shadow: 0 7px 19px rgb(25 54 40 / 7%); transform: translateY(-1px); }
.student-card-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.student-card-open:hover .student-name { color: var(--green); }
.student-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.student-main { display: flex; min-width: 0; align-items: center; gap: 12px; }
.student-avatar { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--pale-green); color: var(--green); font-size: 16px; font-weight: 720; }
.student-identity { display: block; min-width: 0; }
.student-phone { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.student-name { display: block; overflow: hidden; color: var(--ink); font-size: 16px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.student-subtitle { display: flex; align-items: center; gap: 7px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.student-type-pill { display: inline-flex; width: fit-content; align-items: center; padding: 3px 8px; border-radius: 20px; background: var(--pale-green); color: var(--green); font-size: 11px; font-weight: 650; line-height: 1.3; }
.student-chevron { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: #8a9b93; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.student-balance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 14px; }
.student-balance-grid > span { display: block; min-width: 0; padding: 9px 10px; border-radius: 12px; background: var(--surface-soft); }
.student-balance-grid small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.student-balance-grid strong { display: block; color: var(--ink); font-size: 17px; font-weight: 720; font-variant-numeric: tabular-nums; }
.student-balance-grid strong i { margin-left: 3px; color: var(--muted); font-size: 10px; font-style: normal; font-weight: 550; }
.student-balance-grid .balance-negative { color: var(--danger); }
.student-card-actions { display: flex; justify-content: flex-end; margin-top: 9px; }
.student-buy-button { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 4px; padding: 0 11px; border: 0; border-radius: 11px; background: var(--pale-green); color: var(--green); font-size: 12px; font-weight: 680; cursor: pointer; transition: background-color 140ms ease, transform 140ms ease; }
.student-buy-button:hover { background: #e3f0d8; }
.student-buy-button:active { transform: scale(.98); }
.student-buy-button > span { font-size: 16px; line-height: 1; }
.student-count { flex: 0 0 auto; color: var(--muted); font-size: 12px; text-align: right; }
.student-count strong { display: block; color: var(--ink-soft); font-size: 15px; font-weight: 640; }
.student-count .balance-negative, .student-detail-stat .balance-negative { color: var(--danger); }

.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 21px; }
.stat-panel { padding: 16px 15px; border-radius: 18px; background: var(--pale-green); }
.stat-panel .summary-value { font-size: 29px; }
.stat-panel.secondary { background: #f6f8f7; }
.chart-section { margin: 0 0 23px; padding: 18px 14px 14px; border: 1px solid var(--line); border-radius: 18px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; color: var(--ink); font-size: 16px; font-weight: 700; }
.section-heading small { color: var(--muted); font-size: 12px; font-weight: 500; }
.hours-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; min-height: 129px; }
.bar-column { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.bar-value { color: var(--ink-soft); font-size: 10px; font-variant-numeric: tabular-nums; }
.bar-track { display: flex; width: min(24px, 80%); height: 78px; align-items: flex-end; overflow: hidden; border-radius: 9px 9px 5px 5px; background: #f1f5f2; }
.bar-fill { width: 100%; min-height: 3px; border-radius: 9px 9px 4px 4px; background: var(--lime-strong); }
.record-list { border-top: 1px solid var(--line); }
.record-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.record-time { color: var(--ink-soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.record-student { color: var(--ink); font-size: 14px; font-weight: 650; }
.record-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.record-duration { color: var(--ink-soft); font-size: 13px; }

.settings-list { margin-top: 3px; border-top: 1px solid var(--line); }
.settings-group-label { margin: 21px 0 8px; color: var(--muted); font-size: 12px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); }
.settings-link-row { width: 100%; padding: 10px 0; border-top: 0; border-right: 0; border-left: 0; background: transparent; text-align: left; cursor: pointer; }
.settings-link-row > span:first-child { display: grid; gap: 4px; }
.settings-link-row strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.settings-link-row small { color: var(--muted); font-size: 12px; }
.settings-link-arrow { color: var(--muted); font-size: 24px; line-height: 1; }
.settings-row label, .settings-row .settings-label { color: var(--ink); font-size: 15px; font-weight: 580; }
.settings-row input { width: 48%; min-width: 80px; border: 0; background: transparent; color: var(--ink-soft); text-align: right; }
.settings-row select { width: min(58%, 240px); min-width: 150px; min-height: 40px; padding: 0 29px 0 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink-soft); font-size: 13px; text-align: right; }
.completion-settings-row { align-items: stretch; flex-direction: column; gap: 10px; padding: 14px 0; }
.completion-settings-row .settings-label { align-self: flex-start; }
.completion-switch { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 15px; background: #f2f5f3; }
.completion-switch-option { min-width: 0; min-height: 42px; padding: 0 10px; border: 0; border-radius: 11px; background: transparent; color: var(--ink-soft); font-size: 13px; font-weight: 620; cursor: pointer; transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease; }
.completion-switch-option[aria-pressed="true"] { background: var(--lime); color: var(--ink); box-shadow: 0 1px 3px rgb(24 53 42 / 10%); }
.completion-switch-option:focus-visible { position: relative; z-index: 1; }
.text-action { padding: 9px 0 9px 12px; border: 0; background: transparent; color: var(--green); font-size: 14px; font-weight: 650; cursor: pointer; }
.text-action.danger { color: var(--danger); }
.text-action:disabled { color: var(--muted); cursor: not-allowed; opacity: .72; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.settings-note { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.dictionary-back { display: inline-flex; align-items: center; min-height: 38px; padding: 0 8px 0 0; margin: -10px 0 12px; border: 0; background: transparent; color: var(--green); font-size: 14px; font-weight: 650; cursor: pointer; }
#dictionary-form { display: grid; gap: 13px; padding-bottom: 14px; }
.dictionary-section { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.dictionary-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.dictionary-section-heading h2 { margin: 0; font-size: 16px; font-weight: 690; }
.dictionary-section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.dictionary-add { flex: 0 0 auto; min-height: 37px; padding: 0 11px; font-size: 12px; }
.dictionary-session-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 38px; align-items: end; gap: 8px; padding: 10px 0; border-bottom: 1px solid #edf1ef; }
.dictionary-session-row:first-child { padding-top: 0; }
.dictionary-session-row:last-child { padding-bottom: 0; border-bottom: 0; }
.dictionary-coach-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px; align-items: end; gap: 8px; padding: 10px 0; border-bottom: 1px solid #edf1ef; }
.dictionary-coach-row:first-child { padding-top: 0; }
.dictionary-coach-row:last-child { padding-bottom: 0; border-bottom: 0; }
.dictionary-session-row label, .dictionary-field-label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 590; }
.dictionary-coach-row label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 590; }
.dictionary-session-row input, .dictionary-coach-row input, .dictionary-number-input, .dictionary-list-input { width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font-size: 14px; }
.dictionary-session-row input[readonly] { background: var(--surface-soft); color: var(--muted); }
.dictionary-number-input { max-width: 170px; margin-top: 10px; }
.dictionary-list-input { display: block; min-height: 100px; margin-top: 10px; resize: vertical; line-height: 1.55; }
.dictionary-remove { min-height: 38px; border: 0; border-radius: 10px; background: #fff5f3; color: var(--danger); font-size: 12px; cursor: pointer; }
.dictionary-section .field-help { margin-top: 7px; }
.dictionary-save-row { display: flex; justify-content: flex-end; padding-top: 2px; }
.dictionary-save-row .button-primary { min-width: 140px; }

.bottom-dock { z-index: 5; flex: 0 0 auto; border-top: 1px solid #edf0ee; background: rgb(255 255 255 / 96%); padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(14px); }
.primary-action-wrap { width: 100%; max-width: 740px; margin: 0 auto; padding: 9px 28px 8px; }
.primary-action {
  display: flex;
  width: 100%;
  min-height: 51px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 17px;
  background: var(--lime);
  color: var(--ink);
  font-size: 16px;
  font-weight: 710;
  cursor: pointer;
  transition: background-color 140ms ease, transform 140ms ease;
}
.primary-action:hover { background: var(--lime-strong); }
.primary-action:active { transform: scale(.99); }
.primary-action svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; }
.bottom-nav { display: grid; width: min(100%, 740px); grid-template-columns: repeat(4, 1fr); min-height: 70px; margin: 0 auto; padding: 5px 12px 4px; }
.nav-item { position: relative; display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: #697d77; font-size: 11px; cursor: pointer; }
.nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.is-active { color: #4d8c31; }
.nav-item.is-active::after { position: absolute; bottom: -4px; width: 50%; height: 3px; border-radius: 5px; background: var(--lime-strong); content: ""; }
.nav-item.is-active svg { stroke-width: 2; }

.app-dialog { width: min(100% - 22px, 520px); max-height: min(90dvh, 780px); padding: 0; overflow: auto; border: 0; border-radius: 24px; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.app-dialog::backdrop { background: rgb(12 32 25 / 38%); backdrop-filter: blur(3px); }
.dialog-inner { padding: 22px 22px 18px; }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.dialog-title { margin: 0; color: var(--ink); font-size: 22px; font-weight: 740; letter-spacing: -.04em; }
.dialog-close { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: #f2f5f3; color: var(--ink-soft); font-size: 23px; line-height: 1; cursor: pointer; }
.dialog-close span { transform: translateY(-1px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 11px; }
.form-field { min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; margin: 0 0 6px; color: var(--ink-soft); font-size: 12px; font-weight: 620; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-size: 14px; }
.form-field textarea { min-height: 74px; resize: vertical; }
.court-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.court-picker-heading > label { margin-bottom: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 620; }
.court-count { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.court-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 7px; }
.court-option { position: relative; display: flex !important; min-width: 0; min-height: 39px; align-items: center; justify-content: center; margin: 0 !important; cursor: pointer; }
.court-option input { position: absolute; width: 1px !important; min-height: 1px !important; padding: 0 !important; opacity: 0; }
.court-option span { display: flex; width: 100%; min-height: 39px; align-items: center; justify-content: center; padding: 5px 4px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 560; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.court-option:has(input:checked) span { border-color: var(--green); background: var(--pale-green); color: var(--ink); }
.court-option:has(input:focus-visible) span { outline: 2px solid var(--green); outline-offset: 2px; }
.court-option:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.field-hint { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 450; }
.field-help { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.participant-picker { display: grid; max-height: 190px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 6px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.participant-picker .check-option { min-height: 32px; gap: 6px; padding: 3px 5px; font-size: 12px; }
.participant-picker .check-option input { width: 15px; height: 15px; }
.participant-picker .check-option-copy { gap: 0; }
.participant-picker .check-option-copy small { font-size: 10px; }
.participant-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.participant-toolbar > div { min-width: 0; }
.participant-toolbar > div > label { margin-bottom: 3px; }
.participant-count { display: block; color: var(--muted); font-size: 11px; }
.participant-limit { display: flex !important; flex: 0 0 126px; align-items: center; justify-content: space-between; gap: 6px; margin: 0 !important; white-space: nowrap; }
.participant-limit input { width: 58px; min-height: 34px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: 12px; text-align: center; }
.attendance-picker { max-height: 180px; grid-template-columns: 1fr; }
.attendance-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.attendance-person { min-width: 0; }
.attendance-check { width: 100%; }
.attendance-note-preview { display: block; padding: 0 8px 6px 32px; color: var(--muted); font-size: 10px; }
.attendance-confirm-controls { display: grid; gap: 12px; margin-top: 13px; }
.confirm-control-label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 620; }
.confirm-add-row, .confirm-add-new { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.confirm-add-row select, .confirm-add-new input, .confirm-add-new select { width: 100%; min-width: 0; min-height: 41px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font-size: 13px; }
.confirm-add-new { grid-template-columns: minmax(0, 1fr) 92px auto; }
.confirm-add-new #attendance-new-student-phone { grid-column: 1 / -1; }
.confirm-add-row .button-secondary, .confirm-add-new .button-secondary { min-height: 41px; padding: 0 11px; font-size: 12px; white-space: nowrap; }
.check-option { display: flex; min-width: 0; min-height: 41px; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 9px; color: var(--ink-soft); font-size: 13px; cursor: pointer; }
.check-option:has(input:checked) { background: var(--pale-green); color: var(--ink); }
.check-option input { width: 17px; height: 17px; flex: 0 0 auto; margin: 0; accent-color: var(--green); }
.check-option-copy { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.check-option-copy > span { overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.check-option-copy small { color: var(--muted); font-size: 10px; line-height: 1.2; }
.picker-empty { grid-column: 1 / -1; padding: 7px; color: var(--muted); font-size: 12px; }
.quick-student-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 9px; }
.quick-student-row input, .quick-student-row select { width: 100%; min-width: 0; min-height: 41px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font-size: 13px; }
.quick-student-row select { grid-column: 1 / -1; min-height: 37px; padding-top: 6px; padding-bottom: 6px; }
.quick-student-row .button-secondary { flex: 0 0 auto; min-height: 41px; padding: 0 11px; font-size: 12px; white-space: nowrap; }
.form-error { min-height: 18px; margin: 10px 0 0; color: var(--danger); font-size: 12px; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 15px; }
.confirmation-message { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.confirmation-actions { margin-top: 22px; }
.button-secondary, .button-primary, .button-danger { min-height: 42px; padding: 0 15px; border: 0; border-radius: 13px; font-size: 14px; font-weight: 650; cursor: pointer; }
.button-secondary { background: #f1f4f2; color: var(--ink-soft); }
.button-primary { background: var(--lime); color: var(--ink); }
.button-danger { background: #fbefed; color: var(--danger); }
.dialog-actions .spacer { flex: 1; }
.student-detail-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 18px; }
.student-detail-stat { padding: 13px; border-radius: 14px; background: var(--pale-green); }
.student-detail-stat strong { display: block; color: var(--ink); font-size: 19px; }
.student-detail-stat span { color: var(--muted); font-size: 11px; }
.student-type-line { display: flex; align-items: center; gap: 8px; margin: -5px 0 10px; color: var(--muted); font-size: 12px; }
.student-contact { margin: 0 0 7px; color: var(--muted); font-size: 12px; }
.student-contact a { margin-left: 6px; color: var(--green); font-weight: 620; text-decoration: none; }
.detail-heading { margin: 18px 0 8px; }
.detail-heading .text-action { padding-top: 3px; padding-bottom: 3px; }
.compact-empty { padding: 13px 10px; font-size: 12px; }
.course-detail-list { border-top: 1px solid var(--line); }
.course-detail-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.course-detail-row > span { flex: 0 0 76px; color: var(--muted); }
.course-detail-row > strong { color: var(--ink-soft); font-weight: 590; text-align: right; overflow-wrap: anywhere; }
.detail-course { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; }
.student-course-row { align-items: flex-start; }
.detail-course-main { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.detail-course-status { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 3px; color: var(--ink-soft); text-align: right; }
.detail-course-status strong { font-size: 11px; font-weight: 620; }
.detail-course-note { color: var(--muted); font-size: 10px; }
.credit-restored { color: var(--green); font-size: 10px; }
.detail-course > span { min-width: 0; overflow-wrap: anywhere; }
.detail-course > strong { flex: 0 0 auto; font-size: 12px; white-space: nowrap; }
.toast-region { position: fixed; z-index: 20; right: 16px; bottom: calc(146px + env(safe-area-inset-bottom)); left: 16px; display: flex; justify-content: center; pointer-events: none; }
.toast { max-width: min(100%, 420px); padding: 11px 16px; border-radius: 14px; background: #18352a; color: #fff; font-size: 13px; line-height: 1.45; box-shadow: 0 8px 28px rgb(13 42 28 / 19%); animation: toast-in 180ms ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 720px) {
  .topbar { min-height: 80px; padding-right: 40px; padding-left: 40px; }
  .main-content { padding: 21px 40px 32px; }
  .page-title { margin-bottom: 24px; }
  .agenda-row { grid-template-columns: 70px 18px minmax(0, 1fr); column-gap: 13px; }
  .lesson-item { padding: 17px 20px; }
  .calendar-day { min-height: 68px; padding-top: 10px; }
  .calendar-day.is-selected::before { top: 6px; width: 35px; height: 35px; }
  .calendar-day .day-number { font-size: 15px; }
  .week-day .day-name { font-size: 12px; }
  .week-day .day-number { width: 40px; height: 40px; font-size: 16px; }
  .primary-action-wrap { padding-right: 40px; padding-left: 40px; }
  .bottom-nav { min-height: 76px; }
  .nav-item { font-size: 12px; }
  .nav-item svg { width: 24px; height: 24px; }
}

@media (max-width: 380px) {
  .topbar { min-height: 64px; padding-right: 18px; padding-left: 18px; }
  .brand-button { gap: 6px; font-size: 18px; }
  .brand-mark { width: 24px; height: 24px; }
  .main-content { padding: 11px 18px 22px; }
  .date-button { gap: 5px; padding: 8px 9px; font-size: 12px; }
  .period-title { font-size: 19px; }
  .period-summary { font-size: 11px; }
  .agenda-row { grid-template-columns: 51px 12px minmax(0, 1fr); column-gap: 8px; }
  .agenda-time { font-size: 13px; }
  .lesson-item { padding: 12px 13px; border-radius: 15px; }
  .lesson-name { font-size: 16px; }
  .primary-action-wrap { padding-right: 18px; padding-left: 18px; }
  .calendar-day { min-height: 47px; }
  .calendar-day .day-number { font-size: 13px; }
  .free-slot .slot-time { margin-right: 16px; }
}

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