:root {
  --brand: #0f766e;
  --accent: #f59e0b;
  --brand-ink: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, #fff);
  --brand-mid: color-mix(in srgb, var(--brand) 22%, #fff);
  --bg: #f5f6f8;
  --card: #fff;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #9ca3af;
  --line: #e5e7eb;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.16);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.loading { padding: 60px 16px; text-align: center; color: var(--ink-3); }
[hidden] { display: none !important; }

/* prototype bar */
#proto { background: #111827; color: #d1d5db; font-size: 12.5px; }
#proto .in { max-width: 1100px; margin: 0 auto; padding: 6px 16px; display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; }
#proto b { color: #fff; font-weight: 600; }
#proto .tag { background: var(--accent); color: #111; font-weight: 700; padding: 1px 7px; border-radius: 6px; font-size: 11px; letter-spacing: .04em; }
#proto button { background: #374151; border: 0; color: #fff; padding: 3px 9px; border-radius: 6px; cursor: pointer; font-size: 12px; }
#proto button:hover { background: #4b5563; }
#proto .clock-on { background: var(--accent); color: #111; }
#proto .sp { flex: 1; }

/* header */
#top { background: var(--brand); color: var(--brand-ink); position: sticky; top: 0; z-index: 20; }
#top .in { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.brand img { height: 34px; max-width: 140px; object-fit: contain; border-radius: 6px; background: rgba(255,255,255,.12); }
.brand .mark { width: 34px; height: 34px; border-radius: 9px; background: color-mix(in srgb, var(--brand-ink) 16%, transparent); display: grid; place-items: center; font-weight: 800; }
.brand .nm { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .tl { font-size: 12px; opacity: .8; }
.topnav { display: none; gap: 4px; margin-left: 18px; }
.topnav a { color: inherit; text-decoration: none; padding: 7px 12px; border-radius: 9px; font-weight: 500; opacity: .85; }
.topnav a.on, .topnav a:hover { background: color-mix(in srgb, var(--brand-ink) 14%, transparent); opacity: 1; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who .av { background: color-mix(in srgb, var(--brand-ink) 18%, transparent); color: inherit; }

/* bottom tabs (mobile) */
#tabs { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
#tabs a { flex: 1; text-align: center; padding: 8px 2px 9px; font-size: 11px; color: var(--ink-3); text-decoration: none; font-weight: 500; }
#tabs a svg { display: block; margin: 0 auto 2px; width: 22px; height: 22px; }
#tabs a.on { color: var(--brand); }
@media (min-width: 860px) {
  .topnav { display: flex; }
  #tabs { display: none; }
  body { padding-bottom: 40px; }
}

main { max-width: 1100px; margin: 0 auto; padding: 18px 16px; }
.narrow { max-width: 760px; margin: 0 auto; }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.page-h h1 { font-size: 24px; font-weight: 750; }
.page-h p { margin: 2px 0 0; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 15px; border-radius: 10px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; font-size: 14px; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { border-color: #d1d5db; background: #f9fafb; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #111; }
.btn.ok { background: var(--ok-soft); border-color: #a7f3d0; color: var(--ok); }
.btn.warn { background: var(--warn-soft); border-color: #fde68a; color: var(--warn); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #fecaca; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; padding: 12px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #eef0f3; }
.card.pad { padding: 18px; }
.grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } }
.section-t { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 22px 0 10px; }

/* week strip */
.week { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; flex: 1; }
.day { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 7px 0 8px; text-align: center; cursor: pointer; position: relative; }
.day .dw { font-size: 11px; text-transform: uppercase; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; }
.day .dn { font-size: 18px; font-weight: 700; }
.day.today .dn { color: var(--brand); }
.day.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.day.on .dw, .day.on .dn { color: inherit; }
.day .dot { position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.arrow { border: 1px solid var(--line); background: #fff; width: 36px; height: 52px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; flex: none; color: var(--ink-2); }
.arrow:hover { background: #f9fafb; }
.daytitle { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 2px 10px; }
.daytitle h2 { font-size: 17px; }

/* session card */
.sess { display: flex; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; position: relative; overflow: hidden; margin-bottom: 10px; transition: box-shadow .12s, transform .12s; }
.sess:hover { box-shadow: 0 4px 14px rgba(16,24,40,.09); }
.sess::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, var(--brand)); }
.sess .time { width: 62px; flex: none; }
.sess .time b { display: block; font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.sess .time span { font-size: 12px; color: var(--ink-3); }
.sess .info { flex: 1; min-width: 0; }
.sess .nm { font-weight: 650; font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sess .coach { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.sess .act { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sess.past { opacity: .62; }
.sess.cancelled .nm span.t { text-decoration: line-through; }
.places { display: flex; gap: 3px; align-items: center; }
.places i { width: 9px; height: 9px; border-radius: 3px; background: var(--brand-mid); display: block; }
.places i.f { background: var(--brand); }
.places em { font-style: normal; font-size: 12px; color: var(--ink-2); margin-left: 5px; white-space: nowrap; }
.av { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.av.lg { width: 44px; height: 44px; font-size: 16px; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #f3f4f6; color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.lock { background: #f3f4f6; color: var(--ink-3); }
.chip .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* sheet (modal) */
.sheet-wrap { position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg); animation: up .2s ease-out; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 20px; } }
.sheet .hd { padding: 20px 20px 14px; border-bottom: 1px solid var(--line); position: relative; }
.sheet .hd .bar { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--c, var(--brand)); }
.sheet .hd h2 { font-size: 21px; margin-top: 4px; padding-right: 30px; }
.sheet .x { position: absolute; right: 12px; top: 14px; border: 0; background: #f3f4f6; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; color: var(--ink-2); }
.sheet .bd { padding: 16px 20px 22px; }
.sheet .ft { padding: 14px 20px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.kv { display: grid; grid-template-columns: 22px 1fr; gap: 10px 10px; align-items: center; margin-bottom: 14px; color: var(--ink-2); }
.kv svg { width: 18px; height: 18px; color: var(--ink-3); }
.kv b { color: var(--ink); font-weight: 600; }
.note { padding: 11px 13px; border-radius: 10px; font-size: 14px; margin: 0 0 14px; }
.note.warn { background: var(--warn-soft); color: #92400e; }
.note.ok { background: var(--ok-soft); color: #065f46; }
.note.info { background: var(--brand-soft); color: color-mix(in srgb, var(--brand) 75%, #000); }
.note.bad { background: var(--bad-soft); color: #991b1b; }

/* roster */
.roster { list-style: none; padding: 0; margin: 0; }
.roster li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f3f4f6; }
.roster li:last-child { border-bottom: 0; }
.roster .nm { flex: 1; min-width: 0; }
.roster .nm div { font-weight: 600; }
.roster .nm small { color: var(--ink-3); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on.y { background: var(--ok-soft); color: var(--ok); }
.seg button.on.n { background: var(--bad-soft); color: var(--bad); }

/* forms */
label.f { display: block; margin-bottom: 13px; }
label.f > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.inp, select.inp, textarea.inp { width: 100%; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; background: #fff; outline: none; }
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-mid); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); padding: 7px 11px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.checks input { accent-color: var(--brand); }
.colour { display: flex; align-items: center; gap: 8px; }
.colour input[type=color] { width: 44px; height: 40px; border: 1px solid #d1d5db; border-radius: 10px; padding: 3px; background: #fff; }

/* switch */
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d1d5db; border-radius: 99px; cursor: pointer; transition: .15s; }
.switch span::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-mid); }

/* tables / lists */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafafa; position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fafafa; }
.scroll { overflow-x: auto; }
.mlist .m { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f3f4f6; }
.mlist .m:last-child { border-bottom: 0; }
.mlist .m .nm { flex: 1; min-width: 0; cursor: pointer; }
.mlist .m .nm b { display: block; font-weight: 600; }
.mlist .m .nm small { color: var(--ink-3); }
.mlist .m.off .nm b { color: var(--ink-3); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar .inp { width: auto; flex: 1; min-width: 160px; }
.pills { display: inline-flex; background: #eceef1; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.pills button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.pills button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* stats */
.stat { padding: 16px; }
.stat .k { font-size: 12.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 28px; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; }
.stat .s { font-size: 13px; color: var(--ink-2); }
.bar-h { height: 8px; border-radius: 99px; background: #eef0f3; overflow: hidden; min-width: 60px; }
.bar-h i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

.empty { text-align: center; padding: 40px 16px; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-size: 16px; margin-bottom: 4px; }

/* login */
.login { max-width: 900px; margin: 10px auto; }
.hero { background: var(--brand); color: var(--brand-ink); border-radius: 20px; padding: 28px 24px; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 60%, transparent); opacity: .35; }
.hero h1 { font-size: 28px; font-weight: 800; }
.hero p { margin: 6px 0 0; opacity: .9; max-width: 520px; }
.persona { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; text-align: left; width: 100%; border: 1px solid #eef0f3; }
.persona:hover { border-color: var(--brand); }
.persona .nm { flex: 1; }
.persona .nm b { display: block; }
.persona .nm small { color: var(--ink-3); }

.toast { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #111827; color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; font-weight: 500; max-width: calc(100% - 32px); text-align: center; animation: up .2s; }
.toast.err { background: var(--bad); }
@media (min-width: 860px) { .toast { bottom: 28px; } }

.preview { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.preview .ph { background: var(--brand); color: var(--brand-ink); padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-weight: 700; }
.preview .pb { padding: 12px 14px; background: var(--bg); }
iframe.mail { width: 100%; height: 560px; border: 0; background: #f4f5f7; border-radius: 0 0 14px 14px; }
.offer-page { max-width: 460px; margin: 30px auto; }

@media (max-width: 600px) { #proto .in { font-size: 11.5px; gap: 4px 8px; padding: 5px 12px; } #proto .lbl { display: none; } }

/* keep session cards inside a phone screen */
.sess .act { min-width: 0; max-width: 46%; }
.places { flex-wrap: wrap; justify-content: flex-end; row-gap: 3px; }
.sess .nm .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
html, body { overflow-x: hidden; }
@media (max-width: 520px) {
  .sess { flex-wrap: wrap; row-gap: 8px; }
  .sess .info { flex: 1 1 calc(100% - 80px); }
  .sess .act { max-width: none; flex: 1 1 100%; flex-direction: row; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding-left: 76px; gap: 6px 10px; }
  .sess .act .places { margin-right: auto; justify-content: flex-start; }
}
