:root {
  color-scheme: light;
  --ink: #111114;
  --muted: #6e7178;
  --line: #e6e7eb;
  --soft: #f6f7f9;
  --panel: rgba(255, 255, 255, 0.78);
  --blue: #0b6bcb;
  --teal: #087f83;
  --teal-deep: #075f66;
  --green: #2c8f55;
  --amber: #b7791f;
  --danger: #b42318;
  --shadow: 0 24px 60px rgba(12, 18, 28, 0.08);
  --shadow-deep: 0 34px 92px rgba(12, 18, 28, 0.12);
  --radius: 8px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(247, 250, 251, 0.92), rgba(255, 255, 255, 0.98) 36%, #fff 100%),
    linear-gradient(135deg, rgba(225, 238, 240, 0.6), transparent 42%),
    url("./assets/depth-lines.svg");
  background-size: cover;
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body.menu-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(31, 111, 120, 0.18);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  border-right: 1px solid rgba(218, 222, 230, 0.76);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(34px) saturate(1.28);
  -webkit-backdrop-filter: blur(34px) saturate(1.28);
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  -webkit-user-select: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(223, 225, 231, 0.9);
  border-radius: 12px;
  background: linear-gradient(145deg, #fff, rgba(239, 247, 248, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 16px 34px rgba(12, 18, 28, 0.09);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.mode-launcher {
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.brand-mark svg {
  width: 27px;
  fill: var(--ink);
}

.brand-number {
  font-size: 25px;
  font-weight: 780;
  line-height: 1;
}

.brand p,
.brand span,
.rail-panel p,
.rail-panel span,
.eyebrow {
  margin: 0;
}

.brand p {
  font-weight: 680;
  font-size: 15px;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.mode-tabs {
  display: grid;
  gap: 8px;
}

.mode-menu {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: rgba(246, 248, 250, 0.9);
  backdrop-filter: blur(34px) saturate(1.35);
  -webkit-backdrop-filter: blur(34px) saturate(1.35);
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  isolation: isolate;
  transform: translateZ(0);
}

.mode-menu-panel {
  display: grid;
  gap: 16px;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 26px;
  overflow: auto;
  border: 1px solid rgba(223, 225, 231, 0.98);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(12, 18, 28, 0.22);
  transform: translateZ(0);
}

.mode-menu-panel h2 {
  margin-top: 0;
  font-size: 30px;
  line-height: 1.08;
}

.mode-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-height: 60px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 20, 0.02), 0 10px 24px rgba(12, 18, 28, 0.06);
}

.mode-menu-item:hover {
  background: #fff;
  border-color: rgba(17, 17, 20, 0.14);
}

.mode-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #3b3d43;
  text-align: left;
  transition: transform 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
  user-select: none;
  -webkit-user-select: none;
}

.mode-tab:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.72);
}

.mode-tab.active {
  border-color: #dfe1e7;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 12px 34px rgba(12, 18, 28, 0.08);
}

.hidden,
.mode-tab.hidden {
  display: none !important;
}

.icon {
  width: 22px;
  color: var(--teal);
  font-size: 20px;
  line-height: 1;
  text-align: center;
}

.fish-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.rail-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-color: rgba(223, 227, 232, 0.9);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 22px 52px rgba(12, 18, 28, 0.08);
}

.rail-panel strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 34px;
  font-weight: 720;
  letter-spacing: 0;
}

.rail-panel span {
  color: var(--muted);
  font-size: 13px;
}

.main {
  padding: 34px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 34px;
  max-width: 1180px;
  min-height: 228px;
  padding: 38px 0 48px;
  overflow: hidden;
  animation: riseIn 760ms var(--ease) both;
}

.topbar::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 22px;
  width: min(520px, 42vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(8, 127, 131, 0.34), transparent);
  pointer-events: none;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(17, 17, 20, 0.18), transparent);
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 10px;
  font-size: clamp(48px, 6vw, 86px);
  font-weight: 780;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 720;
}

h3 {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
}

.top-actions,
.month-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.solid-button,
.ghost-button,
.submit-button,
.icon-button,
.tiny-button {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(223, 227, 232, 0.92);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), filter 180ms var(--ease);
}

.solid-button:hover,
.ghost-button:hover,
.submit-button:hover,
.icon-button:hover,
.tiny-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(12, 18, 28, 0.1);
}

.solid-button:active,
.ghost-button:active,
.submit-button:active,
.icon-button:active,
.tiny-button:active,
.mode-tab:active,
.day:active,
.upcoming-card:active {
  transform: translateY(0) scale(0.985);
}

.solid-button,
.submit-button {
  border-color: rgba(17, 17, 20, 0.92);
  background: linear-gradient(180deg, #202226, #07080a);
  color: #fff;
  box-shadow: 0 18px 36px rgba(12, 18, 28, 0.14);
}

.solid-button:hover,
.submit-button:hover {
  filter: saturate(1.08);
}

.solid-button,
.ghost-button {
  padding: 0 15px;
}

.submit-button {
  width: 100%;
  margin-top: 4px;
  font-weight: 680;
}

.submit-button:disabled,
.tiny-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
}

.tiny-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.view {
  display: none;
  margin: 0 auto;
  max-width: 1180px;
}

.view.active {
  display: grid;
  animation: riseIn 520ms var(--ease) both;
}

.student-view {
  grid-template-columns: minmax(380px, 0.94fr) minmax(430px, 1.06fr);
  gap: 26px;
}

.coach-view {
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  gap: 22px;
}

.calendar-panel,
.booking-panel,
.publish-panel,
.dashboard-panel,
.student-lock,
.coach-lock {
  border: 1px solid rgba(218, 222, 230, 0.72);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(30px) saturate(1.22);
  -webkit-backdrop-filter: blur(30px) saturate(1.22);
}

.calendar-panel,
.booking-panel,
.publish-panel,
.dashboard-panel,
.student-lock,
.coach-lock {
  padding: 22px;
}

.reveal {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  filter: blur(6px);
  transition:
    opacity 780ms var(--ease) var(--reveal-delay, 0ms),
    transform 780ms var(--ease) var(--reveal-delay, 0ms),
    filter 780ms var(--ease) var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.student-lock,
.coach-lock {
  display: none;
  grid-column: 1 / -1;
  gap: 18px;
  max-width: 560px;
  margin: 0 auto;
}

.student-view.locked {
  grid-template-columns: 1fr;
}

.student-view.locked .student-lock {
  display: grid;
}

.student-view.locked .student-only {
  display: none;
}

.coach-view.locked {
  grid-template-columns: 1fr;
}

.coach-view.locked .coach-lock {
  display: grid;
}

.coach-view.locked .coach-only {
  display: none;
}

.coach-switch {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(218, 222, 230, 0.78);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}

.coach-switch-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #4a4d54;
  font-weight: 680;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 160ms var(--ease);
}

.coach-switch-button.active {
  border-color: rgba(17, 17, 20, 0.1);
  background: #111114;
  color: #fff;
  box-shadow: 0 12px 26px rgba(12, 18, 28, 0.12);
}

.coach-section {
  display: none;
}

.coach-section.active {
  display: grid;
}

.lock-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.lock-row {
  display: grid;
  gap: 12px;
}

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

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.upcoming-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 2px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.upcoming-card,
.upcoming-empty {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 16px;
  text-align: left;
}

.upcoming-card {
  display: grid;
  flex: 0 0 calc((100% - 20px) / 3);
  align-content: space-between;
  gap: 8px;
  color: #fff;
  box-shadow: 0 22px 52px rgba(12, 18, 28, 0.16);
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease), filter 240ms var(--ease);
  animation: riseIn 520ms var(--ease) both;
  scroll-snap-align: start;
}

.upcoming-card.tone-1 {
  background: linear-gradient(135deg, #111114, #126b72 68%, #7fb1b4);
}

.upcoming-card.tone-2 {
  background: linear-gradient(135deg, #233c40, #60959c 82%);
}

.upcoming-card.tone-3 {
  background: linear-gradient(135deg, #2d363c, #8fa4ab);
}

.upcoming-card::after {
  content: "";
  position: absolute;
  inset: -70% -20% auto;
  height: 120%;
  transform: rotate(14deg) translateX(-45%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transition: transform 760ms var(--ease);
}

.upcoming-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 30px 70px rgba(12, 18, 28, 0.2);
  filter: saturate(1.06);
}

.upcoming-card:hover::after {
  transform: rotate(14deg) translateX(48%);
}

.upcoming-card strong {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.05;
}

.upcoming-card span,
.upcoming-card em {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-style: normal;
}

.upcoming-date {
  font-weight: 720;
}

.upcoming-empty {
  display: grid;
  align-content: center;
  width: 100%;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
}

.upcoming-empty strong {
  color: var(--ink);
  font-size: 20px;
}

.weekday-row {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.day {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(225, 229, 235, 0.94);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  text-align: left;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition: border-color 180ms var(--ease), background 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease), color 180ms var(--ease);
}

.day:hover {
  border-color: #bdc1ca;
  background: #fff;
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(12, 18, 28, 0.1);
}

.day.empty {
  visibility: hidden;
}

.day.selected {
  border-color: #111114;
  background: linear-gradient(145deg, #ffffff, #eef9fa);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 20, 0.08), 0 22px 44px rgba(12, 18, 28, 0.13);
}

.day.published {
  min-height: 86px;
  border-color: rgba(17, 17, 20, 0.34);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(232, 247, 248, 0.9));
  box-shadow: 0 18px 40px rgba(12, 18, 28, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.day.published .day-number {
  font-size: 22px;
}

.day.has-demand:not(.selected) {
  border-color: rgba(212, 93, 142, 0.34);
}

.day.level-1:not(.selected) {
  background: linear-gradient(145deg, #fff1f7, #ffffff);
}

.day.level-2:not(.selected) {
  border-color: rgba(134, 92, 196, 0.34);
  background: linear-gradient(145deg, #f7f0ff, #ffffff);
}

.day.level-3:not(.selected) {
  border-color: rgba(222, 129, 49, 0.38);
  background: linear-gradient(145deg, #fff3e8, #ffffff);
}

.day.level-4:not(.selected) {
  border-color: rgba(190, 45, 55, 0.42);
  background: linear-gradient(145deg, #fff0f0, #ffffff);
}

.day.disabled {
  color: #b3b6bd;
  background: rgba(246, 247, 249, 0.6);
  cursor: default;
}

.day.closed {
  border-style: dashed;
  background:
    repeating-linear-gradient(135deg, rgba(231, 233, 237, 0.52) 0 8px, rgba(248, 249, 251, 0.52) 8px 16px),
    rgba(246, 247, 249, 0.74);
}

.day.closed .day-meta {
  color: #9aa0aa;
}

.day-number {
  font-size: 15px;
  font-weight: 680;
}

.day-meta {
  color: var(--teal);
  font-size: 11px;
  font-weight: 650;
}

.day.selected .day-meta {
  color: #5a6170;
  text-shadow: none;
}

.day.selected .day-number,
.day.selected strong {
  color: var(--ink);
  text-shadow: none;
}

.day.selected .day-meta {
  color: #3d4653;
}

.day.level-1:not(.selected) .day-meta {
  color: #c84981;
}

.day.level-2:not(.selected) .day-meta {
  color: #7551b9;
}

.day.level-3:not(.selected) .day-meta {
  color: #c46620;
}

.day.level-4:not(.selected) .day-meta {
  color: #b4232e;
}

.field,
.schedule-form {
  display: grid;
  gap: 8px;
}

.booking-panel,
.publish-panel,
.schedule-form {
  gap: 16px;
}

.booking-panel,
.schedule-form {
  display: grid;
}

.field span {
  color: #4b4e55;
  font-size: 13px;
  font-weight: 630;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(223, 227, 232, 0.96);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 82px;
  padding: 11px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(8, 127, 131, 0.11), 0 16px 32px rgba(12, 18, 28, 0.07);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-grid.three {
  grid-template-columns: 1fr 1fr 0.72fr;
}

.equipment-block {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(223, 227, 232, 0.92);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(246, 249, 250, 0.94));
}

.block-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.equipment-grid label,
.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  color: #34373d;
  font-size: 14px;
}

.equipment-grid label {
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(223, 227, 232, 0.94);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  transition: transform 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.equipment-grid label:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 127, 131, 0.38);
  background: #fff;
  box-shadow: 0 10px 24px rgba(12, 18, 28, 0.07);
}

.equipment-grid label:has(input:checked) {
  border-color: rgba(17, 17, 20, 0.9);
  background: #111114;
  color: #fff;
  box-shadow: 0 14px 30px rgba(12, 18, 28, 0.13);
}

.equipment-grid input,
.check-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 160px;
  padding: 0 10px;
  border: 1px solid #d8e8e9;
  border-radius: 999px;
  background: #effafa;
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.class-preview {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 20px;
  border: 1px solid rgba(223, 227, 232, 0.9);
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 18%, rgba(31, 111, 120, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 247, 0.86)),
    url("./assets/depth-lines.svg");
  background-size: 900px auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 20px 48px rgba(12, 18, 28, 0.07);
  animation: softReveal 560ms var(--ease) both;
}

.class-preview::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 34%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(8, 127, 131, 0.28), transparent);
  pointer-events: none;
}

.class-course {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 760;
  line-height: 1.04;
}

.class-time {
  color: #3b3f45;
  font-size: 15px;
  font-weight: 650;
}

.class-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.class-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #4b4e55;
  font-size: 12px;
  font-weight: 650;
}

.class-empty {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 108px;
  color: var(--muted);
}

.class-empty strong {
  color: var(--ink);
  font-size: 22px;
}

.compact-select {
  width: min(240px, 100%);
}

.coach-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.booking-window-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(223, 227, 232, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.booking-window-fields {
  display: grid;
  grid-template-columns: minmax(132px, 1fr) minmax(132px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric-card {
  display: block;
  width: 100%;
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(223, 227, 232, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.metric-row strong {
  display: block;
  font-size: 30px;
  font-weight: 730;
}

.metric-row span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(17, 17, 20, 0.18);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 44px rgba(12, 18, 28, 0.11);
}

.schedule-list,
.booking-list {
  display: grid;
  gap: 10px;
}

.schedule-list {
  margin-bottom: 18px;
}

.gear-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.day-briefing {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.briefing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 0;
  border: 1px solid rgba(223, 227, 232, 0.9);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: rgba(255, 255, 255, 0.82);
}

.briefing-head span {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 30px;
  border-radius: 999px;
  background: #111114;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.day-briefing pre {
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(223, 227, 232, 0.9);
  border-radius: 0 0 16px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 247, 249, 0.92)),
    url("./assets/depth-lines.svg");
  color: #2f3339;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.coach-calendar {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(223, 227, 232, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.coach-calendar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.coach-calendar-head span {
  color: var(--muted);
  font-size: 12px;
}

.coach-month-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.coach-weekdays,
.coach-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.coach-weekdays {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.coach-day {
  display: grid;
  align-content: space-between;
  gap: 4px;
  min-height: 78px;
  padding: 8px;
  border: 1px solid rgba(223, 227, 232, 0.94);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.coach-day:hover {
  transform: translateY(-2px);
  border-color: rgba(8, 127, 131, 0.28);
  box-shadow: 0 16px 32px rgba(12, 18, 28, 0.09);
}

.coach-day.empty {
  visibility: hidden;
}

.coach-day.published {
  border-color: rgba(17, 17, 20, 0.36);
  background: linear-gradient(145deg, #111114, #173f45 70%, #3e777c);
  color: #fff;
}

.coach-day.level-1:not(.selected) {
  border-color: rgba(212, 93, 142, 0.34);
  background: #fff1f7;
}

.coach-day.level-2:not(.selected) {
  border-color: rgba(134, 92, 196, 0.34);
  background: #f7f0ff;
}

.coach-day.level-3:not(.selected) {
  border-color: rgba(222, 129, 49, 0.38);
  background: #fff3e8;
}

.coach-day.level-4:not(.selected) {
  border-color: rgba(190, 45, 55, 0.42);
  background: #fff0f0;
}

.coach-day.selected {
  border-color: #111114;
  background: linear-gradient(145deg, #ffffff, #eef9fa);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 20, 0.08), 0 16px 30px rgba(12, 18, 28, 0.12);
}

.coach-day.focus-pulse {
  animation: focusPulse 980ms var(--ease) both;
}

.coach-day.selected strong,
.coach-day.selected em,
.coach-day.selected .coach-day-number {
  color: var(--ink);
  text-shadow: none;
}

.coach-day.selected em {
  color: #5a6170;
}

.coach-day.selected .coach-day-number,
.coach-day.selected strong,
.coach-day.selected em {
  color: var(--ink);
}

.coach-day-number {
  font-size: 12px;
  font-weight: 700;
}

.coach-day strong {
  font-size: 25px;
  line-height: 1;
}

.coach-day em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 650;
}

.coach-day.published em {
  color: rgba(255, 255, 255, 0.72);
}

.gear-summary-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #3f434a;
  font-size: 13px;
  font-weight: 700;
}

.gear-summary-title em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 620;
}

.gear-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gear-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(204, 215, 219, 0.9);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 250, 250, 0.88));
  color: #30343a;
  font-size: 13px;
  font-weight: 650;
}

.gear-chip strong {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #111114;
  color: #fff;
  font-size: 12px;
}

.slot-card,
.booking-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

.slot-card:hover,
.booking-card:hover {
  transform: translateY(-2px);
  border-color: rgba(8, 127, 131, 0.25);
  box-shadow: 0 16px 34px rgba(12, 18, 28, 0.08);
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-title {
  font-weight: 720;
}

.card-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: #41444b;
  font-size: 12px;
  font-weight: 620;
}

.tag-dark {
  background: #111114;
  color: #fff;
}

.tag-intent {
  background: #e9f6f5;
  color: var(--teal);
}

.intent-card {
  border-color: rgba(8, 127, 131, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(241, 250, 250, 0.9)),
    url("./assets/depth-lines.svg");
  background-size: 720px auto;
}

.status-select {
  width: 116px;
  height: 34px;
  font-size: 13px;
}

.empty-state {
  padding: 26px 16px;
  border: 1px dashed #cfd2d8;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  padding: 16px;
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  transform: translateX(-50%) translateY(80px);
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 17, 20, 0.92);
  color: #fff;
  opacity: 0;
  box-shadow: 0 24px 60px rgba(12, 18, 28, 0.2);
  transition: 220ms var(--ease);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.success-flash {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: end center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
}

.success-flash::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.9), transparent 24%),
    linear-gradient(0deg, rgba(8, 127, 131, 0.28), transparent 42%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.54), transparent 13%, transparent 87%, rgba(255, 255, 255, 0.54));
  filter: blur(2px);
  transform: scale(1.04);
}

.success-flash div {
  position: relative;
  display: grid;
  gap: 4px;
  width: min(440px, calc(100vw - 32px));
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(17, 17, 20, 0.9);
  color: #fff;
  text-align: center;
  box-shadow: 0 28px 80px rgba(12, 18, 28, 0.28);
  backdrop-filter: blur(24px) saturate(1.4);
}

.success-flash strong {
  font-size: 20px;
}

.success-flash span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.success-flash.show {
  animation: flashWrap 1800ms var(--ease) both;
}

.success-flash.show div {
  animation: flashCard 1800ms var(--ease) both;
}

.roster-popover,
.coach-detail-popover {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(246, 247, 249, 0.56);
  backdrop-filter: blur(18px) saturate(1.25);
}

.roster-popover > div,
.coach-detail-popover > div {
  position: relative;
  display: grid;
  gap: 12px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(78vh, 720px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(218, 222, 230, 0.9);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 250, 0.92)),
    url("./assets/depth-lines.svg");
  box-shadow: 0 34px 90px rgba(12, 18, 28, 0.18);
}

.roster-popover .icon-button,
.coach-detail-popover .icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  min-height: 34px;
  font-size: 22px;
}

.roster-list,
.coach-detail-list {
  display: grid;
  gap: 8px;
}

.roster-person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.roster-person span {
  color: var(--muted);
  font-size: 12px;
}

.detail-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 11px 12px;
  border: 1px solid rgba(223, 227, 232, 0.94);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: left;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.detail-date-row:hover {
  transform: translateY(-2px);
  border-color: rgba(8, 127, 131, 0.28);
  background: #fff;
  box-shadow: 0 16px 34px rgba(12, 18, 28, 0.09);
}

.detail-date-row span {
  display: grid;
  gap: 3px;
}

.detail-date-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.detail-date-row b {
  min-width: 42px;
  color: #b4232e;
  font-size: 13px;
  text-align: right;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softReveal {
  from {
    opacity: 0;
    transform: scale(0.985);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes focusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(8, 127, 131, 0.32), 0 20px 44px rgba(12, 18, 28, 0.1);
    transform: translateY(-1px) scale(1);
  }
  52% {
    box-shadow: 0 0 0 9px rgba(8, 127, 131, 0), 0 24px 52px rgba(12, 18, 28, 0.14);
    transform: translateY(-2px) scale(1.025);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(8, 127, 131, 0), 0 16px 30px rgba(12, 18, 28, 0.12);
    transform: translateY(0) scale(1);
  }
}

@keyframes flashWrap {
  0% {
    opacity: 0;
  }
  18%,
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes flashCard {
  0% {
    transform: translateY(34px) scale(0.98);
  }
  18% {
    transform: translateY(0) scale(1);
  }
  72% {
    transform: translateY(0) scale(1);
  }
  100% {
    transform: translateY(18px) scale(0.99);
  }
}

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

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mode-tabs {
    grid-auto-flow: column;
    margin-left: auto;
  }

  .rail-panel {
    display: none;
  }

  .main {
    padding: 22px 16px;
  }

  .topbar {
    min-height: 170px;
    padding: 24px 0 32px;
  }

  .student-view,
  .coach-view {
    grid-template-columns: 1fr;
  }

  .booking-window-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .upcoming-card {
    flex-basis: calc((100% - 10px) / 2);
  }
}

@media (max-width: 640px) {
  .mode-menu {
    align-items: start;
    padding: max(76px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
  }

  .mode-menu-panel {
    width: 100%;
    padding: 24px;
  }

  .mode-menu-panel h2 {
    font-size: 28px;
  }

  .mode-menu-item {
    min-height: 68px;
    font-size: 21px;
  }

  .rail {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-tabs {
    grid-auto-flow: row;
    margin-left: 0;
  }

  .topbar,
  .panel-head,
  .card-row,
  .card-actions,
  .block-title,
  .coach-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .month-controls {
    width: 100%;
  }

  .top-actions button,
  .month-controls button {
    flex: 1;
  }

  .field-grid,
  .field-grid.three,
  .booking-window-fields,
  .metric-row,
  .equipment-grid {
    grid-template-columns: 1fr;
  }

  .upcoming-card {
    flex-basis: min(86vw, 320px);
  }

  .calendar-grid,
  .weekday-row {
    gap: 5px;
  }

  .day {
    min-height: 58px;
    padding: 8px;
  }

  .day.published {
    min-height: 70px;
  }

  .day.published .day-number {
    font-size: 18px;
  }

  .coach-calendar {
    padding: 12px;
  }

  .coach-calendar-head {
    flex-direction: column;
  }

  .coach-month-tools {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .coach-calendar-grid,
  .coach-weekdays {
    gap: 4px;
  }

  .coach-day {
    min-height: 58px;
    padding: 6px;
  }

  .coach-day strong {
    font-size: 18px;
  }

  h1 {
    font-size: 44px;
  }

  .upcoming-card,
  .upcoming-empty {
    min-height: 118px;
  }
}
