:root {
  --bg: #141414;
  --s1: #1C1C1C;
  --s2: #232323;
  --line: #333333;
  --line-soft: #2A2A2A;
  --text: #F2F2F2;
  --text-2: #B0B0B0;
  --muted: #8A8A8A;
  --dim: #4A4A4A;
  --orange: #FFB38A;
  --orange-hi: #FFD2B5;
  --purple: #C9B5F5;
  --ok: #8FD9B6;
  --bad: #FF8A80;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--body); -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
h1 { font-size: clamp(52px, 9vw, 96px); line-height: .85; letter-spacing: -.01em; }
h2 { font-size: 28px; letter-spacing: .04em; font-weight: 700; }
h3 { font-size: 20px; letter-spacing: .04em; font-weight: 700; }
a { color: var(--orange); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 760px) { .wrap { padding: 0 48px; } }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }
.accent { color: var(--orange); }
.label { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }

.demo-bar { background: var(--purple); color: #141414; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 16px; font-size: 14px; flex-wrap: wrap; }
.demo-bar b { font-family: var(--display); font-size: 16px; letter-spacing: .08em; text-transform: uppercase; }
.demo-bar a { color: #141414; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; }

/* header */
header.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line-soft); padding-top: env(safe-area-inset-top); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 12px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: .04em; text-transform: uppercase; color: var(--text); text-decoration: none; }
.top-right { display: flex; gap: 24px; align-items: center; }
.nav-link { background: none; border: 0; padding: 12px 0; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.nav-link:hover, .nav-link.on { color: var(--text); }
.avatar { width: 36px; height: 36px; background: var(--purple); object-fit: cover; cursor: pointer; display: block; }

/* buttons */
.btn { border: 1px solid var(--line); background: none; color: var(--text); min-height: 44px; padding: 0 20px; cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; border-radius: 0; }
.btn:hover { border-color: var(--text-2); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #141414; }
.btn.primary:hover { background: var(--orange-hi); border-color: var(--orange-hi); }
.btn.light { background: var(--text); border-color: var(--text); color: #141414; }
.btn.light:hover { background: #fff; }
.btn.orange { background: var(--purple); border-color: var(--purple); color: #141414; }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { border-color: var(--line); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 20px; font-weight: 800; }
.btn:disabled { opacity: .4; cursor: default; }
.link { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--purple); font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
.link:hover { color: #E2D7FA; }
.icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); background: none; cursor: pointer; display: grid; place-items: center; padding: 0; color: var(--text); }
.icon-btn:hover:not(:disabled) { border-color: var(--text-2); }
.icon-btn:disabled { opacity: .3; cursor: default; }

.panel { background: var(--s1); padding: 24px; }
.page { padding-top: 40px; padding-bottom: 64px; }
::placeholder { color: #5C5C5C; opacity: 1; }


/* hero + type switch */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px 40px; flex-wrap: wrap; margin-bottom: 36px; }
.seg { display: flex; border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.seg button { min-height: 52px; padding: 0 22px; border: 0; background: none; color: var(--text-2); font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; white-space: nowrap; flex: 1 0 auto; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--text); color: #141414; }
.seg-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
.seg-form button { min-height: 48px; padding: 4px 6px; font-size: 15px; white-space: normal; line-height: 1.1; }

/* booking layout */
.book-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .book-grid { grid-template-columns: minmax(0, 1fr); } }

/* month calendar */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cal-nav { display: flex; gap: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 0 6px 2px; }
.cal-day { height: 64px; border: 0; background: var(--s1); color: var(--dim); font-family: var(--display); font-weight: 700; font-size: 22px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; padding: 8px 10px; cursor: default; border-radius: 0; text-align: left; overflow: hidden; }
.cal-day.on { color: var(--text); background: var(--s2); cursor: pointer; box-shadow: inset 0 -3px 0 var(--orange); }
.cal-day.on:hover { background: #2C2C2C; }
.cal-day.sel, .cal-day.sel:hover { background: var(--orange); color: #141414; box-shadow: none; }
.cal-day.today { outline: 1px solid #555; outline-offset: -1px; }
.cal-day.out { visibility: hidden; }
@media (max-width: 600px) { .cal-day { height: 48px; font-size: 18px; padding: 6px; } }
.legend { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 14px; height: 3px; background: var(--orange); }
.legend i.today { height: 14px; background: none; outline: 1px solid #555; outline-offset: -1px; }
.legend i.l-sess { height: 10px; width: 10px; background: var(--orange); }
.legend i.l-open { height: 10px; width: 10px; background: var(--ok); }
.legend i.l-bk { height: 10px; width: 10px; background: var(--purple); }

/* admin calendar */
.admin-cal .cal-day { color: var(--text); background: var(--s1); height: auto; min-height: 86px; cursor: pointer; gap: 4px; font-size: 20px; }
.admin-cal .cal-day:hover { background: var(--s2); }
.admin-cal .cal-day.sel { background: var(--orange); color: #141414; }
.admin-cal .cal-day.past { opacity: .45; }
@media (max-width: 600px) { .admin-cal .cal-day { min-height: 58px; font-size: 16px; padding: 5px; } }
.marks { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-day, .marks { min-width: 0; max-width: 100%; }
.mk { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mk { display: block; font-family: var(--body); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; padding: 1px 5px; color: #141414; white-space: nowrap; }
.mk.open { background: var(--ok); }
.mk.sess { background: var(--orange); }
.mk.bk { background: var(--purple); }
.cal-day.sel .mk { outline: 1px solid #141414; }
@media (max-width: 600px) { .mk { font-size: 0; width: 8px; height: 8px; padding: 0; } }

/* session-type letter marks (P / S / G) */
.tmks { display: flex; gap: 2px; margin-top: auto; flex-wrap: wrap; }
.tmk { display: inline-grid; place-items: center; width: 16px; height: 16px; font-family: var(--display); font-weight: 800; font-size: 12px; line-height: 1; color: #141414; }
.tmk.p { background: var(--purple); }
.tmk.s { background: var(--orange); }
.tmk.g { background: var(--ok); }
.cal-day.on { box-shadow: none; }
.cal-day.sel .tmk { outline: 1px solid #141414; }
.legend .tmk { margin-right: 2px; }
.type-sec + .type-sec { margin-top: 22px; }
.type-head { display: flex; align-items: center; gap: 8px; font-size: 18px; margin-bottom: 10px; }
.type-head .tmk { width: 20px; height: 20px; font-size: 14px; }
@media (max-width: 600px) { .tmk { width: 13px; height: 13px; font-size: 10px; } .cal-day { height: 56px; } }

/* times */
.times-date { font-size: 48px; font-weight: 800; margin: 2px 0 20px; }
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.slot { height: 64px; border: 1px solid var(--line); background: var(--s1); color: var(--text); font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .02em; cursor: pointer; border-radius: 0; }
.panel .slot { background: var(--bg); }
.slot:hover { border-color: var(--orange); }
.slot.sel { background: var(--orange); border-color: var(--orange); color: #141414; }
.sess-item { border: 1px solid var(--line); background: var(--bg); padding: 14px; display: flex; align-items: center; gap: 14px; cursor: pointer; width: 100%; text-align: left; color: var(--text); font: inherit; }
.sess-item + .sess-item { margin-top: 8px; }
.sess-item:hover:not(:disabled) { border-color: var(--orange); }
.sess-item.sel { border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); }
.sess-item:disabled { opacity: .45; cursor: default; }
.sess-item .t { font-family: var(--display); font-weight: 700; font-size: 24px; min-width: 88px; }
.sess-item .b { flex: 1; min-width: 0; }
.sess-item b { font-family: var(--display); font-size: 19px; letter-spacing: .04em; text-transform: uppercase; }
.spots { height: 3px; background: var(--line); margin-top: 8px; }
.spots i { display: block; height: 100%; background: var(--orange); }
.req-box { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.empty { padding: 28px 16px; text-align: center; border: 1px dashed var(--line); color: var(--muted); }

/* lists */
.item { background: var(--s1); padding: 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.item + .item { margin-top: 4px; }
.item .t { min-width: 92px; font-family: var(--display); font-weight: 700; font-size: 24px; }
.item .b { flex: 1; min-width: 180px; }
.item b { font-family: var(--display); font-size: 19px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; }
.panel .item { background: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.item.has-chat { flex-wrap: wrap; }
.chat-slot { flex-basis: 100%; }
.chat-slot:empty { display: none; }
.chat { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 14px; }
.chat-log { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.msg { max-width: min(80%, 520px); }
.msg.me { align-self: flex-end; text-align: right; }
.msg-who { font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.msg-body { display: inline-block; text-align: left; padding: 10px 14px; background: var(--s2); white-space: pre-line; overflow-wrap: anywhere; }
.msg.me .msg-body { background: var(--orange); color: #141414; }
.msg.them .msg-body { border-left: 3px solid var(--purple); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-width: 0; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text); resize: none; border-radius: 0; line-height: 1.4; }
.chat-form textarea:focus { outline: none; border-color: var(--orange); }
.chat-form .btn { min-height: 48px; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn.on-chat { border-color: var(--purple); color: var(--purple); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; background: var(--purple); color: #141414; font-size: 13px; line-height: 20px; text-align: center; }
.badge.new { background: var(--orange); }
.gym-reply { margin-top: 10px; border-left: 3px solid var(--purple); padding: 4px 0 4px 12px; font-size: 15px; white-space: pre-line; }
.gym-reply span { display: block; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--purple); }
textarea { resize: vertical; }
.chip { display: inline-block; font-family: var(--display); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; vertical-align: 2px; margin-left: 6px; }
.chip.accepted { background: var(--ok); color: #0E2A1E; }
.chip.pending { background: var(--orange); color: #141414; }
.chip.declined, .chip.cancelled { border: 1px solid var(--line); color: var(--muted); }
.pill { display: inline-block; font-family: var(--display); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border: 1px solid var(--line); color: var(--text-2); }
.pill.semi, .pill.class { border-color: var(--orange); color: var(--orange); }
.pill.private { border-color: var(--purple); color: var(--purple); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: none; align-items: flex-end; justify-content: center; z-index: 20; }
.modal.open { display: flex; }
.sheet { background: var(--s1); width: 100%; max-width: 480px; padding: 28px 20px calc(24px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; border-top: 3px solid var(--orange); }
@media (min-width: 600px) { .modal { align-items: center; } .sheet { padding: 32px 28px; } }
.sheet h2 { font-size: 36px; font-weight: 800; }
.field { display: block; margin-top: 16px; }
.field span { display: block; font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 0; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--orange); }
input[type="date"], input[type="time"] { color-scheme: dark; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.actions { display: flex; gap: 8px; margin-top: 24px; }
.actions .btn { flex: 1; }
.err { color: var(--bad); font-size: 14px; margin-top: 10px; min-height: 1em; }
.summary { border-left: 3px solid var(--orange); padding: 4px 0 4px 14px; margin-top: 14px; font-family: var(--display); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: .03em; line-height: 1.15; }
.summary .muted { font-family: var(--body); font-weight: 400; font-size: 15px; text-transform: none; letter-spacing: 0; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--orange); color: #141414; padding: 12px 20px; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; opacity: 0; transition: .2s; z-index: 30; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.notice { border: 1px solid var(--line); border-left: 3px solid var(--purple); padding: 14px 16px; margin-bottom: 20px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice b { font-family: var(--display); font-size: 19px; letter-spacing: .04em; text-transform: uppercase; }

/* sign in */
.signin { max-width: 460px; margin: 6vh auto 0; }
.signin h1 { font-size: clamp(56px, 12vw, 88px); }
.signin p { color: var(--text-2); font-size: 17px; margin: 18px 0 28px; }
.signin #gbtn { min-height: 56px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; max-width: 360px; min-height: 56px; padding: 0 22px; border: 1px solid var(--line); background: var(--s1); color: var(--text); cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; border-radius: 0; }
.gbtn svg { flex: none; background: #fff; padding: 6px; box-sizing: content-box; }
.gbtn:hover { border-color: var(--orange); background: var(--s2); }
.gbtn:disabled { opacity: .6; cursor: progress; }
.signin .panel { margin-top: 8px; }
.day-sec + .day-sec { margin-top: 28px; }
.day-sec h3 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* phone */
@media (max-width: 600px) {
  .page { padding-top: 24px; padding-bottom: 48px; }
  header.top .wrap { height: 60px; }
  .brand { font-size: 22px; white-space: nowrap; }
  .top-right { gap: 14px; }
  .nav-link { font-size: 15px; white-space: nowrap; }
  .avatar { width: 32px; height: 32px; }
  h1 { font-size: 52px; }
  .hero { gap: 20px; margin-bottom: 24px; }
  .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; overflow: visible; }
  .seg button { min-height: 48px; padding: 4px 6px; font-size: 15px; white-space: normal; line-height: 1.1; }
  .seg button + button { border-left: 1px solid var(--line); }
  h2, .cal-head h2 { font-size: 22px; }
  .panel { padding: 16px; }
  .times-date { font-size: 40px; margin-bottom: 16px; }
  .slot { height: 56px; font-size: 22px; }
  .item { padding: 14px; gap: 10px 14px; }
  .item .t { min-width: 0; font-size: 20px; }
  .card-actions { width: 100%; justify-content: flex-start; flex-wrap: nowrap; }
  .card-actions .btn { flex: 1 1 0; padding: 0 6px; min-width: 0; }
  .panel .item { padding: 12px; }
  .sheet h2 { font-size: 30px; }
  .demo-bar { font-size: 13px; padding: 8px 16px; }
}
