@font-face { font-family: "Golos"; src: url("fonts/golos-cyrillic.woff2") format("woff2"); font-weight: 400 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116, U+20B8; }
@font-face { font-family: "Golos"; src: url("fonts/golos-latin.woff2") format("woff2"); font-weight: 400 900; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-2193, U+2212; }

:root {
  color-scheme: light;
  --solid: #2563eb; --bright: #7fb0ff; --on-bright: #0b1220;
  --bg: #f2f3f5; --surface: #ffffff; --surface-2: #e9ebef; --text: #15171c; --muted: #626875; --line: #e2e4e9;
  --ink: #16181f; --on-ink: #f4f5f7; --on-ink-muted: #a6abb7;
  --primary: var(--solid); --on-primary: #ffffff; --current: var(--solid); --on-current: #ffffff;
  --bad: #b3261e; --bad-bg: #fbe9e7; --good: #14713f; --good-bg: #e2f4e8; --warn: #805400; --warn-bg: #fbf0d2;
  --free: #ffffff; --on-free: #15171c; --busy: var(--solid); --on-busy: #ffffff; --off: transparent; --on-off: #8b909c; --lock: #fbe0dc; --on-lock: #a3231b;
  --shadow: 0 1px 2px rgb(22 24 31 / .05), 0 6px 20px rgb(22 24 31 / .05);
}
:root[data-accent="orange"] { --solid: #c2410c; --bright: #ff9a4d; --on-bright: #1f1005; }
:root[data-accent="violet"] { --solid: #6d3fe0; --bright: #b79dff; --on-bright: #150b2e; }
:root[data-accent="mono"] { --solid: #16181f; --bright: #ffffff; --on-bright: #16181f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #0f1115; --surface: #191c22; --surface-2: #262a32; --text: #f0f1f4; --muted: #a0a5b1; --line: #2e323b;
  --ink: #20242c; --on-ink: #f4f5f7; --on-ink-muted: #a6abb7;
  --primary: var(--bright); --on-primary: var(--on-bright); --current: var(--bright); --on-current: var(--on-bright);
  --bad: #ff9c92; --bad-bg: #3b1d1a; --good: #79dca0; --good-bg: #15301f; --warn: #f0c76f; --warn-bg: #352a12;
  --free: #232730; --on-free: #f0f1f4; --busy: var(--bright); --on-busy: var(--on-bright); --off: transparent; --on-off: #6f7582; --lock: #4a211d; --on-lock: #ffb1a8;
  --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115; --surface: #191c22; --surface-2: #262a32; --text: #f0f1f4; --muted: #a0a5b1; --line: #2e323b;
  --ink: #20242c; --on-ink: #f4f5f7; --on-ink-muted: #a6abb7;
  --primary: var(--bright); --on-primary: var(--on-bright); --current: var(--bright); --on-current: var(--on-bright);
  --bad: #ff9c92; --bad-bg: #3b1d1a; --good: #79dca0; --good-bg: #15301f; --warn: #f0c76f; --warn-bg: #352a12;
  --free: #232730; --on-free: #f0f1f4; --busy: var(--bright); --on-busy: var(--on-bright); --off: transparent; --on-off: #6f7582; --lock: #4a211d; --on-lock: #ffb1a8;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 "Golos", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 1.45rem; font-weight: 750; letter-spacing: -.01em; margin: .25rem 0 .75rem; }
h2 { font-size: 1.02rem; font-weight: 700; margin: 0 0 .7rem; }
p { margin: .25rem 0 .75rem; }
a { color: inherit; }
summary { cursor: pointer; font-weight: 600; padding: .35rem 0; }
[hidden] { display: none !important; }

/* ----- шапка ----- */
.top { position: sticky; top: 0; z-index: 5; display: flex; gap: .6rem; align-items: center; padding: .55rem 16px; padding-top: max(.55rem, env(safe-area-inset-top)); background: var(--bg); }
.mark { flex: none; width: 34px; height: 34px; border-radius: 11px; background: var(--ink); display: grid; place-items: center; }
.mark svg { width: 20px; height: 20px; fill: none; stroke: var(--bright); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.top .brand { font-weight: 750; font-size: 1.05rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
select.club { flex: 0 1 auto; min-width: 0; width: auto; max-width: 100%; margin: 0; min-height: 38px; padding: .25rem 1.8rem .25rem .7rem; border: 0; border-radius: 11px; background-color: var(--surface-2); font-weight: 650; }
.who { flex: none; margin-left: auto; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); font: inherit; font-weight: 750; cursor: pointer; }
.who[aria-current="page"] { background: var(--current); color: var(--on-current); }

/* ----- навигация ----- */
.tabs { display: flex; gap: 4px; margin: 0 16px; padding: 4px; background: var(--surface-2); border-radius: 13px; overflow-x: auto; }
.tabs button { flex: 1 1 auto; background: none; border: 0; color: var(--muted); padding: .35rem .5rem; border-radius: 10px; font: inherit; font-size: .9rem; font-weight: 600; min-height: 38px; white-space: nowrap; cursor: pointer; }
.tabs button[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.bottom button { flex: 1 1 0; max-width: 110px; min-width: 0; min-height: 52px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: none; border: 0; color: var(--muted); font: inherit; font-size: .7rem; font-weight: 600; cursor: pointer; }
.bottom svg { width: 40px; height: 28px; padding: 3px 9px; border-radius: 10px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.bottom button[aria-current="page"] { color: var(--text); font-weight: 750; }
.bottom button[aria-current="page"] svg { background: var(--current); color: var(--on-current); }

/* ----- основа ----- */
main { max-width: 720px; margin: 0 auto; padding: 14px 16px 32px; }
main.wide { max-width: 1000px; }
main.with-bottom { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.card, .item, .stat { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); }
.card { padding: 16px; margin-bottom: 12px; }
.item { display: block; width: 100%; text-align: left; font: inherit; color: inherit; border: 0; padding: 13px 15px; margin-bottom: 8px; }
button.item { cursor: pointer; }
button.item:active { transform: scale(.99); }
.item.is-bad { box-shadow: inset 4px 0 0 var(--bad), var(--shadow); }
.item.is-warn { box-shadow: inset 4px 0 0 var(--warn), var(--shadow); }
.item.is-good { box-shadow: inset 4px 0 0 var(--good), var(--shadow); }
.center { max-width: 400px; margin: 0 auto; padding: 12vh 16px 32px; }
.center .mark { width: 54px; height: 54px; border-radius: 17px; margin-bottom: 1rem; }
.center .mark svg { width: 32px; height: 32px; }
.center h1 { font-size: 1.8rem; margin-bottom: .25rem; }
.hero { background: var(--ink); color: var(--on-ink); border-radius: 20px; padding: 18px; margin-bottom: 12px; }
.hero .muted { color: var(--on-ink-muted); }
.hero .big { font-size: 2.3rem; color: var(--bright); margin: .1rem 0 .3rem; }
.delta { display: inline-block; flex: none; white-space: nowrap; padding: .12rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 650; background: rgb(255 255 255 / .1); color: var(--on-ink); }
.delta.up { color: var(--bright); }
.delta.down { color: #ffb4a9; }
.muted { color: var(--muted); font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.big { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.row { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; flex-wrap: nowrap; }
.row.between > :first-child { min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stat { padding: 12px 14px; min-width: 0; }
.stat .v { font-size: 1.2rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.line { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line > :first-child { min-width: 0; overflow-wrap: anywhere; }
.line b { font-weight: 650; flex: none; }

/* ----- формы ----- */
label { display: block; font-size: .85rem; font-weight: 550; color: var(--muted); margin-bottom: .8rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; padding: .65rem .8rem; font: inherit; font-size: 16px; font-weight: 500; color: var(--text); background: var(--surface-2); border: 1.5px solid transparent; border-radius: 12px; min-height: 46px; }
input::placeholder, textarea::placeholder { color: var(--muted); font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--current); background: var(--surface); }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--current); outline-offset: 2px; }
input[type="checkbox"] { display: inline-block; width: 22px; height: 22px; min-height: 0; margin: 0 .5rem 0 0; vertical-align: -5px; accent-color: var(--current); }
input[type="file"] { padding: .55rem; }
textarea { min-height: 96px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .5rem 1.1rem; border: 0; border-radius: 13px; background: var(--surface-2); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 38px; padding: .3rem .85rem; font-size: .875rem; border-radius: 11px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.barline { display: grid; grid-template-columns: 1fr 92px; gap: .75rem; align-items: center; padding: .2rem 0; margin-bottom: .25rem; color: var(--text); font-size: .95rem; }
.barline input { margin: 0; text-align: right; }
.expense { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .3rem; }

/* ----- метки и сообщения ----- */
.tag { display: inline-block; flex: none; white-space: nowrap; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--surface-2); color: var(--muted); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.msg { padding: .7rem .9rem; border-radius: 13px; margin-bottom: .8rem; font-size: .92rem; font-weight: 500; }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.msg.good { background: var(--good-bg); color: var(--good); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.segment { display: flex; gap: 4px; background: var(--surface-2); border-radius: 13px; padding: 4px; margin-bottom: 12px; }
.segment button { flex: 1; min-height: 38px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .9rem; font-weight: 600; border-radius: 10px; cursor: pointer; }
.segment button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; }
img.photo { max-width: 100%; border-radius: 13px; }
.empty { text-align: center; color: var(--muted); padding: 2rem .5rem; }
.card.empty { padding: 1.5rem 1rem; }
details.card > summary, .card details > summary { list-style-position: inside; }
.card details { border-top: 1px solid var(--line); padding: .35rem 0; }
.account .big { margin-bottom: .1rem; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .6rem .2rem; border: 0; border-radius: 13px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; min-width: 0; }
.swatch i { width: 26px; height: 26px; border-radius: 50%; }
.swatch i.blue { background: #2563eb; } .swatch i.orange { background: #c2410c; } .swatch i.violet { background: #6d3fe0; } .swatch i.mono { background: #16181f; box-shadow: inset 0 0 0 1.5px #6f7582; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--current); outline-offset: 1px; }

/* ----- клуб сейчас ----- */
.live-head { margin-bottom: 10px; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; margin-bottom: 14px; }
.pc { aspect-ratio: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px; border: 0; border-radius: 15px; font: inherit; cursor: pointer; background: var(--free); color: var(--on-free); }
.pc.free { box-shadow: inset 0 0 0 1.5px var(--line); }
.pc.off { box-shadow: inset 0 0 0 1.5px var(--line); }
.pc b { font-size: 1.05rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.pc small { font-size: .66rem; font-weight: 600; opacity: .85; white-space: nowrap; }
.pc.busy { background: var(--busy); color: var(--on-busy); }
.pc.off { background: var(--off); color: var(--on-off); }
.pc.locked { background: var(--lock); color: var(--on-lock); }
.pc[aria-pressed="true"] { outline: 3px solid var(--text); outline-offset: 1px; }
.sheet { position: fixed; left: 8px; right: 8px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 5; max-width: 560px; margin: 0 auto; background: var(--surface); border-radius: 20px; padding: 16px; box-shadow: 0 8px 32px rgb(0 0 0 / .28); border: 1px solid var(--line); }
.sheet .row { margin-top: .5rem; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: -4px 0 12px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: .3rem; vertical-align: -1px; background: var(--free); }
.legend i.free { box-shadow: inset 0 0 0 1.5px var(--muted); background: var(--free); }
.legend i.busy { background: var(--busy); }
.legend i.off { background: var(--off); border: 1px solid var(--line); }
.legend i.locked { background: var(--lock); }

@media (max-width: 400px) { .grid2 { grid-template-columns: 1fr; } .hero .big { font-size: 2.05rem; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; transform: none !important; } }
/* загрузка по часам: цвет клетки от процента (--p) */
.heatmap { font-size: .72rem; min-width: 640px; table-layout: fixed; }
.heatmap th, .heatmap td { padding: 0; text-align: center; height: 26px; border: 1px solid var(--surface); }
.heatmap thead th { color: var(--muted); font-weight: 500; }
.heatmap tbody th { width: 30px; color: var(--muted); font-weight: 600; }
.heatmap td.heat { background: color-mix(in srgb, var(--current) calc(var(--p) * 1%), var(--surface-2)); color: var(--text); font-variant-numeric: tabular-nums; }
.heatmap td.heat.hi { color: var(--on-current); font-weight: 650; }
