/* =====================================================================
   Dafola Music School — design system
   Dark "concert hall" palette · brass accents · Instrument Serif + Manrope
   ===================================================================== */

:root {
  color-scheme: dark;
  --bg: #0b090e;
  --bg-2: #121016;
  --bg-3: #1a171f;
  --surface: rgba(255, 248, 238, 0.035);
  --surface-2: rgba(255, 248, 238, 0.06);
  --surface-3: rgba(255, 248, 238, 0.09);
  --line: rgba(255, 244, 228, 0.08);
  --line-2: rgba(255, 244, 228, 0.14);
  --line-3: rgba(255, 244, 228, 0.22);
  --text: #f5eee4;
  --text-2: #c2b8ab;
  --text-3: #877d72;
  --gold: #e3b467;
  --gold-2: #f6dba5;
  --gold-3: #b9843b;
  --gold-ink: #1b1207;
  --gold-glow: rgba(227, 180, 103, 0.35);
  --ok: #86d6a8;
  --warn: #f1c46f;
  --bad: #f2907f;
  --info: #93b9ff;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 12px;
  --serif: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 40px 100px -30px rgba(0, 0, 0, 0.85);
  --side-w: 264px;
  --gutter: clamp(16px, 3.2vw, 40px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ic: var(--gold);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, a, label { touch-action: manipulation; }
html.has-overlay body { overflow: hidden; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.5 var(--sans);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
/* ambient warmth + film grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(227, 180, 103, 0.10), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(146, 96, 210, 0.07), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(227, 120, 80, 0.06), transparent 60%);
}
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

#app { position: relative; z-index: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
::selection { background: rgba(227, 180, 103, 0.35); }
.icon { flex: none; display: block; }

/* ============================ type ============================ */
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0;
}
.display em { font-style: italic; color: var(--gold-2); }
.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
}
.kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.kicker::before { content: ''; width: 22px; height: 1px; background: currentColor; opacity: 0.7; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 12px 4px; }
.gold { color: var(--gold); }
.danger { color: var(--bad) !important; }
.grow { flex: 1; min-width: 0; }
p { margin: 0; }

/* ============================ layout helpers ============================ */
.row-xs { display: inline-flex; align-items: center; gap: 8px; }
.row-sm { display: flex; align-items: center; gap: 10px; }
.row-sm.wrap, .wrap { flex-wrap: wrap; }
.row-sm.end { justify-content: flex-end; }
.stack-xs { display: grid; gap: 6px; }
.stack-sm { display: grid; gap: 10px; }
.stack-md { display: grid; gap: 18px; }
.show-sm { display: none; }

/* ============================ motion ============================ */
.rise { animation: rise 0.8s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
@keyframes rise {
  from { opacity: 0; translate: 0 18px; }
  to { opacity: 1; translate: none; }
}
.page-anim { animation: pageIn 0.5s var(--ease) both; }
@keyframes pageIn {
  from { opacity: 0; translate: 0 14px; }
  to { opacity: 1; translate: none; }
}
.view-swap { animation: viewIn 0.55s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; translate: 0 10px; scale: 0.995; }
  to { opacity: 1; translate: none; scale: none; }
}
.expand { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.6s var(--ease), opacity 0.5s var(--ease); opacity: 0; }
.expand.is-open { grid-template-rows: 1fr; opacity: 1; }
.expand-inner { overflow: hidden; min-height: 0; }

.ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 210, 0.35), transparent 60%);
  transform: scale(0);
  animation: ripple 0.65s var(--ease) forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 2.5px; background: currentColor; border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
.eq i:nth-child(4) { animation-delay: -0.15s; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }

/* ============================ buttons ============================ */
.btn {
  --b: var(--surface-2);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--b);
  border: 1px solid var(--line-2);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform 0.25s var(--spring), background 0.25s, border-color 0.25s, box-shadow 0.3s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--line-3); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.38; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 15.5px; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 45%, var(--gold-3));
  color: var(--gold-ink);
  border-color: transparent;
  box-shadow: 0 10px 30px -10px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 16px 40px -10px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  translate: -120% 0;
  transition: translate 0.9s var(--ease);
}
.btn-primary:hover:not(:disabled)::after { translate: 120% 0; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-soft { background: var(--surface-2); }
.btn-soft:hover:not(:disabled), .btn-soft.is-on { background: var(--surface-3); }
.btn-glass { background: rgba(20, 16, 22, 0.42); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-color: rgba(255, 255, 255, 0.16); }
.btn-gold { background: rgba(227, 180, 103, 0.14); border-color: rgba(227, 180, 103, 0.4); color: var(--gold-2); }
.btn-ok { background: rgba(134, 214, 168, 0.16); border-color: rgba(134, 214, 168, 0.4); color: var(--ok); }
.btn-danger { background: rgba(242, 144, 127, 0.16); border-color: rgba(242, 144, 127, 0.45); color: var(--bad); }
.btn-dashed { background: transparent; border: 1.5px dashed var(--line-3); color: var(--text-2); width: 100%; border-radius: var(--radius); height: 50px; }
.btn-dashed:hover { color: var(--gold-2); border-color: var(--gold); }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: background 0.2s, color 0.2s, transform 0.25s var(--spring);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn:active:not(:disabled) { transform: scale(0.92); }
.icon-btn:disabled { opacity: 0.3; }
.icon-btn-sm { width: 32px; height: 32px; }

/* ============================ chips / pills / tags ============================ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 650;
  font-size: 13.5px;
  transition: all 0.25s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-3); }
.chip[aria-pressed='true'] {
  background: color-mix(in srgb, var(--ic, var(--gold)) 18%, transparent);
  border-color: color-mix(in srgb, var(--ic, var(--gold)) 70%, transparent);
  color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ic, var(--gold)) 14%, transparent);
}
.chip-sm { height: 32px; font-size: 12.5px; padding: 0 12px; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ic); box-shadow: 0 0 10px var(--ic); }

.pill {
  --pc: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--pc);
  background: color-mix(in srgb, var(--pc) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--pc) 30%, transparent);
}
.pill-ok { --pc: var(--ok); }
.pill-warn { --pc: var(--warn); }
.pill-bad { --pc: var(--bad); }
.pill-info { --pc: var(--info); }
.pill-gold { --pc: var(--gold); }
.pill-mute { --pc: var(--text-3); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 650;
}
.tag-btn:hover { color: var(--text); background: var(--surface-3); }
.meta-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 13px; }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9f7a, #f06a5a);
  color: #200a05;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 0 0 2px var(--bg), 0 4px 14px -2px rgba(240, 106, 90, 0.6);
  animation: badgePop 0.5s var(--spring) both;
}
@keyframes badgePop { from { scale: 0; } to { scale: 1; } }

.itag { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; }
.itag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ic); box-shadow: 0 0 10px var(--ic); }
.ithumb {
  width: var(--s);
  height: var(--s);
  border-radius: 30%;
  overflow: hidden;
  flex: none;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ic) 60%, transparent);
}
.ithumb img { width: 100%; height: 100%; object-fit: cover; }

.avatar {
  --s: 40px;
  width: var(--s);
  height: var(--s);
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: hsl(var(--h) 60% 92%);
  background:
    radial-gradient(circle at 30% 25%, hsl(var(--h) 70% 62% / 0.95), transparent 70%),
    linear-gradient(135deg, hsl(var(--h) 45% 38%), hsl(calc(var(--h) + 40) 50% 22%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -6px 14px rgba(0, 0, 0, 0.25);
}
.avatar-photo { overflow: hidden; background: hsl(var(--h) 30% 20%); }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px rgba(227, 180, 103, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25); }

.callout {
  --cc: var(--text-2);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--cc) 28%, transparent);
  background: color-mix(in srgb, var(--cc) 9%, transparent);
  color: color-mix(in srgb, var(--cc) 80%, var(--text));
  font-size: 14px;
}
.callout.sm { padding: 8px 12px; font-size: 13px; }
.callout-warn { --cc: var(--warn); }
.callout-bad { --cc: var(--bad); }
.callout-info { --cc: var(--info); }

/* ============================ form controls ============================ */
.input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line-2);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.25s, background 0.2s;
  resize: vertical;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(227, 180, 103, 0.14); background: rgba(0, 0, 0, 0.35); }
.input:disabled { background: transparent; border-color: transparent; padding-left: 0; resize: none; color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }
.input-narrow { max-width: 120px; }
.input.is-invalid:not(:disabled) { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(242, 144, 127, 0.12); }
.input.is-invalid:disabled { color: var(--bad); -webkit-text-fill-color: var(--bad); }
input[type='date'].input { color-scheme: dark; }
input[type='number'] { -moz-appearance: textfield; }
input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.field { display: grid; gap: 7px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); display: flex; gap: 8px; align-items: baseline; }
.field-label em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-3); opacity: 0.8; }
.field-hint { font-size: 12.5px; color: var(--text-3); }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text-3);
  transition: border-color 0.2s, box-shadow 0.25s;
}
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(227, 180, 103, 0.12); color: var(--gold); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); height: 100%; }
.search input::placeholder { color: var(--text-3); }

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-3);
}
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-weight: 650;
  font-size: 14px;
  padding-right: 4px;
  cursor: pointer;
}
.select-wrap select option { background: var(--bg-3); }
.select-wrap.sm { height: 38px; padding: 0 12px; }

.seg {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(246, 219, 165, 0.22), rgba(227, 180, 103, 0.12));
  border: 1px solid rgba(227, 180, 103, 0.45);
  box-shadow: 0 6px 20px -8px var(--gold-glow);
  transition: transform 0.5s var(--spring), width 0.5s var(--spring);
}
.seg-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.3s;
}
.seg-btn[aria-pressed='true'] { color: var(--gold-2); }
.seg-sm .seg-btn { height: 32px; padding: 0 13px; font-size: 13px; }
.seg-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; }

.toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui {
  position: relative;
  width: 46px;
  height: 28px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  transition: background 0.3s;
}
.toggle-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.45s var(--spring), background 0.3s;
}
.toggle input:checked + .toggle-ui { background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); border-color: transparent; }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); background: #fff8ec; }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--gold); outline-offset: 3px; }
.toggle-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }

/* ============================ empty ============================ */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 46px 20px; }
.empty h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 6px 0 0; }
.empty p { color: var(--text-2); max-width: 340px; }
.empty .btn { margin-top: 10px; }
.empty-art { position: relative; width: 160px; height: 80px; display: grid; place-items: center; }
.empty-staff { position: absolute; inset: 0; width: 100%; height: 100%; }
.empty-staff path { fill: none; stroke: var(--line-3); stroke-width: 1; }
.empty-icon { position: relative; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--gold); box-shadow: 0 0 40px -6px var(--gold-glow); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -6px; } }

/* ============================ login ============================ */
.login {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.15fr minmax(360px, 440px);
  align-items: center;
  gap: clamp(24px, 6vw, 96px);
  padding: clamp(24px, 6vw, 80px);
  overflow: hidden;
  isolation: isolate;
}
.login-bg { position: absolute; inset: 0; z-index: -3; overflow: hidden; }
.login-bg img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 32s ease-in-out infinite alternate; filter: saturate(0.85) contrast(1.05); }
.login-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 700px at 75% 50%, rgba(11, 9, 14, 0.25), rgba(11, 9, 14, 0.9) 70%),
    linear-gradient(90deg, rgba(11, 9, 14, 0.9) 0%, rgba(11, 9, 14, 0.45) 45%, rgba(11, 9, 14, 0.75) 100%);
}
@keyframes kenburns {
  from { scale: 1.06; translate: 0 0; }
  to { scale: 1.18; translate: -2% -1.5%; }
}
.staff { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.staff path {
  fill: none;
  stroke: rgba(246, 219, 165, 0.16);
  stroke-width: 1;
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: draw 3.2s var(--ease) forwards, sway 12s ease-in-out infinite alternate;
  animation-delay: calc(var(--d) * -0.25 + 0.2s), var(--d);
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes sway { from { translate: 0 -10px; } to { translate: 0 12px; } }

.notes-float { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.notes-float span {
  position: absolute;
  left: var(--x);
  bottom: -60px;
  font-size: calc(26px * var(--s));
  color: rgba(246, 219, 165, 0.35);
  text-shadow: 0 0 24px rgba(227, 180, 103, 0.5);
  animation: noteRise var(--t) linear infinite;
  animation-delay: calc(var(--d) * -1);
}
@keyframes noteRise {
  0% { translate: 0 0; rotate: -10deg; opacity: 0; }
  10% { opacity: 1; }
  50% { translate: 30px -55vh; rotate: 12deg; }
  90% { opacity: 0.8; }
  100% { translate: -20px -110vh; rotate: -6deg; opacity: 0; }
}

.login-brand { align-self: center; max-width: 620px; }
.brand-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; }
.brand-mark.big { width: 112px; height: 112px; margin-bottom: 18px; animation: rise 1s var(--ease) both, glowPulse 5s ease-in-out infinite 1s; border-radius: 50%; }
@keyframes glowPulse { 50% { filter: drop-shadow(0 0 22px rgba(227, 180, 103, 0.55)); } }
.logo-img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 4px 14px rgba(227, 180, 103, 0.25)); }
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(241, 196, 111, 0.45);
  background: rgba(241, 196, 111, 0.1);
  color: var(--warn);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: rise 1s var(--ease) both 0.35s;
}
.demo-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 10px var(--warn); animation: nowPulse 2s ease-in-out infinite; }
.badge-demo {
  font-style: normal;
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(241, 196, 111, 0.5);
  color: var(--warn);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: middle;
}
.login-title { font-size: clamp(64px, 11vw, 150px); line-height: 0.85; background: linear-gradient(180deg, #fff6e6 20%, #e3b467 120%); -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise 1.1s var(--ease) both 0.1s; }
.login-tag { margin-top: 16px; font-size: 13px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-2); animation: rise 1s var(--ease) both 0.25s; }
.login-quote { margin-top: 44px; display: grid; gap: 6px; font-family: var(--serif); font-size: 24px; color: var(--text-2); max-width: 420px; animation: rise 1s var(--ease) both 0.4s; }
.login-quote span { font-family: var(--sans); font-size: 12.5px; color: var(--text-3); letter-spacing: 0.04em; }

.login-card {
  position: relative;
  padding: 34px 30px 26px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(30, 25, 32, 0.68), rgba(16, 13, 19, 0.78));
  border: 1px solid rgba(255, 240, 215, 0.12);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: var(--shadow-lg);
  animation: cardIn 1.1s var(--ease) both 0.3s;
  overflow: hidden;
  overflow: clip; /* the glow is larger than the card: never let focus scroll inside it */
}
@keyframes cardIn { from { opacity: 0; translate: 0 36px; scale: 0.96; } to { opacity: 1; translate: none; scale: none; } }
.login-card-glow {
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(227, 180, 103, 0.18) 80%, transparent 90%);
  animation: spin 9s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }
.login-h { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0 0 22px; }
.pin-dots { display: flex; justify-content: center; gap: 20px; height: 26px; align-items: center; margin: 4px 0 8px; }
.pin-dot {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-3);
  transition: border-color 0.25s, box-shadow 0.35s;
}
.pin-dot i {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 55%, var(--gold-3));
  scale: 0;
  transition: scale 0.42s var(--spring), background 0.25s;
}
.pin-dot::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 0;
  pointer-events: none;
}
.pin-dot.is-on { border-color: var(--gold); box-shadow: 0 0 16px var(--gold-glow); }
.pin-dot.is-on i { scale: 1; }
.pin-dot.is-on::after { animation: dotBurst 0.55s var(--ease) both; }
@keyframes dotBurst { from { opacity: 0.9; scale: 1; } to { opacity: 0; scale: 2.4; } }
.login-error .pin-dots { animation: shake 0.5s var(--ease); }
.login-error .pin-dot { border-color: var(--bad); box-shadow: 0 0 16px rgba(242, 144, 127, 0.5); }
.login-error .pin-dot i { background: var(--bad); }
.login-ok .pin-dot i { animation: dotWave 0.6s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes dotWave { 40% { scale: 1.45; filter: brightness(1.3); } 100% { scale: 1; } }
@keyframes shake { 15%, 55% { translate: -10px 0; } 35%, 75% { translate: 10px 0; } 90% { translate: -3px 0; } }
.login-msg { height: 20px; text-align: center; font-size: 13px; color: var(--bad); opacity: 0; transition: opacity 0.3s; margin-bottom: 10px; }
.login-msg.is-on { opacity: 1; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.key {
  position: relative;
  overflow: hidden;
  height: 64px;
  border-radius: 20px;
  background: rgba(255, 248, 238, 0.045);
  border: 1px solid var(--line);
  font-size: 26px;
  font-weight: 600;
  font-family: var(--sans);
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background 0.35s, transform 0.4s var(--spring), border-color 0.35s, box-shadow 0.35s, color 0.2s;
}
.key:hover { background: rgba(255, 248, 238, 0.08); border-color: var(--line-2); }
.key:active:not(:disabled) {
  transform: scale(0.9);
  background: rgba(227, 180, 103, 0.2);
  border-color: rgba(227, 180, 103, 0.55);
  box-shadow: 0 0 26px -4px var(--gold-glow), inset 0 0 18px rgba(246, 219, 165, 0.12);
  color: var(--gold-2);
  transition-duration: 0.06s;
}
.key:disabled { opacity: 0.35; }
.key-del, .key-demo { background: transparent; border-color: transparent; color: var(--text-2); }
.key-demo { font-size: 12px; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.login-foot { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.login-card .kicker { justify-content: center; }
.login-card { text-align: center; }
.login-form { transition: opacity 0.35s var(--ease), scale 0.45s var(--ease), filter 0.35s; }
.login-ok .login-form { opacity: 0; scale: 0.94; pointer-events: none; }
.login-welcome {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease) 0.15s;
}
.login-ok .login-welcome { opacity: 1; }
.login-welcome .kicker, .login-welcome .display, .login-welcome .muted { translate: 0 12px; opacity: 0; transition: translate 0.6s var(--ease), opacity 0.5s var(--ease); }
.login-ok .login-welcome .kicker { translate: none; opacity: 1; transition-delay: 0.3s; }
.login-ok .login-welcome .display { translate: none; opacity: 1; transition-delay: 0.38s; }
.login-ok .login-welcome .muted { translate: none; opacity: 1; transition-delay: 0.46s; }
.sound-toggle { position: absolute; top: 14px; right: 14px; z-index: 2; color: var(--text-3); background: transparent; border-color: transparent; }
.sound-toggle[aria-pressed='true'] { color: var(--gold); }
.login-welcome .display { font-size: 58px; }
.welcome-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: var(--gold-ink);
  background: linear-gradient(135deg, var(--gold-2), var(--gold-3));
  box-shadow: 0 0 0 10px rgba(227, 180, 103, 0.12), 0 0 60px var(--gold-glow);
  scale: 0.3;
  opacity: 0;
}
.login-ok .welcome-ring { animation: welcomePop 0.8s var(--spring) 0.15s both; }
@keyframes welcomePop { from { scale: 0.3; rotate: -45deg; opacity: 0; } to { scale: 1; rotate: 0deg; opacity: 1; } }
.login-ok .login-card { animation: cardOut 0.45s var(--ease-in-out) 1.05s forwards; }
@keyframes cardOut { to { opacity: 0; scale: 1.03; } }

.demo-pins {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(70dvh, 620px);
  overflow: auto;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(18, 15, 21, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  translate: 0 20px;
  scale: 0.96;
  pointer-events: none;
  transition: all 0.45s var(--ease);
  z-index: 50;
}
.demo-pins.is-open { opacity: 1; translate: none; scale: none; pointer-events: auto; }
.demo-pins header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.demo-group { margin-top: 10px; }
.demo-role { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); font-weight: 750; margin: 6px 0; }
.demo-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 10px; text-align: left; }
.demo-row:hover { background: var(--surface-2); }
.demo-reset { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; padding: 10px; border-radius: 12px; border: 1px dashed rgba(241, 196, 111, 0.45); color: var(--warn); font-size: 13px; font-weight: 700; }
.demo-reset:hover { background: rgba(241, 196, 111, 0.08); }
.demo-row code { font: 700 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--gold-2); background: rgba(227, 180, 103, 0.12); padding: 3px 8px; border-radius: 6px; }

/* ---------- email + password sign-in (real accounts) ---------- */
.auth-card { width: min(420px, 100%); }
.auth-form { display: grid; gap: 14px; text-align: left; }
.auth-form .kicker, .auth-form .login-h { text-align: center; justify-self: center; }
.auth-form .login-h { margin-bottom: 4px; }
.auth-field { display: grid; gap: 7px; }
.auth-field > span, .auth-field > label > span { font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.auth-field > label { display: block; }
.auth-pw { position: relative; }
.auth-pw .input { padding-right: 46px; }
.auth-pw .icon-btn { position: absolute; right: 6px; top: 50%; translate: 0 -50%; }
.auth-form .login-msg { height: auto; min-height: 18px; margin: -4px 0 0; }
.auth-hint, .auth-note { font-size: 13px; color: var(--text-3); margin: -4px 0 0; line-height: 1.5; }
.auth-note { color: var(--text-2); text-align: center; margin: 4px 0 6px; }
.btn-block { width: 100%; justify-content: center; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.auth-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650; color: var(--gold-2); padding: 4px 0; justify-self: center; }
.auth-link:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.auth-demo { padding: 6px 12px; border-radius: 999px; background: rgba(227, 180, 103, 0.12); }
.auth-demo:hover { text-decoration: none; background: rgba(227, 180, 103, 0.2); }
.auth-who { margin-top: 12px; font-size: 13px; color: var(--text-2); text-align: center; }
.demo-pass { font-size: 13px; color: var(--text-2); margin: 0 0 4px; }
.demo-pass code { font: 700 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--gold-2); background: rgba(227, 180, 103, 0.12); padding: 3px 8px; border-radius: 6px; user-select: all; }
.demo-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; color: var(--text-2); }
.demo-row:hover { color: var(--text); }
.demo-face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.demo-who { display: grid; min-width: 0; }
.demo-who b { font-weight: 600; color: var(--text); }
.demo-who small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-note-top { margin: 0 0 4px; }
.demo-pins, .demo-pins .demo-role { text-align: left; }
.demo-note { margin-top: 12px; font-size: 12px; color: var(--text-3); line-height: 1.5; }

.mfa-qr { display: grid; place-items: center; justify-self: center; width: 204px; height: 204px; border-radius: 16px; background: #fff; }
.mfa-qr img { width: 180px; height: 180px; }
.mfa-secret { font-size: 13px; color: var(--text-2); text-align: center; }
.mfa-secret summary { cursor: pointer; color: var(--gold-2); font-weight: 650; }
.mfa-secret code { display: block; margin: 10px 0 6px; font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; word-break: break-all; user-select: all; color: var(--text); }
.mfa-code { font: 600 22px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.4em; text-align: center; }

/* ---------- create an account ---------- */
.auth-card-wide { width: min(560px, 100%); }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.role-cards { display: grid; gap: 10px; }
.role-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); text-align: left; transition: border-color 0.2s, background 0.2s, translate 0.2s; }
.role-card:hover { border-color: var(--gold); background: var(--surface-2); translate: 0 -1px; }
.role-card strong { display: block; font-weight: 650; }
.role-card small { display: block; font-size: 13px; color: var(--text-3); margin-top: 2px; }
.role-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--gold-2); background: rgba(227, 180, 103, 0.12); }
.auth-change { justify-self: center; margin-top: -10px; font-size: 12.5px; }
.signup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.signup-grid .span-2 { grid-column: 1 / -1; }
.auth-field em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--text-3); font-weight: 600; opacity: 0.8; }
.signup-kids { display: grid; gap: 8px; }
.kid-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; padding: 10px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); }
.kid-row:not(:has(.icon-btn)) { grid-template-columns: 1fr 1fr; }
.kid-row .kid-dob { grid-column: 1 / 3; grid-row: 2; }
.kid-row .icon-btn { grid-column: 3; grid-row: 1; }
.field-error { font-size: 12.5px; color: var(--bad); }

/* phone with country picker */
.phone-field { position: relative; display: flex; align-items: stretch; min-height: 46px; border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line-2); transition: border-color 0.2s, box-shadow 0.25s; }
.phone-field:focus-within, .phone-field.is-open { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(227, 180, 103, 0.14); }
.phone-field.is-invalid { border-color: var(--bad); }
.phone-cc { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px 0 12px; border-right: 1px solid var(--line-2); color: var(--text); font-weight: 600; font-size: 14.5px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.phone-cc:hover { background: rgba(255, 255, 255, 0.04); }
.phone-cc svg { color: var(--text-3); }
.phone-flag { font-size: 20px; line-height: 1; }
.phone-num { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); padding: 0 14px; font-size: 15px; letter-spacing: 0.01em; }
.phone-menu { position: absolute; left: 0; top: calc(100% + 8px); z-index: 40; width: min(340px, 86vw); border-radius: var(--radius); background: rgba(22, 18, 26, 0.98); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); overflow: hidden; text-align: left; }
.phone-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.phone-search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.phone-list { max-height: 280px; overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.phone-menu, .phone-opt, .phone-name { text-align: left; }
.phone-opt { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; font-size: 14px; color: var(--text-2); }
.phone-opt:hover, .phone-opt[aria-selected='true'] { background: var(--surface-2); color: var(--text); }
.phone-dial { color: var(--text-3); font-variant-numeric: tabular-nums; }
.phone-sep { height: 1px; margin: 6px 4px; background: var(--line-2); }
.phone-none { padding: 10px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.auth-notice { justify-items: center; text-align: center; }
.auth-notice .auth-note { margin-bottom: 4px; }
.notice-ring { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: var(--gold-2); background: rgba(227, 180, 103, 0.12); box-shadow: 0 0 0 8px rgba(227, 180, 103, 0.06); }
.notice-received { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.notice-declined { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
@media (max-width: 520px) {
  .signup-grid { grid-template-columns: 1fr; }

}

/* ---------- Sign-ups (owner) ---------- */
.page-signups .callout { margin-top: 18px; }
.signup-list { display: grid; gap: 14px; margin-top: 22px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.signup-card { display: grid; gap: 14px; }
.signup-head { display: flex; align-items: center; gap: 12px; }
.signup-head h3 { font-size: 18px; font-weight: 650; margin: 0; }
.signup-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.signup-facts .span-2 { grid-column: 1 / -1; }
.signup-facts dt { font-size: 11px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.signup-facts dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.signup-facts dd a { color: var(--gold-2); }
.signup-note { color: var(--text-2); font-style: italic; }
.kid-pill { display: inline-flex; align-items: center; gap: 6px; margin: 2px 6px 2px 0; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.kid-pill em { font-style: normal; color: var(--text-3); }
.signup-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.signup-decided { margin-top: 28px; }
.signup-decided summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-2); }

/* ---------- parent: which child ---------- */
.family-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.family-bar > span { font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.family-kid { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; }
.family-kid[aria-pressed='true'] { border-color: var(--gold); background: rgba(227, 180, 103, 0.14); color: var(--gold-2); }

.search { padding-right: 8px; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { flex: none; color: var(--text-3); }

/* ---------- Instructors (owner) + Students/Instructors switch ---------- */
.people-switch { display: flex; justify-content: center; margin: 0 0 16px; }
.people-switch .seg { width: min(420px, 100%); }
.people-switch .seg-btn { flex: 1; justify-content: center; }
.card-head-sub { margin-top: 22px; }
.hours-list { display: grid; gap: 2px; }
.hours-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hours-row:last-child { border-bottom: 0; }
.hours-row > span:first-child { color: var(--text-2); font-weight: 600; }
.mini-people { display: grid; gap: 4px; }
.mini-person { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: var(--text-2); }
.mini-person:hover { background: var(--surface-2); color: var(--text); }
.mini-person span { display: grid; min-width: 0; }
.mini-person b { font-weight: 600; color: var(--text); }
.mini-person small { font-size: 12.5px; color: var(--text-3); }

/* ---------- People & sign-in (owner) ---------- */
.page-people .callout { margin-top: 18px; }
.people-group { margin-top: 28px; }
.people-list { display: grid; gap: 10px; margin-top: 12px; }
.person-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.person-main { display: grid; gap: 2px; min-width: 0; }
.person-main strong { font-weight: 650; }
.person-main small { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-email { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2) !important; }
.person-side { display: grid; justify-items: end; gap: 8px; }
.access-pill { font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.access-active { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.access-invited { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.access-none { color: var(--text-3); background: var(--surface-2); }
.invite-choices { display: grid; gap: 10px; }
.invite-link .input { font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 560px) {
  .person-row { grid-template-columns: auto 1fr; }
  .person-side { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; justify-items: start; }
}

/* ============================ app shell ============================ */
.app { min-height: 100dvh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side-w);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 16px 18px;
  background: linear-gradient(180deg, rgba(20, 17, 23, 0.85), rgba(12, 10, 15, 0.9));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand-text { display: grid; line-height: 1.1; }
.brand-text b { font-family: var(--serif); font-weight: 400; font-size: 27px; letter-spacing: -0.01em; }
.brand-text small { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.side-nav { display: grid; gap: 4px; }
.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--text-2);
  font-weight: 650;
  transition: background 0.25s, color 0.25s;
}
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link[aria-current='page'] { color: var(--gold-2); background: linear-gradient(90deg, rgba(227, 180, 103, 0.16), rgba(227, 180, 103, 0.02)); }
.side-link[aria-current='page']::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
  box-shadow: 0 0 16px var(--gold);
  animation: barIn 0.5s var(--spring);
}
@keyframes barIn { from { scale: 1 0; } }
.side-link .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 14px; text-align: left; }
.side-user:hover { background: var(--surface-2); }
.side-user[aria-current='page'] { background: linear-gradient(90deg, rgba(227, 180, 103, 0.16), rgba(227, 180, 103, 0.02)); }
.side-user[aria-current='page'] b { color: var(--gold-2); }
.me-link { display: grid; border-radius: 50%; transition: transform 0.3s var(--spring); }
.me-link:active { transform: scale(0.92); }
.me-link[aria-current='page'] .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold), 0 0 18px var(--gold-glow); }
.side-user span { display: grid; min-width: 0; line-height: 1.25; }
.side-user b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { color: var(--text-3); font-size: 12px; }

.topbar { display: none; }
.tabbar { display: none; }

.main {
  margin-left: var(--side-w);
  padding: 22px var(--gutter) 120px;
  max-width: calc(1380px + var(--side-w));
}
.page { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.section, .stack-xs, .stack-sm, .stack-md, .flow, .rail-wrap, .dayview, .agenda, .ag-day, .slotpicker, .sp-row, .card, .step, .month { grid-template-columns: minmax(0, 1fr); }

/* ============================ hero ============================ */
.hero, .home-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  isolation: isolate;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero { min-height: 230px; display: flex; align-items: flex-end; }
.hero-compact { min-height: 200px; }
.hero-media { position: absolute; inset: 0; z-index: -3; overflow: hidden; }
.hero-media { animation: mediaIn 0.9s var(--ease) both; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; scale: 1.06; animation: kenburns 40s ease-in-out infinite alternate; }
@keyframes mediaIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes heroZoom { from { scale: 1.2; filter: blur(8px) brightness(0.6); } to { scale: 1.06; filter: none; } }
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(11, 9, 14, 0.92) 0%, rgba(11, 9, 14, 0.6) 50%, rgba(11, 9, 14, 0.25) 100%),
    linear-gradient(0deg, rgba(11, 9, 14, 0.85), transparent 60%);
}
.hero-staff { position: absolute; left: 0; right: 0; bottom: 18%; width: 100%; height: 90px; z-index: -1; pointer-events: none; }
.hero-staff path { fill: none; stroke: rgba(246, 219, 165, 0.18); stroke-width: 1; stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: draw 2.4s var(--ease) forwards; animation-delay: calc(var(--d) + 0.2s); }
.hero-inner { padding: clamp(22px, 3.4vw, 40px); display: grid; gap: 12px; max-width: 760px; }
.hero .display { font-size: clamp(40px, 5.4vw, 64px); }
.hero-sub { color: var(--text-2); font-size: 16px; max-width: 520px; }
.hero-inner .btn { margin-top: 6px; }

.home-hero { min-height: clamp(330px, 42vw, 440px); display: flex; align-items: flex-end; }
.home-hero .hero-shade {
  background:
    radial-gradient(900px 500px at 15% 100%, rgba(11, 9, 14, 0.95), transparent 70%),
    linear-gradient(90deg, rgba(11, 9, 14, 0.88), rgba(11, 9, 14, 0.25) 70%),
    linear-gradient(0deg, rgba(11, 9, 14, 0.9), transparent 55%);
}
.staff-hero { z-index: -1; opacity: 0.8; }
.home-hero-inner { padding: clamp(24px, 4vw, 48px); display: grid; gap: 14px; width: 100%; }
.home-hero .display { font-size: clamp(46px, 7vw, 92px); }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.stat {
  display: grid;
  gap: 2px;
  min-width: 118px;
  padding: 12px 16px 13px;
  border-radius: 18px;
  background: rgba(20, 16, 22, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  transition: transform 0.35s var(--spring), border-color 0.3s, background 0.3s;
}
.stat:hover { transform: translateY(-3px); border-color: rgba(227, 180, 103, 0.45); }
.stat b { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; }
.stat > span { font-size: 12px; color: var(--text-2); font-weight: 650; }
.stat.is-hot { border-color: rgba(240, 106, 90, 0.5); background: rgba(80, 28, 22, 0.45); }
.stat.is-hot b { color: #ffb19c; }

/* ============================ sections ============================ */
.section { display: grid; gap: 16px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head p { margin-top: 4px; font-size: 14px; }
.section-label { font-size: 11.5px; font-weight: 750; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }

/* ============================ today rail ============================ */
.rail-wrap { display: grid; gap: 10px; }
.expand .rail-wrap { padding-top: 18px; }
.rail-label { display: flex; align-items: baseline; gap: 10px; }
.rail-label span { font-family: var(--serif); font-size: 22px; }
.rail-label small { color: var(--text-3); font-weight: 650; }
.rail-label i { margin-left: auto; font-style: normal; font-size: 12.5px; color: var(--text-3); font-weight: 650; }
.rail { position: relative; }
.rail-track {
  position: relative;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 2px;
  padding: 4px 2px 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.rail-track::-webkit-scrollbar { display: none; }
.rail::before, .rail::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 14px;
  width: 64px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.rail::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.rail::after { right: 0; background: linear-gradient(-90deg, var(--bg), transparent); }
.rail.fade-l::before, .rail.fade-r::after { opacity: 1; }
.rail-nav { position: absolute; top: calc(50% - 28px); z-index: 3; background: rgba(20, 16, 22, 0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: var(--line-2); transition: opacity 0.3s, transform 0.25s var(--spring); }
.rail-nav:disabled { opacity: 0 !important; pointer-events: none; }
.rail-prev { left: -10px; }
.rail-next { right: -10px; }
.rail-empty { display: flex; align-items: center; gap: 12px; padding: 22px; border-radius: var(--radius-lg); border: 1px dashed var(--line-2); color: var(--text-2); }
.rail-empty .icon { color: var(--gold); }
.more-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(227, 180, 103, 0.08), transparent 70%);
  color: var(--text-2);
  font-weight: 650;
  transition: all 0.3s var(--ease);
}
.more-link:hover { color: var(--gold-2); border-color: rgba(227, 180, 103, 0.35); }
.more-link .icon { transition: translate 0.35s var(--spring); }
.more-link:hover .icon { translate: 5px 0; }

/* lesson card */
.lcard {
  position: relative;
  flex: none;
  width: clamp(230px, 24vw, 272px);
  aspect-ratio: 4 / 4.6;
  border-radius: var(--radius-lg);
  overflow: hidden;
  scroll-snap-align: start;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  isolation: isolate;
  border: 1px solid var(--line-2);
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.8);
  animation: rise 0.8s var(--ease) both;
  animation-delay: calc(var(--i) * 80ms + 150ms);
  transition: transform 0.45s var(--ease), border-color 0.3s, box-shadow 0.4s;
}
.lcard:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--ic) 60%, transparent); box-shadow: 0 30px 50px -24px rgba(0, 0, 0, 0.9), 0 0 0 1px color-mix(in srgb, var(--ic) 30%, transparent), 0 20px 60px -30px var(--ic); }
.lcard-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: scale 1.2s var(--ease), filter 0.6s; filter: saturate(0.9); }
.lcard:hover .lcard-img { scale: 1.08; filter: saturate(1.1); }
.lcard-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 9, 14, 0.7) 0%, rgba(11, 9, 14, 0.1) 35%, rgba(11, 9, 14, 0.35) 55%, rgba(11, 9, 14, 0.96) 100%),
    linear-gradient(135deg, color-mix(in srgb, var(--ic) 32%, transparent), transparent 55%);
}
.lcard-top { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.lcard-time { display: inline-flex; align-items: baseline; gap: 4px; margin-right: auto; }
.lcard-time b { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 0.9; letter-spacing: -0.02em; }
.lcard-time small { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: var(--text-2); }
.phase {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(11, 9, 14, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.phase-live { color: #0d2016; background: var(--ok); border-color: transparent; box-shadow: 0 0 24px rgba(134, 214, 168, 0.55); }
.phase.phase-done { color: var(--text-2); }
.phase.phase-cancelled { color: var(--bad); }
.phase-pending { color: var(--warn); }
.lcard.phase-done { opacity: 0.62; }
.lcard.phase-done:hover { opacity: 0.9; }
.lcard.phase-cancelled .lcard-img { filter: grayscale(1) brightness(0.6); }
.lcard.phase-cancelled .lcard-time b { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--text-2); }
.lcard.phase-live { border-color: rgba(134, 214, 168, 0.6); box-shadow: 0 0 0 1px rgba(134, 214, 168, 0.25), 0 24px 60px -24px rgba(134, 214, 168, 0.45); }
.lcard-bottom { display: grid; gap: 10px; }
.lcard-who { display: flex; align-items: center; gap: 10px; }
.lcard-who span { display: grid; line-height: 1.2; min-width: 0; }
.lcard-who strong { font-size: 16px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard-who small { font-size: 13px; color: color-mix(in srgb, var(--ic) 70%, white); font-weight: 650; }
.lcard-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 650; }
.lcard-meta > span { padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.08); }
.lcard-label { color: var(--gold-2); }
.lcard-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.1); }
.lcard-progress i { display: block; height: 100%; background: var(--ok); box-shadow: 0 0 12px var(--ok); }

/* action tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; perspective: 1200px; }
.tile {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  min-height: 190px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  border: 1px solid var(--line-2);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease), border-color 0.3s, box-shadow 0.4s;
  box-shadow: 0 20px 40px -26px rgba(0, 0, 0, 0.9);
}
.tile:hover { border-color: rgba(227, 180, 103, 0.45); box-shadow: 0 34px 60px -30px rgba(0, 0, 0, 0.95), 0 0 50px -20px var(--gold-glow); }
.tile-media { position: absolute; inset: 0; z-index: -3; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; transition: scale 1.4s var(--ease), filter 0.6s; filter: saturate(0.75) brightness(0.85); }
.tile:hover .tile-media img { scale: 1.1; filter: saturate(1.05) brightness(0.95); }
.tile-shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(11, 9, 14, 0.15), rgba(11, 9, 14, 0.55) 45%, rgba(11, 9, 14, 0.95)); }
.tile-spot { position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.4s; background: radial-gradient(420px circle at var(--mx) var(--my), rgba(246, 219, 165, 0.16), transparent 45%); pointer-events: none; }
.tile:hover .tile-spot, .scard:hover .tile-spot { opacity: 1; }
.tile-icon {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--gold-2);
  background: rgba(20, 16, 22, 0.55);
  border: 1px solid rgba(227, 180, 103, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateZ(30px);
  transition: transform 0.5s var(--spring), background 0.3s;
}
.tile:hover .tile-icon { transform: translateZ(40px) rotate(-6deg) scale(1.06); background: rgba(227, 180, 103, 0.22); }
.tile-badge { position: absolute; top: 14px; right: 14px; min-width: 24px; height: 24px; font-size: 12px; }
.tile-text { display: grid; gap: 3px; transform: translateZ(20px); }
.tile-text strong { font-family: var(--serif); font-weight: 400; font-size: 29px; line-height: 1.05; letter-spacing: -0.01em; }
.tile-text small { color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.tile-arrow { position: absolute; right: 18px; bottom: 20px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); transition: all 0.4s var(--spring); }
.tile:hover .tile-arrow { background: var(--gold); color: var(--gold-ink); translate: 3px 0; border-color: transparent; }

/* ============================ cards ============================ */
.card {
  position: relative;
  padding: clamp(18px, 2.4vw, 26px);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.045), rgba(255, 248, 238, 0.02));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  align-content: start;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 750; }
.card-head h3 .icon { color: var(--gold); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .field:has(textarea) { grid-column: 1 / -1; }

/* ============================ notes ============================ */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.notes-grid > div { position: relative; }
.note {
  position: relative;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, color-mix(in srgb, var(--ic, var(--gold)) 9%, transparent), rgba(255, 248, 238, 0.02) 60%);
  border: 1px solid var(--line);
  border-left: 3px solid color-mix(in srgb, var(--ic, var(--gold)) 75%, transparent);
  display: grid;
  gap: 10px;
}
.note-private { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.015) 0 10px, transparent 10px 20px), rgba(255, 248, 238, 0.02); border-left-color: var(--text-3); }
.note-head { display: flex; align-items: center; gap: 10px; }
.note-who { display: grid; line-height: 1.25; flex: 1; min-width: 0; }
.note-who strong { font-size: 14px; }
.note-who small { color: var(--text-3); font-size: 12px; }
.note-text { font-size: 15px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.new-flag { position: absolute; top: -8px; right: 12px; z-index: 2; padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; background: var(--gold); color: var(--gold-ink); box-shadow: 0 6px 20px -6px var(--gold-glow); }

/* ============================ lesson rows ============================ */
.lrow {
  position: relative;
  display: grid;
  grid-template-columns: 86px 3px 46px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(var(--i) * 40ms);
  transition: background 0.25s, border-color 0.25s, transform 0.35s var(--ease);
}
.lrow:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--ic) 40%, transparent); transform: translateX(3px); }
.lrow-time { display: grid; line-height: 1.2; }
.lrow-time b { font-size: 15px; font-weight: 750; }
.lrow-time em { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.lrow-time small { font-size: 12px; color: var(--text-3); }
.lrow-bar { width: 3px; height: 36px; border-radius: 3px; background: var(--ic); box-shadow: 0 0 12px var(--ic); }
.lrow-img { width: 46px; height: 46px; border-radius: 14px; overflow: hidden; }
.lrow-img img { width: 100%; height: 100%; object-fit: cover; }
.lrow-main { display: grid; min-width: 0; line-height: 1.3; }
.lrow-main strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow-main small { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lrow-go { color: var(--text-3); }
.lrow.phase-cancelled { opacity: 0.55; }
.lrow.phase-cancelled .lrow-main strong { text-decoration: line-through; }
.lrow.phase-done { opacity: 0.6; }

/* ============================ overlays ============================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 5, 8, 0.6);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  animation: fadeIn 0.35s var(--ease) both;
}
.overlay.is-closing { animation: fadeOut 0.3s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet {
  --accent: var(--gold);
  position: relative;
  width: min(560px, 100%);
  max-height: min(88dvh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #1b1720, #121015);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg), 0 0 120px -40px color-mix(in srgb, var(--accent) 50%, transparent);
  overflow: hidden;
  animation: sheetIn 0.55s var(--spring) both;
}
.sheet:focus { outline: none; }
.sheet-sm { width: min(420px, 100%); }
.sheet-lg { width: min(720px, 100%); }
.overlay.is-closing .sheet { animation: sheetOut 0.3s var(--ease) both; }
@keyframes sheetIn { from { opacity: 0; translate: 0 30px; scale: 0.94; } to { opacity: 1; translate: none; scale: none; } }
@keyframes sheetOut { to { opacity: 0; translate: 0 20px; scale: 0.97; } }
.sheet-grab { display: none; }
.sheet-hero { position: relative; height: 170px; flex: none; overflow: hidden; }
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; animation: mediaIn 0.6s var(--ease) both; }
.sheet-hero-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(27, 23, 32, 0.1), #1b1720), linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%); }
.sheet-head { padding: 24px 64px 6px 26px; flex: none; }
.sheet-hero + .sheet-head { margin-top: -56px; position: relative; }
.sheet-title { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; margin: 0; }
.sheet-sub { color: var(--text-2); margin-top: 6px; }
.sheet-head .kicker { color: var(--accent); }
.sheet-x { position: absolute; top: 16px; right: 16px; z-index: 3; background: rgba(20, 16, 22, 0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sheet-body { padding: 16px 26px 26px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.sheet-actions.wrap { flex-wrap: wrap; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fact { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-weight: 650; font-size: 14px; }
.fact .icon { color: var(--accent, var(--gold)); }
.fact span { display: grid; line-height: 1.3; }
.fact small { font-size: 11px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.person-chip { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.person-chip span { display: grid; line-height: 1.25; font-weight: 700; font-size: 14px; }
.person-chip small { font-size: 11px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* toasts */
.toasts { position: fixed; z-index: 300; left: 50%; top: calc(16px + var(--safe-t)); translate: -50% 0; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 10px;
  border-radius: 999px;
  background: rgba(28, 24, 32, 0.92);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  font-weight: 650;
  font-size: 14px;
  animation: toastIn 0.6s var(--spring) both;
}
.toast.is-out { animation: toastOut 0.4s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; translate: 0 -24px; scale: 0.9; } }
@keyframes toastOut { to { opacity: 0; translate: 0 -16px; scale: 0.95; } }
.toast-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #0d2016; flex: none; }
.toast-info .toast-icon { background: var(--info); color: #0b1830; }
.toast-bad .toast-icon { background: var(--bad); color: #2a0a05; }

/* ============================ requests ============================ */
.req {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(var(--i) * 60ms);
  transition: border-color 0.3s, background 0.3s;
}
.req.is-yours { border-color: rgba(227, 180, 103, 0.4); background: linear-gradient(135deg, rgba(227, 180, 103, 0.08), rgba(255, 248, 238, 0.02) 50%); box-shadow: 0 20px 50px -30px var(--gold-glow); }
.req-head { width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 24px; align-items: center; gap: 14px; padding: 14px 16px; text-align: left; }
.req-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--ic); background: color-mix(in srgb, var(--ic) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ic) 35%, transparent); }
.req-title { display: grid; min-width: 0; line-height: 1.3; }
.req-title strong { font-size: 15px; }
.req-title small { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-status { display: grid; justify-items: end; gap: 4px; }
.req-status small { font-size: 11.5px; font-weight: 700; }
.req-caret { color: var(--text-3); transition: rotate 0.4s var(--spring); }
.req-caret.is-open { rotate: 180deg; }
.req-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s var(--ease); }
.req-body.is-open { grid-template-rows: 1fr; }
.req-body-inner { overflow: hidden; min-height: 0; padding: 0 16px; }
.req-body.is-open .req-body-inner { padding-bottom: 16px; }
.req-change { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.slotbox { flex: 1; min-width: 160px; display: grid; gap: 2px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(0, 0, 0, 0.2); font-weight: 700; font-size: 14px; }
.slotbox small { font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.slotbox.is-old { color: var(--text-3); text-decoration: line-through; text-decoration-color: rgba(242, 144, 127, 0.6); }
.slotbox.is-old small { text-decoration: none; }
.slotbox.is-new { border-color: rgba(227, 180, 103, 0.45); background: rgba(227, 180, 103, 0.08); color: var(--gold-2); }
.slotbox.is-cancel { border-color: rgba(242, 144, 127, 0.4); background: rgba(242, 144, 127, 0.07); color: var(--bad); }
.req-arrow { display: grid; place-items: center; color: var(--text-3); }
.thread { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; position: relative; }
.thread::before { content: ''; position: absolute; left: 12px; top: 14px; bottom: 14px; width: 1px; background: var(--line-2); }
.thread-item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; position: relative; }
.thread-bubble { padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.thread-meta { font-size: 12.5px; color: var(--text-2); }
.thread-meta strong { color: var(--text); }
.thread-meta em { font-style: normal; color: var(--gold-2); font-weight: 700; }
.thread-bubble p { margin-top: 3px; font-size: 14px; }
.act-accepted .thread-bubble { border-color: rgba(134, 214, 168, 0.3); }
.act-declined .thread-bubble { border-color: rgba(242, 144, 127, 0.3); }
.act-direct .thread-bubble { border-color: rgba(227, 180, 103, 0.35); }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================ pickers ============================ */
.dstrip { position: relative; display: flex; align-items: center; gap: 8px; }
.dstrip-track { position: relative; flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 16px 2px 6px; scrollbar-width: none; }
.dstrip-track::-webkit-scrollbar { display: none; }
.dday {
  position: relative;
  flex: none;
  width: 64px;
  height: 84px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  scroll-snap-align: center;
  transition: all 0.35s var(--ease);
}
.dday:hover { border-color: var(--line-3); background: var(--surface-2); }
.dday-month { position: absolute; top: -15px; left: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.dday-wd { font-size: 11.5px; font-weight: 750; letter-spacing: 0.04em; color: var(--text-3); text-transform: uppercase; }
.dday-num { font-family: var(--serif); font-size: 30px; line-height: 1; }
.dday-dots { display: flex; gap: 3px; height: 6px; align-items: center; }
.dday-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); opacity: 0.8; }
.dday-dots b { font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warn); }
.dday.is-today .dday-wd { color: var(--gold); }
.dday.is-away { background: repeating-linear-gradient(135deg, rgba(241, 196, 111, 0.06) 0 6px, transparent 6px 12px); }
.dday[aria-pressed='true'] {
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 50%, var(--gold-3));
  border-color: transparent;
  color: var(--gold-ink);
  box-shadow: 0 14px 30px -12px var(--gold-glow);
  transform: translateY(-3px);
}
.dday[aria-pressed='true'] .dday-wd { color: rgba(27, 18, 7, 0.7); }
.dday[aria-pressed='true'] .dday-dots i { background: var(--gold-ink); }
.dstrip-sm .dday { width: 56px; height: 72px; border-radius: 16px; }
.dstrip-sm .dday-num { font-size: 25px; }
.dstrip-nav { flex: none; }

.slotpicker { display: grid; gap: 20px; }
.sp-row { display: grid; gap: 10px; min-width: 0; }
.sp-label { font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.sp-label .small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.sp-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.toggle-sm { gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 650; font-size: 12.5px; color: var(--text-2); }
.toggle-sm .toggle-ui { width: 38px; height: 22px; }
.toggle-sm .toggle-ui::after { width: 16px; height: 16px; }
.toggle-sm input:checked + .toggle-ui::after { transform: translateX(16px); }
.slot-groups { display: grid; gap: 14px; }
.slot-group { display: grid; gap: 8px; }
.slot-group-label { font-size: 12.5px; color: var(--text-2); font-weight: 650; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.slot {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-weight: 750;
  font-size: 15px;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  padding-top: 11px;
  transition: all 0.25s var(--ease);
}
.slot small { font-size: 10px; color: var(--text-3); font-weight: 800; }
.slot:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-2); }
.slot.is-off { opacity: 0.28; text-decoration: line-through; background: transparent; border-style: dashed; }
.slot[aria-pressed='true'] { background: linear-gradient(160deg, var(--gold-2), var(--gold-3)); color: var(--gold-ink); border-color: transparent; box-shadow: 0 10px 24px -10px var(--gold-glow); transform: scale(1.04); }
.slot[aria-pressed='true'] small { color: rgba(27, 18, 7, 0.7); }

.pick-list { display: grid; gap: 6px; max-height: 330px; overflow-y: auto; padding: 2px; margin: -2px; scrollbar-width: thin; }
.pick-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 26px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  transition: all 0.25s var(--ease);
}
.pick-row:hover { border-color: var(--line-3); background: var(--surface-2); }
.pick-main { display: grid; line-height: 1.3; min-width: 0; }
.pick-main strong { font-size: 15px; }
.pick-sub { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-icon { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); }
.pick-check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-3); color: transparent; transition: all 0.35s var(--spring); }
.pick-row[aria-pressed='true'] { border-color: rgba(227, 180, 103, 0.6); background: linear-gradient(90deg, rgba(227, 180, 103, 0.12), rgba(227, 180, 103, 0.03)); }
.pick-row[aria-pressed='true'] .pick-check { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); scale: 1.08; }
.inline-form { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius); border: 1px solid rgba(227, 180, 103, 0.35); background: rgba(227, 180, 103, 0.05); animation: rise 0.45s var(--ease) both; }
.inline-form-head { display: flex; align-items: center; gap: 8px; font-weight: 750; color: var(--gold-2); }

.lesson-pick { display: grid; gap: 14px; max-height: 420px; overflow-y: auto; padding: 2px; margin: -2px; }
.lp-day { display: grid; gap: 6px; }
.lp-date { display: flex; align-items: baseline; gap: 8px; font-family: var(--serif); font-size: 20px; }
.lp-date span { font-family: var(--sans); font-size: 12px; color: var(--text-3); font-weight: 650; }
.lp-items { display: grid; gap: 6px; }

/* instrument dropdown */
.iselect { position: relative; }
.iselect-btn {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.22);
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.25s;
}
.iselect.is-open .iselect-btn, .iselect-btn:hover { border-color: rgba(227, 180, 103, 0.55); }
.iselect.is-open .iselect-btn { box-shadow: 0 0 0 4px rgba(227, 180, 103, 0.12); }
.iselect-values { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; padding-left: 4px; min-width: 0; }
.iselect-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 3px; border-radius: 999px; background: color-mix(in srgb, var(--ic) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ic) 45%, transparent); font-weight: 700; font-size: 13.5px; animation: badgePop 0.45s var(--spring) both; }
.iselect-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.iselect-chip.is-locked { opacity: 0.65; border-style: dashed; }
.iselect-caret { color: var(--text-3); transition: rotate 0.35s var(--spring); }
.iselect.is-open .iselect-caret { rotate: 180deg; color: var(--gold); }
.iselect-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: rgba(24, 20, 28, 0.97);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform-origin: top center;
  animation: menuIn 0.4s var(--spring) both;
  max-height: 420px;
  overflow-y: auto;
}
@keyframes menuIn { from { opacity: 0; scale: 0.96 0.9; translate: 0 -8px; } }
.iselect-opt {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid transparent;
  text-align: left;
  animation: rise 0.45s var(--ease) both;
  animation-delay: calc(var(--i) * 25ms);
  transition: background 0.2s, border-color 0.2s;
}
.iselect-opt:hover { background: var(--surface-2); }
.iselect-opt[aria-selected='true'] { background: color-mix(in srgb, var(--ic) 14%, transparent); border-color: color-mix(in srgb, var(--ic) 55%, transparent); }
.iselect-photo { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ic) 40%, transparent); }
.iselect-photo img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.6s var(--ease); }
.iselect-opt:hover .iselect-photo img { scale: 1.12; }
.iselect-name { display: grid; line-height: 1.25; }
.iselect-name strong { font-size: 14px; }
.iselect-name small { font-size: 11.5px; color: var(--text-3); }
.iselect-tick { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ic); color: #111; scale: 0; transition: scale 0.35s var(--spring); }
.iselect-opt[aria-selected='true'] .iselect-tick { scale: 1; }
.iselect-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); padding: 4px 6px 0; }

/* ============================ schedule ============================ */
.sched-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sched-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.sched-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -12px; }
.dayview { display: grid; gap: 18px; }
.day-head { display: flex; align-items: center; gap: 14px; }
.day-title { flex: 1; text-align: center; }
.day-title .h2 { animation: rise 0.5s var(--ease) both; }
.day-title p { font-size: 13.5px; margin-top: 4px; }

.timeline { --hh: 100px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 248, 238, 0.03), rgba(255, 248, 238, 0.01)); overflow: hidden; }
.tl-scroll { padding: 18px 16px 18px 0; }
.tl-grid { position: relative; height: calc(var(--rows) * var(--hh)); margin-left: 72px; }
.tl-hour { position: absolute; left: -72px; right: 0; top: calc(var(--row) * var(--hh)); border-top: 1px solid var(--line); }
.tl-hour::after { content: ''; position: absolute; left: 72px; right: 0; top: calc(var(--hh) / 2); border-top: 1px dashed rgba(255, 244, 228, 0.04); }
.tl-hour span { position: absolute; top: -9px; left: 14px; width: 48px; font-size: 12.5px; font-weight: 750; color: var(--text-3); background: var(--bg); padding-right: 6px; line-height: 18px; }
.tl-hour span small { font-size: 10px; margin-left: 2px; }
.tl-events { position: absolute; inset: 0; }
.tl-event {
  position: absolute;
  top: calc(var(--top) * var(--hh) + 2px);
  height: calc(var(--len) * var(--hh) - 4px);
  left: calc(var(--lane) * (100% / var(--lanes)) + 6px);
  width: calc(100% / var(--lanes) - 10px);
  display: flex;
  gap: 12px;
  align-items: stretch;
  padding: 8px 12px 8px 8px;
  border-radius: 14px;
  text-align: left;
  overflow: hidden;
  background: linear-gradient(110deg, color-mix(in srgb, var(--ic) 26%, #15121a), color-mix(in srgb, var(--ic) 8%, #15121a) 70%);
  border: 1px solid color-mix(in srgb, var(--ic) 45%, transparent);
  border-left: 4px solid var(--ic);
  box-shadow: 0 10px 30px -18px var(--ic);
  animation: evIn 0.6s var(--ease) both;
  animation-delay: calc(var(--i) * 60ms + 100ms);
  transition: transform 0.35s var(--ease), box-shadow 0.35s, z-index 0s;
}
@keyframes evIn { from { opacity: 0; translate: -14px 0; scale: 0.98; } to { opacity: 1; translate: none; scale: none; } }
.tl-event:hover { transform: translateX(3px) scale(1.01); z-index: 3; box-shadow: 0 20px 40px -18px var(--ic); }
.tl-ev-img { width: 44px; flex: none; border-radius: 10px; overflow: hidden; }
.tl-ev-img img { width: 100%; height: 100%; object-fit: cover; }
.tl-ev-body { display: grid; align-content: start; min-width: 0; line-height: 1.3; }
.tl-ev-time { font-size: 11.5px; line-height: 1.25; font-weight: 800; color: color-mix(in srgb, var(--ic) 70%, white); display: inline-flex; align-items: center; gap: 4px; }
.tl-ev-body strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-ev-body small { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-event.is-short { padding-top: 4px; padding-bottom: 4px; }
.tl-event.is-short .tl-ev-img { display: none; }
.tl-event.is-short .tl-ev-body { grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; }
.tl-event.is-short small { display: none; }
.tl-event.phase-cancelled { opacity: 0.5; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 8px, transparent 8px 16px), #151219; border-left-color: var(--text-3); box-shadow: none; }
.tl-event.phase-cancelled strong { text-decoration: line-through; }
.tl-event.phase-done { opacity: 0.6; }
.tl-event.phase-live { box-shadow: 0 0 0 1px var(--ok), 0 18px 40px -16px rgba(134, 214, 168, 0.6); }
.tl-eq { position: absolute; right: 12px; top: 10px; color: var(--ok); }
.tl-now { position: absolute; left: -8px; right: 0; top: calc(var(--top) * var(--hh)); height: 2px; background: linear-gradient(90deg, #ff8e75, rgba(255, 142, 117, 0.2)); z-index: 4; pointer-events: none; }
.tl-now::before { content: ''; position: absolute; left: -4px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: #ff8e75; box-shadow: 0 0 0 4px rgba(255, 142, 117, 0.25); animation: nowPulse 2s ease-in-out infinite; }
.tl-now span { position: absolute; left: -62px; width: 54px; text-align: right; top: -10px; font-size: 11px; font-weight: 800; color: #ff8e75; background: var(--bg); padding: 1px 4px; border-radius: 4px; }
@keyframes nowPulse { 50% { box-shadow: 0 0 0 9px rgba(255, 142, 117, 0); } }

.agenda { display: grid; gap: 22px; }
.ag-day { display: grid; gap: 10px; }
.ag-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 0; background: linear-gradient(180deg, var(--bg) 70%, transparent); }
.ag-date { width: 52px; height: 56px; border-radius: 16px; display: grid; place-items: center; align-content: center; border: 1px solid var(--line-2); background: var(--surface); line-height: 1; }
.ag-date b { font-family: var(--serif); font-weight: 400; font-size: 26px; }
.ag-date small { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-top: 2px; }
.ag-head.is-today .ag-date { background: linear-gradient(160deg, var(--gold-2), var(--gold-3)); color: var(--gold-ink); border-color: transparent; }
.ag-head.is-today .ag-date small { color: rgba(27, 18, 7, 0.7); }
.ag-title { display: grid; line-height: 1.25; }
.ag-title strong { font-family: var(--serif); font-weight: 400; font-size: 23px; }
.ag-title small { color: var(--text-3); font-size: 12.5px; font-weight: 650; }
.ag-list { display: grid; gap: 8px; padding-left: 66px; }

.month { display: grid; gap: 10px; }
.month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.month-head span { text-align: center; font-size: 11.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.mcell {
  position: relative;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  overflow: hidden;
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(var(--i) * 12ms);
  transition: border-color 0.25s, background 0.25s, transform 0.35s var(--ease);
}
.mcell:hover:not(:disabled) { border-color: rgba(227, 180, 103, 0.5); background: var(--surface-2); transform: translateY(-2px); }
.mcell.is-out { opacity: 0.25; background: transparent; }
.mcell.is-today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold), 0 0 30px -12px var(--gold-glow); }
.mcell.is-away { background: repeating-linear-gradient(135deg, rgba(241, 196, 111, 0.05) 0 8px, transparent 8px 16px), var(--surface); }
.mcell-num { font-family: var(--serif); font-size: 22px; line-height: 1; }
.mcell.is-today .mcell-num { color: var(--gold-2); }
.mcell-away { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warn); }
.mcell-list { display: grid; gap: 4px; }
.mchip { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 6px; border-radius: 7px; background: color-mix(in srgb, var(--ic) 13%, transparent); white-space: nowrap; overflow: hidden; }
.mchip i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--ic); }
.mchip b { font-weight: 800; }
.mchip span { overflow: hidden; text-overflow: ellipsis; color: var(--text-2); font-weight: 600; }
.mchip-more { font-size: 11.5px; color: var(--text-3); font-weight: 700; padding-left: 4px; }
.mcell-dots { display: none; gap: 3px; flex-wrap: wrap; margin-top: auto; }
.mcell-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ic); }

/* ============================ students ============================ */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; perspective: 1200px; }
.scard {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--ic) 10%, transparent), rgba(255, 248, 238, 0.02) 55%);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.5s var(--ease), border-color 0.3s, box-shadow 0.4s;
}
.scard:hover { border-color: color-mix(in srgb, var(--ic) 55%, transparent); box-shadow: 0 24px 50px -30px var(--ic); }
.scard-top { display: flex; align-items: center; gap: 14px; }
.scard-name { display: grid; line-height: 1.25; min-width: 0; }
.scard-name strong { font-family: var(--serif); font-weight: 400; font-size: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scard-name small { color: var(--text-3); font-weight: 650; font-size: 12.5px; }
.scard-ins { display: flex; flex-wrap: wrap; gap: 8px; }
.scard-i { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px; background: color-mix(in srgb, var(--ic) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ic) 30%, transparent); font-weight: 700; font-size: 13px; }
.scard-i .ithumb { border-radius: 50%; }
.scard-next { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding-top: 12px; border-top: 1px solid var(--line); }
.scard-next .icon { color: var(--gold); }

.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 650; width: max-content; margin-bottom: -10px; transition: color 0.2s, gap 0.3s var(--spring); }
.back-link:hover { color: var(--gold-2); gap: 12px; }

.profile-head {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  padding: clamp(22px, 3vw, 34px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  isolation: isolate;
}
.profile-glow { position: absolute; z-index: -1; width: 520px; height: 520px; right: -120px; top: -260px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--ic) 30%, transparent), transparent 65%); animation: float 8s ease-in-out infinite; }
.profile-id { flex: 1; min-width: 240px; display: grid; gap: 10px; }
.profile-id .display { font-size: clamp(38px, 5vw, 58px); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.span-2 { grid-column: 1 / -1; }
.parent-box { display: grid; gap: 14px; margin-top: 4px; padding: 16px; border-radius: var(--radius); border: 1px solid rgba(147, 185, 255, 0.2); background: rgba(147, 185, 255, 0.04); }
.parent-box .card-head h3 .icon { color: var(--info); }
.enrol-list { display: grid; gap: 8px; }
.enrol { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(90deg, color-mix(in srgb, var(--ic) 12%, transparent), transparent 70%); }
.enrol-photo { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; flex: none; }
.enrol-photo img { width: 100%; height: 100%; object-fit: cover; }
.enrol span:last-child { display: grid; line-height: 1.3; }
.enrol small { color: var(--text-2); font-size: 12.5px; }
.enrol-info { display: grid; line-height: 1.3; }

.notes-box.is-public { border-color: rgba(227, 180, 103, 0.25); background: linear-gradient(180deg, rgba(227, 180, 103, 0.06), rgba(255, 248, 238, 0.015)); }
.notes-box.is-private .card-head h3 .icon { color: var(--text-2); }
.composer { display: grid; gap: 8px; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.notes-scroll { max-height: 520px; overflow-y: auto; padding-right: 2px; }

/* ============================ flows ============================ */
.page-flow { gap: 22px; }
.flow { display: grid; gap: 14px; }
.step {
  position: relative;
  padding: 20px clamp(16px, 2.4vw, 26px) 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  gap: 16px;
  animation: rise 0.7s var(--ease) both;
  animation-delay: calc(var(--i) * 80ms);
  transition: opacity 0.4s, border-color 0.4s, filter 0.4s;
}
.step.is-done { border-color: rgba(227, 180, 103, 0.22); }
.step.is-locked { pointer-events: none; }
.step.is-locked > * { opacity: 0.38; filter: saturate(0.4); transition: opacity 0.4s, filter 0.4s; }
.step-head { display: flex; align-items: center; gap: 14px; }
.step-head h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.1; }
.step-n { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; border: 1.5px solid var(--line-3); color: var(--text-2); transition: all 0.45s var(--spring); }
.step.is-done .step-n { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); box-shadow: 0 0 20px -4px var(--gold-glow); }
.step-summary { margin-left: auto; font-size: 13px; color: var(--gold-2); font-weight: 700; text-align: right; }
.flow-bar { position: sticky; bottom: 16px; z-index: 20; }
.flow-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 10px 10px 22px;
  border-radius: 999px;
  background: rgba(24, 20, 28, 0.86);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.flow-summary { min-width: 0; font-size: 14px; line-height: 1.35; }
.flow-sum small { color: var(--text-2); }
.flow-sum s { color: var(--text-3); }

.icards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.icard {
  position: relative;
  aspect-ratio: 4 / 3.2;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  border: 1.5px solid var(--line-2);
  text-align: left;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(var(--i) * 50ms);
  transition: border-color 0.3s, transform 0.4s var(--ease), box-shadow 0.4s;
}
.icard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: scale 1s var(--ease), filter 0.5s; filter: saturate(0.8) brightness(0.8); }
.icard:hover img { scale: 1.08; filter: none; }
.icard-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 30%, rgba(11, 9, 14, 0.92)); }
.icard-text { display: grid; line-height: 1.25; }
.icard-text strong { font-family: var(--serif); font-weight: 400; font-size: 24px; }
.icard-text small { font-size: 12px; color: var(--text-2); font-weight: 650; }
.icard-check { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ic); color: #111; scale: 0; transition: scale 0.4s var(--spring); }
.icard[aria-pressed='true'] { border-color: var(--ic); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ic) 25%, transparent), 0 20px 40px -20px var(--ic); transform: translateY(-3px); }
.icard[aria-pressed='true'] .icard-check { scale: 1; }
.starters { display: flex; flex-wrap: wrap; gap: 6px; }
.note-input { font-size: 16px; line-height: 1.6; min-height: 150px; }
.away-days { display: grid; place-items: center; align-content: center; min-width: 74px; height: 64px; margin-top: 22px; border-radius: 16px; border: 1px solid var(--line-2); line-height: 1; }
.away-days b { font-family: var(--serif); font-weight: 400; font-size: 30px; color: var(--gold-2); }
.away-days small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.mini-lesson { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.mini-lesson i { width: 8px; height: 8px; border-radius: 50%; background: var(--ic); box-shadow: 0 0 10px var(--ic); }
.mini-lesson span { color: var(--text-2); }
.away-list { display: grid; gap: 8px; }
.away-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.away-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: var(--warn); background: rgba(241, 196, 111, 0.1); flex: none; }
.away-main { flex: 1; display: grid; line-height: 1.3; min-width: 0; }
.away-main small { color: var(--text-2); }

/* ============================ account ============================ */
.acct-id { display: flex; align-items: center; gap: 18px; }
.acct-id > div { display: grid; gap: 6px; justify-items: start; }
.avail { display: grid; gap: 4px; }
.avail-row { display: grid; grid-template-columns: 190px auto 1fr 44px; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 60px; }
.avail-row:last-child { border-bottom: 0; }
.avail-day b { font-weight: 700; }
.avail-row:not(.is-on) .avail-day { color: var(--text-3); }
.avail-times { display: flex; align-items: center; gap: 8px; }
.avail-bar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.avail-bar i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); box-shadow: 0 0 12px var(--gold-glow); transition: left 0.5s var(--ease), width 0.5s var(--ease); }
.avail-h { text-align: right; font-weight: 750; color: var(--text-2); font-size: 13px; }
.avail-off { grid-column: 2 / -1; }


/* ============================ billing ============================ */
.bstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bstat {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(227, 180, 103, 0.07), rgba(255, 248, 238, 0.02) 60%);
  text-align: left;
}
.bstat > span { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 700; }
.bstat > span .icon { color: var(--gold); }
.bstat b { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.05; }
.bstat b em { font-style: normal; font-size: 18px; color: var(--text-3); }
.bstat small { color: var(--text-3); font-size: 12px; }
button.bstat { transition: border-color 0.3s, transform 0.35s var(--spring); }
button.bstat:hover { transform: translateY(-2px); border-color: var(--line-3); }
.bstat.is-hot { border-color: rgba(242, 144, 127, 0.45); background: linear-gradient(160deg, rgba(242, 144, 127, 0.12), rgba(255, 248, 238, 0.02) 60%); }
.bstat.is-hot b { color: #ffb19c; }
.bstat.is-hot > span .icon { color: var(--bad); }

.inv-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto 18px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(var(--i) * 35ms);
  transition: background 0.25s, border-color 0.25s, transform 0.35s var(--ease);
}
.inv-row:hover { background: var(--surface-2); border-color: var(--line-3); transform: translateX(3px); }
.inv-row.st-overdue { border-color: rgba(242, 144, 127, 0.35); }
.inv-row.st-void { opacity: 0.5; }
.inv-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); }
.inv-main { display: grid; min-width: 0; line-height: 1.3; }
.inv-main strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-main small { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-amt { display: grid; justify-items: end; line-height: 1.2; }
.inv-amt b { font-size: 16px; font-variant-numeric: tabular-nums; }
.inv-amt small { font-size: 11.5px; color: var(--text-3); }

.inv-head { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.inv-head > div { display: grid; gap: 3px; align-content: start; justify-items: start; min-width: 0; }
.inv-head small { font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.inv-head b { font-size: 14.5px; }
.inv-table { display: grid; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.inv-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.inv-line:last-child { border-bottom: 0; }
.inv-line:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.inv-desc { min-width: 0; color: var(--text); }
.inv-desc em { font-style: normal; margin-right: 8px; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.tag-credit { background: rgba(134, 214, 168, 0.14); color: var(--ok); }
.tag-charge { background: rgba(147, 185, 255, 0.14); color: var(--info); }
.inv-lamt { font-weight: 750; font-variant-numeric: tabular-nums; padding: 4px 8px; border-radius: 8px; border: 1px dashed transparent; }
.inv-lamt:not(:disabled):hover { border-color: var(--gold); color: var(--gold-2); }
.inv-lamt:disabled { cursor: default; opacity: 1; }
.kind-credit .inv-lamt { color: var(--ok); }
.inv-edit { display: flex; align-items: center; gap: 6px; }
.inv-edit .input { width: 110px; min-height: 36px; padding: 6px 10px; }
.inv-totals { display: grid; gap: 6px; margin-left: auto; width: min(320px, 100%); font-variant-numeric: tabular-nums; }
.inv-totals div { display: flex; justify-content: space-between; gap: 20px; color: var(--text-2); font-size: 14px; }
.inv-totals .is-total { color: var(--text); font-weight: 750; font-size: 15.5px; padding-top: 6px; border-top: 1px solid var(--line-2); }
.inv-totals .is-balance { color: var(--gold-2); font-weight: 800; font-size: 17px; padding: 8px 12px; margin-top: 4px; border-radius: 12px; background: rgba(227, 180, 103, 0.1); border: 1px solid rgba(227, 180, 103, 0.35); }
.inv-totals .is-balance.is-zero { color: var(--ok); background: rgba(134, 214, 168, 0.08); border-color: rgba(134, 214, 168, 0.3); }
.pay-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.pay-row .grow { display: grid; line-height: 1.3; }
.pay-row small { color: var(--text-3); font-size: 12px; }
.pay-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(134, 214, 168, 0.12); color: var(--ok); flex: none; }
.inv-log { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.inv-log b { text-transform: capitalize; color: var(--gold-2); }

.price-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.price-cell { display: grid; gap: 6px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.price-cell small { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.money-input { display: flex; align-items: center; gap: 4px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.25); padding: 0 10px; }
.money-input:focus-within { border-color: var(--gold); }
.money-input i { font-style: normal; color: var(--text-3); font-weight: 700; }
.money-input input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; height: 40px; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.money-input.sm { width: 92px; }
.money-input.sm input { height: 34px; font-size: 15px; text-align: right; }
.disc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.disc-row { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 650; padding: 4px 0; }

.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: clamp(20px, 3vw, 28px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(227, 180, 103, 0.35);
  background: radial-gradient(600px 240px at 0% 0%, rgba(227, 180, 103, 0.16), transparent 70%), var(--surface);
  box-shadow: 0 24px 60px -30px var(--gold-glow);
}
.balance-card.is-overdue { border-color: rgba(242, 144, 127, 0.5); background: radial-gradient(600px 240px at 0% 0%, rgba(242, 144, 127, 0.16), transparent 70%), var(--surface); }
.balance-card.is-clear { border-color: rgba(134, 214, 168, 0.35); background: radial-gradient(600px 240px at 0% 0%, rgba(134, 214, 168, 0.12), transparent 70%), var(--surface); box-shadow: none; }
.balance-main { display: grid; gap: 4px; }
.balance-main small { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.balance-card.is-overdue .balance-main small { color: var(--bad); }
.balance-main b { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 7vw, 64px); line-height: 1; }
.balance-main span { color: var(--text-2); font-size: 13.5px; }
.balance-ok { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(134, 214, 168, 0.15); color: var(--ok); }
.method-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(0, 0, 0, 0.18); }
.method-row .grow { display: grid; line-height: 1.3; }
.method-row small { color: var(--text-3); font-size: 12.5px; }
.method-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(227, 180, 103, 0.12); color: var(--gold); }
.secure-note { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-lg); border: 1px solid rgba(134, 214, 168, 0.25); background: rgba(134, 214, 168, 0.05); }
.secure-note .icon { color: var(--ok); margin-top: 2px; }
.secure-note p { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.card-ish { background: var(--surface); }

.bill-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(227, 180, 103, 0.4);
  background: linear-gradient(90deg, rgba(227, 180, 103, 0.14), rgba(227, 180, 103, 0.03));
  margin-top: -8px;
}
.bill-banner.is-overdue { border-color: rgba(242, 144, 127, 0.5); background: linear-gradient(90deg, rgba(242, 144, 127, 0.14), rgba(242, 144, 127, 0.03)); }
.bill-banner .grow { display: grid; line-height: 1.3; }
.bill-banner small { color: var(--text-2); font-size: 12.5px; }
.bill-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(227, 180, 103, 0.16); color: var(--gold-2); flex: none; }
.bill-banner.is-overdue .bill-ic { background: rgba(242, 144, 127, 0.16); color: var(--bad); }

.pay-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.pay-summary span { color: var(--text-2); font-size: 13.5px; }
.pay-summary b { font-family: var(--serif); font-weight: 400; font-size: 32px; }
.pay-options { display: grid; gap: 8px; }
.provider-sim { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-2); background: #f6f4f1; color: #1d1b20; }
.provider-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #e9e6e1; color: #4b4650; font-size: 12px; font-weight: 650; }
.provider-bar em { margin-left: auto; font-style: normal; padding: 2px 8px; border-radius: 999px; background: #ffe2a8; color: #6b4a00; font-weight: 800; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.provider-body { padding: 18px; display: grid; gap: 10px; }
.provider-body b { font-size: 17px; }
.provider-body .muted { color: #625d68; }
.provider-amt { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; display: grid; }
.provider-amt small { font-size: 12px; font-weight: 600; color: #625d68; letter-spacing: 0; }
.mandate { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.18); }
.mandate p { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.pay-done { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 16px 0 6px; }
.welcome-ring.is-on { scale: 1; opacity: 1; animation: welcomePop 0.8s var(--spring) both; }

@media (max-width: 900px) {
  .bstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-head { grid-template-columns: 1fr 1fr; }
  .inv-head > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .bstat b { font-size: 26px; }
  .inv-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .inv-row .pill { grid-column: 2; grid-row: 2; justify-self: start; }
  .inv-row .lrow-go { display: none; }
  .inv-row .inv-amt { grid-row: 1 / span 2; grid-column: 3; }
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .disc-list { grid-template-columns: 1fr; }
  .balance-card .btn { width: 100%; }
}


/* ============================ weekly schedules ============================ */
.callout-ok { --cc: var(--ok); }
.wslots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.wslot {
  display: grid;
  grid-template-columns: 58px 3px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--ic) 10%, transparent), transparent 70%), var(--surface);
  text-align: left;
  transition: border-color 0.25s, transform 0.35s var(--ease), background 0.25s;
}
.wslot:not(:disabled):hover { border-color: color-mix(in srgb, var(--ic) 55%, transparent); transform: translateY(-1px); }
.wslot:disabled { cursor: default; opacity: 1; }
.wslot-day { display: grid; line-height: 1.15; }
.wslot-day b { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ic); }
.wslot-day small { font-family: var(--serif); font-size: 24px; }
.wslot-day i { font-style: normal; font-family: var(--sans); font-size: 10.5px; font-weight: 800; color: var(--text-3); margin-left: 2px; }
.wslot-bar { width: 3px; height: 34px; border-radius: 3px; background: var(--ic); box-shadow: 0 0 10px var(--ic); }
.wslot-main { display: grid; min-width: 0; line-height: 1.3; }
.wslot-main strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wslot-main small { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wslot-edit { color: var(--text-3); }
.wslot:hover .wslot-edit { color: var(--gold-2); }

.wk-student { display: grid; gap: 12px; padding: 14px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); }
.wk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wk-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wk-who span { display: grid; line-height: 1.25; min-width: 0; }
.wk-who b { font-family: var(--serif); font-weight: 400; font-size: 22px; }
.wk-who small { color: var(--text-3); font-size: 12.5px; }
a.wk-who:hover b { color: var(--gold-2); }
.wk-none-label { margin-top: 10px; }
.wk-none { display: flex; flex-wrap: wrap; gap: 8px; }
.wk-none-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px dashed var(--line-3); color: var(--text-2); font-weight: 650; font-size: 13.5px; }
.wk-none-chip:hover { border-color: var(--gold); color: var(--gold-2); }
.wk-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.wk-day { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); }
.wk-day header { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 4px; }
.wk-day header b { font-family: var(--serif); font-weight: 400; font-size: 24px; }
.wk-day header small { color: var(--text-3); font-weight: 650; }
.wk-day .wslot { grid-template-columns: 58px 3px minmax(0, 1fr) auto; }
.wedit-row { align-items: flex-end; gap: 16px; }
.input-date { max-width: 190px; }
.draft-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.15); }
.draft-slot .select-wrap.sm { height: 36px; padding: 0 10px; }
.draft-slot .select-wrap select { font-size: 13px; }
@media (max-width: 720px) {
  .wslots { grid-template-columns: 1fr; }
  .wk-days { grid-template-columns: 1fr; }
}

/* =====================================================================
   Responsive
   ===================================================================== */

/* tablet: icon rail */
@media (max-width: 1100px) {
  :root { --side-w: 92px; }
  .sidebar { padding: 22px 12px 16px; align-items: center; }
  .brand { padding: 0; }
  .brand-text, .side-user > span:not(.avatar) { display: none; }
  .side-nav { width: 100%; }
  .side-link { flex-direction: column; justify-content: center; gap: 4px; height: 64px; padding: 0; font-size: 11px; }
  .side-link[aria-current='page']::before { left: -12px; }
  .side-link .badge { position: absolute; top: 6px; right: 14px; margin: 0; }
  .side-foot { flex-direction: column; border-top: 0; }
  .side-user { flex: none; padding: 0; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .avail-row { grid-template-columns: 150px auto 1fr 40px; }
}

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; justify-items: center; align-content: center; text-align: center; gap: 28px; padding: 28px 20px calc(28px + var(--safe-b)); }
  .login-brand { display: grid; justify-items: center; }
  .brand-mark.big { width: 84px; height: 84px; margin-bottom: 10px; }
  .login-title { font-size: clamp(60px, 18vw, 96px); }
  .login-quote { display: none; }
  .login-card { width: min(400px, 100%); }
  .profile-grid { grid-template-columns: 1fr; }
}

/* phone */
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 15px; }
  .sidebar { display: none; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(10px + var(--safe-t)) 16px 10px;
    background: linear-gradient(180deg, rgba(11, 9, 14, 0.92), rgba(11, 9, 14, 0.72));
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand { gap: 8px; }
  .topbar .brand b { font-family: var(--serif); font-weight: 400; font-size: 25px; }
  .topbar .brand-mark { width: 36px; height: 36px; }
  .topbar .badge-demo { margin-left: 2px; }
  .topbar-actions { display: flex; align-items: center; gap: 10px; }
  .bell .badge { position: absolute; top: -4px; right: -4px; }
  .main { margin-left: 0; padding: 14px var(--gutter) calc(110px + var(--safe-b)); }
  .tabbar {
    position: fixed;
    z-index: 40;
    left: 12px;
    right: 12px;
    bottom: calc(10px + var(--safe-b));
    display: flex;
    justify-content: space-around;
    padding: 6px;
    border-radius: 26px;
    background: rgba(22, 18, 26, 0.86);
    border: 1px solid var(--line-2);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
  }
  .tab { position: relative; flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; border-radius: 20px; color: var(--text-3); font-size: 11px; font-weight: 700; transition: color 0.3s; -webkit-tap-highlight-color: transparent; }
  .tab-icon { position: relative; display: grid; place-items: center; width: 50px; height: 30px; border-radius: 999px; transition: background 0.35s var(--spring), transform 0.35s var(--spring); }
  .tab-icon .badge { position: absolute; top: -5px; right: 4px; }
  .tab[aria-current='page'] { color: var(--gold-2); }
  .tab:active .tab-icon { transform: scale(0.88); transition-duration: 0.08s; }
  .tab-pill {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: calc((100% - 12px) / var(--n));
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(227, 180, 103, 0.2), rgba(227, 180, 103, 0.08));
    border: 1px solid rgba(227, 180, 103, 0.28);
    transform: translateX(calc(var(--idx) * 100%));
    transition: transform 0.5s var(--spring), opacity 0.3s;
    pointer-events: none;
  }
  .tab-pill.is-hidden { opacity: 0; }

  .page { gap: 22px; }
  .hero, .home-hero { border-radius: var(--radius-lg); }
  .hero-compact { min-height: 180px; }
  .hero .display { font-size: 42px; }
  .home-hero { min-height: 400px; }
  .home-hero .display { font-size: 52px; }
  .hero-sub { font-size: 14.5px; }
  .stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { min-width: 0; padding: 10px 14px; }
  .stat b { font-size: 32px; }

  .hide-sm { display: none !important; }
  .show-sm { display: inline; }
  .rail-nav { display: none; }
  .rail-track { margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); scroll-padding: 0 var(--gutter); gap: 12px; }
  .rail::before, .rail::after { display: none; }
  .lcard { width: 74vw; max-width: 280px; aspect-ratio: 4 / 4.2; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { min-height: 168px; padding: 14px; }
  .tile-icon { top: 12px; left: 12px; width: 40px; height: 40px; border-radius: 13px; }
  .tile-text strong { font-size: 22px; }
  .tile-text small { font-size: 12px; }
  .tile-arrow { display: none; }

  .section-head { align-items: center; }
  .sched-bar { flex-direction: column; align-items: stretch; }
  .sched-bar .seg { align-self: stretch; }
  .sched-bar .seg-btn { flex: 1; justify-content: center; }
  .sched-filters .select-wrap { flex: 1; }
  .sched-filters .select-wrap select { width: 100%; }
  .sched-chips { flex-wrap: nowrap; overflow-x: auto; margin: -8px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter); scrollbar-width: none; }
  .sched-chips .chips { flex-wrap: nowrap; }
  .sched-chips .chip { flex: none; }
  .dstrip-nav { display: none; }
  .dstrip-track { margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); }
  .sheet .dstrip-track { margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
  .dday { width: 58px; height: 78px; }
  .timeline { --hh: 88px; }
  .tl-grid { margin-left: 56px; }
  .tl-hour { left: -56px; }
  .tl-hour::after { left: 56px; }
  .tl-hour span { left: 8px; width: 42px; }
  .tl-scroll { padding-right: 8px; }
  .tl-now span { display: none; }
  .tl-ev-img { width: 36px; }
  .ag-list { padding-left: 0; }

  .month-grid, .month-head { gap: 4px; }
  .mcell { min-height: 64px; padding: 6px; border-radius: 12px; align-items: center; }
  .mcell-num { font-size: 19px; }
  .mcell-list, .mcell-away { display: none; }
  .mcell-dots { display: flex; justify-content: center; }
  .month-head span { font-size: 10px; letter-spacing: 0.04em; }

  .lrow { grid-template-columns: 62px 3px 40px minmax(0, 1fr) 16px; gap: 10px; padding: 10px; }
  .lrow-tags { grid-column: 4 / 5; justify-content: flex-start; }
  .lrow-tags:empty { display: none; }
  .lrow-img { width: 40px; height: 40px; border-radius: 12px; }
  .lrow-go { grid-row: 1; grid-column: 5; }

  .req-head { grid-template-columns: 40px minmax(0, 1fr) 20px; gap: 12px; padding: 12px; }
  .req-icon { width: 40px; height: 40px; }
  .req-status { grid-column: 2 / 3; grid-row: 2; justify-items: start; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .req-caret { grid-column: 3; grid-row: 1; }
  .req-body-inner { padding: 0 12px; }
  .req-body.is-open .req-body-inner { padding-bottom: 12px; }
  .req-arrow { rotate: 90deg; width: 100%; }
  .slotbox { min-width: 100%; }

  .form-grid { grid-template-columns: 1fr; }
  .fact { padding: 10px 12px; gap: 10px; font-size: 13px; }
  .person-chip { padding: 8px 10px; gap: 10px; }
  .person-chip span { font-size: 13px; }
  .profile-head { gap: 16px; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1 1 auto; }

  .flow-bar { bottom: calc(92px + var(--safe-b)); }
  .flow-bar-inner { border-radius: 22px; padding: 10px 10px 10px 16px; }
  .flow-bar .btn-lg { height: 48px; padding: 0 18px; font-size: 14.5px; }
  .flow-summary { font-size: 13px; }
  .step-head h3 { font-size: 22px; }
  .step-summary { display: none; }
  .icards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .icard-text strong { font-size: 20px; }

  .avail-row { grid-template-columns: 96px 1fr; gap: 8px 12px; }
  .avail-bar, .avail-h { display: none; }

  /* bottom sheet */
  .overlay { place-items: end stretch; padding: 0; }
  .sheet, .sheet-sm, .sheet-lg { width: 100%; max-height: 92dvh; border-radius: 28px 28px 0 0; animation: sheetUp 0.55s var(--ease) both; padding-bottom: var(--safe-b); }
  .overlay.is-closing .sheet { animation: sheetDown 0.32s var(--ease-in-out) both; }
  @keyframes sheetUp { from { translate: 0 100%; } to { translate: none; } }
  @keyframes sheetDown { to { translate: 0 100%; } }
  .sheet-grab { display: block; position: absolute; top: 8px; left: 50%; translate: -50% 0; width: 42px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.25); z-index: 4; }
  .sheet-head { padding: 22px 60px 4px 18px; }
  .sheet-title { font-size: 30px; }
  .sheet-body { padding: 14px 18px 22px; }
  .sheet-hero { height: 140px; }
  .sheet-actions { flex-wrap: wrap; }
  .sheet-actions .btn { flex: 1 1 auto; }

  .demo-pins { left: 16px; right: 16px; width: auto; bottom: calc(16px + var(--safe-b)); }
  .key { height: 60px; }
  .login-h { font-size: 26px; }
}

@media (max-width: 380px) {
  .tiles { grid-template-columns: 1fr; }
  .home-hero .display { font-size: 44px; }
}

/* hover-less devices: no sticky hover lifts */
@media (hover: none) {
  .lcard:hover, .tile:hover, .scard:hover, .lrow:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .notes-float, body::after { display: none; }
}

/* Touch devices (iPhone/iPad): keep motion, drop the GPU-heavy extras. */
@media (hover: none) {
  body::after { animation: none; }
  .hero-media img { animation: none; }
  .home-hero .hero-media img { animation: kenburns 50s ease-in-out infinite alternate; }
  .stat, .btn-glass, .phase, .rail-nav, .tile-icon, .sheet-x, .demo-pins, .iselect-menu, .toast {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .stat { background: rgba(20, 16, 22, 0.72); }
  .btn-glass { background: rgba(20, 16, 22, 0.7); }
  .phase { background: rgba(11, 9, 14, 0.78); }
  .tile-icon { background: rgba(20, 16, 22, 0.78); }
  .toast { background: rgba(28, 24, 32, 0.98); }
  .login-card { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  .login-card-glow { animation-duration: 14s; }
}

/* the sign-up form may be wider than the sign-in card on tablets */
@media (max-width: 900px) {
  .login-card.auth-card-wide { width: min(560px, 100%); }
}

/* =====================================================================
   Daylight theme — warm paper, ink and brass. html[data-theme="light"]
   is set by js/theme-init.js (Account → Appearance, or the sun/moon
   button on the sign-in screen). Panels on photos keep their light text.
   ===================================================================== */
html[data-theme='light'] {
  color-scheme: light;
  --bg: #f7f2ea;
  --bg-2: #efe8dc;
  --bg-3: #e7ddcd;
  --surface: rgba(90, 62, 24, 0.04);
  --surface-2: rgba(90, 62, 24, 0.07);
  --surface-3: rgba(90, 62, 24, 0.1);
  --line: rgba(70, 48, 20, 0.1);
  --line-2: rgba(70, 48, 20, 0.17);
  --line-3: rgba(70, 48, 20, 0.28);
  --text: #221b14;
  --text-2: #5b5046;
  --text-3: #8a7d70;
  --gold: #b9832f;
  --gold-2: #8c5d16;
  --gold-3: #d6a65a;
  --gold-ink: #1d1407;
  --gold-glow: rgba(185, 131, 47, 0.28);
  --ok: #2e8a5a;
  --warn: #a8720c;
  --bad: #c0463a;
  --info: #3466c9;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 18px 44px -26px rgba(60, 40, 15, 0.35);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 30px 80px -30px rgba(60, 40, 15, 0.45);
}

/* Panels that sit on photographs keep the evening palette (light text on a dark shade). */
html[data-theme='light'] :is(.hero, .home-hero, .lcard, .tile, .icard) {
  --text: #f5eee4;
  --text-2: #dcd2c5;
  --text-3: #b7aa99;
  --gold: #e3b467;
  --gold-2: #f6dba5;
  --surface: rgba(255, 248, 238, 0.06);
  --surface-2: rgba(255, 248, 238, 0.1);
  --line: rgba(255, 244, 228, 0.12);
  --line-2: rgba(255, 244, 228, 0.2);
  --line-3: rgba(255, 244, 228, 0.3);
  color: var(--text);
}

/* surfaces */
html[data-theme='light'] .card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.66)); }
html[data-theme='light'] .scard,
html[data-theme='light'] .note,
html[data-theme='light'] .bstat { background-color: rgba(255, 255, 255, 0.72); }
html[data-theme='light'] .person-row, html[data-theme='light'] .family-bar, html[data-theme='light'] .role-card { background: rgba(255, 255, 255, 0.7); }
html[data-theme='light'] .timeline { background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.55)); }
html[data-theme='light'] .tl-hour::after { border-top-color: rgba(70, 48, 20, 0.07); }
html[data-theme='light'] .note-private { background: repeating-linear-gradient(135deg, rgba(70, 48, 20, 0.025) 0 10px, transparent 10px 20px), rgba(255, 255, 255, 0.7); }
html[data-theme='light'] .req.is-yours { background: linear-gradient(135deg, rgba(185, 131, 47, 0.1), rgba(255, 255, 255, 0.7) 50%); }
html[data-theme='light'] .notes-box.is-public { background: linear-gradient(180deg, rgba(185, 131, 47, 0.08), rgba(255, 255, 255, 0.75)); }

/* form controls */
html[data-theme='light'] :is(.input, .seg, .iselect-btn, .phone-field, .money-input, .mandate) { background: rgba(255, 255, 255, 0.85); }
html[data-theme='light'] .input:focus { background: #fff; }
html[data-theme='light'] .input:disabled { background: transparent; }
html[data-theme='light'] .search { background: rgba(255, 255, 255, 0.85); }
html[data-theme='light'] .seg-pill { background: #fff; box-shadow: 0 2px 10px -4px rgba(60, 40, 15, 0.35); }

/* floating things */
html[data-theme='light'] :is(.iselect-menu, .phone-menu, .demo-pins) { background: rgba(255, 252, 247, 0.98); }
html[data-theme='light'] .flow-bar-inner { background: rgba(255, 252, 247, 0.9); }
html[data-theme='light'] .toast { background: rgba(34, 27, 20, 0.94); color: #f5eee4; --text: #f5eee4; --text-2: #dcd2c5; }
html[data-theme='light'] .overlay { background: rgba(40, 30, 20, 0.35); }
html[data-theme='light'] .sheet { background: #fbf8f3; }
html[data-theme='light'] .sheet-hero-fade { background: linear-gradient(180deg, rgba(251, 248, 243, 0.05), #fbf8f3); }
html[data-theme='light'] .sheet-x { background: rgba(255, 255, 255, 0.85); }
html[data-theme='light'] .avatar { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -6px 14px rgba(0, 0, 0, 0.08); }
html[data-theme='light'] :is(.lcard, .tile) { box-shadow: 0 18px 36px -24px rgba(60, 40, 15, 0.55); }

/* app frame */
html[data-theme='light'] .sidebar { background: linear-gradient(180deg, #f3ece1, #efe7da); border-right: 1px solid var(--line); }
@media (max-width: 720px) {
  html[data-theme='light'] .topbar { background: linear-gradient(180deg, rgba(247, 242, 234, 0.95), rgba(247, 242, 234, 0.8)); }
  html[data-theme='light'] .tabbar { background: rgba(255, 252, 247, 0.9); box-shadow: 0 18px 44px -12px rgba(60, 40, 15, 0.35); }
}

/* sign-in / sign-up */
html[data-theme='light'] .login-shade {
  background:
    radial-gradient(1100px 700px at 75% 50%, rgba(247, 242, 234, 0.35), rgba(247, 242, 234, 0.92) 70%),
    linear-gradient(90deg, rgba(247, 242, 234, 0.94) 0%, rgba(247, 242, 234, 0.55) 45%, rgba(247, 242, 234, 0.82) 100%);
}
html[data-theme='light'] .login-title { background: linear-gradient(180deg, #3a2a14 20%, #b9832f 120%); -webkit-background-clip: text; background-clip: text; }
html[data-theme='light'] .login-card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 252, 247, 0.92)); border-color: rgba(70, 48, 20, 0.12); }
html[data-theme='light'] .key { background: rgba(255, 255, 255, 0.8); }
html[data-theme='light'] .key:hover { background: #fff; }
html[data-theme='light'] .staff path, html[data-theme='light'] .notes-float span { stroke: rgba(150, 105, 40, 0.35); color: rgba(150, 105, 40, 0.45); }
html[data-theme='light'] .demo-badge { color: #8c5d16; }

/* the theme button on the sign-in screen */
.theme-toggle { position: fixed; top: calc(14px + var(--safe-t)); right: 14px; z-index: 20; }
html[data-theme='light'] .tl-event { background: linear-gradient(110deg, color-mix(in srgb, var(--ic) 24%, #fff), color-mix(in srgb, var(--ic) 9%, #fff) 70%); }
html[data-theme='light'] .tl-event.phase-cancelled { background: repeating-linear-gradient(135deg, rgba(70, 48, 20, 0.04) 0 8px, transparent 8px 16px), #f1ebe1; }
html[data-theme='light'] .seg-pill { background: linear-gradient(135deg, rgba(246, 219, 165, 0.55), rgba(227, 180, 103, 0.35)); border-color: rgba(185, 131, 47, 0.45); }
.appearance-hint { margin-top: 10px; }

/* ---------- possible matches (sign-ups ↔ people the studio entered) ---------- */
.match-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); text-align: left;
  background: linear-gradient(135deg, rgba(227, 180, 103, 0.16), rgba(227, 180, 103, 0.05)); border: 1px solid rgba(227, 180, 103, 0.4); color: var(--text); transition: border-color 0.2s, translate 0.2s; }
.match-banner:hover { border-color: var(--gold); translate: 0 -1px; }
.match-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--gold-2); background: rgba(227, 180, 103, 0.16); }
.match-text { display: grid; min-width: 0; }
.match-text b { font-weight: 650; }
.match-text small { font-size: 12.5px; color: var(--text-2); }
.match-cta { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; color: var(--gold-2); }
.m-grid { display: grid; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.m-row { display: grid; grid-template-columns: 130px 1fr 1fr; align-items: center; border-top: 1px solid var(--line); }
.m-row:first-child { border-top: 0; }
.m-row > div { padding: 10px 12px; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.m-row > div + div { border-left: 1px solid var(--line); }
.m-row.is-match { background: color-mix(in srgb, var(--ok) 9%, transparent); }
.m-head { background: var(--surface-2); }
.m-head b { display: block; font-weight: 650; margin-top: 2px; }
.m-src { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.m-src-them { color: var(--info); }
.m-src-us { color: var(--gold-2); }
.m-label { display: grid; gap: 4px; justify-items: start; font-size: 11.5px !important; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.m-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; letter-spacing: 0.02em; text-transform: none; font-weight: 750; }
.m-yes { color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, transparent); }
.m-close { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.m-choose { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.m-actions { flex-wrap: wrap; }
.input-sm { min-height: 38px; padding: 6px 10px; font-size: 14px; }
@media (max-width: 560px) {
  .m-row { grid-template-columns: 1fr 1fr; }
  .m-row > .m-label { grid-column: 1 / -1; padding-bottom: 0; }
  .m-row > .m-label + div { border-left: 0; }
  .m-head > div:first-child { display: none; }
  .m-head > div:nth-child(2) { border-left: 0; }
}

/* "Not linked" tag with an explanation on hover / tap */
.tag-unlinked { position: relative; color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); cursor: help; outline: none; }
.tag-sm { font-size: 11px; padding: 2px 8px; margin-top: 4px; justify-self: start; }
.float-tip { position: fixed; z-index: 1000; width: 260px; max-width: calc(100vw - 24px); padding: 10px 12px; border-radius: 12px;
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 12.5px; font-weight: 500; line-height: 1.45;
  pointer-events: none; animation: tip-in 0.18s ease-out; }
@keyframes tip-in { from { opacity: 0; translate: 0 -4px; } }
html[data-theme='light'] .float-tip { background: #fff; }

/* Quick sign-in: Continue with Google / Apple / Facebook */
.social-btns { display: grid; gap: 8px; }
.btn-social { justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.btn-social:hover:not(:disabled) { background: #f6f7f8; }
.btn-social svg { flex: none; }
.btn-social-apple { background: #000; color: #fff; border-color: #000; }
.btn-social-apple:hover:not(:disabled) { background: #1c1c1e; }
html[data-theme='light'] .btn-social-google, html[data-theme='light'] .btn-social-facebook { border-color: var(--line-2); }
.auth-or { margin: 2px 0; }
.social-badge { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; line-height: 1.45; text-align: left; }
.social-badge svg { flex: none; margin-top: 1px; }
.social-badge b { color: var(--text); font-weight: 600; word-break: break-all; }
