:root {
  overscroll-behavior-y: none;
  color-scheme: light;
  --background: #f4efe8;
  --surface: #fcfaf6;
  --surface-subtle: #f1ebe1;
  --ink: #1f2923;
  --muted: #666e66;
  --stroke: #e4ddd1;
  --stroke-strong: #d4cab9;
  --brand: #274234;
  --brand-deep: #1b3025;
  --pine: #22392d;
  --accent: #9c7248;
  --soft: #e9efe9;
  --amber-bg: #f6ebd9;
  --amber-ink: #7a5425;
  --red: #8e3531;
  --red-bg: #f7eae8;
  --radius: 16px;
  --shadow-sm: 0 2px 10px rgba(31, 41, 35, 0.04);
  --shadow-md: 0 14px 36px rgba(31, 41, 35, 0.07);
  --shadow-lg: 0 26px 70px rgba(20, 31, 25, 0.18);
  --display-font: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(214, 198, 174, 0.28), transparent 62%),
    radial-gradient(860px 480px at 8% -12%, rgba(233, 239, 233, 0.55), transparent 60%),
    var(--background);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .18s ease, box-shadow .2s ease; }
button:disabled { opacity: .55; cursor: progress; transform: none !important; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

h1, h2, h3, p { margin: 0; }
h1 {
  font-family: var(--display-font);
  font-size: clamp(2rem, 3.8vw, 2.85rem);
  letter-spacing: .04em;
  line-height: 1.2;
  font-weight: 500;
  color: var(--ink);
}
h2 { font-size: 1.16rem; line-height: 1.38; letter-spacing: .01em; font-weight: 600; }
h3 { font-size: 1.05rem; line-height: 1.38; font-weight: 600; }
small, .muted, .note { color: var(--muted); }
small, .note { font-size: .86rem; }

.eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Top Loading Progress Bar & Skeleton */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent 0%, var(--brand) 45%, var(--accent) 75%, transparent 100%);
  background-size: 200% 100%;
  transition: opacity .22s ease;
}
.progress-bar.active {
  opacity: 1;
  animation: progress-slide 1.15s linear infinite;
}
@keyframes progress-slide {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: .95; }
}
.skeleton-page { display: grid; gap: 16px; }
.skeleton-line {
  height: 16px;
  border-radius: 999px;
  background: var(--stroke);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton-line.short { width: 120px; height: 12px; }
.skeleton-line.title { width: 220px; height: 32px; margin-bottom: 10px; }
.skeleton-card { height: 120px; background: linear-gradient(120deg, var(--surface) 25%, var(--surface-subtle) 50%, var(--surface) 75%); animation: skeleton-pulse 1.4s ease-in-out infinite; }
.skeleton-card.tall { height: 220px; }

/* Sticky Frosted Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(252, 250, 246, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(228, 221, 209, 0.88);
}

.pull-refresh-anchor { position: relative; z-index: 21; pointer-events: none; }
.pull-refresh {
  position: absolute;
  top: var(--pull-offset, 0px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 15px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-deep);
  box-shadow: var(--shadow-sm);
  font-size: .85rem;
  white-space: nowrap;
}

.bar-inner {
  max-width: 1180px;
  margin: auto;
  min-height: 74px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 44px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: .75rem;
  font-family: var(--display-font);
  font-size: 1.18rem;
  letter-spacing: .1em;
  font-weight: 600;
  color: var(--pine);
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-deep) 100%);
  box-shadow: 0 4px 12px rgba(27, 48, 37, 0.18);
}

.brand-mark i {
  display: block;
  width: 1.8px;
  height: 12px;
  border-radius: 4px;
  background: #f5f0e8;
  transform: rotate(24deg);
}
.brand-mark i:nth-child(2) { height: 17px; }

.topbar nav { display: flex; align-items: center; gap: 8px; }
.topbar nav button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  padding: 0 .85rem;
  min-height: 44px;
  background: transparent;
  color: var(--muted);
  font-size: .938rem;
  white-space: nowrap;
}
.bottom-nav { display: none; }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fcfaf6;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.topbar nav button::after {
  content: '';
  position: absolute;
  left: .85rem;
  right: .85rem;
  bottom: 6px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform .22s ease;
}
.topbar nav button:hover { color: var(--pine); }
.topbar nav button[aria-current] { color: var(--brand-deep); font-weight: 600; }
.topbar nav button[aria-current]::after { transform: scaleX(1); }

.profile {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: .875rem;
}
.member-identity {
  display: grid;
  gap: 1px;
  max-width: 180px;
  min-height: 44px;
  padding: 4px 11px;
  color: var(--brand-deep);
  background: var(--surface-subtle);
  border: 1px solid var(--stroke);
  border-radius: 9px;
  text-align: start;
  line-height: 1.3;
}
.member-identity small { font-size: .8125rem; color: var(--muted); }
.member-identity strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.member-identity:hover { border-color: var(--stroke-strong); }
.profile-current-name { overflow-wrap: anywhere; }
.profile-current-name strong { color: var(--brand-deep); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 48px 40px 80px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 30px;
  gap: 20px;
}
.page-head p { color: var(--muted); margin-top: .5rem; font-size: .95rem; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Refined Buttons */
.button, .icon-button, .text-button {
  display: inline-flex;
  gap: .4rem;
  align-items: center;
  justify-content: center;
  padding: 0 1.2rem;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 550;
  font-size: .92rem;
  letter-spacing: .02em;
}

.primary {
  background: var(--brand);
  color: #fcfaf6;
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(39, 66, 52, 0.16);
}
.primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(27, 48, 37, 0.22);
}

.secondary, .icon-button {
  color: var(--brand);
  background: var(--surface);
  border-color: var(--stroke-strong);
}
.secondary:hover, .icon-button:hover {
  background: var(--surface-subtle);
  border-color: #bfb3a0;
}

.danger {
  color: var(--red);
  background: var(--red-bg);
  border-color: #ebd0cb;
}
.danger:hover { background: #f2dcd8; }

.text-button {
  background: transparent;
  color: var(--brand);
  padding-inline: .75rem;
  border-radius: 999px;
}
.text-button:hover { background: rgba(39, 66, 52, 0.07); }

.icon-button { min-width: 42px; padding: 0; font-size: 1.35rem; }
.chevron {
  display: block;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-top: 1.6px solid currentColor;
  transform: rotate(45deg);
}
.chevron.left { transform: rotate(-135deg); }

/* Calendar & Editorial Week Strip */
.calendar { padding: 26px 28px; }
.week-head, .section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.week-head { margin-bottom: 20px; }
.week-title { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.week-title h2 { font-family: var(--display-font); font-size: 1.32rem; font-weight: 500; letter-spacing: .03em; }
.week-note { font-size: .86rem; }
.week-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-grid button {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 13px 4px;
  background: transparent;
  color: var(--muted);
}
.week-grid button:hover { background: var(--surface-subtle); }
.week-grid button span { font-size: .8rem; letter-spacing: .04em; }
.week-grid button strong {
  font-family: Georgia, serif;
  font-size: 1.42rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.15;
}
.week-grid button small { min-height: 20px; font-size: .78rem; color: var(--accent); }
.week-grid button[aria-current="date"] { background: rgba(156, 114, 72, 0.08); }
.week-grid button[aria-current="date"] strong { color: var(--brand); font-weight: 600; }
.week-grid button[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: rgba(252, 250, 246, 0.85);
  box-shadow: 0 8px 20px rgba(39, 66, 52, 0.22);
}
.week-grid button[aria-pressed="true"] :is(strong, small) { color: #fcfaf6; }
.day-dot {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.day-dot.booked { background: var(--brand); }
.day-dot.waitlist { background: var(--accent); }
.week-grid button[aria-pressed="true"] .day-dot { background: #f5f0e8; }

/* Timeline Course Cards */
.agenda { margin-top: 34px; }
.week-agenda { display: grid; gap: 28px; }
.section-head { margin-bottom: 14px; }
.section-head h2 { font-family: var(--display-font); font-size: 1.28rem; font-weight: 500; letter-spacing: .03em; }
.section-head h2 span { font-family: inherit; font-weight: 400; margin-left: 6px; color: var(--muted); font-size: .92rem; }
.course-list { display: grid; gap: 12px; }

.course {
  display: grid;
  align-items: center;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 20px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.course:hover {
  transform: translateY(-1px);
  border-color: var(--stroke-strong);
  box-shadow: var(--shadow-md);
}
.course-mine {
  border-left: 3.5px solid var(--brand);
  background: linear-gradient(90deg, rgba(233, 239, 233, 0.36) 0%, var(--surface) 28%);
}
.course-waitlisted {
  border-left: 3.5px solid var(--accent);
}
.course-cancelled {
  opacity: .72;
  background: rgba(252, 250, 246, 0.65);
}
.course-cancelled .course-title-row h3 {
  text-decoration: line-through;
  text-decoration-color: rgba(102, 110, 102, 0.5);
}
.seat-urgent {
  color: var(--amber-ink);
  font-weight: 600;
}

.time-block {
  display: grid;
  gap: 2px;
  padding: 2px 18px 2px 2px;
  text-align: left;
  background: transparent;
  border-right: 1px solid var(--stroke);
}
.time-block strong {
  font-family: Georgia, serif;
  font-size: 1.42rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--pine);
  font-variant-numeric: tabular-nums;
}
.time-block small { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.course-info, .list-row > div { min-width: 0; overflow-wrap: anywhere; }
.course-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.course-title-row h3 { font-size: 1.08rem; font-weight: 600; letter-spacing: .01em; }
.course-instructor {
  font-size: .78rem;
  color: var(--accent);
  background: rgba(156, 114, 72, 0.11);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 550;
}
.course-info p, .list-row p { margin-top: 5px; color: var(--muted); font-size: .875rem; }
.course-desc { color: var(--ink) !important; opacity: .78; margin-top: 6px !important; }
.course-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; align-items: center; }
.course-actions .note { display: none; }

/* Status Pills with Micro Dot */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 550;
  letter-spacing: .02em;
}
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
}
.pill.green { background: var(--soft); color: var(--brand); }
.pill.amber { color: var(--amber-ink); background: var(--amber-bg); }
.pill.stopped { color: var(--red); background: var(--red-bg); }

/* Empty State */
.empty {
  text-align: center;
  padding: 52px 20px;
  border-radius: var(--radius);
  border: 1px dashed var(--stroke-strong);
  background: rgba(252, 250, 246, 0.55);
}
.empty h3 { font-family: var(--display-font); font-weight: 500; font-size: 1.18rem; letter-spacing: .03em; }
.empty p { color: var(--muted); margin-top: 8px; font-size: .92rem; }
.empty-icon {
  position: relative;
  width: 28px;
  height: 26px;
  margin: 0 auto 18px;
  color: var(--accent);
  border: 1.5px solid currentColor;
  border-radius: 6px;
}
.empty-icon::before { content: ''; position: absolute; top: 7px; inset-inline: 0; border-top: 1.5px solid currentColor; }
.empty-icon::after { content: ''; position: absolute; top: -4px; right: 5px; width: 1.5px; height: 7px; background: currentColor; box-shadow: -13px 0 currentColor; }

/* Gallery Login Layout */
.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  max-width: 1020px;
  margin: min(7vh, 64px) auto 0;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.login-visual {
  position: relative;
  overflow: hidden;
  min-height: 460px;
  background: #e5ddd0;
}
.login-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(25, 36, 30, 0.04) 40%, rgba(25, 36, 30, 0.52) 100%);
  pointer-events: none;
}
.login-visual img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.visual-caption {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 26px;
  z-index: 1;
  color: #fcfaf6;
}
.visual-caption span {
  display: block;
  font-family: Georgia, serif;
  font-size: .84rem;
  letter-spacing: .24em;
  font-weight: 500;
}
.visual-caption small {
  display: block;
  margin-top: 4px;
  color: rgba(252, 250, 246, 0.82);
  font-size: .78rem;
  letter-spacing: .08em;
}
.login-card {
  padding: clamp(32px, 5vw, 64px);
  align-content: center;
  background: var(--surface);
}
.login-card h1 { margin-bottom: 10px; font-size: clamp(1.75rem, 2.6vw, 2.25rem); }
.login-card form { margin-top: 24px; }
.login-card form button { width: 100%; min-height: 46px; }
.login-card input { border-color: var(--stroke-strong); }
.legacy-invite { margin-top: 14px; font-size: .875rem; }
.login-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.login-links a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid rgba(39, 66, 52, 0.3);
  padding-bottom: 2px;
}
.login-links a:hover { border-bottom-color: var(--brand); }
.login-links a.muted-link {
  color: var(--muted);
  border-bottom-color: rgba(102, 110, 102, 0.28);
  font-size: .88rem;
}
.login-links a.muted-link:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* Segmented Control */
.switch {
  display: inline-flex;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-subtle);
  padding: 3px;
  border: 1px solid rgba(212, 202, 185, 0.6);
}
.switch button {
  padding: 0 15px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .88rem;
  white-space: nowrap;
}
.switch button[aria-pressed="true"] {
  border-color: rgba(228, 221, 209, 0.9);
  background: var(--surface);
  color: var(--brand-deep);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(31, 41, 35, 0.06);
}

/* Forms & Inputs */
form, fieldset { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 550; font-size: .9rem; color: var(--ink); }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .56rem .8rem;
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--stroke-strong);
  background: #fffdf9;
  color: var(--ink);
  font-size: .96rem;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(39, 66, 52, 0.12);
}
select {
  appearance: none;
  padding-right: 34px;
  background:
    linear-gradient(45deg, transparent 50%, var(--brand) 50%) calc(100% - 17px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--brand) 50%, transparent 50%) calc(100% - 12px) 50% / 5px 5px no-repeat,
    #fffdf9;
}
textarea { resize: vertical; }
.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap input { padding-right: 44px; }
.password-toggle {
  position: absolute;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.password-toggle:hover { color: var(--brand); background: rgba(39, 66, 52, 0.06); }
.password-toggle svg { width: 18px; height: 18px; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye-off { display: block; }
.login-card form button.password-toggle { width: 36px; min-height: 36px; }
fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 16px 16px;
  background: rgba(244, 239, 232, 0.35);
}
legend { padding: 0 8px; font-weight: 600; font-size: .88rem; color: var(--brand); }
.form-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
.field-wide { grid-column: 1 / -1; font-size: .86rem; }

/* Settings, Credits & Member Directory */
.settings-panel { max-width: 680px; padding: 28px; }
.profile-credential { margin-top: 16px; }
.current-credential { margin-bottom: 16px; }
div.current-credential { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.current-credential textarea { resize: none; }
.credential-display { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; background: var(--surface-subtle); }
.settings-panel h2, .table-panel h2 {
  margin-bottom: 16px;
  font-family: var(--display-font);
  font-weight: 500;
  font-size: 1.24rem;
  letter-spacing: .02em;
}
.credit-summary-panel {
  background: linear-gradient(135deg, #274234 0%, #1d3227 100%);
  border-color: #274234;
  color: #fcfaf6;
}
.credit-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.credit-summary-panel h2 { color: rgba(252, 250, 246, 0.8); margin-bottom: 0; font-size: 1rem; }
.credit-log-trigger { min-height: 34px; padding-inline: .9rem; font-size: .84rem; background: rgba(252, 250, 246, 0.12); color: #fcfaf6; border-color: rgba(252, 250, 246, 0.28); }
.credit-log-trigger:hover { background: rgba(252, 250, 246, 0.22); border-color: rgba(252, 250, 246, 0.45); }
.credit-summary-value { display: flex; align-items: baseline; gap: 10px; color: rgba(252, 250, 246, 0.82); }
.credit-summary-value strong { font-size: 2.35rem; line-height: 1; color: #fcfaf6; font-family: Georgia, serif; font-weight: 400; }
.credit-log-right { text-align: right; flex-shrink: 0; }
.credit-delta-pos { color: var(--brand); }
.credit-delta-neg { color: var(--red); }

.listing { padding-inline: 24px; }
.applications { margin-bottom: 20px; padding-block: 18px; }
.member-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--stroke);
}
.member-toolbar input { flex: 1; min-width: 180px; max-width: 360px; min-height: 40px; border-radius: 999px; padding-inline: 16px; }
.member-toolbar-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-toolbar span { font-size: .86rem; white-space: nowrap; }
.member-disabled { opacity: .72; }
.member-empty { padding: 22px 0; }
.member-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.member-note {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  vertical-align: middle;
}
.duplicate-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 18px;
}
.credit-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.credit-presets button { min-height: 36px; padding-inline: .9rem; font-size: .86rem; }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--stroke);
}
.list-row:last-child { border-bottom: 0; }
.member-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.member-actions .button { min-height: 36px; padding-inline: .9rem; font-size: .85rem; }
.member-actions .text-button { min-height: 36px; font-size: .85rem; }
.member-operations { display: none; }
.member-operation-list { display: grid; gap: 8px; }
.member-operation-list button { display: flex; justify-content: flex-start; align-items: center; min-height: 44px; padding-inline: 16px; text-align: left; }
.member-invite {
  display: inline-block;
  color: var(--brand-deep);
  background: var(--soft);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .09em;
  overflow-wrap: anywhere;
}

/* Report & Analytics Dashboard */
.report-hero { padding: 4px 0 26px; border-block-end: 1px solid var(--stroke); }
.report-hero p { font-variant-numeric: tabular-nums; }
.report-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.report-controls input { width: 162px; border-radius: 999px; padding-inline: 14px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric { display: flex; flex-direction: column; min-height: 174px; padding: clamp(18px, 2.2vw, 26px); }
.metric:first-child {
  background: linear-gradient(150deg, #f3ece0 0%, #fcfaf6 100%);
  border-color: var(--stroke-strong);
}
.metric h2 { color: var(--muted); font-size: .9rem; font-weight: 500; letter-spacing: .02em; }
.metric-value { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; margin: 12px 0 12px; }
.metric p { margin-top: auto; color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.metric strong {
  color: var(--brand-deep);
  font-family: Georgia, serif;
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: lining-nums tabular-nums;
}
.metric span { color: var(--muted); font-size: .88rem; }
.metric meter { display: block; width: 100%; height: 5px; margin-top: 12px; appearance: none; background: var(--surface-subtle); border-radius: 999px; }
.metric meter::-webkit-meter-bar { height: 5px; background: var(--surface-subtle); border: 0; border-radius: 999px; }
.metric meter::-webkit-meter-optimum-value { background: var(--brand); border-radius: 999px; }
.metric meter::-moz-meter-bar { background: var(--brand); border-radius: 999px; }

.seat-breakdown { margin-top: 16px; padding: clamp(20px, 2.5vw, 28px); }
.seat-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.seat-heading span { font-size: .86rem; }
.seat-attended { --seat-color: #2f5c47; }
.seat-booked { --seat-color: #b78d5f; }
.seat-unbooked { --seat-color: #eae2d5; }
.seat-track { position: relative; height: 8px; border-radius: 999px; overflow: hidden; margin: 18px 0; background: #eae2d5; }
.seat-track meter { appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; }
.seat-track meter::-webkit-meter-bar { height: 100%; border: 0; border-radius: 0; background: transparent; }
.seat-track meter::-webkit-meter-optimum-value { background: var(--seat-color); border-radius: 0; }
.seat-track meter::-moz-meter-bar { background: var(--seat-color); }
.seat-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.seat-legend dt { color: var(--muted); font-size: .86rem; }
.seat-legend dt::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-inline-end: 7px; border-radius: 50%; background: var(--seat-color); }
.seat-legend dd { margin: 4px 0 0; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 400; font-variant-numeric: tabular-nums; }

.report-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.table-panel { padding: clamp(18px, 2.4vw, 28px); }
.report-instructors, .report-members { margin-top: 16px; }
.record-link { padding-inline: .65rem; }
.booking-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: 3px; font-weight: 400; }
.booking-meta > span { min-width: 0; overflow-wrap: anywhere; }
.booking-count { white-space: nowrap; font-variant-numeric: tabular-nums; }

table { width: 100%; text-align: left; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 12px 8px; border-bottom: 1px solid var(--stroke); overflow-wrap: anywhere; }
thead th {
  background: var(--surface-subtle);
  padding-block: 11px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
}
thead th:first-child { border-start-start-radius: 10px; padding-inline-start: 12px; }
thead th:last-child { border-start-end-radius: 10px; }
tbody tr { transition: background-color .15s ease; }
tbody tr:hover { background: rgba(244, 239, 232, 0.45); }
tbody tr:last-child > * { border-bottom: 0; }

/* Callout & Dialog with Motion */
.callout {
  margin: 12px 0;
  border: 1px solid #e4d4b7;
  border-radius: 12px;
  padding: 11px 14px;
  background: #fbf3e4;
  color: #6d4d21;
  font-size: .9rem;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sheet-up {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

.dialog {
  width: min(550px, calc(100% - 32px));
  max-height: min(88vh, 840px);
  max-height: min(88dvh, 840px);
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.dialog[open] { animation: dialog-in .22s cubic-bezier(.16, 1, .3, 1); }
.dialog::backdrop {
  background: rgba(20, 31, 25, 0.36);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.dialog-body { padding: 24px 28px 26px; }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.dialog-head h2 {
  font-family: var(--display-font);
  font-size: 1.38rem;
  font-weight: 500;
  letter-spacing: .02em;
}
.form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.page-status { display: grid; justify-items: start; gap: 12px; }
.booking-restriction { font-size: .85rem; }
.schedule-options { border: 1px solid var(--stroke); border-radius: 12px; padding: 10px 14px; }
.schedule-options summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.schedule-options:not([open]) > div { display: none; }
.schedule-option-fields { display: grid; gap: 12px; padding-block-start: 12px; }
.schedule-options[open] > .form-actions { margin-top: 10px; }
.schedule-dialog-footer {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  z-index: 1;
  padding-block: 10px 2px;
  border-top: 1px solid var(--stroke);
}
.attendance-footer { justify-content: space-between; }
.attendance-footer output { font-size: .9rem; }
.dialog-body > label { margin-block: 14px; }
.dialog-error { color: var(--red); background: var(--red-bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: .9rem; }
.roster-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--stroke); font-size: .92rem; }
.roster-desc { margin-top: 10px; }
.records-empty { margin-top: 14px; }
.roster-heading { margin: 16px 0 4px; }
.inline-link { border: 0; padding: 0; background: transparent; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.inline-link:hover { color: var(--brand-deep); }
.bookings-group + .bookings-group { margin-top: 30px; }
.member-pick-search { margin-bottom: 12px; }
.member-pick-search input { border-radius: 999px; padding-inline: 16px; }
.member-pick-list { max-height: 360px; overflow-y: auto; margin-bottom: 14px; }
.check-label { display: flex; align-items: center; min-height: 44px; gap: 8px; }
.check-label input { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); }

/* Floating Toast with Motion */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 35;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  background: rgba(27, 48, 37, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fcfaf6;
  border-radius: 999px;
  font-size: .9rem;
  box-shadow: 0 10px 28px rgba(20, 31, 25, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px) scale(0.96);
  transition: opacity .22s ease, transform .24s cubic-bezier(.16, 1, .3, 1);
}
.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}
.toast.error { background: rgba(142, 53, 49, 0.95); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 750px) {
  .member-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; }
  .member-row .member-row-actions { display: none; }
  .member-row .member-operations { display: inline-flex; min-height: 44px; padding-inline: .85rem; white-space: nowrap; }
  .bar-inner { padding-inline: 20px; gap: 20px; }
  .topbar nav { gap: 4px; }
  .topbar nav button { padding-inline: .55rem; }
  .wrap { padding: 34px 20px 56px; }
  .report-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 570px) {
  .bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 0 16px; }
  .brand, .profile { padding-block: 0; }
  .brand { font-size: 1.08rem; gap: .6rem; }
  .brand-mark { width: 30px; height: 30px; }
  .profile { gap: 4px; }
  .profile .text-button { min-height: 34px; padding-inline: .6rem; font-size: .86rem; }
  .member-identity {
    display: inline-flex;
    align-items: center;
    max-width: 112px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: .85rem;
  }
  .member-identity small { display: none; }
  .topbar .desktop-nav { display: none; }
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    justify-content: space-around;
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(252, 250, 246, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(228, 221, 209, 0.9);
    box-shadow: 0 -6px 24px rgba(31, 41, 35, 0.06);
  }
  .bottom-nav button {
    position: relative;
    display: inline-flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.2;
  }
  .bottom-nav button[aria-current] { color: var(--brand-deep); font-weight: 600; }
  .bottom-nav .nav-icon { display: inline-flex; width: 20px; height: 20px; }
  .bottom-nav .nav-icon svg { width: 20px; height: 20px; }
  .bottom-nav button .nav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 20px);
    min-width: 16px;
    height: 16px;
    font-size: .65rem;
  }
  .member-identity { max-width: 126px; }
  .wrap { padding: 24px 16px 48px; }
  body.has-bottom-nav .wrap { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  body.has-bottom-nav .toast { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .day-dot { top: 6px; right: 6px; width: 5px; height: 5px; }
  .page-head { align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
  .report-hero { padding: 4px 0 20px; }
  .report-hero input { max-width: 152px; }
  .calendar { padding: 16px; }
  .week-head { margin-bottom: 14px; }
  .week-grid { gap: 4px; }
  .week-grid button { padding: 9px 1px; border-radius: 12px; }
  .week-grid button strong { font-size: 1.18rem; }
  .week-grid button small { font-size: .75rem; }
  .agenda { margin-top: 24px; }
  .course { grid-template-columns: 70px minmax(0, 1fr); gap: 8px 14px; padding: 15px 16px; }
  .time-block { grid-row: span 2; padding-right: 12px; }
  .time-block strong { font-size: 1.18rem; }
  .time-block small { font-size: .74rem; }
  .course-actions { grid-column: 2; justify-content: flex-start; }
  .course-actions button { min-height: 38px; padding-inline: 1rem; font-size: .86rem; }
  .login-layout { grid-template-columns: 1fr; margin: 0 auto; border-radius: 18px; }
  .login-card { order: -1; }
  .login-visual { min-height: 0; aspect-ratio: 1.6; }
  .visual-caption { left: 18px; bottom: 16px; }
  .metrics { gap: 10px; }
  .metric { min-height: 144px; }
  .listing { padding-inline: 16px; }
  .settings-panel { padding: 20px 18px; }
  .dialog .form-grid:has(input[type="datetime-local"]) { grid-template-columns: 1fr; }

  /* Mobile Bottom Sheet Dialog */
  .dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    max-height: 88dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .dialog[open] { animation: sheet-up .26s cubic-bezier(.16, 1, .3, 1); }
  .dialog-body { padding: 14px 18px 24px; }
  .dialog-body::before {
    content: '';
    display: block;
    width: 38px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: var(--stroke-strong);
  }
}

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