:root {
  color-scheme: light;
  --ink: #2f2a25;
  --muted: #8c8276;
  --line: #e3d8ca;
  --paper: #f7f0e8;
  --panel: #fffdf8;
  --accent: #b39d82;
  --accent-strong: #665747;
  --warn: #a77c55;
  --danger: #9b6a60;
  --blue: #777b72;
  --button-hover-bg: #efe7dc;
  --button-hover-fg: #2f2a25;
  --button-hover-border: #d9cfc3;
  --traffic-comfort-bg: #fffaf3;
  --traffic-comfort-border: #efe5d8;
  --traffic-comfort-fg: #766c61;
  --traffic-comfort-dot: #ddcfbe;
  --traffic-medium-bg: #efd0a4;
  --traffic-medium-border: #c99c62;
  --traffic-medium-fg: #684525;
  --traffic-medium-dot: #bc8244;
  --traffic-peak-bg: #8b5149;
  --traffic-peak-border: #6f3d37;
  --traffic-peak-fg: #fffdf8;
  --traffic-peak-dot: #8b5149;
  --shadow: none;
  --font-body: "Avenir Next", "Helvetica Neue", Inter, "PingFang TC", "Noto Sans TC", Arial, sans-serif;
  --font-display: "Avenir Next", "Helvetica Neue", Inter, "PingFang TC", "Noto Sans TC", Arial, sans-serif;
  --font-numeric: "SF Pro Text", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

input,
select,
textarea,
button {
  max-width: 100%;
  min-width: 0;
  font: inherit;
}

label {
  min-width: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
  --pull-refresh-distance: 0px;
}

.pull-refresh-indicator {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 10000;
  display: grid;
  place-items: center;
  min-width: 138px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid rgba(179, 157, 130, 0.42);
  background: rgba(255, 253, 248, 0.96);
  color: var(--accent-strong);
  box-shadow: 0 12px 28px rgba(47, 42, 37, 0.12);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-120% + (var(--pull-refresh-distance) * 0.72)));
  transition: opacity 150ms ease, transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

body.is-pulling-refresh .pull-refresh-indicator,
body.is-ready-refresh .pull-refresh-indicator,
body.is-refreshing .pull-refresh-indicator {
  opacity: 1;
}

body.is-ready-refresh .pull-refresh-indicator,
body.is-refreshing .pull-refresh-indicator {
  border-color: rgba(102, 87, 71, 0.42);
  background: #f1e6d9;
  color: var(--ink);
}

body.is-refreshing .pull-refresh-indicator {
  transform: translate(-50%, 14px);
}

.deployment-banner {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 10000;
  transform: translateX(-50%);
  padding: 6px 12px;
  border: 1px solid rgba(160, 132, 96, 0.34);
  background: rgba(248, 239, 227, 0.94);
  color: #5f5145;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(61, 52, 43, 0.1);
}

body.topup-notice-open {
  overflow: hidden;
}

.topup-notice-screen {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 0%, rgba(227, 216, 202, 0.44), transparent 42%),
    rgba(247, 240, 232, 0.98);
}

.topup-notice-screen[hidden] {
  display: none;
}

.topup-notice-card {
  display: grid;
  gap: 16px;
  width: min(520px, 100%);
  max-height: min(720px, calc(100dvh - 44px));
  overflow: auto;
  padding: 34px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 24px 70px rgba(47, 42, 37, 0.18);
  animation: topupNoticeIn 220ms ease-out both;
}

.topup-notice-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.topup-notice-card h2 {
  margin: -4px 0 0;
  font-size: clamp(32px, 7vw, 48px);
  line-height: 1.04;
  letter-spacing: 0;
}

.topup-notice-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.topup-notice-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.topup-notice-item {
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fbf5ee;
}

.topup-notice-item span,
.topup-notice-item small {
  color: var(--muted);
}

.topup-notice-item strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.45;
}

.topup-notice-confirm {
  min-height: 52px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fffdf8;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.topup-notice-confirm:disabled {
  opacity: 0.58;
  cursor: wait;
}

.topup-notice-footnote {
  font-size: 12px;
}

.app-toast-stack {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9999;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 15px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.98);
  color: var(--ink);
  box-shadow: 0 18px 38px rgba(47, 42, 37, 0.13);
  opacity: 0;
  transform: translateY(14px);
  animation: toastSlideIn 220ms ease forwards;
}

.app-toast.is-leaving {
  animation: toastSlideOut 180ms ease forwards;
}

.coach-onboarding-dialog {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border: 0;
  padding: 0;
  background: transparent;
}

.coach-onboarding-dialog::backdrop {
  background: #fffdf8;
}

.coach-onboarding-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 18px;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 253, 248, 0.92), rgba(255, 253, 248, 0) 42%),
    linear-gradient(180deg, #fffdf8 0%, #f8f1e8 100%);
  color: var(--ink);
  box-shadow: none;
  overflow: hidden;
  animation: onboardingCardIn 360ms ease both;
  touch-action: pan-y;
}

.coach-onboarding-pages {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  transform: translateX(calc(var(--coach-onboarding-step, 0) * -100%));
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.coach-onboarding-page {
  flex: 0 0 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  width: 100%;
  min-height: 0;
  padding: 24px 12px;
  text-align: center;
  opacity: 0.36;
  pointer-events: none;
  transform: scale(0.985);
  transition: opacity 260ms ease, transform 260ms ease;
}

.coach-onboarding-page.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.coach-onboarding-page.is-exit-left {
  opacity: 0.36;
}

.coach-onboarding-page h2,
.coach-onboarding-page p {
  margin: 0;
}

.coach-onboarding-page h2 {
  max-width: min(100%, 420px);
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
}

.coach-onboarding-page p {
  max-width: min(100%, 380px);
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  text-wrap: pretty;
}

.coach-onboarding-hero {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.coach-onboarding-logo {
  width: 108px;
  height: 108px;
  border: 1px solid rgba(179, 157, 130, 0.44);
  background: #fbf5ee;
  object-fit: contain;
  padding: 12px;
  animation: onboardingMarkPulse 1200ms ease 180ms both;
}

.coach-onboarding-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(179, 157, 130, 0.36);
  background: rgba(251, 245, 238, 0.92);
  color: var(--accent);
  font-family: var(--font-numeric);
  font-size: 24px;
  font-weight: 900;
}

.coach-onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.coach-onboarding-progress span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(140, 130, 118, 0.26);
  transition: width 220ms ease, background-color 220ms ease;
}

.coach-onboarding-progress span.is-active {
  width: 24px;
  background: var(--accent-strong);
}

.coach-onboarding-card menu {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.coach-onboarding-card menu button {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 850;
}

.coach-onboarding-card menu button#finishCoachOnboardingButton {
  order: -1;
  border-color: var(--ink);
  background: var(--ink);
  color: #fffdf8;
}

.coach-feature-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9400;
  background: rgba(47, 42, 37, 0.5);
  animation: onboardingItemIn 180ms ease both;
}

.coach-feature-tour-target {
  position: relative;
  z-index: 9550 !important;
  isolation: isolate;
}

.coach-feature-tour-spotlight {
  position: fixed;
  z-index: 9500;
  border: 2px solid rgba(255, 253, 248, 0.96);
  border-radius: 14px;
  padding: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow:
    0 0 0 4px rgba(255, 253, 248, 0.72),
    0 0 0 8px rgba(179, 157, 130, 0.58),
    0 18px 42px rgba(47, 42, 37, 0.3);
  pointer-events: none;
  animation: coachTourTargetPulse 1400ms ease infinite;
  overflow: hidden;
}

.coach-feature-tour-spotlight-frame {
  width: 100%;
  height: 100%;
  display: grid;
  align-items: stretch;
  justify-items: stretch;
}

.coach-feature-tour-spotlight-frame > * {
  width: 100% !important;
  min-height: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  position: static !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

.coach-feature-tour-spotlight-frame .coach-account-tour-anchor {
  display: grid !important;
  gap: 8px !important;
}

.coach-feature-tour-spotlight-frame .coach-account-tour-anchor .account-button {
  display: grid !important;
  width: 100% !important;
  min-height: 34px !important;
}

.coach-feature-tour-spotlight-frame .door-lock-entry-panel,
.coach-feature-tour-spotlight-frame .cancel-next-booking-button {
  display: none !important;
}

.coach-feature-tour-card {
  position: fixed;
  z-index: 9600;
  width: min(340px, calc(100vw - 28px));
  padding: 16px;
  border: 1px solid rgba(179, 157, 130, 0.38);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.98);
  color: var(--ink);
  box-shadow: 0 22px 48px rgba(47, 42, 37, 0.22);
  animation: onboardingCardIn 220ms ease both;
}

.coach-feature-tour-card h2,
.coach-feature-tour-card p {
  margin: 0;
}

.coach-feature-tour-card h2 {
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.25;
}

.coach-feature-tour-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.coach-feature-tour-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.coach-feature-tour-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 850;
}

.coach-feature-tour-actions button[data-coach-tour-next] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffdf8;
}

@keyframes onboardingCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes onboardingItemIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes onboardingMarkPulse {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  60% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes coachTourTargetPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.015);
  }
}

.app-toast-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fbf5ee;
  color: var(--accent-strong);
  font-weight: 900;
  line-height: 1;
}

.app-toast.is-success .app-toast-mark {
  background: var(--traffic-comfort-bg);
  color: var(--traffic-comfort-fg);
}

.app-toast.is-warning .app-toast-mark {
  background: var(--traffic-medium-bg);
  color: var(--traffic-medium-fg);
}

.app-toast.is-error .app-toast-mark {
  background: var(--traffic-peak-bg);
  color: var(--traffic-peak-fg);
}

.app-toast.is-stamp {
  border-color: rgba(179, 157, 130, 0.46);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(251, 245, 238, 0.98));
}

.app-toast.is-stamp .app-toast-mark {
  position: relative;
  border-color: rgba(179, 157, 130, 0.58);
  background: transparent;
  color: var(--accent-strong);
  animation: completionStampIn 360ms ease both;
}

.completion-stamp-check {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
}

.completion-stamp-check::before,
.completion-stamp-check::after {
  content: "";
  position: absolute;
  display: block;
}

.completion-stamp-check::before {
  inset: 1px;
  border: 1px solid rgba(179, 157, 130, 0.48);
  opacity: 0;
  transform: scale(0.82);
  animation: completionStampFrame 360ms ease 80ms forwards;
}

.completion-stamp-check::after {
  left: 7px;
  top: 3px;
  width: 7px;
  height: 13px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0;
  transform: rotate(42deg) scale(0.56);
  transform-origin: 56% 76%;
  animation: completionCheckDraw 420ms cubic-bezier(0.2, 0.8, 0.22, 1) 170ms forwards;
}

.app-toast strong,
.app-toast span {
  display: block;
}

.app-toast strong {
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.app-toast span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@keyframes toastSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastSlideOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes topupNoticeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes premiumViewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes premiumButtonPress {
  0% {
    transform: translateY(0) scale(1);
  }

  42% {
    transform: translateY(1px) scale(0.985);
    filter: brightness(1.035);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes premiumLoadingSweep {
  0% {
    transform: translateX(-140%);
    opacity: 0;
  }

  35% {
    opacity: 0.55;
  }

  100% {
    transform: translateX(140%);
    opacity: 0;
  }
}

@keyframes subtleBookingPulse {
  0%,
  100% {
    box-shadow: 0 14px 30px rgba(47, 42, 37, 0.1), 0 0 0 rgba(168, 139, 105, 0);
  }

  50% {
    box-shadow: 0 16px 34px rgba(47, 42, 37, 0.13), 0 0 0 3px rgba(168, 139, 105, 0.12);
  }
}

@keyframes entryButtonBreath {
  0%,
  100% {
    border-color: rgba(168, 139, 105, 0.34);
    background: #fffdf8;
  }

  50% {
    border-color: rgba(168, 139, 105, 0.62);
    background: #fbf5ee;
  }
}

@keyframes completionStampIn {
  from {
    opacity: 0;
    transform: translateY(3px) scale(0.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes completionStampFrame {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes completionCheckDraw {
  0% {
    opacity: 0;
    transform: rotate(42deg) scale(0.56);
  }

  55% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: rotate(42deg) scale(1);
  }
}

body:not(.authenticated) .app-shell {
  display: none;
}

body:not(.authenticated) .admin-only,
body:not(.authenticated) .coach-only {
  display: none !important;
}

body.authenticated .login-screen {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.login-card img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.login-card h1,
.login-card p {
  margin: 0;
}

.login-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.login-card label[hidden] {
  display: none;
}

.login-card input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 12px;
  background: #fffdf8;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: stretch;
  gap: 8px;
}

.password-field input {
  min-width: 0;
}

.password-field button,
.login-card .password-field button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.login-card button {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 700;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.login-card .google-login-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  background: #fffdf8;
  color: var(--ink);
  border-color: var(--line);
}

.login-card .google-login-button.google-login-button-attention {
  border-color: var(--accent);
  background: #f5ede2;
  box-shadow: 0 0 0 3px rgba(176, 131, 79, 0.14);
}

.google-login-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #3f3932;
  font-size: 15px;
  font-weight: 800;
}

.login-card .register-open-button {
  background: #fffdf8;
  color: var(--ink);
  border-color: var(--line);
}

.login-card .register-open-button[hidden] {
  display: none;
}

.system-usage-notice {
  padding-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.hidden-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.privacy-page {
  display: block;
  background: #f7f0e8;
  color: var(--ink);
}

.privacy-document {
  width: min(840px, calc(100% - 32px));
  margin: 32px auto;
  padding: 28px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.privacy-document h1 {
  margin-top: 0;
}

.privacy-document h2 {
  margin: 24px 0 8px;
  font-size: 18px;
}

.privacy-document p {
  color: var(--muted);
  line-height: 1.7;
}

.privacy-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbf5ee;
}

.privacy-consent-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--ink);
}

.privacy-consent-row span {
  line-height: 1.5;
}

.privacy-consent-row a {
  color: var(--accent-strong);
  font-weight: 800;
}

.email-code-field {
  border: 1px solid #ddd2c6;
  border-radius: 8px;
  padding: 10px;
  background: #f8f1e8;
}

.login-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

.warning-text {
  color: #9a7346;
  font-weight: 700;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 120ms ease,
    opacity 120ms ease;
}

button:not(:disabled):hover,
button:not(:disabled):focus-visible,
.secondary-action:not(:disabled):hover,
.secondary-action:not(:disabled):focus-visible,
.student-detail-button:not(:disabled):hover,
.student-detail-button:not(:disabled):focus-visible,
.lesson-plan-actions button:not(:disabled):hover,
.lesson-plan-actions button:not(:disabled):focus-visible,
.booking-form menu button:not(:disabled):hover,
.booking-form menu button:not(:disabled):focus-visible,
.session-type-toggle button:not(:disabled):hover,
.session-type-toggle button:not(:disabled):focus-visible,
.password-field button:not(:disabled):hover,
.password-field button:not(:disabled):focus-visible {
  background: var(--button-hover-bg);
  color: var(--button-hover-fg);
  border-color: var(--button-hover-border);
}

button:not(:disabled):focus-visible {
  outline: 2px solid rgba(36, 35, 33, 0.22);
  outline-offset: 2px;
}

.danger-action:not(:disabled):hover,
.danger-action:not(:disabled):focus-visible,
.lesson-plan-actions .danger-action:not(:disabled):hover,
.lesson-plan-actions .danger-action:not(:disabled):focus-visible {
  background: var(--danger);
  color: #fffdf8;
  border-color: var(--danger);
}

.nav button:not(:disabled):hover,
.nav button:not(:disabled):focus-visible {
  background: var(--button-hover-bg);
  color: var(--button-hover-fg);
  border-color: var(--button-hover-border);
  padding-left: 10px;
}

.app-shell {
  display: grid;
  grid-template-columns: 276px minmax(520px, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #fbf5ee;
  border-right: 1px solid var(--line);
  padding: 22px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.brand > div {
  min-width: 0;
}

.brand img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0;
}

.brand span,
.eyebrow,
.panel small,
.metrics small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mode-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.coach-only {
  display: none;
}

body[data-mode="coach"] .nav button[data-view="coaches"],
body[data-mode="coach"] .nav button[data-view="lock"] {
  display: none !important;
}

body[data-mode="coach"] .plan-panel.coach-only,
body[data-mode="coach"] .coach-account-card {
  display: none !important;
}

.mobile-nav-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  min-height: 36px;
  min-width: 40px;
  padding: 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.nav {
  display: grid;
  gap: 0;
  margin: 22px 0;
  border-top: 1px solid var(--line);
}

.nav button,
.secondary-action,
.booking-form menu button {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  min-height: 44px;
}

.nav button {
  display: flex;
  align-items: center;
  text-align: left;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.nav button.active,
.booking-form menu button[value="confirm"] {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--ink);
}

.secondary-action,
.booking-form menu button {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 12px;
  background: #fffdf8;
}

.booking-form menu button[value="confirm"] {
  background: var(--ink);
  color: #fffdf8;
  border-color: var(--ink);
}

.plan-panel {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 16px;
  background: #fffdf8;
}

.plan-panel p,
.plan-panel strong,
.plan-panel span {
  display: block;
  margin: 0;
}

.plan-panel strong {
  margin: 8px 0;
}

.plan-panel span + span {
  margin-top: 6px;
}

.period-range {
  display: inline-grid;
  gap: 2px;
  line-height: 1.25;
  white-space: normal;
}

.period-range i {
  color: var(--muted);
  font-style: normal;
  line-height: 1;
}

.coach-account-stats .period-range,
.coach-plan-detail .period-range {
  display: grid;
}

.workspace {
  padding: 30px;
  min-width: 0;
}

.topbar,
.panel-header,
.chat-header,
.metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.view-guide-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(179, 157, 130, 0.36);
  border-radius: 2px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
}

.view-guide-button span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(102, 87, 71, 0.22);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
}

.view-guide-button strong {
  font-size: 12px;
  font-weight: 850;
}

.view-guide-button:not(:disabled):hover,
.view-guide-button:not(:disabled):focus-visible {
  border-color: rgba(102, 87, 71, 0.48);
  background: #f4eee5;
  color: var(--ink);
  outline: none;
}

.student-management-panel .panel-actions .secondary-action {
  white-space: nowrap;
}

.student-management-link-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 2.6vw, 38px);
  font-weight: 650;
  line-height: 1.05;
}

h2 {
  font-size: 17px;
  font-weight: 650;
}

.date-block {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.date-block strong,
.status-chip {
  color: var(--accent-strong);
}

.digital-clock {
  min-width: 96px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  font-family: var(--font-numeric);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  box-shadow: none;
}

.logout-button,
.account-button,
.coach-status-button {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.logout-button.is-confirming-logout {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, #fffdf8);
  color: var(--danger);
}

.account-button {
  color: var(--ink);
}

.coach-account-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.coach-account-actions .account-button {
  min-width: 0;
}

.coach-account-actions .account-button[hidden] {
  display: none;
}

.coach-account-actions:has(.account-button[hidden]) {
  grid-template-columns: 1fr;
}

#switchToLiuCoachButton {
  color: var(--ink);
  min-height: 46px;
}

.coach-status-button {
  display: grid;
  gap: 2px;
  justify-items: start;
  min-width: 156px;
  min-height: 46px;
  padding: 7px 10px;
  color: var(--ink);
  text-align: left;
}

.coach-account-tour-anchor {
  display: grid;
  grid-template-columns: minmax(0, auto);
  gap: 8px;
  justify-items: stretch;
}

.date-block .coach-account-tour-anchor {
  min-width: 0;
}

.coach-status-button span,
.coach-status-button strong,
.coach-status-button small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coach-status-button span {
  color: var(--muted);
  font-size: 11px;
}

.coach-status-button strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.coach-status-button small {
  color: var(--muted);
  font-size: 11px;
}

.booking-form input[readonly] {
  background: #f2eae1;
  color: var(--muted);
}

.sidebar-logout {
  width: 100%;
  min-height: 42px;
  margin: -10px 0 18px;
  border-color: #dfcfc5;
  color: var(--danger);
  font-weight: 700;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 24px 0;
}

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 16px;
}

.metrics article[data-coach-metric-range] {
  display: grid;
  grid-template-rows: minmax(42px, auto) auto auto;
  align-content: start;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.metrics article[data-coach-metric-range] > span {
  min-height: 42px;
  display: flex;
  align-items: flex-start;
}

.dashboard-health-card {
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.dashboard-health-card:hover {
  border-color: rgba(179, 157, 130, 0.42);
  background: #f8f1e8;
}

.dashboard-health-card:active {
  transform: translateY(1px);
}

.dashboard-health-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.health-light {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: #cfc4b8;
  box-shadow: 0 0 0 4px rgba(207, 196, 184, 0.18);
}

.health-light.is-ok {
  background: #7f9a7a;
  box-shadow: 0 0 0 4px rgba(127, 154, 122, 0.18);
}

.health-light.is-warning {
  background: #c5a45e;
  box-shadow: 0 0 0 4px rgba(197, 164, 94, 0.2);
}

.health-light.is-error {
  background: #a96961;
  box-shadow: 0 0 0 4px rgba(169, 105, 97, 0.18);
}

body[data-mode="coach"] .metrics article[data-coach-metric-range]:hover,
body[data-mode="coach"] .metrics article[data-coach-metric-range].is-active,
body[data-mode="admin"] .metrics article[data-coach-metric-range]:hover,
body[data-mode="admin"] .metrics article[data-coach-metric-range].is-active {
  border-color: rgba(179, 157, 130, 0.35);
  background: #f8f1e8;
}

body[data-mode="coach"] .metrics article[data-coach-metric-range]:active,
body[data-mode="admin"] .metrics article[data-coach-metric-range]:active {
  transform: translateY(1px);
}

.metrics span,
.metrics strong,
.metrics small {
  display: block;
}

.metrics strong {
  margin: 8px 0;
  font-size: 28px;
  font-weight: 600;
}

.metrics .pending {
  font-size: 23px;
  color: var(--warn);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin: -10px 0 24px;
}

.dashboard-panel {
  padding: 16px;
  min-width: 0;
}

.coach-metric-detail-panel {
  margin: -8px 0 16px;
  padding: 16px;
}

.coach-dashboard-quick-actions {
  display: flex;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: stretch;
  margin: 0 0 12px;
}

.coach-dashboard-booking-button {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
}

.coach-operations-card {
  display: grid;
  gap: 12px;
  margin: 0 0 12px;
  background: #fffdf8;
}

.coach-operations-card[data-tone="danger"] {
  border-color: #d9b8ad;
  background: #fff8f4;
}

.coach-operations-card[data-tone="warning"] {
  border-color: #ddc69f;
  background: #fffaf0;
}

.coach-operations-card[data-tone="success"] {
  border-color: #d2c9b8;
  background: #fbf7ef;
}

.coach-operations-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.coach-operations-grid article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 253, 248, 0.76);
}

.coach-operations-grid span,
.coach-operations-next span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.coach-operations-grid strong {
  color: var(--accent-strong);
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.coach-operations-grid small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.coach-operation-formula {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.coach-operation-formula summary {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.82);
  color: var(--accent-strong);
  cursor: pointer;
  list-style: none;
}

.coach-operation-formula summary::-webkit-details-marker {
  display: none;
}

.coach-operation-formula p {
  margin: 7px 0 0;
  padding-top: 7px;
  border-top: 1px solid rgba(218, 208, 196, 0.75);
}

.coach-operation-stage {
  grid-row: span 2;
}

.coach-operation-stage strong {
  font-size: 22px;
}

.coach-operations-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: start;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.coach-operations-next div,
.coach-operations-next ol {
  margin: 0;
  min-width: 0;
}

.coach-operations-next strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

.coach-operations-next ol {
  display: grid;
  gap: 6px;
  padding-left: 20px;
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1.45;
}

.coach-plan-suggestion {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.coach-plan-suggestion[data-tone="danger"] {
  border-color: #d9b8ad;
  background: #fff8f4;
}

.coach-plan-suggestion[data-tone="warning"] {
  border-color: #ddc69f;
  background: #fffaf0;
}

.coach-plan-suggestion[data-tone="quiet"] {
  background: rgba(255, 253, 248, 0.45);
}

.coach-plan-suggestion strong {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
}

.coach-plan-suggestion p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.coach-metric-date-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 4px;
  margin: 0 0 12px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.coach-metric-date-tab {
  flex: 0 0 118px;
  display: grid;
  gap: 4px;
  min-height: 56px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
  scroll-snap-align: start;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.coach-metric-date-tab:hover,
.coach-metric-date-tab.is-active {
  border-color: rgba(179, 157, 130, 0.35);
  background: #f1e8de;
  color: var(--accent-strong);
}

.coach-metric-date-tab strong,
.coach-metric-date-tab span {
  display: block;
  white-space: nowrap;
}

.coach-metric-date-tab strong {
  font-size: 13px;
}

.coach-metric-date-tab span {
  color: var(--muted);
  font-size: 11px;
}

.coach-metric-day-list {
  display: grid;
  gap: 10px;
}

.coach-metric-booking.is-canceled {
  opacity: 0.74;
  background: #faf8f6;
}

.coach-metric-lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.coach-metric-lesson-actions .student-detail-button {
  min-height: 36px;
}

.dashboard-chart-panel {
  grid-column: 1 / -1;
}

.dashboard-todo-panel {
  grid-column: 1 / -1;
}

.dashboard-todo-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.dashboard-todo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(74px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 2px;
  background: #fffdf8;
}

.dashboard-todo-row.is-warning {
  border-left-color: var(--warn);
  background: #fbf2e6;
}

.dashboard-todo-row.is-danger {
  border-left-color: var(--danger);
  background: #f8eee8;
}

.dashboard-todo-row strong,
.dashboard-todo-row span {
  display: block;
}

.dashboard-todo-row strong {
  color: var(--ink);
}

.dashboard-todo-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-todo-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-todo-row button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
  padding: 0 12px;
  white-space: nowrap;
}

.dashboard-todo-row button.secondary {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(158, 79, 72, 0.06);
}

.dashboard-booking-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.dashboard-booking-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
}

.dashboard-booking-row strong,
.dashboard-booking-row span,
.dashboard-booking-row small {
  display: block;
}

.dashboard-booking-row strong {
  color: var(--accent-strong);
}

.dashboard-booking-row span,
.dashboard-booking-row small {
  color: var(--muted);
  font-size: 13px;
}

.weekly-line-chart {
  margin-top: 14px;
  overflow-x: auto;
}

.weekly-line-chart svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}

.chart-axis {
  stroke: var(--line);
  stroke-width: 2;
}

.chart-line {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: #fffdf8;
  stroke: var(--accent-strong);
  stroke-width: 3;
}

.chart-value {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.chart-label {
  fill: var(--muted);
  font-size: 12px;
}

.topbar {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-subnote {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.panel-header + * {
  margin-top: 14px;
}

.booking-form input,
.booking-form select,
.booking-form textarea,
.student-create-form input,
.student-row input,
.admin-student-create input,
.admin-student-row input,
.topup-form input,
.topup-form select {
  border-radius: 2px;
  border-color: var(--line);
  background: #fffdf8;
}

.primary-booking-button,
.admin-booking-fab,
.topup-submit-button,
.door-lock-entry-button,
.student-detail-button,
.cancel-next-booking-button,
.mock-unlock-button {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: none;
  transform: translateY(0) scale(1);
  transition: transform 160ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.primary-booking-button:active,
.admin-booking-fab:active,
.topup-submit-button:active,
.door-lock-entry-button:active,
.student-detail-button:active,
.cancel-next-booking-button:active,
.mock-unlock-button:active {
  transform: translateY(1px) scale(0.985);
}

.primary-booking-button.is-press-feedback,
.admin-booking-fab.is-press-feedback,
.topup-submit-button.is-press-feedback,
.door-lock-entry-button.is-press-feedback,
.student-detail-button.is-press-feedback,
.cancel-next-booking-button.is-press-feedback,
.mock-unlock-button.is-press-feedback {
  animation: premiumButtonPress 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.primary-booking-button.is-loading,
.admin-booking-fab.is-loading,
.topup-submit-button.is-loading,
.door-lock-entry-button.is-loading,
.student-detail-button.is-loading,
.cancel-next-booking-button.is-loading,
.mock-unlock-button.is-loading {
  opacity: 0.78;
}

.primary-booking-button.is-loading::after,
.admin-booking-fab.is-loading::after,
.topup-submit-button.is-loading::after,
.door-lock-entry-button.is-loading::after,
.student-detail-button.is-loading::after,
.cancel-next-booking-button.is-loading::after,
.mock-unlock-button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 253, 248, 0.34), transparent);
  pointer-events: none;
  animation: premiumLoadingSweep 880ms ease-in-out infinite;
}

.student-management-row,
.coach-row,
.coach-portal-row,
.completed-course-row,
.credit-history-row,
.topup-record-row,
.timeline-item,
.slot-row,
.week-load-card {
  border-radius: 2px;
  box-shadow: none;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.view-section[hidden] {
  display: none !important;
}

.view-section:not([hidden]) {
  animation: premiumViewIn 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body[data-mode="coach"] .app-shell {
  grid-template-columns: 220px minmax(520px, 1fr);
}

body[data-mode="coach"] .content-grid {
  grid-template-columns: minmax(0, 1fr);
}

body[data-mode="coach"] .admin-only {
  display: none;
}

body[data-mode="admin"] .coach-only {
  display: none !important;
}

body[data-mode="coach"] .next-booking-metric {
  display: none;
}

body[data-mode="admin"] .coach-last-month-metric {
  display: none;
}

body[data-mode="coach"] .metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-mode="coach"] .coach-grid {
  display: none;
}

body[data-mode="coach"] .coach-portal-panel {
  max-width: 560px;
}

body[data-mode="coach"] .coach-only {
  display: grid;
}

body[data-mode="coach"] .admin-booking-coach {
  display: none !important;
}

.coach-next-booking-card {
  position: sticky;
  top: 12px;
  z-index: 35;
  grid-template-columns: minmax(180px, auto) 1fr auto;
  gap: 14px;
  align-items: center;
  margin: -6px 0 18px;
  padding: 14px 16px;
  border: 1px solid #ddd2c6;
  border-radius: 8px;
  background: rgba(247, 240, 232, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.coach-next-booking-card.is-clickable {
  cursor: pointer;
}

.coach-next-booking-card.is-clickable:hover,
.coach-next-booking-card.is-clickable:focus-visible {
  border-color: var(--accent);
  background: #f1e8de;
  outline: none;
}

.coach-next-booking-card.is-ongoing {
  border-color: var(--accent);
  background: #f3e9dc;
  animation: subtleBookingPulse 2600ms ease-in-out infinite;
}

.coach-next-booking-card.is-clickable:not(.is-ongoing) .door-lock-entry-button:not(:disabled) {
  animation: entryButtonBreath 2400ms ease-in-out infinite;
}

body[data-mode="coach"]:not([data-view="dashboard"]) .coach-next-booking-card {
  display: none !important;
}

.coach-tour-belt {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  margin: -8px 0 18px;
  padding: 13px 16px;
  border: 1px solid rgba(179, 157, 130, 0.28);
  border-left: 3px solid rgba(102, 87, 71, 0.72);
  border-radius: 2px;
  background: rgba(255, 253, 248, 0.68);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.coach-tour-belt span,
.coach-tour-belt strong,
.coach-tour-belt small {
  display: block;
  min-width: 0;
}

.coach-tour-belt span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coach-tour-belt strong {
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.35;
}

.coach-tour-belt small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.coach-tour-belt:hover,
.coach-tour-belt:focus-visible {
  border-color: rgba(102, 87, 71, 0.42);
  border-left-color: var(--ink);
  background: #f8f1e8;
  outline: none;
}

.monthly-coach-notice {
  margin: -10px 0 18px;
  padding: 14px 16px;
  border: 1px solid #e0cead;
  border-radius: 8px;
  background: #fbf5eb;
  color: #8c6f50;
  box-shadow: var(--shadow);
}

.monthly-coach-notice strong,
.monthly-coach-notice span {
  display: block;
}

.monthly-coach-notice strong {
  margin-bottom: 4px;
}

.monthly-coach-notice span {
  font-size: 14px;
}

.coach-update-notice {
  margin: -8px 0 18px;
}

.coach-update-notice .panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.coach-update-notice .panel-header > div {
  min-width: 0;
}

.coach-update-notice .panel-header h2 {
  width: 100%;
  max-width: 100%;
  overflow: visible;
  white-space: normal;
  line-height: 1.3;
}

.coach-update-notice #ackCoachUpdateNoticeButton {
  min-height: 30px;
  min-width: auto;
  padding: 0 12px;
  border: 1px solid rgba(179, 157, 130, 0.34);
  border-radius: 999px;
  background: #fbf5ee;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.coach-update-notice #ackCoachUpdateNoticeButton:hover,
.coach-update-notice #ackCoachUpdateNoticeButton:focus-visible {
  border-color: rgba(102, 87, 71, 0.38);
  background: #f1e8de;
  color: var(--ink);
}

.coach-update-notice ul {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.venue-guidelines-panel {
  max-width: 980px;
}

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

.guideline-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fbf5ee;
}

.guideline-card > span {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.guideline-card h3 {
  margin: 0;
  font-size: 20px;
}

.guideline-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.insurance-panel {
  max-width: 980px;
}

.insurance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.insurance-summary article,
.insurance-coverage,
.insurance-document {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fbf5ee;
}

.insurance-summary article {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 118px;
  padding: 16px;
}

.insurance-summary span,
.insurance-summary small,
.insurance-coverage span,
.insurance-document figcaption {
  color: var(--muted);
  line-height: 1.55;
}

.insurance-summary span,
.insurance-coverage h3 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.insurance-summary strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.insurance-summary small {
  font-size: 13px;
}

.insurance-coverage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  overflow: hidden;
}

.insurance-coverage h3 {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.insurance-coverage div {
  display: grid;
  gap: 6px;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.insurance-coverage div:nth-child(2n + 1) {
  border-right: 0;
}

.insurance-coverage div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.insurance-coverage strong {
  color: var(--text);
  font-size: 20px;
}

.insurance-document {
  margin: 14px 0 0;
  padding: 14px;
}

.insurance-document img {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

.insurance-document figcaption {
  margin-top: 12px;
  font-size: 13px;
}

.coach-next-booking-card strong,
.coach-next-booking-card small {
  display: block;
}

.coach-next-booking-card strong {
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 20px;
  line-height: 1.25;
}

#coachNextBookingTime {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}

#coachNextBookingTime span {
  display: inline-block;
  white-space: nowrap;
}

.coach-next-booking-card small {
  color: var(--muted);
  font-size: 13px;
}

.cancel-next-booking-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #dfcfc5;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--danger);
  font-weight: 700;
}

.door-lock-entry-panel {
  display: grid;
  gap: 6px;
}

.door-lock-entry-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #ded4c7;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--accent-strong);
  font-weight: 800;
}

.door-lock-entry-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.door-lock-entry-panel p {
  margin: 0;
}

#doorLockEntryHelp {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.door-lock-entry-result {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.door-lock-entry-result span,
.door-lock-entry-result strong,
.door-lock-entry-result small {
  display: block;
}

.door-lock-entry-result strong {
  margin: 2px 0;
  color: var(--accent-strong);
  font-size: 24px;
  letter-spacing: 0.08em;
}

.door-lock-entry-result.is-success {
  color: var(--accent-strong);
}

.door-lock-entry-result.is-error {
  color: var(--danger);
}

.door-lock-entry-result.is-fallback {
  color: var(--text);
}

.door-lock-entry-result.is-fallback strong {
  color: var(--danger);
  font-size: 18px;
  letter-spacing: 0;
}

.door-lock-call-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--button-radius);
  color: var(--text);
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
}

.door-lock-call-button:hover,
.door-lock-call-button:focus-visible {
  background: var(--surface-strong);
}

.door-lock-fallback-reason {
  margin-top: 8px;
  color: var(--muted);
}

.cancel-next-booking-button[hidden] {
  display: none;
}

.cancel-next-booking-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.current-booking-dialog {
  width: min(560px, calc(100vw - 28px));
}

.current-booking-detail {
  display: grid;
  gap: 12px;
}

.current-booking-main,
.current-booking-students,
.current-booking-student-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fbf5ee;
}

.current-booking-main strong {
  color: var(--accent-strong);
  font-size: 22px;
}

.current-booking-main strong,
.current-booking-main small,
.current-booking-student-row strong,
.current-booking-student-row span {
  display: block;
}

.current-booking-student-info {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.current-booking-student-info span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.current-booking-student-info b {
  display: inline-block;
  min-width: 6.5em;
  margin-right: 6px;
  color: var(--ink);
  font-weight: 700;
}

.current-booking-students h3 {
  margin: 0;
  font-size: 15px;
}

.current-booking-student-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: #fffdf8;
}

.completed-course-panel {
  margin: 24px 0;
  padding: 16px;
}

.completed-course-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.completed-course-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.completed-course-controls select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.completed-course-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.completed-course-summary div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8efe5;
}

.completed-course-summary span,
.completed-course-summary strong {
  display: block;
}

.completed-course-summary span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.completed-course-summary strong {
  color: var(--accent-strong);
  font-size: 17px;
}

.completed-course-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.completed-course-row.is-canceled {
  border-color: #dfcfc5;
  background: #f7ece7;
}

.completed-course-row strong,
.completed-course-row span,
.completed-course-row small {
  display: block;
}

.completed-course-row strong {
  color: var(--accent-strong);
}

.completed-course-row span,
.completed-course-row small {
  color: var(--muted);
  font-size: 13px;
}

.coach-personal-revenue-panel {
  margin: 24px 0;
  padding: 16px;
}

.coach-revenue-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.coach-revenue-summary div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.coach-revenue-summary span,
.coach-revenue-summary strong,
.coach-revenue-summary small {
  display: block;
}

.coach-revenue-summary span,
.coach-revenue-summary small {
  color: var(--muted);
}

.coach-revenue-summary strong {
  margin: 6px 0 4px;
  color: var(--accent-strong);
  font-size: 17px;
  line-height: 1.25;
}

.coach-revenue-list {
  display: grid;
  gap: 10px;
}

.coach-revenue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.coach-revenue-row strong,
.coach-revenue-row span,
.coach-revenue-row small {
  display: block;
}

.coach-revenue-row strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.coach-revenue-row span,
.coach-revenue-row small {
  color: var(--muted);
  font-size: 13px;
}

.coach-revenue-row-values {
  display: grid;
  gap: 4px;
  text-align: right;
}

.completed-student-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.completed-student-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.completed-student-fields.is-two-students {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.completed-student-field select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fffdf8;
  font: inherit;
}

.student-management-panel {
  margin: 24px 0;
  padding: 16px;
}

.student-management-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.student-management-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 12px 0 4px;
}

.student-status-filter-tabs {
  display: flex;
  gap: 8px;
  margin: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.student-renewal-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #ead9d1;
  border-radius: 2px;
  background: #fff8f4;
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1.55;
}

.student-renewal-note span {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(155, 106, 96, 0.12);
}

.student-view-toggle {
  display: inline-flex;
  gap: 4px;
  justify-self: end;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.student-view-toggle button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-weight: 850;
  white-space: nowrap;
}

.student-view-toggle button.is-active {
  background: var(--ink);
  color: #fffdf8;
}

.view-toggle-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.view-toggle-icon.is-tiles {
  width: 17px;
  height: 17px;
}

.view-toggle-icon.is-tiles::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
  box-shadow:
    9px 0 0 currentColor,
    0 9px 0 currentColor,
    9px 9px 0 currentColor;
}

.view-toggle-icon.is-card {
  width: 19px;
  height: 17px;
}

.view-toggle-icon.is-card::before,
.view-toggle-icon.is-card::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: transparent;
}

.view-toggle-icon.is-card::before {
  top: 1px;
  left: 4px;
  width: 12px;
  height: 10px;
  opacity: .55;
}

.view-toggle-icon.is-card::after {
  right: 1px;
  bottom: 1px;
  width: 12px;
  height: 10px;
  background: currentColor;
}

.student-status-filter-tab {
  position: relative;
  flex: 0 0 96px;
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
  scroll-snap-align: start;
}

.student-status-filter-tab strong,
.student-status-filter-tab span {
  display: block;
  white-space: nowrap;
}

.student-status-filter-tab strong {
  font-size: 13px;
}

.student-status-filter-tab span {
  color: var(--muted);
  font-size: 11px;
}

.student-status-filter-tab.is-active {
  border-color: var(--accent);
  background: #f1e8de;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.student-status-filter-tab.has-alert {
  border-color: #d9b8ad;
}

.student-status-filter-tab.has-alert::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  opacity: 0.78;
  box-shadow: 0 0 0 3px rgba(155, 106, 96, 0.08);
}

.student-management-list.is-compact-view {
  gap: 12px;
}

.student-orb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: flex-start;
  padding: 6px 2px 10px;
  transform-origin: top left;
  transition: opacity 220ms ease, transform 240ms ease;
}

.student-management-list.has-expanded-student .student-orb-grid.is-detail-open {
  animation: studentCrmGridRetreat 240ms cubic-bezier(0.2, 0.8, 0.22, 1) both;
}

.student-orb {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  width: 104px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(47, 42, 37, 0.045);
  font: inherit;
  padding: 11px 10px;
  text-align: center;
  transition: opacity 180ms ease, transform 220ms ease, border-color 180ms ease, background 180ms ease;
}

.student-orb.has-renewal-alert::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  opacity: 0.72;
  box-shadow: 0 0 0 3px rgba(155, 106, 96, 0.08);
}

.student-orb:hover,
.student-orb:focus-visible {
  border-color: var(--accent);
  background: #fbf5ee;
  transform: translateY(-2px);
}

.student-orb.is-expanded {
  border-color: var(--accent-strong);
  background: #f1e8de;
  transform: scale(1.06);
  box-shadow: 0 14px 28px rgba(47, 42, 37, 0.1);
  z-index: 1;
  animation: studentCrmSelectedFocus 260ms cubic-bezier(0.2, 0.8, 0.22, 1) both;
}

.student-orb.is-dimmed {
  opacity: 0.28;
  filter: saturate(0.7);
  transform: scale(0.78);
  display: none;
}

.student-orb.is-dimmed small,
.student-orb.is-dimmed b {
  display: none;
}

.student-orb-name {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.student-orb small,
.student-orb b {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-orb b {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.student-orb-detail,
.student-orb-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 14px;
  animation: studentCrmDetailIn 300ms cubic-bezier(0.2, 0.8, 0.22, 1) both;
}

.student-orb-detail-stage {
  display: grid;
  min-width: 0;
}

.student-orb-detail-stage.is-open {
  animation: studentCrmDetailStageIn 300ms cubic-bezier(0.2, 0.8, 0.22, 1) both;
}

.student-orb-empty {
  color: var(--muted);
  text-align: center;
}

.student-orb-detail-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.student-profile-avatar.is-large {
  width: 58px;
  height: 58px;
  font-size: 17px;
}

.student-orb-detail-head h3,
.student-orb-detail-head p {
  margin: 0;
}

.student-orb-detail-head h3 {
  font-size: 22px;
  line-height: 1.2;
}

.student-orb-detail-head p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.student-orb-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.student-orb-detail-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.student-orb-detail-grid span,
.student-orb-detail-grid strong,
.student-orb-detail-grid small {
  display: block;
}

.student-orb-detail-grid span,
.student-orb-detail-grid small {
  color: var(--muted);
  font-size: 12px;
}

.student-orb-detail-grid strong {
  margin: 5px 0 3px;
  color: var(--ink);
  font-size: 18px;
}

@keyframes studentCrmGridRetreat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0.92;
    transform: translateY(-3px) scale(0.985);
  }
}

@keyframes studentCrmSelectedFocus {
  0% {
    transform: translateY(0) scale(0.96);
  }

  100% {
    transform: translateY(-1px) scale(1.06);
  }
}

@keyframes studentCrmDetailStageIn {
  from {
    opacity: 0.2;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes studentCrmDetailIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.student-compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto minmax(150px, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.student-compact-identity,
.student-compact-next {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font: inherit;
}

.student-compact-identity {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.student-compact-identity strong,
.student-compact-identity small,
.student-compact-next span,
.student-compact-next strong,
.student-compact-status small {
  display: block;
}

.student-compact-identity strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2;
}

.student-compact-identity small,
.student-compact-next span,
.student-compact-status small {
  color: var(--muted);
  font-size: 12px;
}

.student-compact-status {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.student-compact-next {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.student-compact-next strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-management-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.student-profile-card {
  gap: 14px;
  padding: 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffdf8 0%, #fbf5ee 100%);
}

.student-profile-card-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.student-profile-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f1e8de;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
}

.student-profile-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.student-profile-card-head strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.student-profile-card-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.student-profile-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.student-profile-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
}

.student-profile-metric + .student-profile-metric {
  border-left: 1px solid var(--line);
}

.student-profile-metric span,
.student-profile-insight span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.student-profile-metric strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.student-profile-metric small,
.student-profile-insight small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.student-profile-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.student-profile-insight {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
}

.student-profile-insight strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.student-profile-card .student-management-actions {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.student-management-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.student-management-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-management-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.student-contact-review-notice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  margin-top: 8px;
  border: 1px solid rgba(167, 116, 58, 0.24);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(248, 239, 229, 0.92);
  color: #7c5a31;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
}

.student-contact-review-notice.is-compact {
  min-height: 22px;
  margin-top: 5px;
  padding: 3px 8px;
  font-size: 10px;
}

.student-followup-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 11px;
  background: #f8efe5;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.student-followup-pill.is-action {
  cursor: pointer;
}

.student-followup-pill.is-action:hover,
.student-followup-pill.is-action:focus-visible {
  background: var(--button-hover-bg);
  color: var(--button-hover-fg);
  outline: 2px solid rgba(36, 35, 33, 0.18);
  outline-offset: 2px;
}

.student-followup-pill.is-scheduled {
  background: #f7ede1;
  color: var(--accent-strong);
}

.student-followup-pill.is-waiting {
  background: #f8efe2;
  color: var(--warn);
}

.student-name-line {
  display: inline-flex;
  align-items: flex-start;
  gap: 5px;
  max-width: 100%;
  position: relative;
}

.student-renewal-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  min-height: 10px;
  margin-top: 1px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
}

.student-renewal-dot::before {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  margin: 2px auto 0;
  border-radius: 50%;
  background: var(--danger);
  opacity: 0.76;
  box-shadow: 0 0 0 3px rgba(155, 106, 96, 0.08);
}

.student-renewal-dot:hover::before,
.student-renewal-dot:focus-visible::before {
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(155, 106, 96, 0.14);
}

.student-detail-button {
  justify-self: start;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
}

.student-detail-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .student-management-toolbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
  }

  .student-renewal-note {
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.5;
  }

  .student-renewal-note span {
    width: 5px;
    height: 5px;
    margin-top: 6px;
    box-shadow: 0 0 0 3px rgba(155, 106, 96, 0.08);
  }

  .student-view-toggle {
    justify-self: end;
  }

  .student-status-filter-tabs {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  .student-orb-grid {
    justify-content: flex-start;
    gap: 6px;
  }

  .student-orb {
    width: calc((100% - 12px) / 3);
    min-height: 76px;
    padding: 9px 7px;
    border-radius: 16px;
  }

  .student-orb.is-expanded {
    transform: scale(1.04);
  }

  .student-orb-detail-head {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .student-orb-detail-head .student-followup-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .student-profile-avatar.is-large {
    width: 52px;
    height: 52px;
  }

  .student-orb-detail-grid {
    grid-template-columns: 1fr;
  }

  .student-compact-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .student-compact-status {
    justify-items: start;
  }

  .student-profile-card {
    padding: 14px;
  }

  .student-profile-card-head {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .student-profile-card-head .student-followup-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .student-profile-metrics,
  .student-profile-insights {
    grid-template-columns: 1fr;
  }

  .student-profile-metric + .student-profile-metric {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .student-profile-metric strong {
    font-size: 22px;
  }
}

.coach-plan-periods-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.coach-plan-periods-section h3,
.coach-plan-periods-section p {
  margin: 0;
}

.coach-plan-period-list {
  display: grid;
  gap: 8px;
}

.plan-period-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.plan-period-row strong,
.plan-period-row small,
.plan-period-row span {
  display: block;
}

.plan-period-row small,
.plan-period-row span {
  color: var(--muted);
}

.plan-period-row.is-cancelled {
  opacity: 0.55;
}

.coach-plan-period-create {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.coach-plan-period-create input[name="planPeriodNote"] {
  grid-column: 1 / -1;
}

.student-notification-preference {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.student-notification-preference legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.student-notification-preference small {
  color: var(--muted);
  line-height: 1.45;
}

.student-notification-preference .inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.student-notification-preference .inline-check input {
  width: 16px;
  height: 16px;
}

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

.notification-method-grid label {
  position: relative;
  display: block;
  margin: 0;
}

.notification-method-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.notification-method-grid span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted);
  font-weight: 850;
}

.notification-method-grid input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.notification-method-grid label.is-disabled {
  opacity: 0.45;
}

.student-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-detail-dialog section {
  display: grid;
  gap: 10px;
}

.student-detail-dialog section[hidden] {
  display: none;
}

.student-detail-dialog h3 {
  margin: 8px 0 0;
  font-size: 15px;
}

.student-detail-list {
  display: grid;
  gap: 8px;
}

.student-management-summary strong,
.student-management-summary small {
  display: block;
}

.student-management-summary small,
.student-empty-lessons,
.student-lesson-row span,
.student-lesson-row small {
  color: var(--muted);
  font-size: 13px;
}

.student-lesson-list {
  display: grid;
  gap: 8px;
}

.student-lesson-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.student-lesson-row strong,
.student-lesson-row span,
.student-lesson-row small {
  display: block;
}

.student-lesson-row strong {
  color: var(--accent-strong);
}

.student-credit-edit-details {
  margin-top: 4px;
}

.student-credit-edit-details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
}

.student-credit-edit-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.student-credit-edit-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.student-credit-edit-form input {
  width: 100%;
}

.student-lesson-month {
  display: grid;
  gap: 8px;
}

.student-lesson-month h4 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 14px;
}

.student-lesson-month-list {
  display: grid;
  gap: 8px;
}

.student-manual-lesson-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e0d4c8;
  border-radius: 8px;
  background: #f8f1e8;
}

.student-manual-lesson-form h4 {
  margin: 0;
  font-size: 15px;
}

.student-manual-lesson-form button {
  min-height: 38px;
  border: 1px solid var(--accent-strong);
  border-radius: 8px;
  background: var(--accent-strong);
  color: #fffdf8;
  font-weight: 800;
}

.student-manual-lesson-form small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.student-lesson-details summary {
  display: grid;
  gap: 3px;
  cursor: pointer;
  list-style-position: inside;
}

.student-lesson-detail-body {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.coach-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  width: 100%;
  min-width: 0;
}

.panel {
  padding: 20px;
  min-width: 0;
}

.schedule-panel {
  grid-row: auto;
}

.traffic-panel {
  order: -1;
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(340px, 1fr);
  gap: 12px;
  align-items: start;
}

.traffic-panel .panel-header {
  grid-column: 1 / -1;
}

.traffic-panel {
  position: sticky;
  top: 12px;
  z-index: 34;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

body[data-mode="coach"] .traffic-panel {
  position: sticky;
  top: 104px;
  grid-template-columns: 1fr;
}

body[data-mode="coach"] .traffic-panel .panel-header,
body[data-mode="coach"] .traffic-panel > .traffic-legend,
body[data-mode="coach"] .traffic-panel > .capacity-note {
  display: none;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  font-size: 24px;
  line-height: 1;
}

.primary-booking-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 700;
}

.primary-booking-button span {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 18px;
  line-height: 1;
}

.admin-booking-fab {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 190px;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(31, 35, 40, 0.26);
  transform: translateX(-50%);
}

body:not(.authenticated) .admin-booking-fab,
body:not([data-mode="admin"]) .admin-booking-fab,
body:not([data-view="bookings"]) .admin-booking-fab {
  display: none !important;
}

.admin-booking-fab span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 18px;
  line-height: 1;
}

.primary-booking-button:disabled,
.coach-actions button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #f2eae1;
  color: var(--muted);
  box-shadow: none;
}

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.coach-calendar-board {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffdf8;
}

.admin-coach-calendar-board {
  margin: 18px 0;
}

.coach-calendar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.coach-calendar-header h3 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.coach-calendar-sync {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 2px 0 4px;
  text-align: center;
}

.coach-calendar-sync .secondary-action {
  width: min(280px, 100%);
  min-height: 40px;
  justify-content: center;
  font-weight: 800;
}

.coach-calendar-sync p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.coach-calendar-scroll {
  position: relative;
  max-height: min(72vh, 860px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding-bottom: 0;
  overscroll-behavior: contain;
}

.coach-calendar-grid {
  display: grid;
  grid-template-columns: 52px repeat(var(--calendar-days, 7), 132px);
  --calendar-hour-height: 64px;
  width: max-content;
  min-width: 100%;
  overflow: visible;
  background: #fbf5ee;
}

.coach-calendar-time-head,
.coach-calendar-day-head {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.coach-calendar-time-head {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 8;
  border-right: 1px solid var(--line);
  box-shadow: 6px 6px 14px rgba(102, 87, 71, 0.06);
}

.coach-calendar-day-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 8px;
  border-left: 1px solid var(--line);
  box-shadow: 0 6px 12px rgba(102, 87, 71, 0.04);
}

.coach-calendar-day-head strong {
  font-family: var(--font-numeric);
  font-size: 15px;
  line-height: 1.05;
  white-space: nowrap;
}

.coach-calendar-day-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.coach-calendar-day-head.is-today {
  background: #efe4d8;
}

.coach-calendar-times {
  position: sticky;
  left: 0;
  z-index: 5;
  display: grid;
  height: calc(var(--calendar-hour-height) * var(--calendar-hours, 19));
  grid-template-rows: repeat(var(--calendar-hours, 19), var(--calendar-hour-height));
  padding-top: 0;
  border-right: 1px solid var(--line);
  background: #fffdf8;
  box-shadow: 6px 0 12px rgba(102, 87, 71, 0.05);
}

.coach-calendar-times span {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  color: var(--muted);
  font-family: var(--font-numeric);
  font-size: 11px;
  border-bottom: 1px solid rgba(45, 41, 37, .06);
}

.coach-calendar-day {
  position: relative;
  height: calc(var(--calendar-hour-height) * var(--calendar-hours, 19));
  border-left: 1px solid var(--line);
  background: #fffaf4;
}

.coach-calendar-day.is-today {
  background: #f8efe4;
}

.coach-calendar-hour-line {
  display: block;
  height: var(--calendar-hour-height);
  border-bottom: 1px solid rgba(45, 41, 37, .06);
}

.coach-calendar-event {
  position: absolute;
  left: 8px;
  right: 8px;
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 56px;
  overflow: hidden;
  border: 1px solid rgba(45, 41, 37, .1);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(45, 41, 37, .07);
}

.coach-calendar-event strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coach-calendar-event span {
  overflow: hidden;
  color: rgba(45, 41, 37, .82);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coach-calendar-event small {
  overflow: hidden;
  color: rgba(45, 41, 37, .64);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coach-calendar-event.is-one {
  background: #efe4d8;
}

.coach-calendar-event.is-two {
  background: #e5d2c1;
}

.coach-calendar-event.is-three {
  background: #d8c2ad;
}

.coach-calendar-event.is-massage {
  background: #e7ece3;
}

.coach-calendar-event.is-trial {
  background: #eee8cf;
}

.coach-calendar-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.booking-card.is-calendar-focused,
.coach-booking.is-calendar-focused {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  background: #f4eadf;
  transition: background .25s ease, outline-color .25s ease;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fbf5ee;
  text-align: center;
}

.booking-status-board {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.booking-status-board > div:first-child {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbf5ee;
}

.booking-status-board strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--font-numeric);
  font-size: 22px;
  letter-spacing: 0;
}

.time-color-table {
  position: relative;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  height: 124px;
  max-height: 124px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      to right,
      rgba(179, 157, 130, 0.055) 0,
      rgba(179, 157, 130, 0.055) 1px,
      transparent 1px,
      transparent 24px
    ),
    linear-gradient(to bottom, rgba(255, 253, 248, 0.96), rgba(248, 241, 232, 0.72));
  -webkit-overflow-scrolling: touch;
}

.time-color-table.is-date-linked {
  border-color: var(--line);
  background:
    repeating-linear-gradient(
      to right,
      rgba(102, 87, 71, 0.055) 0,
      rgba(102, 87, 71, 0.055) 1px,
      transparent 1px,
      transparent 24px
    ),
    linear-gradient(to bottom, rgba(244, 236, 226, 0.88), rgba(239, 229, 216, 0.86));
  box-shadow: none;
}

.load-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  gap: 0;
  width: 100%;
  min-width: 100%;
  height: 122px;
  min-height: 122px;
  max-height: 122px;
  padding: 8px 8px 14px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.45) 1px, transparent 1px) 0 0 / 100% 25%,
    transparent;
}

.load-segment {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  align-items: end;
  justify-content: center;
  height: 98px;
  min-height: 98px;
  max-height: 98px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
  isolation: isolate;
}

.load-segment:last-child {
  border-right: 0;
}

.load-segment b,
.load-segment small {
  display: block;
}

.load-segment b {
  position: absolute;
  left: 0;
  bottom: -11px;
  transform: none;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0.72;
  z-index: 2;
}

.load-segment > i {
  position: relative;
  display: block;
  width: 8px;
  height: var(--load-fill, 0%);
  min-height: 4px;
  max-height: 96px;
  border: 0;
  border-radius: 5px 5px 1px 1px;
  background: var(--traffic-comfort-dot);
  overflow: hidden;
  box-shadow: none;
  z-index: 0;
}

.load-segment > i::after {
  content: none;
}

.load-segment.is-medium > i {
  background: var(--traffic-medium-dot);
}

.load-segment.is-peak > i {
  background: var(--traffic-peak-dot);
}

.load-segment small {
  position: absolute;
  left: 50%;
  bottom: clamp(8px, calc(var(--load-fill, 0%) + 3px), 86px);
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0;
  min-width: 100%;
  color: #6f6254;
  font-family: var(--font-body);
  font-size: 7px;
  font-weight: 850;
  line-height: 0.96;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 253, 248, 0.7);
  z-index: 12;
}

.load-segment:hover small,
.load-segment:focus-visible small {
  opacity: 1;
}

.load-segment:hover,
.load-segment:focus-visible {
  z-index: 10;
}

.load-segment.is-current {
  outline: 0;
  box-shadow: inset 0 0 0 2px rgba(47, 42, 37, 0.56);
  z-index: 8;
}

.load-segment.is-selected {
  outline: 0;
  box-shadow: inset 0 0 0 2px rgba(102, 87, 71, 0.72);
  z-index: 9;
}

body[data-mode="admin"] .time-color-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body[data-mode="admin"] .load-bar {
  min-width: 100%;
}

body[data-mode="admin"] .time-axis {
  min-width: 100%;
}

body[data-mode="admin"] .load-segment {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  gap: 0;
}

body[data-mode="admin"] .load-segment b {
  font-size: 8px;
  line-height: 1.1;
}

body[data-mode="admin"] .load-segment small {
  font-size: 10px;
  line-height: 1.1;
}

body[data-mode="admin"] .load-segment.is-current,
body[data-mode="admin"] .load-segment.is-selected {
  outline: 0;
}

.week-forecast {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.week-forecast-board {
  display: grid;
  gap: 10px;
}

.week-date-tabs {
  position: relative;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.week-date-tab {
  flex: 0 0 152px;
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 56px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7f1;
  color: var(--ink);
  text-align: left;
  scroll-snap-align: start;
}

.week-date-tab.is-today {
  flex-basis: 210px;
}

.week-date-tab strong,
.week-date-tab span {
  display: block;
  white-space: nowrap;
}

.week-date-tab strong {
  font-size: 14px;
  overflow: visible;
}

.week-date-tab span {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-date-tab.is-active {
  position: relative;
  z-index: 2;
  border-color: transparent;
  background: #efe5d8;
  box-shadow: 0 8px 18px rgba(102, 87, 71, 0.055);
}

.week-date-tab.is-active strong {
  color: #2f2a25;
}

.week-date-tab.is-active span {
  color: #6f6254;
}

.week-forecast-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  overflow: clip;
}

.week-forecast-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #f8efe5;
}

.week-forecast-panel-header span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.week-booking-list,
.week-load-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.week-booking-list + .week-load-list {
  border-top: 1px solid var(--line);
}

.week-load-list {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.week-load-card {
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.week-load-card strong,
.week-load-card span,
.week-load-card small {
  display: block;
}

.week-load-card strong {
  font-size: 13px;
}

.week-load-card span {
  font-size: 12px;
  font-weight: 800;
}

.week-load-card .capacity-bar {
  margin-top: 0;
}

.week-load-card .capacity-bar small {
  color: currentColor;
  opacity: 0.78;
}

.week-load-card small {
  color: currentColor;
  font-size: 11px;
  opacity: 0.82;
}

.week-load-card.is-comfort {
  border-color: var(--traffic-comfort-border);
  background: var(--traffic-comfort-bg);
  color: var(--traffic-comfort-fg);
}

.week-load-card.is-medium {
  border-color: var(--traffic-medium-border);
  background: var(--traffic-medium-bg);
  color: var(--traffic-medium-fg);
}

.week-load-card.is-peak {
  border-color: var(--traffic-peak-border);
  background: var(--traffic-peak-bg);
  color: var(--traffic-peak-fg);
}

.week-load-card.is-current,
.week-load-card.is-selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.time-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.booking-card {
  display: grid;
  grid-template-columns: minmax(112px, 0.32fr) minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.cancel-booking-button {
  border: 1px solid #dfcfc5;
  border-radius: 999px;
  background: #fffdf8;
  color: var(--danger);
  min-height: 32px;
  padding: 0 10px;
  font-weight: 700;
}

.booking-calendar-actions {
  display: grid;
  gap: 6px;
  min-width: 112px;
}

.booking-calendar-actions button,
.calendar-add-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  min-height: 34px;
  padding: 0 12px;
  font-weight: 700;
}

.booking-calendar-actions button:hover,
.booking-calendar-actions button:focus-visible,
.calendar-add-actions button:hover,
.calendar-add-actions button:focus-visible {
  background: #f1ede7;
}

.calendar-add-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 6px;
}

.calendar-feed-actions {
  grid-template-columns: 1fr;
}

.booking-card strong,
.booking-card span {
  display: block;
}

.booking-card .time {
  font-weight: 700;
  color: var(--accent-strong);
}

.admin-date-booking-board {
  display: grid;
  gap: 10px;
}

.admin-date-booking-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.admin-date-booking-tab {
  flex: 0 0 132px;
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
  scroll-snap-align: start;
}

.admin-date-booking-tab strong,
.admin-date-booking-tab span {
  display: block;
  white-space: nowrap;
}

.admin-date-booking-tab strong {
  font-size: 13px;
}

.admin-date-booking-tab span {
  color: var(--muted);
  font-size: 11px;
}

.admin-date-booking-tab.is-active {
  border-color: var(--accent);
  background: #f1e8de;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.admin-date-booking-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  overflow: clip;
}

.admin-date-booking-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #f8efe5;
}

.admin-date-booking-panel-header strong {
  color: var(--ink);
}

.admin-date-booking-panel-header span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.admin-date-booking-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

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

.admin-booking-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.admin-booking-row.is-canceled {
  opacity: 0.72;
}

.admin-booking-row .time {
  color: var(--muted);
  font-weight: 700;
}

.booking-note {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

.status-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1e8de;
  font-size: 12px;
  font-weight: 700;
}

.status-chip.is-comfort {
  background: var(--traffic-comfort-bg);
  color: var(--traffic-comfort-fg);
}

.status-chip.is-medium {
  background: var(--traffic-medium-bg);
  color: var(--traffic-medium-fg);
}

.status-chip.is-peak {
  background: var(--traffic-peak-bg);
  color: var(--traffic-peak-fg);
}

.status-chip.waiting {
  background: #f8efe2;
  color: var(--warn);
}

.traffic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.traffic-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #fffdf8;
}

.traffic-legend.compact {
  margin: 0;
}

.traffic-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.traffic-legend .is-comfort {
  background: var(--traffic-comfort-dot);
}

.traffic-legend .is-medium {
  background: var(--traffic-medium-dot);
}

.traffic-legend .is-peak {
  background: var(--traffic-peak-dot);
}

.capacity-breakdown {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 0;
  min-width: 0;
}

.capacity-breakdown div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbf5ee;
}

.capacity-breakdown span,
.capacity-breakdown strong {
  display: block;
}

.capacity-breakdown span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.capacity-breakdown strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.capacity-bar {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  min-width: 0;
}

.capacity-bar > span {
  position: relative;
  display: block;
  width: 100%;
  height: 8px;
  margin: 0;
  border: 1px solid rgba(102, 87, 71, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.74);
  overflow: hidden;
}

.capacity-bar > span i {
  display: block;
  width: var(--capacity-fill, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--traffic-comfort-dot);
}

.capacity-bar.is-medium > span i {
  background: var(--traffic-medium-dot);
}

.capacity-bar.is-peak > span i {
  background: var(--traffic-peak-dot);
}

.capacity-bar small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

body[data-mode="admin"] .traffic-panel .panel-header {
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

body[data-mode="admin"] .traffic-panel .panel-header > div:first-child {
  flex: 0 0 auto;
}

body[data-mode="admin"] .traffic-panel .capacity-breakdown {
  display: flex;
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
}

body[data-mode="admin"] .traffic-panel .capacity-breakdown div {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 30px;
  padding: 5px 8px;
  white-space: nowrap;
}

body[data-mode="admin"] .traffic-panel .capacity-breakdown span {
  margin: 0;
  font-size: 11px;
}

body[data-mode="admin"] .traffic-panel .capacity-breakdown strong {
  font-size: 13px;
}

body[data-mode="admin"] .traffic-panel .status-chip {
  margin-left: auto;
}

.capacity-mini-pie {
  display: grid;
  grid-column: 1 / -1;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.capacity-mini-pie-chart {
  --capacity-rate: 0%;
  --capacity-color: var(--traffic-comfort-dot);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fffdf8 0 50%, transparent 51%),
    conic-gradient(var(--capacity-color) var(--capacity-rate), #efe7dc 0);
}

.capacity-mini-pie-chart.is-medium {
  --capacity-color: var(--traffic-medium-dot);
}

.capacity-mini-pie-chart.is-peak {
  --capacity-color: var(--traffic-peak-dot);
}

.capacity-mini-pie-chart span {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.capacity-mini-pie strong,
.capacity-mini-pie small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.capacity-mini-pie strong {
  font-size: 14px;
  margin-bottom: 4px;
}

.capacity-mini-pie small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.capacity-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.slot-bookings-panel {
  grid-row: span 3;
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbf5ee;
}

.slot-bookings-panel h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.slot-booking-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 260px;
  overflow: auto;
}

.slot-booking-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.slot-booking-row strong,
.slot-booking-row span,
.slot-booking-row small {
  display: block;
}

.slot-booking-row span,
.slot-booking-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.integration-steps {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.integration-steps div {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.integration-steps span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #d9cfc3;
  flex: 0 0 auto;
}

.integration-steps .done {
  color: var(--ink);
}

.integration-steps .done span {
  background: var(--accent);
}

.secondary-action {
  width: 100%;
}

.lock-compact-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbf5ee;
  color: var(--muted);
  font-size: 13px;
}

.lock-compact-note .secondary-action {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
}

.lock-record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.lock-record-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  background: #fffdf8;
  min-width: 0;
}

.lock-fingerprint-card {
  margin-top: 14px;
  background: #fbf5ee;
}

.lock-fingerprint-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.lock-fingerprint-header .secondary-action {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
}

.lock-fingerprint-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.door-lock-fingerprint-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(120px, 0.7fr) minmax(140px, 1fr) minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.door-lock-fingerprint-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.door-lock-fingerprint-summary {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.door-lock-fingerprint-summary strong {
  display: block;
  margin-bottom: 8px;
}

.fingerprint-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fingerprint-chip-list button {
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
}

.unknown-fingerprint-chip {
  animation: fingerprintPulse 1.15s ease-in-out infinite;
  border-color: #b78378;
  color: #8b5a50;
  background: #fff5f1;
}

@keyframes fingerprintPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(183, 131, 120, 0.16);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(183, 131, 120, 0.07);
  }
}

.fingerprint-chip-list small {
  margin-left: 4px;
  color: var(--muted);
}

.fingerprint-assignment-list {
  display: grid;
  gap: 8px;
}

.fingerprint-assignment-section {
  display: grid;
  gap: 8px;
}

.fingerprint-assignment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbf5ee;
}

.fingerprint-assignment-row span,
.fingerprint-assignment-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.panel-header.compact {
  margin-bottom: 12px;
}

.panel-header.compact h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.lock-record-list {
  display: grid;
  gap: 10px;
}

.lock-unlock-browser {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.lock-unlock-month-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.lock-unlock-month-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lock-unlock-month-row span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.lock-unlock-date-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.lock-unlock-date-tabs button {
  width: auto;
  min-width: 104px;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.lock-unlock-date-tabs button.active {
  border-color: var(--accent);
  background: #f1e8de;
  color: var(--accent-strong);
}

.lock-unlock-date-tabs small,
.lock-cache-note {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.lock-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 4px solid #d8d2ca;
  border-radius: 6px;
  padding: 12px;
  background: #fbf5ee;
}

.lock-record-row.is-success {
  border-left-color: var(--accent);
}

.lock-record-row.is-warning {
  border-left-color: #c09a64;
}

.lock-record-row.is-error {
  border-left-color: #b78378;
}

.lock-record-row strong,
.lock-record-row span,
.lock-record-row small,
.lock-record-row time {
  display: block;
}

.lock-record-row span,
.lock-record-row small,
.lock-record-row time {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.lock-record-row time {
  white-space: nowrap;
}

.coach-table {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  min-width: 0;
}

.coach-account-card {
  margin: 0 0 18px;
}

.coach-student-card {
  display: none;
  margin: 0 0 18px;
}

.coach-student-card h2 {
  margin-top: 4px;
  font-size: 17px;
}

.student-create-form {
  display: grid;
  grid-template-columns: 1fr 84px;
  gap: 8px;
  margin-top: 14px;
}

.student-create-form input,
.student-row input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  width: 100%;
}

.student-create-form input[name="name"] {
  grid-column: 1 / -1;
}

.student-create-form button {
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 700;
}

.admin-student-grant,
.admin-coach-topups,
.sensitive-profile-panel {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid #e0d4c8;
  border-radius: 8px;
  background: #f8f1e8;
}

.admin-student-grant h3,
.admin-student-grant p,
.admin-coach-topups h3,
.admin-coach-topups p,
.sensitive-profile-panel h3,
.sensitive-profile-panel p {
  margin: 0;
}

.admin-student-grant p,
.admin-coach-topups p,
.sensitive-profile-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sensitive-profile-panel button {
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
}

.admin-student-list {
  display: grid;
  gap: 8px;
}

.admin-student-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(120px, 150px) minmax(120px, 150px);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

@media (max-width: 720px) {
  .admin-student-row {
    grid-template-columns: 1fr 1fr;
  }

  .admin-student-row > div {
    grid-column: 1 / -1;
  }
}

.admin-student-row strong,
.admin-student-row small {
  display: block;
}

.admin-student-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-student-create {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) 140px auto;
  gap: 8px;
}

.admin-student-create input,
.admin-student-create select,
.admin-student-row input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  width: 100%;
  min-width: 0;
  background: #fffdf8;
  color: var(--ink);
}

.admin-student-create button {
  min-height: 40px;
  border: 1px solid var(--accent-strong);
  border-radius: 8px;
  background: var(--accent-strong);
  color: #fffdf8;
  font-weight: 700;
}

.student-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.student-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.student-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.student-row-header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.student-delete-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.student-readonly-stats {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.student-readonly-stats span {
  overflow-wrap: anywhere;
}

.student-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.coach-account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.coach-account-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbf5ee;
}

.coach-account-stats span,
.coach-account-stats strong {
  display: block;
}

.coach-account-stats span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.edit-coach-button,
.danger-action {
  min-height: 36px;
  align-self: end;
  border-radius: 8px;
  font-weight: 700;
}

.edit-coach-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fffdf8;
}

.danger-action {
  border: 1px solid #dfcfc5;
  background: #fffdf8;
  color: var(--danger);
}

.danger-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.coach-row {
  display: grid;
  grid-template-columns:
    minmax(150px, 1.25fr)
    minmax(104px, 0.85fr)
    minmax(82px, 0.75fr)
    minmax(112px, 0.85fr)
    minmax(142px, 1fr)
    96px;
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
  min-width: 0;
  max-width: 100%;
}

.coach-filter-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.coach-filter-tab {
  flex: 0 0 112px;
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
  scroll-snap-align: start;
}

.coach-filter-tab strong,
.coach-filter-tab span {
  display: block;
  white-space: nowrap;
}

.coach-filter-tab strong {
  font-size: 13px;
}

.coach-filter-tab span {
  color: var(--muted);
  font-size: 11px;
}

.coach-filter-tab.is-active {
  border-color: var(--accent);
  background: #f1e8de;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.coach-filter-result {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.coach-row strong,
.coach-row span,
.coach-row small {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.coach-row > div {
  min-width: 0;
  align-self: stretch;
}

.coach-row-actions {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: center;
  grid-auto-rows: 34px;
}

.coach-weekly-status {
  display: grid;
  gap: 3px;
  align-content: center;
  min-width: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.coach-weekly-status[data-tone="danger"] {
  border-color: #d9b8ad;
  background: #fff8f4;
}

.coach-weekly-status[data-tone="warning"] {
  border-color: #ddc69f;
  background: #fffaf0;
}

.coach-weekly-status[data-tone="success"] {
  border-color: #d2c9b8;
  background: #fbf7ef;
}

.coach-weekly-status strong {
  font-size: 13px;
}

.coach-weekly-status small {
  font-size: 11px;
}

.coach-row .edit-coach-button,
.coach-row .view-agreement-button {
  width: 100%;
  height: 34px;
  min-height: 34px;
  min-width: 0;
  padding: 0 8px;
  box-sizing: border-box;
  white-space: nowrap;
}

.coach-agreement-empty {
  display: block;
  height: 34px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.7);
  color: var(--muted);
  font-size: 12px;
  line-height: 32px;
  text-align: center;
  box-sizing: border-box;
  white-space: nowrap;
}

.coach-row span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.coach-summary-main strong {
  font-size: 16px;
}

.coach-row small,
.coach-portal small {
  color: var(--muted);
}

.credit-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 999px;
  background: #f2eae1;
  color: var(--blue);
  font-weight: 700;
}

.credit-pill.monthly {
  background: #f1e8de;
  color: var(--accent-strong);
}

.credit-pill.low {
  background: #f8efe2;
  color: var(--warn);
}

.coach-portal {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.venue-closure-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.venue-closure-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.venue-closure-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.venue-closure-form input {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdf8;
  color: var(--ink);
}

.venue-closure-full-day {
  align-self: end;
  min-height: 44px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdf8;
}

.venue-closure-compensation {
  color: var(--ink);
  font-weight: 800;
}

.venue-closure-compensation-detail {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.venue-closure-form .primary-action {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 0 18px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 800;
}

.venue-closure-list {
  display: grid;
  gap: 8px;
}

.venue-closure-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.venue-closure-item strong,
.venue-closure-item span {
  display: block;
}

.venue-closure-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.trial-assignment-panel {
  display: grid;
  gap: 14px;
}

.student-visit-list {
  display: grid;
  gap: 12px;
}

.student-visit-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.student-visit-card.is-processed {
  opacity: 0.74;
}

.student-visit-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.student-visit-main h3,
.student-visit-main p {
  margin: 0;
}

.student-visit-main p,
.student-visit-details,
.student-visit-processed-note {
  color: var(--muted);
}

.student-visit-details {
  display: grid;
  gap: 6px;
  font-size: 13px;
  line-height: 1.6;
}

.student-visit-candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-visit-candidates button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fbf5ee;
  color: var(--ink);
  font-weight: 700;
}

.student-visit-controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.student-visit-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.student-visit-controls select,
.student-visit-controls input {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdf8;
  color: var(--ink);
}

.student-visit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.student-visit-actions button {
  min-height: 44px;
  white-space: nowrap;
}

.student-visit-actions .danger-action {
  min-height: 44px;
  border: 1px solid #d8b7b0;
  border-radius: 8px;
  padding: 0 14px;
  background: #fffdf8;
  color: #8f5d58;
  font-weight: 800;
}

.student-visit-actions .danger-action:not(:disabled):hover,
.student-visit-actions .danger-action:not(:disabled):focus-visible {
  background: #f7ece8;
  color: #6f3d38;
}

.coach-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbf5ee;
}

.coach-hero strong,
.coach-hero span {
  display: block;
}

.coach-hero strong {
  font-size: 24px;
  margin-top: 4px;
}

.coach-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.coach-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  min-height: 40px;
}

.admin-credit-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf8;
}

.admin-credit-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-credit-summary div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8efe5;
}

.admin-credit-summary span,
.admin-credit-summary strong {
  display: block;
}

.admin-credit-summary span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.admin-credit-summary strong {
  color: var(--accent-strong);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.admin-credit-ledger {
  display: grid;
  gap: 8px;
}

.admin-credit-ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.admin-credit-ledger-row strong,
.admin-credit-ledger-row span,
.admin-credit-ledger-row small {
  display: block;
}

.admin-credit-ledger-row span,
.admin-credit-ledger-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-credit-ledger-row b {
  color: var(--accent-strong);
  white-space: nowrap;
}

.admin-credit-ledger-row.booking_debit b {
  color: var(--danger);
}

.admin-credit-ledger-row.booking_refund b {
  color: var(--accent-strong);
}

.revenue-panel {
  display: grid;
  gap: 14px;
}

.revenue-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.revenue-pie-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 190px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.revenue-pie-visual {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(179, 157, 130, 0.28);
  border-radius: 50%;
  background: #eee6dc;
  box-shadow: inset 0 0 0 10px #fffdf8;
}

.revenue-pie-card strong,
.revenue-pie-card small {
  display: block;
}

.revenue-pie-card strong {
  color: var(--ink);
  font-size: 13px;
}

.revenue-pie-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.revenue-month-controls {
  display: grid;
  grid-template-columns: auto minmax(128px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.revenue-month-controls select {
  min-height: 38px;
}

.revenue-month-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

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

.revenue-summary div,
.expense-summary div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8efe5;
}

.revenue-summary span,
.revenue-summary strong,
.expense-summary span,
.expense-summary strong {
  display: block;
}

.revenue-summary span,
.expense-summary span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.revenue-summary strong,
.expense-summary strong {
  color: var(--accent-strong);
  font-size: 16px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.currency-unit {
  display: inline-block;
  margin-right: 2px;
  color: var(--muted);
  font-size: 0.42em;
  font-weight: 800;
  line-height: 1;
  vertical-align: 0.24em;
}

.revenue-obligation-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

.revenue-obligation-summary {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
}

.revenue-obligation-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.revenue-obligation-summary span,
.revenue-obligation-summary strong,
.revenue-obligation-summary small {
  display: block;
}

.revenue-obligation-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.revenue-obligation-summary strong {
  margin: 6px 0;
  color: var(--accent-strong);
  font-size: 17px;
  line-height: 1.25;
}

.revenue-obligation-summary small {
  color: var(--muted);
  line-height: 1.45;
}

.revenue-obligation-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.revenue-obligation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.revenue-obligation-row strong,
.revenue-obligation-row span,
.revenue-obligation-row small {
  display: block;
}

.revenue-obligation-row span,
.revenue-obligation-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.revenue-obligation-row b {
  color: var(--accent-strong);
  font-size: 12px;
  white-space: nowrap;
}

.revenue-table {
  display: grid;
  gap: 8px;
}

.revenue-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) minmax(130px, 1fr) repeat(6, minmax(82px, 0.7fr));
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  font-size: 13px;
}

.revenue-row-head {
  color: var(--muted);
  background: #f8efe5;
  font-weight: 700;
}

.revenue-row strong,
.revenue-row small {
  display: block;
}

.revenue-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}

.revenue-row b {
  color: var(--accent-strong);
  font-size: 12px;
  white-space: nowrap;
}

.revenue-coach-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.revenue-coach-button:hover,
.revenue-coach-button:focus-visible {
  color: var(--accent-strong);
  outline: none;
}

.revenue-coach-button[aria-expanded="true"] {
  color: var(--accent-strong);
}

.revenue-coach-detail {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.revenue-detail-head,
.revenue-detail-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(90px, 0.8fr) minmax(90px, 0.8fr) minmax(78px, 0.7fr) minmax(84px, 0.7fr);
  gap: 10px;
  align-items: center;
}

.revenue-detail-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 8px 4px;
}

.revenue-detail-row {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  font-size: 13px;
}

.revenue-detail-row b,
.revenue-detail-row small,
.revenue-detail-row strong {
  display: block;
}

.revenue-detail-row small {
  color: var(--muted);
  margin-top: 2px;
}

.revenue-detail-row strong {
  color: var(--accent-strong);
  font-size: 12px;
  white-space: nowrap;
}

.expense-panel {
  display: grid;
  gap: 12px;
}

.expense-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.expense-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.expense-form input,
.expense-form select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fffdf8;
  color: var(--text);
  font: inherit;
}

.expense-note-field {
  grid-column: span 2;
}

.expense-checkbox {
  display: flex !important;
  grid-column: span 1;
  align-items: center;
  gap: 8px !important;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.expense-checkbox input {
  min-height: auto;
  width: 16px;
  height: 16px;
  padding: 0;
}

.expense-submit-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--text);
  color: #fffdf8;
  font-weight: 800;
  padding: 0 18px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.expense-cancel-edit-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted);
  font-weight: 800;
  padding: 0 18px;
}

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

.expense-list {
  display: grid;
  gap: 8px;
}

.expense-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(120px, 0.8fr) minmax(110px, 0.7fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  font-size: 13px;
}

.expense-row strong,
.expense-row span,
.expense-row small,
.expense-row b {
  display: block;
  min-width: 0;
}

.expense-row small,
.expense-row span {
  color: var(--muted);
}

.expense-row small {
  font-size: 12px;
  line-height: 1.45;
  margin-top: 2px;
}

.expense-row b {
  color: var(--accent-strong);
  white-space: nowrap;
}

.expense-delete-button {
  min-width: 72px;
  min-height: 36px;
}

.expense-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.expense-edit-button,
.expense-delete-button {
  min-width: 64px;
  min-height: 36px;
}

.reconciliation-panel {
  display: grid;
  gap: 14px;
}

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

.reconciliation-summary div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8efe5;
}

.reconciliation-summary span,
.reconciliation-summary strong {
  display: block;
}

.reconciliation-summary span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.reconciliation-summary strong {
  color: var(--accent-strong);
  font-size: 19px;
  overflow-wrap: anywhere;
}

.reconciliation-table {
  display: grid;
  gap: 8px;
}

.reconciliation-row {
  display: grid;
  grid-template-columns: minmax(122px, 0.75fr) minmax(180px, 1.2fr) minmax(150px, 0.9fr) minmax(190px, 1.1fr) minmax(88px, 0.45fr) minmax(150px, 0.85fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  font-size: 13px;
}

.reconciliation-row-head {
  color: var(--muted);
  background: #f8efe5;
  font-weight: 800;
}

.reconciliation-row.is-completed {
  border-color: #ded4c7;
  background: #fcf4e8;
}

.reconciliation-row.is-cancelled {
  border-color: #dfcfc5;
  background: #faf1ec;
}

.reconciliation-row strong,
.reconciliation-row span,
.reconciliation-row small,
.reconciliation-row b {
  display: block;
  min-width: 0;
}

.reconciliation-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 2px;
}

.reconciliation-row b {
  color: var(--accent-strong);
  white-space: nowrap;
}

.topup-panel {
  display: grid;
  gap: 12px;
}

.topup-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.topup-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topup-form input,
.topup-form select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fffdf8;
  color: var(--text);
  font: inherit;
}

.topup-form button {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 180px;
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 800;
  padding: 0 18px;
}

.topup-submit-button {
  box-shadow: none;
}

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

.coach-private-revenue-note {
  border: 1px solid var(--line);
  background: #fbf5ee;
  padding: 10px 12px;
}

.student-topup-row {
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 0.8fr)) auto;
}

.student-topup-detail-toggle {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 850;
  padding: 0 12px;
  white-space: nowrap;
}

.student-topup-detail-toggle:hover,
.student-topup-detail-toggle:focus-visible {
  border-color: rgba(102, 87, 71, 0.42);
  background: #f4eee5;
  outline: none;
}

.student-topup-detail-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(179, 157, 130, 0.26);
}

.student-topup-detail-panel > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(179, 157, 130, 0.24);
  border-radius: 2px;
  background: rgba(255, 253, 248, 0.62);
}

.student-topup-detail-panel span,
.student-topup-detail-panel strong,
.student-topup-detail-panel small {
  display: block;
  min-width: 0;
}

.student-topup-detail-panel span {
  color: var(--muted);
  font-size: 12px;
}

.student-topup-detail-panel strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
}

.student-topup-detail-panel small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.student-topup-detail-panel ul {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.student-topup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.student-topup-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
  padding: 0 12px;
}

.topup-summary div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8efe5;
}

.topup-summary span,
.topup-summary strong {
  display: block;
}

.topup-summary span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.topup-summary strong {
  color: var(--accent-strong);
  font-size: 20px;
}

.topup-list {
  display: grid;
  gap: 8px;
}

.topup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(100px, 0.35fr) minmax(120px, 0.35fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.topup-row.is-cancelled {
  background: #f7ece7;
  border-color: #dfcfc5;
}

.topup-row strong,
.topup-row span,
.topup-row small,
.topup-row b {
  display: block;
}

.topup-row span,
.topup-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.topup-row b {
  color: var(--accent-strong);
  white-space: nowrap;
}

.topup-cancel-button {
  min-height: 34px;
  white-space: nowrap;
}

.audit-panel {
  display: grid;
  gap: 14px;
}

.audit-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.audit-filter-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.audit-filter-tabs button,
.audit-filter-bar select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.audit-filter-tabs button {
  padding: 0 12px;
}

.audit-filter-tabs button.is-active {
  border-color: var(--accent);
  background: #efe3d7;
  box-shadow: inset 0 0 0 1px rgba(179, 157, 130, 0.25);
}

.audit-filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.system-health-panel {
  display: grid;
  gap: 16px;
}

.system-health-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.system-health-summary article,
.system-health-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.system-health-summary article {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.system-health-summary span,
.system-health-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.system-health-summary strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.system-health-summary small,
.system-health-card small {
  color: var(--muted);
  line-height: 1.45;
}

.system-health-list,
.system-health-group {
  display: grid;
  gap: 12px;
}

.system-health-group {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

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

.system-health-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-left-width: 4px;
}

.system-health-card > div {
  min-width: 0;
}

.system-health-card strong {
  display: block;
  margin: 4px 0 6px;
  color: var(--ink);
}

.system-health-card b {
  display: block;
  color: var(--ink);
  font-size: 22px;
  text-align: right;
}

.system-health-card.is-ok {
  border-left-color: #9fb8a2;
}

.system-health-card.is-warning {
  border-left-color: #d4bd8a;
}

.system-health-card.is-error {
  border-left-color: #b98780;
}

.privacy-control-panel {
  display: grid;
  gap: 18px;
}

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

.privacy-classification-grid article {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.privacy-classification-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.privacy-classification-grid strong {
  color: var(--ink);
  line-height: 1.5;
}

.privacy-export-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.privacy-export-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.privacy-export-form legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 800;
}

.privacy-export-form button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 800;
}

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

.privacy-record-form,
.privacy-records-grid section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.privacy-record-form h3,
.privacy-record-form p,
.privacy-records-grid h3 {
  margin: 0;
}

.privacy-record-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.privacy-record-form button,
.privacy-record-row button {
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
}

.privacy-record-list {
  display: grid;
  gap: 8px;
}

.privacy-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.privacy-record-row strong,
.privacy-record-row span,
.privacy-record-row small {
  display: block;
}

.privacy-record-row span,
.privacy-record-row small {
  color: var(--muted);
  line-height: 1.5;
}

.privacy-consent-dialog {
  max-width: 680px;
}

.privacy-consent-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.2em;
  color: var(--muted);
  line-height: 1.6;
}

.audit-alert-list,
.audit-log-list {
  display: grid;
  gap: 8px;
}

.audit-alert-card,
.audit-log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.35fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.audit-alert-card.is-high,
.audit-log-row.has-alert {
  border-color: #e0cbc6;
  background: #fbf0ec;
}

.audit-alert-card.is-medium {
  border-color: #ded2ba;
  background: #fbf2e6;
}

.audit-alert-card strong,
.audit-alert-card span,
.audit-alert-card small,
.audit-alert-card b,
.audit-log-row strong,
.audit-log-row span,
.audit-log-row small {
  display: block;
}

.audit-alert-card span,
.audit-alert-card small,
.audit-log-row span,
.audit-log-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.audit-log-row .audit-behavior-text {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(179, 157, 130, 0.22);
  color: #75685b;
  font-size: 12px;
}

.audit-alert-card strong,
.audit-log-row strong {
  margin: 3px 0;
  color: var(--ink);
  font-size: 14px;
}

.audit-alert-card b {
  color: var(--danger);
  font-size: 20px;
  text-align: right;
}

.audit-alert-card div:last-child,
.audit-log-row div:last-child {
  text-align: right;
}

.audit-log-header {
  margin-top: 8px;
}

.coach-bookings {
  display: grid;
  gap: 8px;
}

.coach-booking {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) 1fr auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.admin-booking-edit-details {
  grid-column: 1 / -1;
}

.admin-booking-edit-details summary {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  width: fit-content;
  margin-top: 4px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.admin-booking-edit-details summary::-webkit-details-marker {
  display: none;
}

.admin-booking-edit-details[open] summary {
  border-color: var(--accent);
  background: #f1e8de;
  color: var(--accent-strong);
}

.admin-booking-edit-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(90px, 0.6fr) minmax(90px, 0.7fr) minmax(90px, 0.6fr) minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}

.admin-booking-edit-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.admin-booking-edit-form .admin-booking-otp-field {
  grid-column: span 2;
}

.admin-booking-edit-form .admin-booking-otp-note {
  grid-column: span 2;
  align-self: center;
  margin: 0;
}

.admin-booking-edit-form select,
.admin-booking-edit-form input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 13px;
}

.admin-booking-edit-form button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf8;
  padding: 0 10px;
  font-weight: 800;
}

.completed-bookings-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.credit-history-list {
  display: grid;
  gap: 10px;
}

.coach-credit-section {
  display: grid;
  gap: 8px;
}

.coach-credit-section h3 {
  margin: 4px 0 2px;
  font-size: 14px;
}

.credit-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbf5ee;
}

.credit-history-row strong,
.credit-history-row span,
.credit-history-row small {
  display: block;
}

.credit-history-row span,
.credit-history-row small {
  color: var(--muted);
  font-size: 12px;
}

.credit-history-row b {
  color: var(--accent-strong);
}

.credit-history-row small {
  grid-column: 1 / -1;
}

.lesson-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lesson-plan-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  min-height: 36px;
  padding: 0 10px;
  font-weight: 800;
}

.lesson-plan-actions .danger-action {
  border-color: #dfcfc5;
  color: var(--danger);
}

.lesson-feedback-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lesson-feedback-toggle input {
  appearance: none;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  margin: 0;
}

.lesson-feedback-toggle input::before,
.booking-form .checkbox-field input::before {
  content: "";
  width: 6px;
  height: 6px;
  transform: scale(0);
  transition: transform 120ms ease;
  background: var(--accent-strong);
}

.lesson-feedback-toggle input:checked::before,
.booking-form .checkbox-field input:checked::before {
  transform: scale(1);
}

.lesson-feedback-toggle:has(input:checked) {
  border-color: var(--accent);
  background: #f1e8de;
  color: var(--accent-strong);
}

.lesson-rpe-url {
  overflow-wrap: anywhere;
}

.student-latest-rpe-notice {
  display: grid;
  gap: 5px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(179, 157, 130, 0.34);
  border-left: 3px solid rgba(102, 87, 71, 0.62);
  border-radius: 8px;
  background: rgba(248, 241, 232, 0.76);
}

.student-latest-rpe-notice span,
.student-latest-rpe-notice small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.student-latest-rpe-notice strong {
  color: var(--accent-strong);
  font-size: 16px;
  line-height: 1.25;
}

.student-latest-rpe-notice p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.lesson-photo-uploader {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fbf6ef;
}

.lesson-photo-uploader strong,
.lesson-photo-uploader small {
  display: block;
}

.lesson-photo-uploader strong {
  font-size: 14px;
}

.lesson-photo-uploader small {
  color: var(--muted);
  line-height: 1.55;
}

.lesson-photo-uploader img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
}

.lesson-photo-button {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.lesson-photo-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.lesson-photo-button:hover,
.lesson-photo-button:focus-within {
  background: #f1e8de;
  border-color: rgba(179, 157, 130, 0.5);
}

.lesson-photo-status {
  overflow-wrap: anywhere;
}

.completed-bookings-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.completed-bookings-panel .coach-bookings {
  margin-top: 10px;
}

.completed-booking {
  background: #fbf5ee;
}

.booking-form input,
.booking-form select,
.booking-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--ink);
}

.booking-form input[type="date"],
.booking-form input[type="time"],
.booking-form input[type="datetime-local"] {
  display: block;
  inline-size: 100%;
  min-inline-size: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}

.booking-form input,
.booking-form select {
  min-height: 42px;
}

.booking-form input[type="date"],
.booking-form input[type="time"],
.booking-form input[type="number"],
.booking-form input[type="datetime-local"] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booking-form input[type="date"]::-webkit-date-and-time-value,
.booking-form input[type="time"]::-webkit-date-and-time-value,
.booking-form input[type="datetime-local"]::-webkit-date-and-time-value {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  text-align: left;
}

.booking-form input[type="date"]::-webkit-datetime-edit,
.booking-form input[type="time"]::-webkit-datetime-edit,
.booking-form input[type="datetime-local"]::-webkit-datetime-edit,
.booking-form input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.booking-form input[type="time"]::-webkit-datetime-edit-fields-wrapper,
.booking-form input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
  min-width: 0;
  max-width: 100%;
  padding: 0;
}

.booking-form input[type="date"]::-webkit-calendar-picker-indicator,
.booking-form input[type="time"]::-webkit-calendar-picker-indicator,
.booking-form input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  margin-inline-start: auto;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-align: left;
}

input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper,
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
  display: flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-inline-start: 4px;
  padding: 0;
}

.booking-form .password-field input {
  min-height: 42px;
}

.booking-form textarea {
  min-height: 78px;
  padding: 10px 12px;
  resize: vertical;
}

.session-type-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.booking-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fbf5ee;
}

.booking-form select[name="sessionType"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.session-type-toggle button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
}

.booking-mode-toggle button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.session-type-toggle button.is-active,
.booking-mode-toggle button.is-active {
  border-color: var(--accent);
  background: #f1e8de;
  color: var(--accent-strong);
}

.session-type-toggle button:disabled {
  opacity: 0.45;
}

body[data-mode="coach"] .booking-form.is-quick-booking-mode .detailed-booking-field {
  display: none !important;
}

dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  width: min(420px, calc(100vw - 32px));
}

#coachEditDialog {
  width: min(980px, calc(100vw - 32px));
}

#coachEditDialog .coach-edit-form {
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding-right: 4px;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.booking-form {
  display: grid;
  gap: 14px;
}

.booking-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.captcha-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.captcha-box img,
.captcha-inline-svg {
  width: 160px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.captcha-inline-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.captcha-inline-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.captcha-box button,
.coach-agreement-panel button,
.signature-pad-wrap button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
}

.coach-agreement-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.coach-agreement-panel h3,
.coach-agreement-panel p {
  margin: 0;
}

.register-email-verify {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e3d8ca;
  border-radius: 8px;
  background: #f7ede1;
}

.register-email-verify[hidden] {
  display: none;
}

.register-email-verify h3,
.register-email-verify p {
  margin: 0;
}

.account-google-link {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e3d8ca;
  border-radius: 8px;
  background: #faf4ed;
}

.account-google-link h3,
.account-google-link p {
  margin: 0;
}

.account-google-link button {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.account-google-link.is-linked {
  background: #f4eee6;
}

.agreement-sign-form {
  width: min(860px, calc(100vw - 32px));
}

dialog:has(.agreement-sign-form),
dialog:has(.agreement-view-form) {
  width: min(900px, calc(100vw - 32px));
}

.agreement-view-form {
  width: min(860px, calc(100vw - 32px));
}

.agreement-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.agreement-view-header h2 {
  margin: 4px 0 0;
}

.agreement-view-header .icon-button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.agreement-view-frame {
  width: 100%;
  height: min(72vh, 760px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.agreement-preview-frame {
  width: 100%;
  height: min(48vh, 520px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.agreement-checkbox {
  width: 100%;
  white-space: normal;
}

.signature-pad-wrap {
  display: grid;
  gap: 8px;
}

.signature-pad-wrap span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

#agreementSignatureCanvas {
  width: 100%;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  touch-action: none;
}

.booking-datetime-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 2px 0 0;
  padding: 12px;
  border: 1px solid #e0d4c8;
  border-radius: 8px;
  background: #f8f1e8;
}

.booking-datetime-options legend {
  padding: 0 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.booking-slot-capacity {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-color: var(--traffic-comfort-border);
  background: var(--traffic-comfort-bg);
  color: var(--traffic-comfort-fg);
}

.booking-slot-capacity strong,
.booking-slot-capacity span {
  display: block;
}

.booking-slot-capacity strong {
  font-size: 14px;
}

.booking-slot-capacity span {
  font-size: 12px;
  line-height: 1.45;
}

.booking-slot-capacity .capacity-bar {
  margin: 4px 0;
}

.booking-slot-capacity .capacity-bar > span {
  background: rgba(255, 253, 248, 0.54);
}

.booking-slot-capacity .capacity-bar small {
  color: currentColor;
  opacity: 0.76;
}

.booking-slot-capacity.is-medium {
  border-color: var(--traffic-medium-border);
  background: var(--traffic-medium-bg);
  color: var(--traffic-medium-fg);
}

.booking-slot-capacity.is-peak {
  border-color: var(--traffic-peak-border);
  background: var(--traffic-peak-bg);
  color: var(--traffic-peak-fg);
}

.booking-slot-capacity.is-closed {
  border-color: #d6c7b7;
  background: #f2e8dc;
  color: #6d5844;
}

.booking-form .checkbox-field {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  background: #fffdf8;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  cursor: pointer;
  white-space: normal;
  overflow: visible;
}

.booking-form .checkbox-field input {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fffdf8;
  margin: 2px 0 0;
}

.booking-form .checkbox-field span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.booking-form .checkbox-field:has(input:checked) {
  border-color: var(--accent);
  background: #f1e8de;
  color: var(--accent-strong);
}

.student-confirmation-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

.coach-notification-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fbf5ee;
  color: var(--ink);
  font-weight: 800;
}

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

.form-grid-2 > *,
.booking-form label {
  min-width: 0;
}

.student-profile-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.student-profile-row strong {
  font-size: 13px;
  color: var(--muted);
}

.student-profile-row span {
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
}

.lesson-note-field {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.lesson-note-field input,
.lesson-note-field select,
.lesson-note-field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
}

.lesson-note-field textarea {
  resize: vertical;
}

.booking-form menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  margin: 4px 0 0;
}

.booking-form menu button {
  min-width: 84px;
}

.coach-plan-detail {
  display: grid;
  gap: 10px;
}

.coach-plan-detail div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf5ee;
}

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

.coach-plan-detail strong {
  color: var(--ink);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

@media (max-width: 820px) {
  .app-shell,
  .content-grid,
  .coach-grid,
  .dashboard-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-panel {
    grid-column: auto;
  }

  .lock-record-grid,
  .lock-record-row {
    grid-template-columns: 1fr;
  }

  .system-health-summary,
  .system-health-grid,
  .audit-filter-bar {
    grid-template-columns: 1fr;
  }

  .system-health-card {
    flex-direction: column;
  }

  .system-health-card b {
    text-align: left;
  }

  .lock-compact-note,
  .lock-unlock-month-row,
  .lock-fingerprint-header {
    grid-template-columns: 1fr;
  }

  .door-lock-fingerprint-form,
  .door-lock-fingerprint-summary,
  .fingerprint-assignment-row {
    grid-template-columns: 1fr;
  }

  .lock-record-row time {
    white-space: normal;
  }

  body[data-mode="coach"] {
    padding-bottom: 92px;
    background: #fffdf8;
  }

  body[data-mode="coach"] .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 12px;
    min-height: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
  }

  .sidebar.nav-open {
    z-index: 1000;
  }

  .brand {
    gap: 9px;
    padding-bottom: 6px;
  }

  .brand > div {
    flex: 1 1 auto;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand strong {
    font-size: 13px;
  }

  .brand span {
    font-size: 11px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    position: relative;
    z-index: 1010;
  }

  .nav {
    position: fixed;
    top: max(70px, calc(12px + env(safe-area-inset-top)));
    right: 12px;
    z-index: 1005;
    width: min(260px, calc(100vw - 24px));
    margin: 0;
    padding: 6px;
    border: 1px solid var(--line);
    background: #fffdf8;
    overflow: visible;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition:
      opacity 160ms ease,
      transform 180ms cubic-bezier(0.2, 0.9, 0.2, 1);
    box-shadow: 0 18px 40px rgba(23, 23, 23, 0.14);
  }

  .sidebar:not(.nav-open) .nav {
    display: none;
  }

  .sidebar.nav-open .nav {
    display: grid;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .nav button {
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    text-align: left;
    padding: 0 12px;
    height: 42px;
    min-height: 42px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(8px);
    transition:
      opacity 150ms ease,
      transform 180ms ease;
  }

  .sidebar.nav-open .nav button {
    opacity: 1;
    transform: translateX(0);
  }

  .sidebar.nav-open .nav button:nth-child(2) {
    transition-delay: 20ms;
  }

  .sidebar.nav-open .nav button:nth-child(3) {
    transition-delay: 40ms;
  }

  .sidebar.nav-open .nav button:nth-child(4) {
    transition-delay: 60ms;
  }

  .sidebar.nav-open .nav button:nth-child(5) {
    transition-delay: 80ms;
  }

  .sidebar.nav-open .nav button:nth-child(6) {
    transition-delay: 100ms;
  }

  @media (prefers-reduced-motion: reduce) {
    .nav,
    .nav button {
      transition: none;
    }
  }

  .plan-panel {
    display: none;
  }

  body[data-mode="coach"] .plan-panel.coach-only {
    display: none;
  }

  .workspace {
    padding: 0 12px 12px;
  }

  .topbar,
  .panel-header {
    align-items: flex-start;
  }

  .schedule-panel #addBookingButton {
    width: 100%;
    margin-left: 0;
  }

  .student-management-panel .panel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .coach-update-notice .panel-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .coach-update-notice #ackCoachUpdateNoticeButton {
    min-height: 28px;
    padding-inline: 10px;
    font-size: 11px;
  }

  .student-management-panel .panel-actions {
    display: contents;
  }

  .student-topup-row {
    grid-template-columns: 1fr;
  }

  .student-topup-detail-toggle {
    width: 100%;
  }

  .student-topup-detail-panel {
    grid-template-columns: 1fr;
  }

  .student-management-panel .student-view-toggle {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
  }

  .student-management-panel .panel-actions > :not(.student-view-toggle) {
    grid-column: 1 / -1;
  }

  .student-management-panel .panel-actions .status-chip {
    justify-self: start;
  }

  .student-management-panel .panel-actions .status-chip {
    margin-top: 10px;
  }

  .student-management-link-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-top: 8px;
  }

  .student-management-link-actions .secondary-action {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .student-management-panel .student-status-filter-tabs {
    width: 100%;
  }

  .student-management-panel .panel-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .coach-plan-period-create {
    grid-template-columns: 1fr;
  }

  .coach-plan-period-create input[name="planPeriodNote"] {
    grid-column: auto;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 6px;
    padding: 8px 0 10px;
  }

  body[data-mode="coach"] .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(176px, 42%);
    align-items: start;
    min-height: 0;
    height: auto;
    margin: 0 0 8px;
    padding: 0 0 8px;
  }

  body[data-mode="coach"] .topbar .eyebrow,
  body[data-mode="coach"] .topbar .mode-note {
    display: none;
  }

  body[data-mode="coach"] .topbar > div:first-child {
    min-width: 0;
    align-self: center;
  }

  body[data-mode="coach"] .topbar h1 {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .date-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    justify-items: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body[data-mode="coach"] .date-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 58px;
    gap: 8px;
    align-items: stretch;
    justify-content: stretch;
    justify-items: stretch;
    width: 100%;
    align-self: stretch;
    overflow: visible;
  }

body[data-mode="coach"] .date-block .digital-clock,
body[data-mode="coach"] .date-block #todayLabel,
body[data-mode="coach"] .date-block #openStatus,
body[data-mode="coach"] .date-block .account-button {
  display: none;
}

body[data-mode="coach"] .date-block .coach-account-tour-anchor {
  display: grid;
  min-width: 0;
  width: 100%;
  height: 100%;
}

body[data-mode="coach"] .date-block .coach-account-actions {
  display: none;
}

body[data-mode="coach"] .coach-status-button {
  display: grid;
  align-self: stretch;
    min-width: 0;
    width: 100%;
    height: 100%;
    min-height: 58px;
    padding: 8px 9px;
    border-color: #ddd2c6;
    background: #f8f1e8;
  }

  body[data-mode="coach"] .coach-status-button span {
    font-size: 10px;
  }

  body[data-mode="coach"] .coach-status-button strong {
    font-size: 12px;
  }

  body[data-mode="coach"] .coach-status-button small {
    font-size: 10px;
  }

  h1 {
    font-size: 24px;
  }

  .mode-note {
    max-width: none;
    font-size: 12px;
  }

  .digital-clock {
    min-width: 84px;
    font-size: 15px;
    padding: 6px 8px;
  }

  .account-button,
  .logout-button {
    flex: 0 0 auto;
    min-height: 34px;
  }

  body[data-mode="coach"] .logout-button {
    display: grid;
    place-items: center;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 58px;
    padding: 0;
    font-size: 12px;
  }

  .date-block span,
  .date-block #openStatus {
    font-size: 12px;
  }

  body[data-mode="admin"] .sidebar-logout {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 45;
    width: auto;
    min-height: 44px;
    padding: 0 14px;
    margin: 0;
    border-color: var(--danger);
    background: #fffdf8;
    box-shadow: 0 12px 28px rgba(31, 35, 40, 0.2);
  }

  .metrics {
    gap: 10px;
    margin: 6px 0 10px;
  }

  .coach-next-booking-card {
    position: static;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 0 8px;
    padding: 12px 14px;
  }

  .current-booking-student-row {
    grid-template-columns: 1fr;
  }

  body[data-mode="coach"]:not([data-view="dashboard"]) .coach-next-booking-card {
    display: none !important;
    visibility: hidden;
    height: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
  }

  body[data-mode="coach"][data-view="students"] .student-management-panel {
    margin-top: 6px;
  }

  body[data-mode="coach"] .coach-student-card {
    display: none;
  }

  body[data-mode="coach"] .coach-account-card {
    display: grid;
    gap: 10px;
    margin: 10px 0 0;
    padding: 12px;
    box-shadow: none;
  }

  body[data-mode="coach"] .coach-account-card h2 {
    margin-top: 3px;
    font-size: 16px;
  }

  body[data-mode="coach"] .coach-account-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
  }

  body[data-mode="coach"] .coach-account-stats div {
    padding: 10px;
  }

  body[data-mode="coach"] .coach-account-stats strong {
    font-size: 14px;
    line-height: 1.3;
  }

  body[data-mode="coach"] .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-mode="coach"] .coach-last-month-metric {
    grid-column: 1 / -1;
  }

  .metrics article {
    padding: 14px;
  }

  .metrics strong {
    font-size: 28px;
  }

  .guideline-grid {
    grid-template-columns: 1fr;
  }

  .guideline-card {
    padding: 14px;
  }

  .guideline-card h3 {
    font-size: 18px;
  }

  .insurance-summary,
  .insurance-coverage {
    grid-template-columns: 1fr;
  }

  .insurance-summary article {
    min-height: 0;
    padding: 14px;
  }

  .insurance-coverage div,
  .insurance-coverage div:nth-child(2n + 1),
  .insurance-coverage div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .insurance-coverage div:last-child {
    border-bottom: 0;
  }

  .insurance-document {
    padding: 10px;
  }

  .panel {
    padding: 16px;
  }

  .traffic-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  body[data-mode="coach"] .traffic-panel {
    position: static;
    top: auto;
    z-index: 0;
    padding: 14px;
  }

  body[data-mode="coach"] .traffic-panel .panel-header {
    display: none;
  }

  .capacity-mini-pie {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 8px;
    min-width: 0;
  }

  .capacity-mini-pie-chart {
    width: 56px;
    height: 56px;
  }

  .capacity-mini-pie-chart span {
    font-size: 11px;
  }

  .capacity-mini-pie strong {
    font-size: 13px;
    margin-bottom: 2px;
  }

  .capacity-mini-pie small {
    font-size: 11px;
    line-height: 1.35;
  }

  .capacity-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .capacity-breakdown div {
    padding: 8px;
  }

  .capacity-breakdown div:last-child {
    grid-column: 1 / -1;
  }

  .capacity-breakdown span {
    font-size: 10px;
    margin-bottom: 3px;
  }

  .capacity-breakdown strong {
    font-size: 12px;
    line-height: 1.25;
  }

  body[data-mode="admin"] .traffic-panel .panel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 8px;
  }

  body[data-mode="admin"] .traffic-panel {
    padding: 10px 12px;
    gap: 8px;
  }

  body[data-mode="admin"] .traffic-panel .panel-header .eyebrow {
    display: none;
  }

  body[data-mode="admin"] .traffic-panel .panel-header h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.2;
  }

  body[data-mode="admin"] .traffic-panel .capacity-breakdown {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }

  body[data-mode="admin"] .traffic-panel .capacity-breakdown div {
    display: grid;
    min-height: 0;
    padding: 5px 6px;
    white-space: normal;
  }

  body[data-mode="admin"] .traffic-panel .capacity-breakdown div:last-child {
    grid-column: auto;
  }

  body[data-mode="admin"] .traffic-panel .capacity-breakdown span {
    font-size: 9px;
    margin-bottom: 2px;
  }

  body[data-mode="admin"] .traffic-panel .capacity-breakdown strong {
    font-size: 12px;
    line-height: 1.15;
  }

  body[data-mode="admin"] .traffic-panel .status-chip {
    justify-self: end;
    margin-left: 0;
    padding: 4px 8px;
    font-size: 11px;
  }

  body[data-mode="admin"] .traffic-panel .traffic-legend,
  body[data-mode="admin"] .traffic-panel .capacity-bar {
    display: none;
  }

  body[data-mode="admin"] .traffic-panel .capacity-note {
    display: none;
  }

  body[data-mode="admin"] .traffic-panel .slot-bookings-panel {
    padding: 7px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }

  body[data-mode="admin"] .traffic-panel .slot-bookings-panel .eyebrow {
    display: none;
  }

  body[data-mode="admin"] .traffic-panel .slot-bookings-panel h3 {
    margin: 0;
    font-size: 13px;
    line-height: 1.2;
  }

  body[data-mode="admin"] .traffic-panel .slot-booking-list {
    gap: 4px;
    margin-top: 6px;
    max-height: 92px;
  }

  body[data-mode="admin"] .traffic-panel .slot-booking-row {
    gap: 1px;
    padding: 6px 8px;
    border-radius: 7px;
  }

  body[data-mode="admin"] .traffic-panel .slot-booking-row strong {
    font-size: 12px;
    line-height: 1.2;
  }

  body[data-mode="admin"] .traffic-panel .slot-booking-row span,
  body[data-mode="admin"] .traffic-panel .slot-booking-row small {
    font-size: 10px;
    line-height: 1.25;
  }

  .schedule-panel {
    grid-row: auto;
    padding: 14px;
  }

  .booking-status-board {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 12px;
  }

  .booking-status-board > div:first-child {
    display: none;
  }

  .traffic-legend {
    gap: 6px;
  }

  .traffic-legend span {
    min-height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }

  .time-color-table,
  .load-bar {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .time-color-table {
    height: 120px;
    max-height: 120px;
    border-radius: 8px;
    margin-top: 10px;
  }

  .load-bar {
    height: 118px;
    min-height: 118px;
    max-height: 118px;
    padding: 8px 8px 14px;
  }

  .load-segment {
    flex: 0 0 13px;
    height: 96px;
    min-height: 96px;
    max-height: 96px;
    padding-bottom: 0;
    scroll-snap-align: start;
  }

  .load-segment b {
    font-size: 8px;
  }

  .load-segment small {
    font-size: 10px;
  }

  .coach-calendar-board {
    margin-top: 14px;
    padding: 12px;
  }

  .coach-calendar-header h3 {
    font-size: 20px;
  }

  .coach-calendar-grid {
    --calendar-hour-height: 58px;
    grid-template-columns: 46px repeat(var(--calendar-days, 7), 112px);
  }

  .coach-calendar-times,
  .coach-calendar-day {
    height: calc(var(--calendar-hour-height) * var(--calendar-hours, 19));
  }

  .coach-calendar-hour-line {
    height: var(--calendar-hour-height);
  }

  .coach-calendar-event {
    left: 5px;
    right: 5px;
    padding: 6px;
  }

  .coach-calendar-event span {
    font-size: 12px;
  }

  body[data-mode="admin"] .load-segment {
    flex-basis: 22px;
    min-height: 34px;
  }

  body[data-mode="admin"] .load-segment b {
    font-size: 8px;
  }

  body[data-mode="admin"] .load-segment small {
    font-size: 10px;
  }

  .week-date-tab {
    flex-basis: 148px;
    min-height: 56px;
    padding: 9px 11px;
  }

  .week-date-tab.is-today {
    flex-basis: 204px;
  }

  .week-forecast-panel-header {
    display: grid;
    gap: 3px;
  }

  .week-forecast-panel-header span {
    text-align: left;
  }

  .week-load-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-axis {
    min-width: 1088px;
  }

  .primary-booking-button {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 40;
    min-height: 56px;
    border-radius: 12px;
    font-size: 16px;
    box-shadow: 0 12px 28px rgba(31, 35, 40, 0.24);
  }

  body[data-mode="coach"][data-view="bookings"] .schedule-panel .panel-header .primary-booking-button {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin-top: 10px;
    border-radius: 8px;
    box-shadow: none;
  }

  body[data-mode="coach"][data-view="bookings"] .schedule-panel .panel-header {
    align-items: stretch;
  }

  body[data-mode="coach"] .coach-dashboard-quick-actions {
    display: flex;
    width: 100%;
    max-width: 100%;
    margin: 0 0 12px;
    padding: 0;
  }

  body[data-mode="coach"] .coach-dashboard-booking-button {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    border-radius: 10px;
    box-shadow: none;
  }

  body[data-mode="coach"] .coach-operations-card {
    margin-bottom: 12px;
    padding: 14px;
  }

  body[data-mode="coach"] .coach-operations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-mode="coach"] .coach-operation-stage {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  body[data-mode="coach"] .coach-operations-grid strong {
    font-size: 16px;
  }

  body[data-mode="coach"] .coach-operation-stage strong {
    font-size: 20px;
  }

  body[data-mode="coach"] .coach-operations-next {
    grid-template-columns: 1fr;
  }

  body[data-mode="admin"] .primary-booking-button {
    position: static;
    min-height: 40px;
    box-shadow: none;
  }

  body[data-mode="admin"] .admin-booking-fab {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    min-height: 54px;
    border-radius: 12px;
    transform: none;
  }

  .privacy-classification-grid {
    grid-template-columns: 1fr;
  }

  .privacy-export-form fieldset {
    display: grid;
  }

  .privacy-ops-grid,
  .privacy-records-grid,
  .privacy-record-row {
    grid-template-columns: 1fr;
  }

  .revenue-title-wrap {
    display: grid;
    gap: 10px;
  }

  .revenue-pie-card {
    width: 100%;
    min-width: 0;
  }

  .revenue-obligation-summary,
  .revenue-obligation-row {
    grid-template-columns: 1fr;
  }

  .revenue-obligation-row b {
    white-space: normal;
  }

  .booking-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .completed-course-controls {
    display: grid;
    width: 100%;
  }

  .completed-course-controls select {
    width: 100%;
  }

  .completed-course-summary {
    grid-template-columns: 1fr;
  }

  .completed-student-fields.is-two-students {
    grid-template-columns: 1fr;
  }

  .admin-date-booking-tab {
    flex-basis: 118px;
  }

  .admin-date-booking-panel-header {
    display: grid;
    gap: 3px;
  }

  .admin-date-booking-panel-header span {
    text-align: left;
  }

  .booking-card .cancel-booking-button {
    width: 100%;
    border-radius: 8px;
  }

  .booking-calendar-actions,
  .calendar-add-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .coach-row,
  .coach-booking {
    grid-template-columns: 1fr;
  }

  .coach-filter-tab {
    flex-basis: 104px;
  }

  .admin-credit-summary,
  .admin-credit-ledger-row,
  .revenue-summary,
  .revenue-row,
  .revenue-detail-head,
  .revenue-detail-row,
  .expense-form,
  .expense-summary,
  .expense-row,
  .reconciliation-summary,
  .reconciliation-row,
  .topup-form,
  .topup-summary,
  .topup-row,
  .audit-alert-card,
  .audit-log-row {
    grid-template-columns: 1fr;
  }

  .audit-alert-card div:last-child,
  .audit-log-row div:last-child {
    text-align: left;
  }

  .revenue-detail-head {
    display: none;
  }

  .topup-form button {
    width: 100%;
    justify-self: stretch;
  }

  .expense-note-field,
  .expense-checkbox,
  .expense-submit-button,
  .expense-cancel-edit-button {
    grid-column: auto;
  }

  .expense-row-actions {
    width: 100%;
    justify-content: stretch;
  }

  .expense-edit-button,
  .expense-delete-button {
    flex: 1;
    width: 100%;
  }

  .admin-booking-edit-form {
    grid-template-columns: 1fr;
  }

  .admin-booking-edit-form input[type="date"],
  .admin-booking-edit-form input[type="time"],
  .admin-booking-edit-form input[type="datetime-local"],
  .topup-form input[type="date"],
  .topup-form input[type="time"],
  .topup-form input[type="datetime-local"],
  .student-manual-lesson-form input[type="date"],
  .student-manual-lesson-form input[type="time"],
  .student-lesson-detail-body input[type="date"],
  .student-lesson-detail-body input[type="time"] {
    font-size: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .admin-booking-edit-details {
    width: 100%;
  }

  .admin-booking-edit-details summary {
    width: 100%;
  }

  .credit-history-row {
    grid-template-columns: 1fr;
  }

  .coach-account-stats {
    grid-template-columns: 1fr;
  }

  .booking-card .time {
    grid-column: 1 / -1;
  }

  dialog {
    width: min(440px, calc(100vw - 24px));
  }

  #coachEditDialog {
    width: min(720px, calc(100vw - 16px));
  }

  .booking-form {
    max-height: calc(100vh - 64px);
    overflow: auto;
  }

  body[data-mode="coach"] dialog {
    width: min(440px, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    margin: 8px auto;
    overflow: hidden;
  }

  body[data-mode="coach"] .booking-form {
    max-height: calc(100dvh - 16px);
    gap: 12px;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body[data-mode="coach"] .booking-datetime-options {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }

  body[data-mode="coach"] .student-confirmation-fields {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  body[data-mode="coach"] .form-grid-2 {
    grid-template-columns: 1fr;
  }

  body[data-mode="coach"] .booking-datetime-options label:first-of-type {
    grid-column: 1 / -1;
  }

  body[data-mode="coach"] .booking-datetime-options select,
  body[data-mode="coach"] .booking-form input:not([type="checkbox"]),
  body[data-mode="coach"] .booking-form select {
    min-height: 48px;
    font-size: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    position: relative;
    z-index: 1;
    -webkit-appearance: menulist;
    appearance: auto;
  }

  body[data-mode="coach"] .booking-form .checkbox-field {
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    width: 100%;
    min-height: 44px;
    padding: 12px;
    white-space: normal;
    overflow: visible;
  }

  body[data-mode="coach"] .booking-form .checkbox-field input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    margin: 2px 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: #fffdf8;
  }

  body[data-mode="coach"] .booking-form input[type="date"],
  body[data-mode="coach"] .booking-form input[type="time"],
  body[data-mode="coach"] .booking-form input[type="datetime-local"],
  body[data-mode="coach"] .admin-booking-edit-form input[type="date"],
  body[data-mode="coach"] .admin-booking-edit-form input[type="time"],
  body[data-mode="coach"] .admin-booking-edit-form input[type="datetime-local"],
  body[data-mode="coach"] .topup-form input[type="date"],
  body[data-mode="coach"] .topup-form input[type="time"],
  body[data-mode="coach"] .topup-form input[type="datetime-local"],
  body[data-mode="coach"] .booking-form input[type="number"] {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    text-align: left;
    line-height: normal;
    padding-inline: 12px;
    overflow: hidden;
  }

  body[data-mode="coach"] .booking-form input[type="date"]::-webkit-date-and-time-value,
  body[data-mode="coach"] .booking-form input[type="time"]::-webkit-date-and-time-value,
  body[data-mode="coach"] .booking-form input[type="datetime-local"]::-webkit-date-and-time-value,
  body[data-mode="coach"] .admin-booking-edit-form input[type="date"]::-webkit-date-and-time-value,
  body[data-mode="coach"] .admin-booking-edit-form input[type="time"]::-webkit-date-and-time-value,
  body[data-mode="coach"] .admin-booking-edit-form input[type="datetime-local"]::-webkit-date-and-time-value,
  body[data-mode="coach"] .topup-form input[type="date"]::-webkit-date-and-time-value,
  body[data-mode="coach"] .topup-form input[type="time"]::-webkit-date-and-time-value,
  body[data-mode="coach"] .topup-form input[type="datetime-local"]::-webkit-date-and-time-value {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    text-align: left;
    overflow: hidden;
  }

  body[data-mode="coach"] .student-lesson-detail-body,
  body[data-mode="coach"] .student-lesson-detail-body .form-grid-2,
  body[data-mode="coach"] .student-lesson-detail-body .lesson-note-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body[data-mode="coach"] .booking-form select[name="sessionType"] {
    display: none;
  }

  body[data-mode="coach"] .session-type-toggle button {
    min-height: 52px;
    font-size: 16px;
  }

  body[data-mode="coach"] .booking-form textarea {
    font-size: 16px;
  }

  body[data-mode="coach"] .booking-form menu {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding-top: 8px;
    background: #fffdf8;
  }

  body[data-mode="coach"] .booking-form menu button {
    flex: 1;
    min-height: 46px;
  }
}

@media (max-width: 820px) {
  .venue-closure-form {
    grid-template-columns: 1fr 1fr;
  }

  .venue-closure-reason-field,
  .venue-closure-full-day,
  .venue-closure-form .primary-action {
    grid-column: 1 / -1;
  }

  .venue-closure-item {
    align-items: stretch;
    flex-direction: column;
  }

  .student-visit-main,
  .student-visit-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .student-visit-controls {
    grid-template-columns: 1fr;
  }

  .student-visit-actions button {
    width: 100%;
  }

  .coach-onboarding-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100svh;
    max-height: 100svh;
    margin: 0;
  }

  .coach-onboarding-card {
    width: 100%;
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
    gap: 14px;
    padding: max(24px, env(safe-area-inset-top)) 20px max(16px, env(safe-area-inset-bottom));
    border-radius: 0;
  }

  .coach-onboarding-page {
    gap: 11px;
    padding: 8px 4px;
  }

  .coach-onboarding-page h2 {
    max-width: 340px;
    font-size: clamp(24px, 7vw, 32px);
    line-height: 1.12;
  }

  .coach-onboarding-page p {
    max-width: 320px;
    font-size: 14px;
    line-height: 1.58;
  }

  .coach-onboarding-logo {
    width: 86px;
    height: 86px;
    padding: 10px;
  }

  .coach-onboarding-icon {
    width: 72px;
    height: 72px;
    font-size: 21px;
  }

  .coach-onboarding-card menu {
    gap: 9px;
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }

  .coach-onboarding-card menu button {
    min-height: 44px;
    font-size: 14px;
  }

  .coach-onboarding-progress {
    gap: 7px;
  }

  body[data-mode="coach"] .sidebar {
    display: block;
    height: 68px;
    min-height: 68px;
    max-height: 68px;
    overflow: visible;
  }

  body[data-mode="coach"] .brand {
    min-height: 51px;
    padding-bottom: 8px;
  }

  body[data-mode="coach"] .workspace {
    margin-top: 0;
    padding-top: 8px;
  }

  body[data-mode="coach"] .topbar {
    position: relative;
    z-index: 1;
    grid-template-columns: minmax(0, 1fr) minmax(168px, 42%);
    column-gap: 8px;
    align-items: start;
    margin: 0 0 10px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--line);
  }

  body[data-mode="coach"] .topbar > div:first-child {
    align-self: start;
    padding-top: 2px;
  }

  body[data-mode="coach"] .topbar h1 {
    position: relative;
    z-index: 1;
    max-width: 100%;
    margin: 0;
    line-height: 1.15;
  }

  body[data-mode="coach"] .date-block {
    grid-template-columns: minmax(0, 1fr) 58px;
    width: 100%;
    max-width: 268px;
    min-width: 0;
    justify-self: end;
    align-items: stretch;
    overflow: visible;
  }

  body[data-mode="coach"] .coach-status-button {
    min-width: 0;
    width: 100%;
    max-width: none;
    min-height: 58px;
    height: 58px;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    align-items: center;
    align-content: stretch;
    gap: 0;
    padding: 6px 8px;
    overflow: hidden;
  }

  body[data-mode="coach"] .coach-status-button span {
    font-size: 9px;
    line-height: 1.15;
  }

  body[data-mode="coach"] .coach-status-button strong {
    font-size: 12px;
    line-height: 1.15;
  }

  body[data-mode="coach"] .coach-status-button small {
    font-size: 9px;
    line-height: 1.15;
  }

  body[data-mode="coach"] .logout-button {
    width: 58px;
    max-width: 58px;
    min-height: 58px;
    height: 58px;
    font-size: 12px;
    line-height: 1.15;
    justify-self: end;
  }

  body[data-mode="coach"] .metrics {
    margin-top: 0;
  }

  .coach-revenue-summary,
  .coach-revenue-row {
    grid-template-columns: 1fr;
  }

  .coach-revenue-row-values {
    text-align: left;
  }
}

@media (max-width: 820px) and (max-height: 700px) {
  .coach-onboarding-card {
    height: 100svh;
    max-height: 100svh;
    gap: 10px;
    padding: max(16px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  }

  .coach-onboarding-page {
    gap: 8px;
    padding-block: 4px;
  }

  .coach-onboarding-logo {
    width: 72px;
    height: 72px;
    padding: 8px;
  }

  .coach-onboarding-icon {
    width: 62px;
    height: 62px;
    font-size: 18px;
  }

  .coach-onboarding-page h2 {
    font-size: clamp(22px, 6.4vw, 28px);
  }

  .coach-onboarding-page p {
    font-size: 13px;
    line-height: 1.5;
  }

  .coach-onboarding-card menu button {
    min-height: 40px;
  }
}

/* Shape-only consistency pass: match the menu button's small-radius frame. */
:is(
  .panel,
  .metrics article,
  .secondary-action,
  .mobile-nav-toggle,
  .logout-button,
  .account-button,
  .coach-status-button,
  .digital-clock,
  .plan-panel,
  .status-chip,
  .student-status-filter-tab,
  .student-view-toggle button,
  .student-orb,
  .student-orb-detail,
  .student-orb-empty,
  .student-compact-row,
  .student-compact-next,
  .student-profile-card,
  .student-profile-avatar,
  .student-profile-metrics,
  .student-profile-metric,
  .student-profile-insight,
  .student-followup-pill,
  .student-detail-button,
  .student-management-row,
  .booking-card,
  .week-load-card,
  .load-segment,
  .coach-next-booking-card,
  .dashboard-health-card,
  .dashboard-todo-item,
  .topup-row,
  .coach-revenue-card,
  .coach-revenue-row,
  .coach-revenue-summary,
  .completed-course-row,
  .guideline-card,
  .door-lock-entry-panel,
  .lock-record-card,
  .lock-compact-note,
  .revenue-pie-card,
  .system-health-card,
  .audit-alert-card,
  .student-public-card,
  .form-card,
  .student-management-actions button,
  .booking-form menu button,
  dialog,
  input,
  select,
  textarea
) {
  border-radius: 2px;
}

@media (max-width: 720px) {
  dialog:not(.coach-onboarding-dialog) {
    position: fixed;
    inset: auto 8px 0;
    width: min(520px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    max-height: calc(100svh - 12px);
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border-radius: 2px 2px 0 0;
  }

  @supports (height: 100dvh) {
    dialog:not(.coach-onboarding-dialog) {
      max-height: calc(100dvh - 12px);
    }
  }

  dialog:not(.coach-onboarding-dialog)[open] {
    animation: mobile-dialog-sheet-in 180ms ease-out;
  }

  dialog:not(.coach-onboarding-dialog) > .booking-form {
    width: 100%;
    max-width: 100%;
    max-height: inherit;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 18px 18px calc(104px + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }

  dialog:not(.coach-onboarding-dialog) > .booking-form > menu {
    position: fixed;
    right: auto;
    bottom: 0;
    left: 50%;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
    width: min(520px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    margin: 0;
    padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.88), #fffdf8 22%);
    transform: translateX(-50%);
  }

  dialog:not(.coach-onboarding-dialog) > .booking-form > menu button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
  }

  dialog:not(.coach-onboarding-dialog) .form-grid-2 {
    grid-template-columns: 1fr;
  }

  dialog:not(.coach-onboarding-dialog) input[type="date"],
  dialog:not(.coach-onboarding-dialog) input[type="time"],
  dialog:not(.coach-onboarding-dialog) input[type="datetime-local"],
  dialog:not(.coach-onboarding-dialog) input[type="number"],
  dialog:not(.coach-onboarding-dialog) input[type="text"],
  dialog:not(.coach-onboarding-dialog) input[type="email"],
  dialog:not(.coach-onboarding-dialog) input[type="tel"],
  dialog:not(.coach-onboarding-dialog) input[type="password"],
  dialog:not(.coach-onboarding-dialog) select,
  dialog:not(.coach-onboarding-dialog) textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  dialog:not(.coach-onboarding-dialog) .agreement-view-frame,
  dialog:not(.coach-onboarding-dialog) .agreement-preview-frame {
    height: min(58svh, 560px);
  }

  @supports (height: 100dvh) {
    dialog:not(.coach-onboarding-dialog) .agreement-view-frame,
    dialog:not(.coach-onboarding-dialog) .agreement-preview-frame {
      height: min(58dvh, 560px);
    }
  }
}

@keyframes mobile-dialog-sheet-in {
  from {
    opacity: 0.86;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog:not(.coach-onboarding-dialog)[open],
  .view-section:not([hidden]),
  .primary-booking-button.is-press-feedback,
  .admin-booking-fab.is-press-feedback,
  .topup-submit-button.is-press-feedback,
  .door-lock-entry-button.is-press-feedback,
  .student-detail-button.is-press-feedback,
  .cancel-next-booking-button.is-press-feedback,
  .mock-unlock-button.is-press-feedback,
  .app-toast.is-stamp .app-toast-mark,
  .completion-stamp-check::before,
  .completion-stamp-check::after,
  .student-management-list.has-expanded-student .student-orb-grid.is-detail-open,
  .student-orb.is-expanded,
  .student-orb-detail-stage.is-open,
  .student-orb-detail,
  .primary-booking-button.is-loading::after,
  .admin-booking-fab.is-loading::after,
  .topup-submit-button.is-loading::after,
  .door-lock-entry-button.is-loading::after,
  .student-detail-button.is-loading::after,
  .cancel-next-booking-button.is-loading::after,
  .mock-unlock-button.is-loading::after,
  .coach-next-booking-card.is-ongoing,
  .coach-next-booking-card.is-clickable:not(.is-ongoing) .door-lock-entry-button:not(:disabled) {
    animation: none !important;
  }

  .primary-booking-button,
  .admin-booking-fab,
  .topup-submit-button,
  .door-lock-entry-button,
  .student-detail-button,
  .cancel-next-booking-button,
  .mock-unlock-button {
    transition: none !important;
  }
}
