/* CHIP&CHILL — стили мини-аппа. Токены сняты с Figma «Client App». */
@font-face { font-family: 'Inter Tight'; font-weight: 400; font-display: swap; src: url(../assets/fonts/inter-tight-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter Tight'; font-weight: 500; font-display: swap; src: url(../assets/fonts/inter-tight-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter Tight'; font-weight: 600; font-display: swap; src: url(../assets/fonts/inter-tight-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter Tight'; font-weight: 700; font-display: swap; src: url(../assets/fonts/inter-tight-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter Tight'; font-weight: 400; font-display: swap; src: url(../assets/fonts/inter-tight-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+20BD; }
@font-face { font-family: 'Inter Tight'; font-weight: 500; font-display: swap; src: url(../assets/fonts/inter-tight-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+20BD; }
@font-face { font-family: 'Inter Tight'; font-weight: 600; font-display: swap; src: url(../assets/fonts/inter-tight-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+20BD; }
@font-face { font-family: 'Inter Tight'; font-weight: 700; font-display: swap; src: url(../assets/fonts/inter-tight-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+20BD; }
@font-face { font-family: 'Instrument Serif'; font-weight: 400; font-display: swap; src: url(../assets/fonts/instrument-serif-latin-400-normal.woff2) format('woff2'); }

:root {
  --bg: #141414; --bg-soft: #191919; --bg-card: #1C1C1C; --bg-input: #232323; --bg-raise: #2A2A2A;
  --green: #76B287; --green-light: #D1FFCF; --green-deep: #557D60; --green-mid: #58A074;
  --red: #A40000; --red-soft: rgba(164, 0, 0, .16); --red-text: #E08585;
  --warn: #E3B341; --warn-soft: rgba(227, 179, 65, .14);
  --text: #FFFFFF; --text-soft: #E8EBE8; --text-mid: #D4D4D4; --text-dim: #888888; --text-dark: #171717;
  --stroke: rgba(118, 178, 135, .12);
  --font: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-accent: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --r-input: 10px; --r-card: 16px; --r-tabs: 22px; --r-btn: 42px; --r-nav: 24px;
  --side: 16px; --gap: 14px;
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --nav-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); height: 100%; }
body {
  font-family: var(--font); color: var(--text); font-size: 15px; line-height: 1.35;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); text-decoration: none; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* ---------- каркас ---------- */
#app { position: relative; max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.view {
  min-height: 100vh; min-height: 100dvh;
  padding: calc(var(--safe-top) + 12px) var(--side) calc(var(--nav-h) + var(--safe-bottom) + 28px);
  display: flex; flex-direction: column; gap: var(--gap);
  animation: vin .22s ease-out;
}
.view.no-nav { padding-bottom: calc(var(--safe-bottom) + 24px); }
.view.has-bar { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 96px); }
@keyframes vin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } * { transition: none !important; animation-duration: .01ms !important; } }

.top { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.top h1 { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.01em; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.top h1.sm { font-size: 22px; line-height: 28px; }
.back { width: 36px; height: 36px; margin-left: -8px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--text); }
.back:active { background: var(--bg-input); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-card); flex: none; color: var(--text-mid); position: relative; }
.icon-btn:active { background: var(--bg-input); }
.ic { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.s { width: 16px; height: 16px; }
.ic.xs { width: 14px; height: 14px; }

/* ---------- нижняя навигация ---------- */
.nav {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 520px;
  padding: 8px 12px calc(var(--safe-bottom) + 8px);
  background: linear-gradient(180deg, rgba(20,20,20,0) 0, rgba(20,20,20,.94) 22%, #141414 60%);
}
.nav-in { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--bg-card); border-radius: var(--r-nav); padding: 6px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
.nav a { height: 52px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-dim); font-size: 11px; font-weight: 600; transition: background .15s, color .15s; min-width: 0; }
.nav a .ic { width: 21px; height: 21px; }
.nav a.on { background: var(--green); color: #0F1A12; }
.nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- текст ---------- */
.serif { font-family: var(--font-accent); font-weight: 400; letter-spacing: -.01em; }
.display { font-family: var(--font-accent); font-size: 38px; line-height: 40px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.sec h2 { font-size: 18px; line-height: 24px; font-weight: 600; }
.sec a, .sec button { font-size: 13px; color: var(--green); font-weight: 600; }
.muted { color: var(--text-dim); }
.small { font-size: 12.5px; line-height: 17px; }
.note { font-size: 12.5px; line-height: 18px; color: var(--text-dim); }
.center { text-align: center; }

/* ---------- карточки и строки ---------- */
.card { background: var(--bg-card); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.tight { padding: 12px; gap: 8px; }
.card.green { box-shadow: inset 0 0 0 1.5px var(--green); }
.card.red { box-shadow: inset 0 0 0 1.5px var(--red); background: linear-gradient(180deg, rgba(164,0,0,.10), rgba(164,0,0,0) 70%), var(--bg-card); }
.card.warn { box-shadow: inset 0 0 0 1.5px var(--warn); }
/* карточка-строка */
.card.row, .card.count { flex-direction: row; align-items: center; }
button.card { width: 100%; text-align: left; color: inherit; }
.card.press { transition: transform .12s; cursor: pointer; }
.card.press:active { transform: scale(.985); }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row .grow { flex: 1; min-width: 0; }
.ttl { font-size: 15px; font-weight: 600; line-height: 20px; overflow-wrap: anywhere; }
.sub { font-size: 12.5px; color: var(--text-dim); line-height: 17px; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 52px; min-width: 0; }
.li + .li { border-top: 1px solid #242424; }
.li .grow { flex: 1; min-width: 0; }
button.li, a.li { width: 100%; text-align: left; color: inherit; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; line-height: 19px; padding: 6px 0; }
.kv .k { color: var(--text-dim); flex: none; max-width: 55%; }
.kv .v { color: var(--text-soft); text-align: right; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.kv + .kv { border-top: 1px solid #222; }

/* ---------- метки ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--bg-raise); color: var(--text-mid); white-space: nowrap; }
.tag.g { background: var(--green); color: var(--text-dark); }
.tag.live { background: var(--red); color: #fff; }
.tag.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
@keyframes blink { 50% { opacity: .25; } }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 100px; padding: 5px 11px; font-size: 12px; font-weight: 600; line-height: 15px; white-space: nowrap; background: var(--bg-raise); color: var(--text-mid); }
.pill.g { background: rgba(118,178,135,.16); color: var(--green); }
.pill.solid { background: var(--green); color: var(--text-dark); }
.pill.r { background: var(--red-soft); color: var(--red-text); }
.pill.w { background: var(--warn-soft); color: var(--warn); }
.pill.red-solid { background: var(--red); color: #fff; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: var(--r-btn);
  font-size: 16px; font-weight: 600; flex: none; text-align: center; transition: transform .1s, opacity .15s, background .15s; user-select: none; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.md { height: 42px; font-size: 14.5px; padding: 0 16px; }
.btn.sm { height: 34px; font-size: 13px; padding: 0 14px; }
.btn.primary { background: var(--green); color: #0F1A12; }
.btn.outline { box-shadow: inset 0 0 0 1.5px var(--green); color: var(--green); }
.btn.dark { background: var(--bg-raise); color: var(--text-soft); }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { color: var(--text-dim); }
.btn[disabled], .btn.dis { background: var(--bg-input); color: #5F5F5F; box-shadow: none; pointer-events: none; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(15,26,18,.25); border-top-color: #0F1A12; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btns { display: flex; gap: 10px; }
.btns > .btn { flex: 1 1 0; min-width: 0; }
.actionbar {
  position: fixed; z-index: 29; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px); padding: 10px var(--side) 4px;
  background: linear-gradient(180deg, rgba(20,20,20,0), rgba(20,20,20,.96) 30%);
}
.actionbar.no-nav { bottom: 0; padding-bottom: calc(var(--safe-bottom) + 12px); }
.actionbar .why { font-size: 12px; color: var(--text-dim); text-align: center; margin-top: 7px; }

/* ---------- сегменты / табы ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--side)); padding: 0 var(--side); flex: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { height: 32px; padding: 0 14px; border-radius: 100px; font-size: 13.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap; flex: none; box-shadow: inset 0 0 0 1px transparent; }
.chips button.on { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text-soft); }
.seg { display: flex; background: var(--bg-input); border-radius: 12px; padding: 3px; gap: 3px; flex: none; }
.seg button { flex: 1 1 0; min-width: 0; height: 34px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.seg button.on { background: var(--green); color: #0F1A12; }

/* ---------- плитки цифр ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tiles.two { grid-template-columns: repeat(2, 1fr); }
.tile { background: var(--bg-card); border-radius: 14px; padding: 12px 12px 11px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile .tk { font-size: 11px; line-height: 14px; color: var(--text-dim); }
.tile .tv { font-family: var(--font-accent); font-size: 24px; line-height: 28px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tv.g { color: var(--green-light); }
.tile .ts { font-size: 11px; color: var(--text-dim); line-height: 14px; }
.tile.in { background: var(--bg-input); }

/* ---------- карточка турнира в списке ---------- */
.tcard { gap: 10px; }
.tcard .tc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tcard .price { font-size: 15px; font-weight: 600; white-space: nowrap; text-align: right; }
.tcard .price .sub { display: block; font-weight: 500; }
.tcard .tc-title { font-size: 17px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.bar { height: 4px; border-radius: 4px; background: #2A2A2A; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--green); }
.bar.full i { background: var(--red); }
.tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; }

/* ---------- обложка турнира ---------- */
.hero { position: relative; border-radius: 20px; padding: 18px 16px 16px; overflow: hidden; display: flex; flex-direction: column; gap: 10px;
  background: url(../assets/pattern.svg) center/40px auto repeat, var(--bg-card); }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,20,20,.15), rgba(20,20,20,.75)); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.meta { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-mid); }
.meta div { display: flex; align-items: center; gap: 7px; }
.meta .ic { color: var(--text-dim); }

/* обратный отсчёт */
.count { display: flex; align-items: center; gap: 14px; }
.count .grow { min-width: 0; }
.count .cv { font-family: var(--font-accent); font-size: 32px; line-height: 36px; color: var(--green-light); letter-spacing: .02em; white-space: nowrap; }
.count .ck { font-size: 12px; color: var(--text-dim); }
.qr-btn { width: 52px; height: 52px; border-radius: 12px; background: #fff; display: grid; place-items: center; flex: none; color: #111; }

/* ---------- часы в приложении ---------- */
.clock { align-items: center; text-align: center; gap: 10px; background: linear-gradient(180deg, rgba(118,178,135,.12), rgba(118,178,135,.02)), var(--bg-card); box-shadow: inset 0 0 0 1px var(--stroke); }
.clock .lvl { font-size: 13px; font-weight: 600; color: var(--text-mid); }
.clock .time { font-family: var(--font-accent); font-size: 68px; line-height: 70px; letter-spacing: -1px; color: var(--text); font-variant-numeric: tabular-nums; }
.clock .time.stop { color: #6A6A6A; }
.clock .time.brk { color: var(--warn); }
.clock .figs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.clock .figs > div { background: var(--bg-input); border-radius: 12px; padding: 9px 6px; }
.clock .fv { font-family: var(--font-accent); font-size: 20px; line-height: 24px; }
.clock .fk { font-size: 10.5px; color: var(--text-dim); }
.progress { width: 100%; height: 4px; border-radius: 4px; background: #2A2A2A; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); transition: width 1s linear; }

/* ---------- стол ---------- */
.table-wrap { position: relative; width: 100%; aspect-ratio: 1.55 / 1; margin: 8px 0 4px; }
.felt { position: absolute; inset: 15% 9%; border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(118,178,135,.0) 30%, rgba(0,0,0,.35) 100%), url(../assets/felt.svg) center/26px repeat, #1E4A30;
  box-shadow: 0 0 0 7px #102A1B, 0 0 0 9px #2E5A3F, 0 18px 40px rgba(0,0,0,.5); display: grid; place-items: center; }
.felt .logo { display: flex; align-items: center; gap: 8px; color: var(--green-light); font-family: var(--font-accent); font-size: clamp(16px, 5vw, 24px); letter-spacing: .02em; padding: 6px 14px; border-radius: 100px; background: rgba(10,24,15,.75); }
.felt .logo img { width: 18px; height: 18px; }
.seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 3px; width: 64px; }
.seat .av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #2A2A2A; color: var(--text-mid); box-shadow: 0 0 0 2px #141414; }
.seat .nm { font-size: 10px; color: var(--text-dim); max-width: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat.me .av { background: var(--green); color: #0F1A12; box-shadow: 0 0 0 2px #141414, 0 0 0 4px var(--green-light); }
.seat.me .nm { color: var(--green-light); font-weight: 700; }
.seat.free .av { background: transparent; box-shadow: inset 0 0 0 1.5px #3A3A3A; color: #4A4A4A; }
.seat.out .av { opacity: .45; }
.seat.dealer .av { background: var(--bg-input); color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--warn); }

/* ---------- аватар ---------- */
.av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #2E4A38, #1E2A22); color: var(--green-light);
  display: grid; place-items: center; font-size: 14px; font-weight: 700; flex: none; overflow: hidden; text-transform: uppercase; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 84px; height: 84px; font-size: 28px; }
.av.sm { width: 32px; height: 32px; font-size: 12px; }
.rank { width: 26px; text-align: center; font-size: 14px; font-weight: 700; color: var(--text-dim); flex: none; font-variant-numeric: tabular-nums; }
.rank.top { color: var(--green-light); }
.me-row { background: rgba(118,178,135,.10); border-radius: 12px; padding-left: 10px !important; padding-right: 10px !important; box-shadow: inset 0 0 0 1px var(--stroke); }
.pts { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* подиум */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; }
.podium .pd { background: var(--bg-card); border-radius: 16px 16px 12px 12px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.podium .pd.p1 { padding-top: 18px; background: linear-gradient(180deg, rgba(118,178,135,.18), rgba(118,178,135,.04)), var(--bg-card); box-shadow: inset 0 0 0 1px var(--stroke); }
.podium .pn { font-size: 13px; font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium .pp { font-family: var(--font-accent); font-size: 20px; color: var(--green-light); }
.podium .pl { font-size: 11px; color: var(--text-dim); }

/* ---------- формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .lbl { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.input { height: 48px; border-radius: var(--r-input); background: var(--bg-input); border: 0; outline: 0; padding: 0 14px; font-size: 16px; width: 100%; color: var(--text);
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .15s; }
.input:focus { box-shadow: inset 0 0 0 1.5px var(--green); }
.input::placeholder { color: #666; }
.field.bad .input { box-shadow: inset 0 0 0 1.5px var(--red); }
.field .err { font-size: 12px; color: var(--red-text); min-height: 0; }
.field .hint { font-size: 12px; color: var(--text-dim); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
input[type="date"].input { appearance: none; -webkit-appearance: none; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.7); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 19px; color: var(--text-soft); cursor: pointer; padding: 4px 0; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px #4A4A4A; flex: none; display: grid; place-items: center; margin-top: -1px; transition: background .15s; }
.check input:checked + .box { background: var(--green); box-shadow: none; }
.check input:checked + .box::after { content: ''; width: 10px; height: 6px; border-left: 2px solid #0F1A12; border-bottom: 2px solid #0F1A12; transform: rotate(-45deg) translate(1px, -1px); }
.check.bad .box { box-shadow: inset 0 0 0 1.5px var(--red); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .tr { width: 46px; height: 28px; border-radius: 28px; background: #3A3A3A; position: relative; flex: none; transition: background .15s; }
.switch .tr::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .tr { background: var(--green); }
.switch input:checked + .tr::after { transform: translateX(18px); }

/* ---------- пустые состояния, загрузка, ошибки ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 20px; }
.empty .ei { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-card); color: var(--text-dim); }
.empty .et { font-size: 17px; font-weight: 600; }
.empty .es { font-size: 13.5px; color: var(--text-dim); max-width: 300px; line-height: 19px; }
.sk { background: linear-gradient(90deg, #1E1E1E 0, #262626 40%, #1E1E1E 80%); background-size: 200% 100%; animation: sk 1.3s infinite linear; border-radius: var(--r-card); }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.toast { position: fixed; z-index: 100; left: 50%; top: calc(var(--safe-top) + 12px); transform: translate(-50%, -20px); opacity: 0;
  max-width: min(92vw, 440px); background: #262626; color: var(--text); border-radius: 14px; padding: 12px 16px; font-size: 14px; line-height: 19px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); transition: transform .25s, opacity .25s; pointer-events: none; display: flex; gap: 10px; align-items: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.ok { box-shadow: inset 0 0 0 1.5px var(--green), 0 10px 30px rgba(0,0,0,.45); }
.toast.bad { box-shadow: inset 0 0 0 1.5px var(--red), 0 10px 30px rgba(0,0,0,.45); }
.offline { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-bottom) + 20px);
  background: var(--warn-soft); color: var(--warn); border-radius: 100px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; backdrop-filter: blur(8px); }

/* ---------- лист (bottom sheet) ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .2s; }
.sheet-bg.show { opacity: 1; }
.sheet { position: fixed; z-index: 61; left: 50%; bottom: 0; width: 100%; max-width: 520px; transform: translate(-50%, 100%);
  background: #1A1A1A; border-radius: 24px 24px 0 0; padding: 10px var(--side) calc(var(--safe-bottom) + 20px); transition: transform .25s cubic-bezier(.2,.8,.2,1);
  max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.sheet.show { transform: translate(-50%, 0); }
.sheet .grab { width: 40px; height: 5px; border-radius: 5px; background: #3A3A3A; align-self: center; margin-bottom: 4px; flex: none; }
.sheet h3 { font-size: 20px; font-weight: 600; }
.qr { background: #fff; border-radius: 20px; padding: 18px; align-self: center; width: min(78vw, 300px); aspect-ratio: 1; display: grid; place-items: center; }
.qr svg, .qr img { width: 100%; height: 100%; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .06em; color: var(--text-mid); text-align: center; }

/* ---------- приветственный экран ---------- */
.welcome { align-items: center; text-align: center; gap: 12px; padding-top: 12px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0 4px; }
.brand img { width: 64px; height: 64px; }
.brand .wm { font-family: var(--font-accent); font-size: 40px; line-height: 42px; color: var(--green-light); letter-spacing: .01em; }
.brand .tl { text-align: center; font-size: 14px; color: var(--text-dim); max-width: 280px; line-height: 19px; }

/* ---------- пульт часов ---------- */
.ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ctrl .wide { grid-column: 1 / -1; }
.counter { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.counter + .counter { border-top: 1px solid #242424; }
.counter .cn { flex: 1; font-size: 14px; color: var(--text-soft); min-width: 0; }
.counter .cv { font-family: var(--font-accent); font-size: 22px; min-width: 44px; text-align: center; }
.round { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-raise); color: var(--text); flex: none; font-size: 20px; font-weight: 500; }
.round.g { background: var(--green); color: #0F1A12; }
.round:active { transform: scale(.94); }
.lvls { display: flex; flex-direction: column; }
.lv { display: flex; align-items: center; gap: 10px; padding: 9px 4px; font-size: 13.5px; border-radius: 10px; width: 100%; text-align: left; }
.lv + .lv { border-top: 1px solid #222; }
.lv .ln { width: 32px; color: var(--text-dim); font-weight: 600; flex: none; font-variant-numeric: tabular-nums; }
.lv .lb { flex: 1; min-width: 0; color: var(--text-soft); }
.lv .lm { color: var(--text-dim); flex: none; }
.lv.on { background: rgba(118,178,135,.12); box-shadow: inset 0 0 0 1px var(--stroke); border-top-color: transparent; }
.lv.on + .lv { border-top-color: transparent; }
.lv.done .lb, .lv.done .ln { color: #555; }
.lv.brk .lb { color: var(--warn); }

/* ---------- адаптив ---------- */
@media (max-width: 359px) {
  :root { --side: 12px; --gap: 12px; }
  .top h1 { font-size: 24px; line-height: 30px; }
  .display { font-size: 32px; line-height: 34px; }
  .tile .tv { font-size: 20px; line-height: 24px; }
  .count .cv { font-size: 26px; }
  .clock .time { font-size: 56px; line-height: 60px; }
  .nav a { font-size: 10px; }
  .btn { font-size: 15px; padding: 0 16px; }
  .seat { width: 52px; } .seat .av { width: 32px; height: 32px; font-size: 11px; }
}
@media (min-width: 430px) {
  .display { font-size: 42px; line-height: 44px; }
}

/* редактор уровней блайндов */
.lvh, .lvr { display: grid; grid-template-columns: 20px 1fr 1fr .8fr 50px 26px; gap: 5px; align-items: center; }
.lvh { margin: 10px 0 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.lvr { padding: 4px 0; }
.lvr .ln { font-size: 13px; color: var(--text-dim); text-align: center; }
.lvr .sl, .lvh .sl { display: none; }
.lvr .bt { grid-column: 2 / 5; font-size: 14px; color: var(--text-dim); padding-left: 4px; }
.lvr.brk { background: rgba(227,179,65,.07); border-radius: 10px; }
.lvr.done { opacity: .45; }
.lvr.on .ln { color: var(--green-light); font-weight: 700; }
.input.sm { height: 40px; padding: 0 6px; font-size: 14px; font-variant-numeric: tabular-nums; border-radius: 10px; min-width: 0; }
.lvx { width: 26px; height: 30px; border-radius: 50%; background: transparent; color: var(--text-dim); font-size: 20px; line-height: 1; border: 0; }
.lvx:active { background: rgba(255,255,255,.08); }
.refbox { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.refbox .btns2 { display: flex; gap: 8px; width: 100%; } .refbox .btns2 .btn { flex: 1; }
.refbox .code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 22px; font-weight: 700; letter-spacing: .06em; color: var(--green-light); }
.pctr { display: grid; grid-template-columns: 1fr 40px 36px 40px; gap: 8px; align-items: center; padding: 6px 0; }
.pctr .cv { text-align: center; font-weight: 700; font-size: 18px; }

.tpls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tpl { display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; border-radius: 999px; background: rgba(118,178,135,.14); color: var(--green-light); font-size: 14px; }
.tpl button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 18px; line-height: 1; }
.brandbar { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; }
.brandbar img { width: 30px; height: 30px; }
.brandbar span { font-family: var(--serif, 'Instrument Serif', serif); font-size: 22px; letter-spacing: .02em; color: #D1FFCF; }
.brandbar small { margin-left: auto; font-size: 11px; color: var(--text-3, #8a8a8a); }
