:root {
  --bg: #0b0b0b;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --line: #2c2c2c;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --accent: #ffffff;
  --accent-ink: #0b0b0b;
  --ok: #7fd49b;
  --warn: #f2c66d;
  --err: #ff8a80;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
[hidden] { display: none !important; }
h1 { font-size: 26px; margin: 8px 0 4px; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 0 0 6px; }
.muted { color: var(--muted); margin: 0 0 16px; }
.error { color: var(--err); min-height: 1.4em; margin: 8px 0; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 4px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(11,11,11,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand img { display: block; }
.hero-logo { display: block; width: 72px; height: auto; margin: 12px 0 18px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; }
#whoName { font-weight: 600; }

main { max-width: 640px; margin: 0 auto; padding: 16px; }

.coach-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.coach-btn { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 12px; text-align: left; font-weight: 600; font-size: 16px; }
.coach-btn:active { background: var(--surface-2); }
.coach-btn small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 4px; }

.back { margin-left: -4px; }
.pin-dots { display: flex; gap: 16px; justify-content: center; margin: 22px 0 6px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); }
#pinError { text-align: center; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 8px auto 0; }
.key { height: 64px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); font-size: 24px; font-weight: 500; aspect-ratio: 1; justify-self: center; width: 64px; }
.key:active { background: var(--surface-2); }
.key.blank { visibility: hidden; }
.key.small { font-size: 14px; }

.tabs { display: flex; gap: 6px; background: var(--surface); padding: 4px; border-radius: 12px; margin-bottom: 14px; }
.tab { flex: 1; border: 0; background: none; padding: 10px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--accent); color: var(--accent-ink); }

.daybar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.daylabel { font-weight: 700; font-size: 18px; text-align: center; }
.daylabel small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
#dayPrev, #dayNext { width: 44px; height: 44px; padding: 0; font-size: 22px; }

.notice { background: #2a2414; color: var(--warn); border: 1px solid #4a3d1c; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.class-list { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card.mine { border-color: #3d5a45; background: #131c16; }
.card-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.card-time { font-weight: 700; font-size: 17px; white-space: nowrap; }
.card-title { font-weight: 600; font-size: 17px; }
.card-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.staff { margin: 10px 0 0; font-size: 14px; display: grid; gap: 4px; }
.staff span { color: var(--muted); }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.btn { flex: 1; border-radius: 11px; padding: 12px 10px; font-weight: 700; border: 1px solid var(--line); background: var(--surface-2); font-size: 15px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; }
.closed { color: var(--muted); font-size: 13px; margin-top: 10px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

.period { color: var(--muted); margin: 0 0 10px; font-size: 14px; }
.totals { display: grid; gap: 8px; margin-bottom: 14px; }
.total-row { display: flex; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.total-row b { font-size: 18px; }
.hours-list { display: grid; gap: 6px; }
.hour-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.hour-item span { color: var(--muted); }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); width: 100%; max-width: 640px; }
.sheet-actions { display: flex; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); padding: 12px 16px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px); z-index: 30; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast.err { background: var(--err); }
.toast.warn { background: var(--warn); }
.spinner { text-align: center; color: var(--muted); padding: 30px; }
.small-note { font-size: 13px; text-align: center; margin-top: 18px; }
.change-pin { display: block; width: 100%; margin-top: 22px; }
