:root {
  --dark: #1f2328;
  --dark-2: #3a3f45;
  --bg: #f2f2f7;
  --card: #fff;
  --line: #e5e5ea;
  --text: #000;
  --muted: #8e8e93;
  --muted-2: #6c6c70;
  --green: #30c85e;
  --green-d: #1c7c3c;
  --green-bg: #d6f5df;
  --blue: #0a60c2;
  --blue-bg: #dcebfb;
  --yellow: #ffcc00;
  --yellow-bg: #fff4d6;
  --yellow-d: #7a5a00;
  --red: #d70015;
  --red-bg: #ffe5e3;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0b0b0b; }
body {
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--text); -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.app {
  position: relative; height: 100vh; height: 100dvh; max-width: 520px; margin: 0 auto;
  background: var(--bg); display: flex; flex-direction: column; overflow: hidden;
}
.top { background: var(--dark); color: #fff; padding-top: var(--sat); flex-shrink: 0; }
.nav { height: 44px; display: grid; grid-template-columns: 90px minmax(0, 1fr) 90px; align-items: center; padding: 0 14px; }
.nav.wide { grid-template-columns: 8px minmax(0, 1fr) 8px; }
.nav .t { text-align: center; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill {
  justify-self: start; background: var(--green); color: #fff; border-radius: 7px; height: 28px; padding: 0 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .3px; transition: transform .15s;
}
.pill:active { transform: scale(.95); }
.ib { justify-self: end; color: #fff; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 9px; transition: background .2s; }
.ib:active { background: #ffffff22; }
.ib.l { justify-self: start; }

/* Календарь */
.cal { padding: 0 10px 10px; color: #fff; }
.cal .mrow { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; height: 30px; }
.cal .mon { text-align: center; font-size: 14px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.cal .arr { width: 36px; height: 30px; display: flex; align-items: center; justify-content: center; color: #fff; border-radius: 8px; }
.cal .arr:disabled { opacity: .2; }
.cal .arr svg.i { width: 18px; height: 18px; }
.wd, .gr { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.wd span { font-size: 11px; color: var(--muted); height: 22px; line-height: 22px; }
.cw { overflow: hidden; transition: height .38s var(--ease); }
.dc { height: 38px; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; }
.dc b { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 400; transition: background .2s, transform .15s; }
.dc:active b { transform: scale(.9); }
.dc.sel b { background: var(--green); color: #fff; font-weight: 600; }
.dc.off b { color: #5a5f66; text-decoration: line-through; }
.dc.pa b { color: #5a5f66; }
.dc.today:not(.sel) b { box-shadow: inset 0 0 0 1.5px #ffffff40; }
.dc.emp { cursor: default; }
.dot { position: absolute; top: 3px; right: calc(50% - 17px); width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.dot.y { background: var(--yellow); }
.cal.light { color: #000; background: var(--bg); border-radius: 12px; padding-top: 4px; }
.cal.light .arr { color: #000; }
.cal.light .dc.off b, .cal.light .dc.pa b { color: #c7c7cc; }
.cal.light .dc.today:not(.sel) b { box-shadow: inset 0 0 0 1.5px #00000020; }

/* Содержимое */
.content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 14px 120px; position: relative; }
.view { display: none; flex-direction: column; flex: 1; min-height: 0; }
.view.on { display: flex; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dh { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 10px; gap: 8px; }
.dh .d { font-size: 18px; font-weight: 600; }
.dh .n { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sec { font-size: 12px; color: var(--muted-2); margin: 16px 4px 6px; text-transform: uppercase; letter-spacing: .3px; display: flex; justify-content: space-between; align-items: center; }
.sec:first-child { margin-top: 0; }
.sec button { color: var(--blue); text-transform: none; letter-spacing: 0; font-size: 13px; }

.sg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.sl {
  height: 40px; border-radius: 10px; background: var(--card); font-size: 16px; font-weight: 600; color: #000;
  transition: transform .15s, background .2s, color .2s; animation: pop .3s var(--ease) both;
}
.sl:active { transform: scale(.94); }
.sl.aq { background: var(--blue-bg); color: var(--blue); }
.sl.bz { background: #e5e5ea; color: #aeaeb2; text-decoration: line-through; cursor: default; }
.sl.on, .sl.me { background: var(--green); color: #fff; }
.sl.me.p { background: #8fdca6; }
.sl.me { cursor: default; }
.lg { display: flex; gap: 14px; margin: 12px 2px 0; font-size: 12px; color: var(--muted-2); flex-wrap: wrap; }
.lg span { display: flex; align-items: center; gap: 6px; }
.lg i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.card { background: var(--card); border-radius: 12px; }
.mine { background: var(--card); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; animation: pop .3s both; }
.mine .ic { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mine .ic svg.i { width: 18px; height: 18px; }
.nm { font-size: 15px; font-weight: 600; }
.sub { font-size: 13px; color: var(--muted); }
.msg { background: var(--card); border-radius: 12px; padding: 18px 16px; text-align: center; color: var(--muted-2); font-size: 15px; line-height: 1.45; }
.msg svg.i { width: 28px; height: 28px; display: block; margin: 0 auto 6px; color: #aeaeb2; }

.warn {
  position: absolute; left: 14px; right: 14px; bottom: calc(118px + var(--sab)); z-index: 3;
  background: var(--yellow-bg); color: var(--yellow-d); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.4;
  display: flex; gap: 8px; align-items: flex-start; transform: translateY(16px); opacity: 0; pointer-events: none;
  transition: all .3s var(--ease);
}
.warn.show { transform: none; opacity: 1; }
.warn svg.i { width: 18px; height: 18px; }
.cta {
  position: absolute; left: 14px; right: 14px; bottom: calc(64px + var(--sab)); height: 48px; border-radius: 13px; z-index: 4;
  background: var(--green); color: #fff; font-size: 17px; font-weight: 600;
  transform: translateY(160px); transition: transform .38s var(--ease), background .2s;
}
.cta.show { transform: none; }
.cta:active { background: #28b052; }
.cta.busy { opacity: .7; pointer-events: none; }

/* Таб-бар */
.tb { background: #000; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 6px 0 calc(6px + var(--sab)); flex-shrink: 0; z-index: 5; }
.tb button { text-align: center; color: var(--muted); font-size: 11px; line-height: 1.2; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tb button svg.i { width: 24px; height: 24px; }
.tb .on { color: var(--yellow); }
.tb .on:before { content: ""; position: absolute; top: -6px; left: 14%; right: 14%; height: 2px; background: var(--yellow); }
.bdg {
  position: absolute; top: -3px; left: calc(50% + 5px); background: #ff3b30; color: #fff; font-size: 11px; font-weight: 600;
  min-width: 17px; height: 17px; border-radius: 9px; line-height: 17px; padding: 0 5px; transition: transform .3s var(--spring);
}
.bdg.hide { transform: scale(0); }

/* Формы */
.h1 { font-size: 22px; font-weight: 700; margin: 2px 4px 0; }
.h2 { font-size: 13px; color: var(--muted); margin: 3px 4px 14px; line-height: 1.4; }
.grp { background: var(--card); border-radius: 12px; overflow: hidden; }
.row { position: relative; min-height: 46px; display: flex; align-items: center; padding: 0 14px; gap: 10px; }
.row + .row:before, .kid .row:before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: .5px solid var(--line); }
.row input, .row textarea, .row select { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; padding: 12px 0; }
.row input::placeholder, .row textarea::placeholder { color: #aeaeb2; }
.row textarea { resize: none; min-height: 110px; line-height: 1.4; }
.opt { cursor: pointer; }
.opt:active { background: #f2f2f7; }
.oi { width: 30px; height: 30px; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--muted-2); flex-shrink: 0; }
.oi svg.i { width: 18px; height: 18px; }
.ck { margin-left: auto; width: 23px; height: 23px; border-radius: 50%; border: 1.5px solid #c7c7cc; display: flex; align-items: center; justify-content: center; color: #fff; transition: all .2s; flex-shrink: 0; }
.ck svg.i { width: 15px; height: 15px; stroke-width: 3; transform: scale(0); transition: transform .2s var(--spring); }
.ck.on { background: var(--green); border-color: var(--green); }
.ck.on svg.i { transform: scale(1); }
.ck.sq { border-radius: 6px; margin: 0; }
.kid { overflow: hidden; max-height: 0; transition: max-height .35s var(--ease); }
.kid.show { max-height: 100px; }
.err { font-size: 13px; color: var(--red); margin: 6px 4px 0; min-height: 16px; }
.pd { display: flex; gap: 12px; align-items: center; padding: 12px 14px; font-size: 14px; line-height: 1.35; color: #3a3a3c; cursor: pointer; }
.btn {
  display: block; width: 100%; height: 48px; border-radius: 13px; background: var(--green); color: #fff; font-size: 17px; font-weight: 600;
  transition: opacity .2s, transform .15s;
}
.btn:active { transform: scale(.98); }
.btn.dis { opacity: .4; }
.btn.y { background: var(--yellow); color: #000; }
.btn.g2 { background: var(--card); color: var(--blue); }
.bottom { padding: 12px 14px calc(14px + var(--sab)); flex-shrink: 0; }

/* Уведомления */
.nt { background: var(--card); border-radius: 12px; padding: 11px 13px; margin-bottom: 8px; animation: pop .3s both; }
.nt.new { box-shadow: inset 3px 0 0 var(--green); }
.bd { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.nt p { margin: 6px 0 4px; font-size: 15px; line-height: 1.4; white-space: pre-line; }
.nt small { font-size: 12px; color: var(--muted); }
.soc { display: flex; justify-content: center; gap: 18px; padding: 10px 0; flex-shrink: 0; background: var(--bg); border-top: .5px solid var(--line); }
.soc:empty { display: none; }
.soc a { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; transition: transform .15s; }
.soc a:active { transform: scale(.9); }
.soc svg { width: 26px; height: 26px; fill: #fff; }

/* Расписание клуба */
.ws { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0 8px 10px; }
.ws button { color: #fff; height: 40px; border-radius: 10px; font-size: 15px; font-weight: 500; transition: background .2s; }
.ws button.on { background: var(--dark-2); }
.cls { background: var(--card); border-radius: 12px; overflow: hidden; }
.cl { display: flex; align-items: center; min-height: 62px; padding: 10px 16px 10px 18px; position: relative; border-left: 4px solid; }
.cl + .cl:after { content: ""; position: absolute; top: 0; left: 12px; right: 0; border-top: .5px solid var(--line); }
.cl .n { font-size: 16px; font-weight: 500; }
.cl .tm { margin-left: auto; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.c-z { border-color: #ffc44d; } .c-b { border-color: #5aa8f6; } .c-k { border-color: #ff6b6b; } .c-c { border-color: #1fbf75; } .c-t { border-color: #6fe3b5; }

/* Списки (админка) */
.lst { background: var(--card); border-radius: 12px; overflow: hidden; animation: pop .3s both; }
.bk { display: flex; align-items: center; gap: 11px; padding: 9px 14px; position: relative; cursor: pointer; transition: background .15s; }
.bk + .bk:before { content: ""; position: absolute; top: 0; left: 58px; right: 0; border-top: .5px solid var(--line); }
.bk:active { background: #f2f2f7; }
.bk.req { background: #fff8e1; }
.bk.new { animation: flash 1.4s ease; }
@keyframes flash { 0% { background: var(--green-bg); } 100% { background: #fff; } }
.av { width: 34px; height: 34px; border-radius: 50%; background: #e5e5ea; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--muted-2); flex-shrink: 0; }
.bk.req .av { background: #ffe08a; color: var(--yellow-d); }
.bk .tx { min-width: 0; }
.bk .nm { text-transform: uppercase; font-size: 14px; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk .tm { margin-left: auto; font-size: 16px; font-variant-numeric: tabular-nums; padding-left: 8px; }
.tag { display: inline-block; border-radius: 5px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.tag.a { background: #e5e5ea; color: #3a3a3c; } .tag.k { background: #fff1c2; color: var(--yellow-d); } .tag.q { background: var(--blue-bg); color: var(--blue); }
.fab {
  position: absolute; right: 16px; bottom: calc(76px + var(--sab)); width: 54px; height: 54px; border-radius: 50%; z-index: 4;
  background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px #30c85e55; transition: transform .15s;
}
.fab:active { transform: scale(.92); }
.fab svg.i { width: 28px; height: 28px; }
.search { display: flex; align-items: center; gap: 8px; background: #e3e3e8; border-radius: 10px; padding: 0 10px; height: 38px; color: var(--muted); margin-bottom: 12px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; color: #000; min-width: 0; }
.search svg.i { width: 18px; height: 18px; }

/* Нижний лист */
.dim { position: absolute; inset: 0; background: #0000; pointer-events: none; transition: background .3s; z-index: 20; }
.dim.show { background: #0006; pointer-events: auto; }
.sh {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 90%; overflow-y: auto; background: #fff; z-index: 21;
  border-radius: 16px 16px 0 0; padding: 7px 16px calc(20px + var(--sab)); transform: translateY(105%); transition: transform .42s var(--ease);
}
.sh.show { transform: none; }
.grab { width: 36px; height: 5px; border-radius: 3px; background: #d1d1d6; margin: 0 auto 12px; }
.sh h4 { margin: 0 0 8px; font-size: 19px; font-weight: 700; }
.rw { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: .5px solid var(--line); font-size: 15px; }
.rw:last-of-type { border-bottom: 0; }
.rw > span:first-child { color: var(--muted); flex-shrink: 0; }
.rw > span:last-child { text-align: right; }
.bts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.bt { height: 46px; border-radius: 12px; font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; transition: transform .15s; }
.bt:active { transform: scale(.97); }
.bt.w { grid-column: 1 / 3; }
.bt.gr { background: var(--green); color: #fff; } .bt.rd { background: var(--red-bg); color: var(--red); }
.bt.gy { background: var(--bg); color: var(--blue); } .bt.yl { background: var(--yellow); color: #000; }
.bt svg.i { width: 18px; height: 18px; }
.hg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.hg .sl { height: 38px; font-size: 15px; background: var(--bg); }
.hg .sl.bz { text-decoration: none; background: #fff1c2; color: var(--yellow-d); cursor: pointer; }
.hg .sl.aq { background: var(--blue-bg); }
.hg .sl.on { background: var(--green); color: #fff; }
.occ { margin-top: 10px; font-size: 14px; line-height: 1.8; color: #3a3a3c; }
.sug { background: var(--bg); border-radius: 10px; margin-top: 6px; overflow: hidden; }
.sug button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-bottom: .5px solid var(--line); }
.sug button:last-child { border: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #e3e3e8; border-radius: 9px; padding: 2px; margin-bottom: 10px; }
.seg button { height: 32px; border-radius: 7px; font-size: 14px; font-weight: 500; transition: background .2s; }
.seg button.on { background: #fff; box-shadow: 0 1px 3px #0002; }

.toast {
  position: absolute; top: calc(var(--sat) + 56px); left: 50%; transform: translate(-50%, -20px); max-width: calc(100% - 32px);
  background: #1c1c1ee6; color: #fff; font-size: 14px; padding: 10px 16px; border-radius: 12px; opacity: 0; text-align: center;
  transition: all .3s var(--ease); z-index: 40; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #d70015ee; }
.empty { background: var(--card); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); font-size: 15px; }
.spin { width: 22px; height: 22px; border: 2.5px solid #d1d1d6; border-top-color: var(--muted); border-radius: 50%; animation: rot .8s linear infinite; margin: 24px auto; }
@keyframes rot { to { transform: rotate(360deg); } }

/* Заставка */
.splash { position: fixed; inset: 0; background: #373941; z-index: 100; display: flex; align-items: center; justify-content: center; transition: opacity .45s ease; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash .lg0 { position: relative; width: min(78vw, 340px); aspect-ratio: 1; }
.splash img, .splash canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.splash img[hidden] { display: none; }
.sl.aqx { background: #eef3f9; color: #b5c6da; cursor: default; }
.mine .mx { margin-left: auto; flex-shrink: 0; height: 32px; padding: 0 12px; border-radius: 9px; background: var(--bg); color: var(--red); font-size: 14px; font-weight: 600; transition: background .2s, color .2s; }
.mine .mx.sure { background: var(--red); color: #fff; }
.dc.pk:not(.sel) b { background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 11px; border-radius: 15px; background: var(--blue-bg); color: var(--blue); font-size: 14px; font-weight: 600; }
.chip.cur { background: var(--green); color: #fff; }
.chip b { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #ffffff80; font-size: 13px; line-height: 1; }
.hint { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 10px 8px 10px 10px; margin-bottom: 12px; font-size: 13px; line-height: 1.4; color: #3a3a3c; animation: pop .3s both; }
.hint img { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.hint button { width: 30px; height: 30px; flex-shrink: 0; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.hint button svg.i { width: 18px; height: 18px; }
