:root {
    --bg: #09090a; --card: #121214; --card2: #18181b; --line: #27272c; --txt: #f4f4f2; --mut: #8f8f98;
    --acc: #6dff7d; --onacc: #06240a; --bad: #ff5d4d; --ok: #4cd964; --r: 14px;
    color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; scrollbar-width: thin; scrollbar-color: #3a3a42 transparent; }
html, body { margin: 0; background: var(--bg); color: var(--txt); font: 15px/1.4 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--acc); }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.02em; }
p { margin: 0 0 10px; }
.mut { color: var(--mut); } .sm { font-size: 13px; } .xs { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.center { text-align: center; } .acc { color: var(--acc); } .error { color: var(--bad); } .success { color: var(--ok); } .no-margin { margin: 0; }
.loading { text-align: center; color: var(--mut); padding: 40px 16px; }

.landing { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.card-narrow { max-width: 420px; width: 100%; }
.row { display: flex; align-items: center; gap: 8px; } .row.sp { justify-content: space-between; }

label.f, .f { display: block; font-size: 13px; color: var(--mut); margin: 0 0 6px; }
input { width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; color: var(--txt); font: inherit; padding: 14px; outline: 0; }
input:focus { border-color: var(--acc); }
select { width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; color: var(--txt); font: inherit; padding: 14px; outline: 0; }
select:focus { border-color: var(--acc); }
.hint { font-size: 12px; color: var(--mut); margin: 6px 0 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; background: var(--acc); color: var(--onacc); border: 0; border-radius: 12px;
       font: inherit; font-weight: 700; padding: 14px 18px; cursor: pointer; text-decoration: none; }
.btn.block { width: 100%; }
.btn.sec { background: var(--card2); color: var(--txt); border: 1px solid var(--line); }
.btn:disabled { opacity: .6; cursor: default; }
.lnk { background: none; border: 0; color: var(--acc); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 0; text-decoration: none; }

.dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 99px; background: #2a2a30; }
.dots i.on { width: 34px; background: var(--acc); } .dots i.done { background: var(--acc); }

.panel { max-width: 720px; margin: 0 auto; padding: 28px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--mut); }
.chip.ok { color: var(--ok); border-color: #1f4a2a; background: #0f2415; }

#blazor-error-ui { background: #2a1210; color: var(--txt); bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.4); display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

@media (max-width: 560px) { .hide-narrow { display: none; } }
.panel.wide { max-width: 1100px; }
.row.wrap { flex-wrap: wrap; } .grow { flex: 1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type="time"], input[type="number"] { width: 100%; }
input[type="checkbox"] { width: auto; }
.chk { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.hint.center { text-align: center; }

.bar { height: 6px; background: #2a2a30; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--acc); border-radius: 99px; transition: width .2s; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { background: var(--card2); color: var(--txt); border: 1px solid var(--line); border-radius: 99px; font: inherit; font-weight: 600; padding: 10px 16px; cursor: pointer; }
.pill.on { background: var(--acc); color: var(--onacc); border-color: var(--acc); }
.counter { justify-content: center; gap: 22px; } .counter .btn { width: 56px; font-size: 22px; } .count { font-size: 40px; min-width: 60px; text-align: center; }
.sum { display: flex; flex-direction: column; gap: 14px; } .sum > div { border-bottom: 1px solid var(--line); padding-bottom: 12px; }

.card.off { opacity: .6; } .card.inner { background: var(--card2); }
.rule { padding: 8px 0; border-bottom: 1px solid var(--line); }
.btn.danger { background: #3a1511; color: var(--bad); border: 1px solid #5a2019; } .danger-text { color: var(--bad); }
.chip.warn { color: #ffb74d; border-color: #5a4216; background: #1d1608; }

.slot { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 14px;
        width: 100%; color: var(--txt); font: inherit; text-align: left; cursor: pointer; min-height: 56px; }
.slot .t { font-weight: 700; min-width: 48px; font-variant-numeric: tabular-nums; } .slot .p { margin-left: auto; font-weight: 800; font-size: 17px; }
.slot.libre { border-color: color-mix(in srgb, var(--acc) 55%, transparent); background: color-mix(in srgb, var(--acc) 8%, var(--card)); } .slot.libre .p { color: var(--acc); }
.slot.past { opacity: .38; cursor: default; } .slot.busy { background: #0e0e10; } .slot.pend { border-color: #5a4216; background: #1d1608; }
.slot.mine { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 16%, var(--card)); cursor: default; } .slot.mine .t, .slot.mine .grow { color: var(--acc); font-weight: 700; }
.slot.block { background: repeating-linear-gradient(45deg, #101012, #101012 8px, #151518 8px, #151518 16px); color: var(--mut); }

.tg { border: 1px solid var(--line); border-radius: var(--r); overflow: auto; max-height: calc(100vh - 340px); min-height: 420px; background: #050506; }
.tg-in { display: grid; grid-template-columns: 56px repeat(var(--n), minmax(190px, 1fr)); min-width: max-content; }
.tg-h { position: sticky; top: 0; z-index: 3; background: #090909; padding: 10px 14px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.tg-h b { display: block; }
.tg-corner { left: 0; z-index: 4; border-left: 0; }
.tg-axis { position: sticky; left: 0; z-index: 2; background: #070708; }
.tg-axis span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 12px; color: var(--mut); font-variant-numeric: tabular-nums; }
.tg-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 72px; background-position: 0 10px; }
.tc { position: absolute; left: 6px; right: 6px; border-radius: 12px; padding: 8px 10px; overflow: hidden; text-align: left; font: inherit; color: var(--txt); cursor: pointer;
      border: 1px solid #34343b; background: #111113; display: flex; flex-direction: column; justify-content: space-between; }
.tc .tcp { font-weight: 800; font-size: 19px; }
.tc.free { border-color: #a8372c; background: #140908; } .tc.free .row b, .tc.free .tcp { color: #ff6a5c; }
.tc.past { border: 1px dashed #2b2b30; background: transparent; color: #6f6f78; justify-content: flex-end; text-decoration: line-through; font-size: 13px; cursor: default; }
.tc.bkc { border-left: 3px solid #4a4a52; }
.tc.pend { border-color: #5a4216; background: #1d1608; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--acc); z-index: 1; opacity: .8; pointer-events: none; }
.tc.blk { background: repeating-linear-gradient(45deg, #101012, #101012 8px, #151518 8px, #151518 16px); color: var(--mut); }
.scroll-x { flex-wrap: nowrap; overflow-x: auto; } .scroll-x .pill { flex: none; white-space: nowrap; }
.btn .ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-right: 6px; }

.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); display: flex; align-items: flex-end; justify-content: center; z-index: 500; }
.sheet { background: var(--card); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 20px 16px 28px; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 20px; } }
.tabs { display: flex; gap: 6px; background: var(--card2); border-radius: 12px; padding: 4px; }
.tabs button { flex: 1; background: none; border: 0; color: var(--mut); font: inherit; font-weight: 700; padding: 10px; border-radius: 9px; cursor: pointer; }
.tabs button.on { background: var(--acc); color: var(--onacc); }
.btn.sec:disabled { opacity: .4; }

.public { max-width: 520px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.day { flex: 0 0 auto; min-width: 58px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; background: var(--card);
       color: var(--txt); border: 1px solid var(--line); border-radius: 12px; font: inherit; cursor: pointer; }
.day b { font-size: 18px; } .day.on { background: var(--acc); color: var(--onacc); border-color: var(--acc); } .day.on .xs { color: var(--onacc); }
.ac { position: relative; }
.ac-list { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--card); border: 1px solid var(--line);
           border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.ac-item { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 14px; background: none; border: 0; border-top: 1px solid var(--line);
           color: var(--txt); font: inherit; text-align: left; cursor: pointer; }
.ac-item:first-child { border-top: 0; } .ac-item:hover, .ac-item:focus { background: var(--card2); }
.hint.error { color: var(--bad); }
input[readonly] { color: var(--mut); }

h1:focus { outline: none; }
.block-text { display: block; margin-top: 2px; }
.slot .grow { min-width: 0; }
.tbl .num { white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; max-width: 640px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 20px; } .stat.bad { border-color: #7a2e27; } .stat.bad b { color: var(--bad); }
.seg { display: flex; gap: 4px; background: var(--card2); border-radius: 12px; padding: 4px; max-width: 460px; }
.seg button { flex: 1; background: none; border: 0; color: var(--mut); font: inherit; font-weight: 700; padding: 9px 6px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--acc); color: var(--onacc); }
.settings-body { margin-top: 14px; max-width: 560px; }
.tbl { width: 100%; border-collapse: collapse; } .tbl th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); padding: 8px 6px; }
.tbl td { padding: 10px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.num, .tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.btn.sm { padding: 8px 12px; font-size: 13px; }
@media print {
    .no-print, #blazor-error-ui { display: none !important; }
    :root { --bg: #fff; --card: #fff; --card2: #fff; --line: #bbb; --txt: #000; --mut: #444; --acc: #000; --bad: #000; }
    html, body { background: #fff; color: #000; }
    .app { display: block; }
    .panel { max-width: none; padding: 0; } .stat, .card { border-color: #bbb; }
}

@media (max-width: 640px) {
    .tg { max-height: none; }
    .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .stat { padding: 10px; } .stat b { font-size: 16px; }
    .tbl.resp thead { display: none; }
    .tbl.resp, .tbl.resp tbody, .tbl.resp tr, .tbl.resp td { display: block; }
    .tbl.resp tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--card); }
    .tbl.resp td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
    .tbl.resp td::before { content: attr(data-label); color: var(--mut); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; text-align: left; }
    .tbl.resp td[data-label=""]::before { display: none; }
    .tbl.resp td[data-label=""]:first-child { display: block; text-align: left; }
    .stats.four { grid-template-columns: repeat(2, 1fr); }
}

.app { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; }
.ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -4px; }
.side { width: 250px; flex: none; background: #0d0d0f; border-right: 1px solid var(--line); padding: 14px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
        display: flex; flex-direction: column; gap: 2px; }
.side .brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.side .brand .grow { min-width: 0; } .side .brand b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { width: 36px; height: 36px; border-radius: 10px; background: var(--acc); color: var(--onacc); font-weight: 800; display: grid; place-items: center; flex: none; }
.side .nav { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; color: var(--mut);
             font: inherit; font-weight: 600; background: none; cursor: pointer; width: 100%; text-align: left; }
.side .nav:hover { background: var(--card); } .side .nav.on { background: var(--card2); color: var(--txt); border-color: var(--line); }
.side .grp { font-size: 11px; letter-spacing: .1em; color: #5d5d66; text-transform: uppercase; padding: 14px 12px 4px; }
.bnav { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: #0b0b0c; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bnav a, .bnav button { flex: 1; border: 0; background: none; color: var(--mut); font: 600 12px Inter, system-ui, sans-serif; display: flex; flex-direction: column; align-items: center;
                        gap: 3px; padding: 11px 0 9px; text-decoration: none; position: relative; cursor: pointer; min-width: 0; }
.bnav .ic { width: 24px; height: 24px; }
.bnav a.on { color: var(--acc); }
.bnav a.on::before { content: ""; position: absolute; top: 0; left: 14%; right: 14%; height: 3px; border-radius: 0 0 3px 3px; background: var(--acc); }
.mrow { display: flex; gap: 12px; align-items: center; padding: 14px 4px; text-decoration: none; color: var(--txt); font: inherit; font-weight: 500; cursor: pointer;
        background: none; border: 0; width: 100%; text-align: left; }
.mrow .ic { width: 22px; height: 22px; } .more-list { gap: 0; } .sep { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 6px 0; }
.sheet .btn.block { margin: 6px 0; }
@media (max-width: 820px) {
    .side { display: none; } .bnav { display: flex; }
    .app-main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

.club-theme { min-height: 100%; }
.club-header { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 3px solid var(--club2, var(--line)); }
.club-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: var(--card); flex: none; }
.logo-preview { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); flex: none; }
.logo-empty { display: grid; place-items: center; color: var(--mut); font-size: 12px; border-style: dashed; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.file-btn { cursor: pointer; align-self: flex-start; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--acc); }
.color-input { width: 48px; height: 40px; padding: 2px; background: var(--card2); cursor: pointer; }
.color-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--bg);
                 border: 1px solid var(--line); border-left: 6px solid var(--club2); border-radius: 12px; }
.color-preview-title { font-weight: 700; color: var(--acc); }
