/* Sport Zal Mini App: graphite, chalk-white text, a lime accent for "go", amber and coral for busy and refused. */
:root {
  --bg: #0f1214; --panel: #171b1e; --panel2: #1d2226; --line: #2a3137; --ink: #eef2ef; --muted: #8e999f;
  --lime: #c6f24e; --lime-ink: #142006; --amber: #ffb547; --coral: #ff6a55; --cyan: #5bd5e8;
  --r: 16px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
.g-root { height: 100%; }
.g-outside { margin: 0; padding: 28px 22px 0; color: var(--muted); text-align: center; }
.app { display: flex; flex-direction: column; height: 100%; max-width: 560px; margin: 0 auto; background: var(--bg); position: relative; overflow: hidden; }
.app-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; }
.app-brand b { display: block; font-size: 17px; letter-spacing: .2px; }
.app-brand small { color: var(--muted); font-size: 12px; }
.lang-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.app-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px 18px; scrollbar-width: none; }
.app-body::-webkit-scrollbar { display: none; }
.app-tabs { display: flex; border-top: 1px solid var(--line); background: var(--panel); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 6px 2px; border-radius: 12px; cursor: pointer; }
.tab-ico svg { width: 22px; height: 22px; display: block; }
.tab.on { color: var(--lime); background: rgba(198, 242, 78, .08); }
.screen h2 { font-size: 20px; margin: 10px 2px 10px; letter-spacing: -.2px; }
.screen h2.mt { margin-top: 26px; }
.screen h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 18px 4px 8px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 4px 12px; }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 10px 0; }
.card.warn { border-color: rgba(255, 181, 71, .45); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row h2 { margin: 0; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.pill.good { background: rgba(198, 242, 78, .14); color: var(--lime); }
.pill.warn { background: rgba(255, 181, 71, .14); color: var(--amber); }
.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; cursor: pointer; width: 100%; margin-top: 12px; transition: transform .08s ease, filter .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--lime); color: var(--lime-ink); }
.btn.ghost { background: var(--panel2); border: 1px solid var(--line); }
.btn.danger { background: var(--coral); color: #2a0703; }
.btn.small { width: auto; margin: 0; padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; }

/* live card */
.live-card { background: radial-gradient(120% 90% at 0% 0%, #1d2427 0%, var(--panel) 60%); border: 1px solid var(--line); border-radius: 20px; padding: 14px 14px 10px; margin: 6px 0 10px; }
.live-title { font-size: 22px !important; margin: 2px 2px 4px !important; }
.live-row { display: flex; align-items: center; gap: 10px; }
.gauge { width: 62%; max-width: 220px; height: auto; }
.g-zone { fill: none; stroke-width: 12; stroke-linecap: butt; opacity: .22; }
.z-low { stroke: var(--lime); } .z-mid { stroke: var(--amber); } .z-high { stroke: var(--coral); }
.g-fill { fill: none; stroke-width: 12; stroke-linecap: round; stroke: var(--lime); transition: d .5s ease; }
.lvl-mid .g-fill { stroke: var(--amber); } .lvl-high .g-fill { stroke: var(--coral); }
.g-knob { fill: var(--ink); stroke: var(--bg); stroke-width: 3; }
.g-num { font-size: 38px; font-weight: 800; fill: var(--ink); letter-spacing: -1px; }
.g-cap { font-size: 11px; fill: var(--muted); }
.live-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.level-chip { font-weight: 800; font-size: 15px; padding: 6px 12px; border-radius: 999px; background: rgba(198, 242, 78, .15); color: var(--lime); }
.level-chip.lvl-mid { background: rgba(255, 181, 71, .15); color: var(--amber); }
.level-chip.lvl-high { background: rgba(255, 106, 85, .16); color: var(--coral); }
.live-pct { font-size: 13px; color: var(--muted); padding-left: 4px; }
.fc { width: 100%; height: auto; margin-top: 8px; }
.fc-bar { fill: #3a434a; } .fc-bar.past { fill: #262d32; } .fc-bar.quiet { fill: var(--lime); } .fc-bar.now { fill: var(--ink); }
.fc-bar.quiet.past { fill: #4c5d24; }
.fc-now { stroke: var(--ink); stroke-dasharray: 2 3; opacity: .5; }
.fc-busy { stroke: var(--coral); stroke-dasharray: 4 4; opacity: .35; }
.fc-x { font-size: 10px; fill: var(--muted); }
.live-quiet { margin: 6px 2px 2px; font-weight: 700; color: var(--lime); }
.live-note { margin: 2px 2px 4px; font-size: 12px; color: var(--muted); }

/* abonement */
.abon-mini b { font-size: 16px; }
.abon-nums { display: flex; gap: 10px; margin-top: 10px; }
.abon-nums > div { flex: 1; background: var(--panel2); border-radius: 12px; padding: 10px; }
.abon-nums strong { display: block; font-size: 22px; letter-spacing: -.4px; }
.abon-nums.big strong { font-size: 28px; }
.abon-nums small { color: var(--muted); font-size: 12px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 0; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; text-align: right; }
.frozen-line { color: var(--cyan); font-weight: 700; margin: 12px 0 0; }
.plans { list-style: none; padding: 0; margin: 12px 0 0; }
.plans li { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0; }
.stepper-n { font-size: 22px; min-width: 90px; text-align: center; }
.chips, .segs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chip, .seg { border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.seg { border-radius: 10px; flex: 1; }
.chip.on, .seg.on { border-color: var(--lime); color: var(--lime); }
.fz-preview { background: rgba(91, 213, 232, .08); border: 1px solid rgba(91, 213, 232, .3); color: var(--ink); border-radius: 12px; padding: 10px; font-size: 14px; }

/* QR */
.qr-screen { text-align: center; }
.qr-wrap { position: relative; width: 252px; height: 252px; margin: 8px auto 6px; }
.qr-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 3; }
.ring-fg { fill: none; stroke: var(--lime); stroke-width: 3.2; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring-fg.low { stroke: var(--amber); }
.qr-frame { position: absolute; inset: 22px; background: #fff; border-radius: 18px; display: grid; place-items: center; overflow: hidden; }
.qr-frame canvas { display: block; }
.qr-meta { display: flex; justify-content: center; gap: 14px; align-items: baseline; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.qr-code { color: var(--ink); font: 700 17px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1.5px; }
.qr-secs { min-width: 64px; }
.qr-abon { font-weight: 600; margin: 14px 8px 4px; }
.qr-abon.warn { color: var(--amber); }

/* classes */
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.class-row { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.class-row.me-booked { border-color: rgba(198, 242, 78, .5); }
.class-row.me-wait { border-color: rgba(255, 181, 71, .5); }
.class-time { min-width: 54px; } .class-time b { font-size: 17px; display: block; } .class-time small { color: var(--muted); font-size: 11px; }
.class-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.class-main small { color: var(--muted); font-size: 12px; }
.class-act { flex-shrink: 0; }
.places { height: 5px; background: var(--panel2); border-radius: 3px; overflow: hidden; margin-top: 2px; }
.places i { display: block; height: 100%; background: var(--lime); border-radius: 3px; }
.places.full i { background: var(--coral); }
.t-row { flex-direction: column; align-items: stretch; }
.t-head { display: flex; gap: 12px; align-items: center; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; width: 100%; }
.people { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.person { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.person b { display: block; font-size: 14px; } .person small { color: var(--muted); font-size: 12px; margin-right: 6px; }
.person.st-wait { opacity: .7; }
.mark { display: flex; gap: 6px; }
.slot-form .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
select, input { width: 100%; min-width: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }

.g-toasts { position: absolute; left: 12px; right: 12px; bottom: 76px; display: grid; gap: 6px; pointer-events: none; z-index: 5; }
.g-toast { background: #22292e; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); transition: opacity .4s, transform .4s; }
.g-toast.good { border-color: rgba(198, 242, 78, .6); } .g-toast.bad { border-color: rgba(255, 106, 85, .7); }
.g-toast.out { opacity: 0; transform: translateY(6px); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.abon-nums > div:last-child strong { font-size: 16px; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
