:root {
  color-scheme: light;
  --ink: #17221f;
  --muted: #67736f;
  --paper: #f5f3ec;
  --card: #fffdf8;
  --line: #d8ddd8;
  --green: #173f35;
  --mint: #d6eadf;
  --orange: #ef8354;
  --danger: #b64343;
  --shadow: 0 14px 36px rgba(23, 63, 53, .1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #dcecdf 0, transparent 28rem),
    linear-gradient(145deg, var(--paper), #ece9df);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  padding: 0 5vw;
  color: white;
  background: rgba(23, 63, 53, .96);
  backdrop-filter: blur(12px);
}
.brand { color: white; font-size: 1.35rem; font-weight: 900; text-decoration: none; letter-spacing: -.04em; }
.shell { width: min(1120px, 92vw); margin: 0 auto; padding: 48px 0 80px; }
.hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 32px; align-items: center; min-height: 70vh; }
.eyebrow { color: var(--orange); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 8px 0 16px; font-size: clamp(2.6rem, 7vw, 5.7rem); line-height: .95; letter-spacing: -.07em; }
h2 { margin: 0 0 18px; font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -.04em; }
h3 { margin: 0 0 10px; }
p { line-height: 1.65; }
.muted { color: var(--muted); }
.card {
  padding: 24px;
  border: 1px solid rgba(216, 221, 216, .8);
  border-radius: 22px;
  background: rgba(255, 253, 248, .94);
  box-shadow: var(--shadow);
}
.trainer-hero, .member-hero {
  background:
    linear-gradient(135deg, rgba(214, 234, 223, .95), rgba(255, 253, 248, .96)),
    radial-gradient(circle at top right, rgba(239, 131, 84, .14), transparent 20rem);
}
.hero-strip {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.hero-strip h3 { margin: 6px 0 10px; font-size: clamp(1.35rem, 2.4vw, 2rem); }
.hero-strip-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.soft-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(23, 63, 53, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .74);
}
.inline-code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(23, 63, 53, .08);
  white-space: nowrap;
}
.auth-card { max-width: 440px; justify-self: end; width: 100%; }
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; font-size: .92rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}
textarea { min-height: 90px; resize: vertical; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 11px;
  color: white;
  background: var(--green);
  font-weight: 800;
  text-decoration: none;
}
.button.secondary { color: var(--green); background: var(--mint); }
.button.danger { background: var(--danger); }
.button.ghost { color: inherit; background: transparent; border: 1px solid currentColor; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: .86rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs button.active { color: white; background: var(--green); }
.dashboard-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 26px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat { padding: 20px; border-radius: 18px; background: var(--green); color: white; }
.stat strong { display: block; margin-top: 8px; font-size: 1.8rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.wide { grid-column: 1 / -1; }
.planner-card { overflow: hidden; }
.planner-top, .calendar-toolbar, .collapse-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.planner-actions, .segmented, .quick-slots { display: flex; gap: 8px; flex-wrap: wrap; }
.calendar-toolbar { margin: 20px 0 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.calendar-grid {
  display: grid;
  gap: 10px;
}
.month-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-cell, .column-head {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  background: rgba(255, 255, 255, .85);
}
.calendar-cell {
  min-height: 110px;
  display: grid;
  align-content: space-between;
}
.calendar-cell.is-muted { opacity: .45; }
.calendar-cell.is-today, .calendar-column.is-today .column-head { border-color: var(--orange); }
.calendar-cell.is-selected { background: var(--mint); }
.calendar-date { font-size: 1.05rem; font-weight: 800; }
.calendar-meta { color: var(--muted); font-size: .84rem; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.calendar-column { min-width: 0; }
.column-head { width: 100%; display: flex; flex-direction: column; align-items: flex-start; }
.column-body { display: grid; gap: 8px; margin-top: 10px; }
.slot-chip, .timeline-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: #edf5f0;
  color: var(--green);
}
.slot-chip span, .timeline-card span { color: var(--muted); font-size: .85rem; }
.slot-chip.FULL, .timeline-card.FULL { background: #f3ead0; }
.slot-chip.COMPLETED, .timeline-card.COMPLETED { background: #e4eaf5; }
.slot-chip.CANCELLED, .timeline-card.CANCELLED { background: #f6dddd; color: var(--danger); }
.timeline { display: grid; gap: 12px; }
.timeline-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  align-items: center;
}
.timeline-time { font-weight: 800; color: var(--green); }
.collapsible { padding: 0; overflow: hidden; }
.collapse-head {
  width: 100%;
  padding: 20px 24px;
  border: 0;
  background: transparent;
  text-align: left;
}
.collapse-head span { display: grid; gap: 4px; }
.collapse-head small { color: var(--muted); }
.collapse-body {
  display: none;
  padding: 0 24px 24px;
  border-top: 1px solid var(--line);
}
.collapsible.is-open .collapse-body { display: block; }
.compact-list .list-item { padding: 12px 0; }
.date-group-list { display: grid; gap: 18px; }
.date-group {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .6);
}
.date-group-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.slot-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.slot-pick-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: #edf5f0;
}
.slot-pick-card strong {
  display: block;
  margin-bottom: 6px;
}
.slot-pick-card span { color: var(--muted); font-size: .9rem; }
.list { display: grid; gap: 10px; }
.list-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; }
.badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: var(--mint); color: var(--green); font-size: .78rem; font-weight: 800; }
.badge.PENDING { background: #fff0bf; }
.badge.CANCELLED, .badge.SUSPENDED { background: #f5d6d6; color: var(--danger); }
.badge.CONFIRMED, .badge.ACTIVE { background: var(--mint); }
.badge.COMPLETED { background: #dce5f5; color: #31588a; }
.empty { padding: 24px 0; color: var(--muted); text-align: center; }
.empty.mini { padding: 12px 0; font-size: .86rem; }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 340px;
  padding: 14px 18px;
  border-radius: 12px;
  color: white;
  background: var(--green);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }
.error { color: var(--danger); font-size: .9rem; }

@media (max-width: 760px) {
  .shell { padding-top: 28px; }
  .hero, .grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .auth-card { justify-self: stretch; }
  .mini-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dashboard-head, .list-item, .planner-top, .calendar-toolbar, .timeline-item, .hero-strip, .date-group-head { align-items: flex-start; flex-direction: column; grid-template-columns: 1fr; }
  .month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week-grid { grid-template-columns: 1fr; }
  h1 { font-size: 3.5rem; }
}
