/* MatPilot app. Black and bone; --red is the gym's own accent (gym.js sets it from the brand). */
:root {
  --black: #0a0a0a; --coal: #121212; --char: #1a1a1a; --card: #141414; --line: rgba(236,230,218,.12);
  --bone: #ece6da; --bone-2: #b9b2a5; --muted: #8d877c;
  --red: #d7141f; --red-2: #a30d16; --red-glow: rgba(215,20,31,.45); --ok: #2fb36b; --warn: #e4c21b;
  --serif: "Barlow", system-ui, sans-serif; --cond: "Barlow Condensed", "Arial Narrow", sans-serif; --sans: "Barlow", system-ui, sans-serif;
  --tab-h: 64px; --ease: cubic-bezier(.22,1,.36,1);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--black); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--black); color: var(--bone); font: 400 16px/1.5 var(--sans); min-height: 100dvh; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 800; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 1em; } a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.kicker { font: 700 12px/1 var(--cond); letter-spacing: .3em; text-transform: uppercase; color: var(--red); margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.cond { font-family: var(--cond); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }

/* ---- app shell ---- */
#app { display: none; }
#app.ready { display: block; }
.topbar { position: sticky; top: 0; z-index: 20; padding: calc(10px + var(--sat)) 16px 10px; background: linear-gradient(var(--black) 70%, transparent); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; font: 800 15px/1 var(--cond); letter-spacing: .22em; text-transform: uppercase; }
.topbar .brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red); }
.topbar .who { font-size: 13px; color: var(--bone-2); display: flex; align-items: center; gap: 8px; }
.topbar .who .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--char); display: grid; place-items: center; font: 700 13px var(--cond); border: 1px solid var(--line); }
main { padding: 4px 16px calc(var(--tab-h) + var(--sab) + 24px); max-width: 640px; margin: 0 auto; }
.view { animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---- tab bar ---- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tab-h) + var(--sab)); padding-bottom: var(--sab); background: rgba(10,10,10,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--muted); font: 600 10px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; }
.tabs a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--bone); } .tabs a.on svg { stroke: var(--red); }
/* the logo IS the middle tab (Announcements), raised and still, same shape as the EKC Hub */
.tabs { align-items: end; }
.tabs a.logo-tab { position: relative; gap: 0; }
.tabs .logo-ring { position: relative; top: -15px; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--coal); border: 2px solid var(--line); box-shadow: 0 -3px 14px rgba(0,0,0,.55); transition: border-color .15s, transform .15s; }
.tabs .logo-ring img { width: 44px; height: 44px; object-fit: contain; }   /* the whole logo inside the ring: never stretched, never clipped to a circle */
.tabs a.logo-tab.on .logo-ring { border-color: var(--red); transform: scale(1.04); box-shadow: 0 -3px 14px rgba(0,0,0,.55), 0 0 18px var(--red-glow); }
.tabs a.logo-tab:active .logo-ring { transform: scale(.96); }
.tabs a.logo-tab span { margin-top: -10px; }
.tabs .logo-dot { position: absolute; top: 2px; right: 50%; margin-right: -26px; width: 11px; height: 11px; border-radius: 50%; background: var(--red); border: 2px solid var(--black); }

/* ---- boot splash: the wordmark as a solid turning badge (EKC Hub recipe) ---- */
.boot { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: radial-gradient(720px 420px at 50% 42%, #2a0a0d 0%, transparent 62%), var(--black); transition: opacity .4s; }
.boot.out { opacity: 0; pointer-events: none; }
.boot-stage { position: relative; display: grid; place-items: center; width: 260px; height: 170px; perspective: 1000px; perspective-origin: 50% 42%; }
.boot-halo { position: absolute; width: 220px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(215,20,31,.45) 0%, rgba(215,20,31,.14) 45%, transparent 70%); filter: blur(14px); animation: halo3d 3.4s ease-in-out infinite; }
.spinner3d { position: relative; grid-area: 1 / 1; width: 230px; height: 110px; transform-style: preserve-3d; animation: spin3d 3.4s cubic-bezier(.45,.05,.55,.95) infinite; }
.s3d-slice, .s3d-face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.s3d-slice { transform: translateZ(calc((var(--i) - 10.5) * .55px)); filter: brightness(calc(.10 + var(--i) * .011)) saturate(.55); }
.s3d-face { backface-visibility: hidden; }
.s3d-front { transform: translateZ(6.5px); }
.s3d-back { transform: rotateY(180deg) translateZ(6.5px); filter: brightness(.42) saturate(.7); }
.boot-floor { position: absolute; bottom: 2px; width: 160px; height: 14px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(215,20,31,.4) 0%, transparent 72%); filter: blur(5px); animation: floor3d 3.4s cubic-bezier(.45,.05,.55,.95) infinite; }
@keyframes spin3d { 0% { transform: rotateY(0deg) rotateX(9deg) translateY(0); } 50% { transform: rotateY(180deg) rotateX(9deg) translateY(-7px); } 100% { transform: rotateY(360deg) rotateX(9deg) translateY(0); } }
@keyframes floor3d { 0%, 100% { transform: scaleX(1) scaleY(1); opacity: .85; } 25%, 75% { transform: scaleX(.32) scaleY(.8); opacity: .45; } 50% { transform: scaleX(1) scaleY(1); opacity: .85; } }
@keyframes halo3d { 0%, 100% { opacity: .95; transform: scale(1); } 25%, 75% { opacity: .6; transform: scale(.88); } 50% { opacity: .95; transform: scale(1); } }
.boot-word { font: 800 22px var(--serif); letter-spacing: .12em; text-transform: uppercase; color: var(--bone); }
.boot-msg { color: var(--muted); font-size: 13px; min-height: 18px; }
@media (prefers-reduced-motion: reduce) { .spinner3d { animation: none; transform: rotateY(-26deg) rotateX(9deg); } .boot-floor { animation: none; transform: scaleX(.86); } .boot-halo { animation: pulse3d 2.4s ease-in-out infinite; } @keyframes pulse3d { 0%, 100% { opacity: .5; } 50% { opacity: 1; } } }

/* ---- coaches corner ---- */
.corner { border-color: rgba(215,20,31,.45); background: linear-gradient(135deg, #1a0c0e, var(--card)); cursor: pointer; }
.corner .kicker { margin: 0 0 4px; }
.subnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 4px 0 14px; padding-bottom: 2px; }
.subnav a { flex: none; text-decoration: none; border: 1px solid var(--line); background: var(--char); color: var(--bone-2); border-radius: 999px; padding: 9px 14px; font: 700 12px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; }
.subnav a.on { background: var(--red); border-color: var(--red); color: #fff; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.rank-row:first-child { border-top: 0; }
.rank-row .belt { margin: 6px 0 0; height: 22px; }
.rank-row .belt .bar { width: 48px; }

/* ---- cards ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.card.hot { border-color: rgba(215,20,31,.5); box-shadow: 0 0 40px rgba(215,20,31,.12) inset; }
.card h2 { margin-bottom: 6px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--char); border-radius: 12px; padding: 12px; }
.stat b { display: block; font: 800 28px/1 var(--cond); color: var(--bone); }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .l { min-width: 0; } .list .l b { display: block; } .list .l span { font-size: 13px; color: var(--muted); }
.list li.tap { cursor: pointer; }
.pill { display: inline-block; font: 700 11px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; background: var(--char); color: var(--bone-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.red { background: var(--red); color: #fff; border-color: var(--red); }
.pill.ok { color: var(--ok); border-color: rgba(47,179,107,.4); }
.pill.warn { color: var(--warn); border-color: rgba(228,194,27,.4); }
.pill.gi { color: var(--bone); } .pill.nogi { color: var(--red); }

/* ---- buttons / forms ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 700 14px/1 var(--cond); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; padding: 14px 20px; border-radius: 12px; border: 2px solid transparent; background: var(--char); color: var(--bone); cursor: pointer; width: 100%; transition: transform .15s var(--ease), box-shadow .2s; }
.btn:active { transform: scale(.985); }
.btn.red { background: var(--red); color: #fff; }
.btn.red:hover { box-shadow: 0 0 30px var(--red-glow); }
.btn.ghost { background: transparent; border-color: rgba(236,230,218,.3); }
.btn.lg { padding: 20px; font-size: 17px; }
.btn.sm { padding: 10px 14px; font-size: 12px; width: auto; }
.btn[disabled] { opacity: .4; pointer-events: none; }
label { display: block; font: 600 11px/1 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 12px; }
input, select, textarea { width: 100%; background: #0d0d0d; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; color: var(--bone); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--red); }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }
.note { font-size: 13px; color: var(--muted); min-height: 18px; }
.note.err { color: #ff7a7a; } .note.ok { color: var(--ok); }
.seg { display: flex; background: var(--char); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); border-radius: 9px; padding: 10px; font: 700 12px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.seg button.on { background: var(--red); color: #fff; }

/* ---- belt ---- */
.belt { position: relative; height: 34px; border-radius: 6px; background: var(--bc, #ece6da); border: 1px solid rgba(0,0,0,.5); box-shadow: inset 0 -6px 12px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; margin: 10px 0; overflow: hidden; }
.belt.two::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 33%; transform: translateY(-50%); background: var(--bc2, #fff); }
.belt .bar { width: 72px; height: 100%; background: #111; display: flex; align-items: center; justify-content: center; gap: 6px; }
.belt.black .bar { background: var(--red); }
.belt .bar i { width: 7px; height: 70%; background: #fff; display: block; }
.belt-name { font: 700 13px/1 var(--cond); letter-spacing: .2em; text-transform: uppercase; color: var(--bone-2); }
.progress { height: 8px; border-radius: 999px; background: var(--char); overflow: hidden; margin: 8px 0 4px; }
.progress i { display: block; height: 100%; background: var(--red); width: 0; transition: width .8s var(--ease); }

/* ---- hero on home ---- */
.hero { position: relative; padding: 18px 0 8px; }
.hero .spider { position: absolute; right: -10px; top: -20px; width: 110px; opacity: .9; filter: drop-shadow(0 10px 20px rgba(0,0,0,.8)); pointer-events: none; animation: sway 4s ease-in-out infinite alternate; transform-origin: 50% -200px; }
@keyframes sway { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
.hero h1 { font-size: 28px; max-width: 70%; }
.hero .sub { color: var(--bone-2); margin: 8px 0 0; max-width: 72%; }

/* ---- auth screen ---- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(ellipse at 50% 0%, rgba(215,20,31,.18), transparent 60%); }
.auth .box { width: 100%; max-width: 400px; }
.auth .logo { width: 220px; margin: 0 auto 10px; }
.auth .widow { width: 120px; margin: 0 auto 10px; filter: drop-shadow(0 20px 30px rgba(0,0,0,.8)); }
.auth h1 { text-align: center; font-size: 22px; margin-bottom: 4px; }
.auth .lede { text-align: center; color: var(--bone-2); margin-bottom: 18px; }

/* ---- roster / coach ---- */
.roster li .tick { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.roster li .tick.on { background: var(--red); border-color: var(--red); color: #fff; }
.roster li .tick svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 3; }
.search { position: sticky; top: calc(54px + var(--sat)); z-index: 10; background: var(--black); padding: 4px 0 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips button { flex: none; border: 1px solid var(--line); background: var(--char); color: var(--bone-2); border-radius: 999px; padding: 8px 14px; font: 700 12px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; }
.chips button.on { background: var(--bone); color: var(--black); border-color: var(--bone); }
.stripes-pick { display: flex; gap: 8px; }
.stripes-pick button { flex: 1; padding: 14px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--char); color: var(--bone); font: 800 18px var(--cond); }
.stripes-pick button.on { background: var(--red); border-color: var(--red); color: #fff; }

/* ---- modal sheet ---- */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet .panel { width: 100%; max-width: 640px; background: var(--coal); border-radius: 20px 20px 0 0; padding: 18px 16px calc(20px + var(--sab)); max-height: 90dvh; overflow: auto; animation: up .3s var(--ease); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--sab) + 16px); transform: translateX(-50%); background: var(--bone); color: var(--black); font: 600 14px var(--sans); padding: 12px 18px; border-radius: 999px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: rise .3s var(--ease); max-width: 90vw; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }
.sched-day { font: 800 13px/1 var(--cond); letter-spacing: .24em; text-transform: uppercase; color: var(--red); margin: 18px 0 8px; }
.sched-day:first-child { margin-top: 4px; }
.today { outline: 2px solid var(--red); outline-offset: -2px; }
.medal { font-size: 22px; width: 36px; text-align: center; }
@media (min-width: 700px) { main { padding-top: 10px; } .hero h1 { font-size: 34px; } }

/* ---- mat: timer + music ---- */
.mirror { text-align: center; padding: 22px 16px 18px; position: relative; overflow: hidden; background: radial-gradient(80% 60% at 50% 0%, rgba(215,20,31,.14), transparent 70%), var(--card); }
.mirror-widow { position: absolute; right: -14px; top: -18px; width: 90px; opacity: .22; pointer-events: none; }
.mirror .phase { font: 800 12px/1 var(--cond); letter-spacing: .34em; text-transform: uppercase; color: var(--muted); }
.mirror .clock { font: 800 clamp(64px, 20vw, 84px)/1 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -.01em; margin: 8px 0 6px; }
.mirror .sub { color: var(--bone-2); font: 600 13px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; }
.mirror .progress { margin: 14px 0 10px; height: 6px; }
.mirror.work .clock, .mirror.work .phase { color: var(--red); text-shadow: 0 0 30px var(--red-glow); }
.mirror.rest .clock { color: var(--bone); } .mirror.rest .progress i { background: var(--bone); }
.mirror.paused .clock { animation: blink 1s steps(2) infinite; }
.mirror.done .clock { color: var(--bone); }
@keyframes blink { to { opacity: .35; } }
.dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--char); border: 1px solid var(--line); }
.dots i.done { background: var(--red); border-color: var(--red); }
.dots i.now { background: transparent; border-color: var(--red); box-shadow: 0 0 10px var(--red-glow); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.presets button { border: 1px solid var(--line); background: var(--char); color: var(--bone-2); border-radius: 999px; padding: 9px 13px; font: 700 12px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; }
.presets button.on { border-color: var(--red); color: var(--red); }
.fields3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fields3 input { text-align: center; font-weight: 800; font-size: 18px; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: #2a2a2a; position: relative; border: 0; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--bone); transition: left .15s; }
.switch.on { background: var(--red); } .switch.on::after { left: 24px; }
.np { display: flex; gap: 12px; align-items: center; }
.np img { width: 64px; height: 64px; border-radius: 10px; background: var(--char); object-fit: cover; }
.np .l { min-width: 0; flex: 1; } .np .l b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transport { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; margin-top: 12px; }
.transport .btn { padding: 16px 0; font-size: 20px; }
.vol { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.vol input[type=range] { flex: 1; accent-color: var(--red); padding: 0; background: transparent; border: 0; }
.pl { max-height: 260px; overflow: auto; }

/* ---- messages: WhatsApp feel in the gym's colors. A chat covers the whole screen, tab bar and all. ---- */
.tab-dot { position: absolute; top: 10px; right: calc(50% - 20px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); }
.tabs a { position: relative; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--red); color: #fff; font: 700 12px/22px var(--cond); text-align: center; }
.cav { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--char); border: 1px solid var(--line); display: grid; place-items: center; font: 800 16px var(--cond); color: var(--bone); overflow: hidden; }
.cav img { width: 100%; height: 100%; object-fit: cover; }
.chat-row { gap: 12px; } .chat-row .l { flex: 1; min-width: 0; } .chat-row .l .row { gap: 8px; } .chat-row .l .row > span:first-child { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.in-chat .tabs, body.in-chat .topbar { display: none; }
.chat { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--black); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--sat)) 12px 8px 6px; background: var(--coal); border-bottom: 1px solid var(--line); }
.chat-head .back { font: 400 34px/1 var(--sans); text-decoration: none; color: var(--bone); padding: 0 6px 4px; }
.chat-head .cav { width: 40px; height: 40px; }
.chat-head .l { min-width: 0; flex: 1; } .chat-head b { display: block; font: 800 16px var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .chat-head span { font-size: 12px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head span.typing { color: var(--ok); }
.chat-wall { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 8px 4% 14px; background-color: #0b0b0b; background-image: linear-gradient(rgba(11,11,11,.86), rgba(11,11,11,.86)), url('/assets/img/chat-wall-mp.svg'); background-size: auto, 300px 300px; background-attachment: local, local; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.wa-day { align-self: center; margin: 10px 0 6px; }
.wa-day span { display: inline-block; background: var(--coal); color: var(--muted); font-size: 12px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); }
.msg { position: relative; max-width: 84%; align-self: flex-start; margin-top: 8px; -webkit-user-select: none; user-select: none; }
.msg.cont { margin-top: 1px; } .msg.mine { align-self: flex-end; }
.msg .bubble { position: relative; background: #202020; color: var(--bone); border-radius: 10px; padding: 6px 8px 6px 9px; min-width: 80px; font-size: 14.5px; line-height: 1.38; box-shadow: 0 1px .5px rgba(0,0,0,.4); display: flow-root; }
.msg .txt { white-space: pre-wrap; word-break: break-word; } .msg .txt a { color: #8fd3ff; }
.msg:not(.cont) .bubble { border-top-left-radius: 0; }
.msg.mine .bubble { background: #5a0b12; } .msg.mine:not(.cont) .bubble { border-top-left-radius: 10px; border-top-right-radius: 0; }
.msg:not(.cont) .bubble::before { content: ""; position: absolute; top: 0; left: -8px; border-style: solid; border-width: 0 8px 8px 0; border-color: transparent #202020 transparent transparent; }
.msg.mine:not(.cont) .bubble::before { left: auto; right: -8px; border-width: 0 0 8px 8px; border-color: transparent transparent transparent #5a0b12; }
.msg .by { font: 700 12.5px/1.2 var(--cond); letter-spacing: .06em; margin-bottom: 3px; }
.msg .quote { border-left: 3px solid var(--red); background: rgba(0,0,0,.28); border-radius: 6px; padding: 5px 8px; margin: 0 0 6px; font-size: 13px; color: var(--bone-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg .quote b { display: block; color: var(--red); font-size: 12px; }
.msg .pic { width: min(260px, 70vw); border-radius: 8px; margin: 0 0 4px; display: block; cursor: zoom-in; }
.msg .t { float: right; margin: 8px -2px -3px 10px; font-size: 11px; color: rgba(236,230,218,.55); display: inline-flex; align-items: center; gap: 3px; }
.msg .tick { font-style: normal; font-size: 12px; letter-spacing: -3px; color: rgba(236,230,218,.55); } .msg .tick.read { color: #53bdeb; }
.msg .rx { display: flex; gap: 4px; margin: -6px 0 0 8px; position: relative; z-index: 1; }
.msg.mine .rx { justify-content: flex-end; margin-right: 8px; }
.msg .rx button { border: 1px solid var(--line); background: var(--coal); color: var(--bone); border-radius: 999px; padding: 2px 7px; font-size: 13px; line-height: 1.3; cursor: pointer; }
.msg .rx button.on { border-color: var(--red); background: #2a0d10; }
.jump { position: absolute; right: 14px; bottom: 76px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--coal); color: var(--bone); font-size: 22px; line-height: 1; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0,0,0,.5); z-index: 2; }
.jump i { position: absolute; top: -6px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font: 700 11px/18px var(--cond); font-style: normal; padding: 0 5px; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--coal); border-top: 1px solid var(--line); }
.reply-bar .l { flex: 1; min-width: 0; border-left: 3px solid var(--red); padding-left: 8px; font-size: 13px; color: var(--bone-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar .l b { display: block; color: var(--red); font-size: 12px; } .reply-bar button { border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; }
.emoji-tray { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px; background: var(--coal); border-top: 1px solid var(--line); max-height: 150px; overflow: auto; }
.emoji-tray button { border: 0; background: transparent; font-size: 26px; width: 44px; height: 44px; border-radius: 8px; } .emoji-tray button:active { background: var(--char); }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px 8px calc(8px + var(--sab)); background: var(--coal); border-top: 1px solid var(--line); }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; border-radius: 22px; padding: 11px 14px; line-height: 1.4; background: #161616; }
.composer .ico { flex: none; width: 44px; height: 44px; border: 0; background: transparent; font-size: 24px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; color: var(--bone-2); margin: 0; }
.composer .send { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--red); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 16px var(--red-glow); }
.composer .send svg { width: 20px; height: 20px; fill: currentColor; margin-left: 2px; }
.rx-pick { display: flex; justify-content: space-between; gap: 4px; padding: 4px 2px 12px; }
.rx-pick button { border: 0; background: var(--char); font-size: 26px; width: 44px; height: 44px; border-radius: 50%; }
.menu li { font-weight: 600; }
/* ---- waiver text (Texas fair notice: the release language stands out) ---- */
.terms { font-size: 14px; color: var(--bone-2); line-height: 1.55; padding: 14px; background: #0d0d0d; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; }
.terms p { margin: 0 0 .8em; } .terms h4 { font: 700 13px/1.2 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: var(--bone); margin: 14px 0 6px; }
.terms .wv-title { font: 800 15px/1.25 var(--serif); color: var(--bone); margin: 0 0 10px; }
.terms .loud { font-weight: 800; font-size: 14.5px; color: var(--bone); text-transform: uppercase; letter-spacing: .01em; background: rgba(215,20,31,.1); border-left: 3px solid var(--red); padding: 8px 10px; border-radius: 0 8px 8px 0; }
.terms .wv-parent { color: var(--red); margin-top: 20px; }

/* ---- membership plans + waiver signature ---- */
.plan .price { text-align: right; flex: none; } .plan .price b { display: block; font: 800 26px/1 var(--cond); color: var(--bone); } .plan .price span { font-size: 12px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.sig { font: 800 24px var(--serif); border-bottom: 2px solid var(--bone); background: transparent; border-radius: 0; padding: 8px 4px; }

/* ---- MatPilot: gym branding, gym-code screen, paywall, settings editors ---- */
.topbar .brand-logo { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; }
.auth .logo.gym { max-width: 180px; max-height: 150px; width: auto; margin: 0 auto 12px; object-fit: contain; }
.auth .logo.mp { width: 230px; margin: 0 auto 8px; }
.auth .mp-foot { opacity: .6; }
.found { text-align: center; margin-top: 14px; } .found img { max-width: 160px; max-height: 120px; margin: 0 auto 8px; object-fit: contain; } .found .btn { margin-top: 10px; }
.s3d-slice, .s3d-face { object-fit: contain; }
#paywall { position: fixed; inset: 0; z-index: 90; background: rgba(10,10,10,.96); display: grid; place-items: center; padding: 20px; overflow: auto; }
#paywall .gate-box { max-width: 420px; text-align: center; } #paywall img { max-width: 150px; max-height: 110px; margin: 0 auto 14px; object-fit: contain; } #paywall .btn { margin-top: 10px; }
.look-logo { display: grid; place-items: center; min-height: 150px; margin: 10px 0 12px; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.05), transparent 70%); border-radius: 14px; } .look-logo img { max-width: 220px; max-height: 160px; object-fit: contain; }
.rows { display: grid; gap: 8px; margin-top: 8px; }
.rows .row { gap: 6px; flex-wrap: nowrap; } .rows .row input, .rows .row select { min-width: 0; }
.srow select, .srow input { flex: 1; padding: 8px 6px; font-size: 14px; } .srow select[data-f=day] { flex: 0 0 64px; } .srow select[data-f=gi] { flex: 0 0 84px; } .srow .btn { flex: 0 0 auto; }
.plan-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check.sm { font: 600 13px var(--sans); text-transform: none; letter-spacing: 0; gap: 6px; white-space: nowrap; }
.pill.warn { background: rgba(228,194,27,.15); color: var(--warn); border-color: rgba(228,194,27,.4); }
.hero { position: relative; }

/* in-app QR scanner for the check-in sign */
.scan { position: fixed; inset: 0; z-index: 60; background: #000; display: grid; place-items: center; grid-template-rows: 1fr auto auto; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-box { position: relative; width: min(68vw, 300px); aspect-ratio: 1; border: 3px solid #fff; border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); align-self: center; }
.scan p { position: relative; color: #fff; font-weight: 600; margin: 14px 0; }
.scan .btn { position: relative; min-width: 160px; }

/* ---- the gym shop ---- */
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-item { display: block; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 12px; color: var(--bone); cursor: pointer; font: inherit; }
.shop-item .ph { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--char); margin-bottom: 8px; }
.shop-item b { display: block; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-item span { display: block; padding: 2px 4px 0; font-size: 13px; color: var(--muted); } .shop-item i { font-style: normal; color: var(--warn); }
.ph.none, .shop-big.none, .shop-thumb.none { display: grid; place-items: center; font: 800 44px/1 var(--cond); color: var(--muted); background: var(--char); }
.shop-big { display: block; width: 100%; max-height: 46dvh; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--char); }
.shop-thumb { flex: none; width: 48px; height: 48px; object-fit: cover; border-radius: 10px; background: var(--char); } .shop-thumb.none { font-size: 20px; } .shop-thumb.big { width: 88px; height: 88px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--line); background: var(--char); color: var(--bone); border-radius: 10px; padding: 11px 14px; min-width: 48px; font: 700 14px/1 var(--cond); letter-spacing: .08em; cursor: pointer; }
.chips button.on { background: var(--red); border-color: var(--red); color: #fff; }
.chips button[disabled], .chips button.off { opacity: .4; text-decoration: line-through; }
.chips.sm button { padding: 8px 10px; font-size: 12px; color: var(--bone-2); }
.qty { display: flex; align-items: center; gap: 4px; flex: none; }
.qty button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--char); color: var(--bone); font: 700 20px/1 var(--cond); cursor: pointer; }
.qty b { min-width: 28px; text-align: center; font: 800 20px/1 var(--cond); }
.shop-bag { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + var(--sab) + 12px); max-width: 608px; margin: 0 auto; z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.shop-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---- shop: several photos per item ---- */
.shop-item { position: relative; }
.shop-item .morep { position: absolute; top: 14px; right: 14px; font: 700 10px/1 var(--cond); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.66); padding: 5px 7px; border-radius: 999px; }
.shop-gal { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 14px; }
.shop-gal::-webkit-scrollbar { display: none; }
.shop-gal img { flex: none; display: block; width: 100%; max-height: 46dvh; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--char); scroll-snap-align: center; }
.shop-dots { display: flex; justify-content: center; gap: 6px; min-height: 7px; margin-top: 8px; }
.shop-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); } .shop-dots i.on { background: var(--red); }
.shop-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-strip .ph { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--char); border: 1px solid var(--line); cursor: pointer; }
.shop-strip .ph.cover { border-color: var(--red); }
.shop-strip .ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shop-strip .ph i { position: absolute; left: 0; right: 0; bottom: 0; font: 700 10px/1.7 var(--cond); font-style: normal; letter-spacing: .1em; text-transform: uppercase; text-align: center; color: #fff; background: rgba(0,0,0,.66); }
.shop-strip .ph button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.72); color: #fff; font: 700 16px/1 var(--sans); cursor: pointer; }
.shop-strip .ph.add { display: grid; place-items: center; align-content: center; gap: 2px; border-style: dashed; color: var(--muted); font: 800 26px/1 var(--cond); }
.shop-strip .ph.add span { font: 700 10px/1.3 var(--cond); letter-spacing: .1em; text-transform: uppercase; }

/* the demo gym: a card on the gym-code screen, and the bar that flips member / coach view */
.demo-card { margin-top: 14px; text-align: center; }
.demo-card h2 { margin: 0 0 4px; } .demo-card p { margin: 0 0 12px; }
#demo-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--sab) + 24px); z-index: 29; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 999px; background: rgba(20,20,22,.94); border: 1px solid var(--red); box-shadow: 0 6px 22px rgba(0,0,0,.6); font: 600 12px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; color: var(--bone-2); }
#demo-bar b { color: var(--red); }
#demo-bar button { font: inherit; letter-spacing: inherit; text-transform: inherit; border: 0; border-radius: 999px; padding: 8px 12px; background: var(--red); color: #fff; cursor: pointer; }
#demo-bar #demo-x { background: var(--char); color: var(--bone-2); }
body.demo #main { padding-bottom: calc(var(--tab-h) + var(--sab) + 84px); }
body.in-chat #demo-bar { display: none; }
