/* Світло — styles. Tokens first; dark theme by system or by the switch in Settings. */
:root {
  --bg: #F5F3EE;
  --bg2: #ECE8DF;
  --card: #FFFFFF;
  --line: #E4DFD4;
  --text: #1A2133;
  --muted: #6B7183;
  --accent: #F5B400;
  --accent-ink: #3A2A00;
  --on: #FFC83D;
  --on-2: #F59E0B;
  --off: #2E3A57;
  --off-2: #1B2438;
  --maybe: #F08A4B;
  --maybe-bg: #FCE3D2;
  --ok: #1E9E6A;
  --err: #D64545;
  --shadow: 0 1px 2px rgba(26, 33, 51, .06), 0 8px 24px rgba(26, 33, 51, .06);
  --seg-on: #FFFFFF;
  --pressed-ink: #3A2A00;
  --radius: 20px;
  --tab-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1020; --bg2: #121a2e; --card: #141C30; --line: #24304A; --text: #E8ECF6; --muted: #8E98B0;
    --off: #3A4767; --off-2: #273250; --maybe-bg: #3A2A22; --seg-on: #2A3654; --pressed-ink: #FFC83D; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1020; --bg2: #121a2e; --card: #141C30; --line: #24304A; --text: #E8ECF6; --muted: #8E98B0;
  --off: #3A4767; --off-2: #273250; --maybe-bg: #3A2A22; --seg-on: #2A3654; --pressed-ink: #FFC83D; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: .4em 0; }
a { color: inherit; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; border-radius: 10px; }

/* ---------- layout ---------- */
#app { min-height: 100vh; }
.main { max-width: 1180px; margin: 0 auto; padding: 0 16px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
.side { display: none; }
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.top-row { display: flex; align-items: center; gap: 10px; }
.top-brand .logo { width: 36px; height: 36px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.offline { margin-top: 8px; font-size: 14px; padding: 8px 12px; border-radius: 12px; background: var(--maybe-bg); color: var(--text); }

.logo { display: inline-block; width: 40px; height: 40px; flex: none; }
.logo svg { width: 100%; height: 100%; }
.logo rect { fill: var(--accent); }
.logo path { fill: #1A2133; }

.chip { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 15px; white-space: nowrap; }
.chip em { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--bg2); color: var(--muted); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.active em { background: color-mix(in srgb, var(--bg) 20%, transparent); color: var(--bg); }
.chip.add { padding: 0 12px; color: var(--muted); }
.chip.add svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.s1 { background: var(--on); box-shadow: 0 0 0 3px color-mix(in srgb, var(--on) 30%, transparent); }
.dot.s0 { background: var(--off); }
.dot.s2 { background: var(--maybe); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; padding: 6px 0; font-size: 12px; color: var(--muted); border-radius: 14px; min-height: 52px; }
.nav-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; padding: 2px; border-radius: 10px; }
.nav-btn.active { color: var(--text); font-weight: 600; }
.nav-btn.active svg { background: var(--accent); stroke: var(--accent-ink); width: 44px; }
.nav-btn:first-child svg path { fill: none; }
.nav-btn.active:first-child svg path { fill: var(--accent-ink); }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 14px; }
.card-h { font-size: 17px; margin-bottom: 12px; }
.card-h.row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-h.row h3 { font-size: 17px; }
.page-h { padding: 14px 2px 0; }
.page-h h2 { font-size: 26px; }
.page-h p { color: var(--muted); margin-top: 4px; }
.src { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 14px 4px; }
.link { border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 4px; font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-weight: 600; text-decoration: none; transition: transform .08s; }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big { min-height: 56px; font-size: 17px; border-radius: 16px; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.ghost { background: none; border-color: transparent; }
.btn.danger { color: var(--err); }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; border-radius: 12px; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--bg2); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="true"] { color: var(--pressed-ink); background: color-mix(in srgb, var(--accent) 35%, transparent); }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; display: flex; gap: 16px; align-items: center; border-radius: 26px; padding: 22px 20px; margin-top: 10px; color: #fff; box-shadow: var(--shadow); }
.hero.s1 { background: radial-gradient(120% 140% at 0% 0%, #FFE38A 0%, #FFC83D 45%, #F59E0B 100%); color: #2E2100; }
.hero.s0 { background: radial-gradient(120% 140% at 0% 0%, #3B4A70 0%, #222C47 50%, #121829 100%); }
.hero.s2 { background: radial-gradient(120% 140% at 0% 0%, #FFC89E 0%, #F49456 50%, #D9662C 100%); color: #2B1407; }
.hero.unknown { background: var(--card); color: var(--text); }
.hero h1 { font-size: 34px; letter-spacing: -.5px; margin-top: 2px; }
.hero p { margin: 4px 0 0; font-size: 17px; opacity: .9; }
.hero-txt { flex: 1; min-width: 0; }
.hero-addr { font-size: 14px; opacity: .8; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-ic { width: 76px; height: 76px; flex: none; }
.countdown { font-size: 44px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 8px; }
.hero-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .25); margin-top: 12px; overflow: hidden; }
.hero.s1 .hero-bar, .hero.s2 .hero-bar { background: rgba(0, 0, 0, .12); }
.hero-bar i { display: block; height: 100%; border-radius: 3px; background: currentColor; opacity: .75; transition: width 1s linear; }
.bulb { width: 100%; height: 100%; }
.bulb .glass { fill: rgba(255, 255, 255, .55); stroke: currentColor; stroke-width: 2.4; }
.bulb .base, .bulb .fil { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bulb.on .glow { fill: #FFF6C9; opacity: .7; animation: glow 2.6s ease-in-out infinite; }
.bulb.on .glass { fill: #FFF3B0; }
.bulb.off .glass { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .7); }
.bulb.off .base, .bulb.off .fil { stroke: rgba(255, 255, 255, .7); }
.hero.unknown .bulb.off .glass, .hero.unknown .bulb.off .base, .hero.unknown .bulb.off .fil { stroke: var(--muted); }
.bulb.maybe .glass { fill: rgba(255, 255, 255, .35); }
@keyframes glow { 50% { opacity: .35; transform: scale(.94); transform-origin: 32px 26px; } }
@media (prefers-reduced-motion: reduce) { .bulb.on .glow { animation: none; } .hero-bar i { transition: none; } }

/* ---------- segmented ---------- */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--bg2); }
.seg button { flex: 1; border: 0; background: none; border-radius: 12px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; line-height: 1.2; color: var(--muted); min-height: 44px; justify-content: center; }
.seg button b { font-size: 15px; }
.seg button small { font-size: 12px; }
.seg button.active { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.small { flex-wrap: wrap; }
.seg.small button { font-size: 14px; flex: 1 1 0; padding: 8px 4px; white-space: nowrap; }

/* ---------- dial ---------- */
.dial-wrap { position: relative; max-width: 360px; margin: 14px auto 4px; aspect-ratio: 1; touch-action: manipulation; }
.dial { width: 100%; height: 100%; overflow: visible; }
.seg-p { cursor: pointer; transition: opacity .2s, transform .2s; transform-origin: 150px 150px; }
.seg-p.s1 { fill: var(--on); }
.seg-p.s0 { fill: var(--off); }
.seg-p.s2 { fill: url(#hatch); }
.h-bg { fill: var(--maybe-bg); }
.h-fg { fill: var(--maybe); }
/* past slots keep their colours (user asked): only the hand shows where "now" is */
.seg-p.sel { transform: scale(1.045); opacity: 1; }
.prev-p { opacity: .7; }
.prev-p.s1 { fill: var(--on); } .prev-p.s0 { fill: var(--off); } .prev-p.s2 { fill: var(--maybe); }
.ticks text { font-size: 11px; fill: var(--muted); text-anchor: middle; font-weight: 600; }
.hand line { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.hand circle { fill: var(--text); stroke: var(--card); stroke-width: 3; }
.dial-center { position: absolute; inset: 30%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.c-big { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.c-big.ok { color: var(--ok); }
.c-k { font-size: 13px; color: var(--muted); margin-top: 4px; }
.c-k.maybe { color: var(--maybe); font-weight: 600; }
.c-v { font-size: 18px; font-weight: 700; margin-top: 4px; }
.c-v.s0 { color: var(--off); } .c-v.s1 { color: var(--on-2); } .c-v.s2 { color: var(--maybe); }
:root[data-theme="dark"] .c-v.s0 { color: #9FB0D8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .c-v.s0 { color: #9FB0D8; } }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lg.s1 { background: var(--on); } .lg.s0 { background: var(--off); }
.lg.s2 { background: repeating-linear-gradient(45deg, var(--maybe) 0 3px, var(--maybe-bg) 3px 6px); }
.nodata { display: flex; gap: 14px; align-items: center; padding: 26px 8px 14px; color: var(--muted); }
.nodata svg { width: 40px; height: 40px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nodata b { color: var(--text); }

/* ---------- changes ---------- */
.changed { border: 2px solid var(--maybe); }
.changed-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; background: var(--maybe); color: #fff; padding: 3px 8px; border-radius: 8px; }
.changed ul { margin: 10px 0; padding-left: 20px; }
.changed li.add::marker { color: var(--off); }
.changed li.rem { color: var(--ok); }

/* ---------- periods ---------- */
.periods { list-style: none; margin: 0; padding: 0; }
.per { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.per + .per { border-top: 1px dashed var(--line); }
.per-t { width: 52px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; line-height: 1.2; }
.per-t small { font-weight: 500; color: var(--muted); }
.per-bar { width: 8px; align-self: stretch; border-radius: 4px; min-height: 36px; }
.per.s1 .per-bar { background: var(--on); }
.per.s0 .per-bar { background: var(--off); }
.per.s2 .per-bar { background: repeating-linear-gradient(45deg, var(--maybe) 0 3px, var(--maybe-bg) 3px 6px); }
.per-l { display: flex; flex-direction: column; line-height: 1.25; }
.per-l small { color: var(--muted); }
.per.past { opacity: .45; }
.per.now { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 12px; margin: 0 -10px; padding: 8px 10px; }
.per.now + .per, .per.now { border-top: 0; }

/* ---------- queue bars ---------- */
.qaxis { display: grid; grid-template-columns: 40px 1fr 52px; gap: 8px; margin: 14px 0 4px; }
.qaxis .ticks { position: relative; height: 16px; }
.qaxis em { position: absolute; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--muted); }
.qaxis em:first-child { transform: none; }
.qaxis em:last-child { transform: translateX(-100%); }
.qlist { list-style: none; margin: 0; padding: 0; }
.qlist li { display: grid; grid-template-columns: 40px 1fr 52px; gap: 8px; align-items: center; padding: 5px 0; }
.qlist.compact li { padding: 3px 0; }
.ql { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; }
.qh { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.qbar { display: flex; gap: 1px; height: 22px; border-radius: 6px; overflow: hidden; }
.qlist.compact .qbar { height: 14px; }
.qbar i { flex: 1; }
.qbar i.s1 { background: var(--on); }
.qbar i.s0 { background: var(--off); }
.qbar i.s2 { background: repeating-linear-gradient(45deg, var(--maybe) 0 2px, var(--maybe-bg) 2px 4px); }
.qbar i.cur { box-shadow: inset 0 0 0 2px var(--text); }
.qlist li.mine { background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 10px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.qlist li.mine .ql { color: var(--accent-ink); }
:root[data-theme="dark"] .qlist li.mine .ql { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qlist li.mine .ql { color: var(--accent); } }
.chg { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--maybe); }
.help { background: var(--bg2); box-shadow: none; }
.help h3 { font-size: 17px; }
.help .btn { margin-top: 8px; }
.help.small { font-size: 14px; padding: 12px 14px; border-radius: 14px; margin-top: 14px; color: var(--muted); }
.help.small b { color: var(--text); }

/* ---------- history ---------- */
.stats { display: flex; gap: 12px; margin-bottom: 16px; }
.stats > div { flex: 1; background: var(--bg2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.stats b { font-size: 24px; }
.stats small { color: var(--muted); font-size: 13px; }
.hchart { display: flex; gap: 6px; align-items: flex-end; height: 220px; overflow-x: auto; padding-bottom: 2px; }
.hb { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.hv { font-size: 11px; color: var(--muted); white-space: nowrap; margin-bottom: 4px; }
.hcol { flex: 1; width: 100%; max-width: 34px; display: flex; flex-direction: column; justify-content: flex-end; background: var(--bg2); border-radius: 8px; overflow: hidden; }
.hcol .o { background: var(--off); }
.hcol .m { background: var(--maybe); opacity: .7; }
.hd { font-size: 11px; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.hb.today .hd { color: var(--text); font-weight: 700; }
.hb.future .hcol .o { opacity: .45; }

/* ---------- settings ---------- */
.alist { list-style: none; margin: 0 0 12px; padding: 0; }
.alist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.alist li + li { border-top: 1px solid var(--line); }
.a-ic svg { width: 26px; height: 26px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; }
.a-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.a-t small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qpill { font-weight: 700; font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.chan { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.chan-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--bg2); display: flex; align-items: center; justify-content: center; flex: none; }
.chan-ic svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.chan-ic.tg { background: #2AABEE; }
.chan-ic.tg svg { stroke: #fff; }
.chan-t { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.chan-t small { color: var(--muted); }
.field { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field label small { font-weight: 400; color: var(--muted); }
.field input { height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); padding: 0 14px; font-size: 17px; width: 100%; }
.field input:focus { border-color: var(--accent); outline: none; }
.ro { padding: 12px 14px; border-radius: 14px; background: var(--bg2); }
.two { display: flex; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.house { width: 96px; flex: none; }
.switch { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > i { width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch > i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
.switch span { display: flex; flex-direction: column; line-height: 1.25; }
.switch small { color: var(--muted); font-size: 13px; }
.switch.sm { border: 0; padding: 4px 0 0; font-size: 14px; }
.switch.sm > i { width: 42px; height: 26px; }
.switch.sm > i::after { width: 20px; height: 20px; }
.switch.sm input:checked + i::after { transform: translateX(16px); }
.card > .btn { margin-top: 14px; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
details.more .btn { margin-top: 12px; }
.about { font-size: 14px; color: var(--muted); }
.about .src { margin: 8px 0; }
.empty { text-align: center; padding: 32px 22px; }
.empty-ic svg, .big-ic svg { width: 56px; height: 56px; margin: 0 auto 10px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.empty p { color: var(--muted); max-width: 420px; margin: 8px auto 18px; }
.spin { width: 32px; height: 32px; margin: 30px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth-hero { background: radial-gradient(130% 100% at 0% 0%, #FFE38A 0%, #FFC83D 40%, #F59E0B 100%); color: #2E2100; padding: calc(24px + env(safe-area-inset-top)) 20px 26px; border-radius: 0 0 28px 28px; }
.auth-hero h1 { font-size: 28px; margin: 18px 0 10px; letter-spacing: -.4px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand b { display: block; font-size: 20px; }
.brand small { display: block; font-size: 13px; opacity: .75; }
.auth-hero .logo rect { fill: #1A2133; }
.auth-hero .logo path { fill: #FFC83D; }
.pluses { list-style: none; padding: 0; margin: 0; display: none; }
.pluses li { padding: 5px 0 5px 28px; position: relative; }
.pluses li::before { content: ''; position: absolute; left: 2px; top: 9px; width: 16px; height: 16px; border-radius: 50%; background: #1A2133; box-shadow: inset 0 0 0 4px #FFD966; }
.auth-demo { margin-top: 14px; background: #1A2133; color: #fff; border-radius: 16px; padding: 12px 14px; }
.demo-h { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.auth-main { flex: 1; display: flex; justify-content: center; padding: 20px 16px 40px; }
.auth-card { width: 100%; max-width: 440px; }
.err { color: var(--err); font-weight: 600; margin-top: 12px; }
.pw { position: relative; }
.pw input { padding-right: 52px; }
.eye { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border: 0; background: none; font-size: 18px; opacity: .6; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 18px 0 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.lang-row { display: flex; justify-content: center; gap: 6px; margin-top: 22px; }
.lang-row button { border: 0; background: none; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.lang-row button.active { background: var(--bg2); color: var(--text); }

/* ---------- wizard ---------- */
.wiz { position: fixed; inset: 0; z-index: 30; background: rgba(10, 14, 26, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.wiz-card { background: var(--card); width: 100%; max-height: 94vh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 12px 18px calc(22px + env(safe-area-inset-bottom)); animation: up .25s ease-out; }
.wiz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.steps { display: flex; gap: 6px; }
.steps i { width: 28px; height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--accent); }
.wiz-body { padding-top: 8px; }
.wiz-body h2 { font-size: 24px; margin-top: 6px; }
.wiz-body.center { text-align: center; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.tile { min-height: 64px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg); font-size: 17px; font-weight: 600; }
.tile.active, .tile:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--card)); }
.qgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.qbtn { min-height: 64px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); font-size: 22px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; font-variant-numeric: tabular-nums; }
.qbtn small { font-size: 11px; font-weight: 500; color: var(--muted); }
.qbtn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.qbtn.active small { color: var(--accent-ink); }
.qprev { margin-top: 14px; padding: 12px; border-radius: 14px; background: var(--bg2); }
.qprev .qaxis { grid-template-columns: 0 1fr 0; margin: 6px 0 0; }
.hint { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--ok) 14%, var(--card)); }
.hint > svg { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--ok); stroke-width: 2; }
.hint span { flex: 1; font-weight: 600; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--ok); color: #fff; }
.toast.err { background: var(--err); color: #fff; }

/* ---------- tablet / desktop ---------- */
@media (min-width: 700px) {
  .wiz { align-items: center; }
  .wiz-card { max-width: 620px; border-radius: 26px; padding: 18px 28px 28px; }
  .qgrid { grid-template-columns: repeat(6, 1fr); }
  .hero { padding: 28px; }
  .hero-ic { width: 96px; height: 96px; }
}
@media (min-width: 960px) {
  #app { display: grid; grid-template-columns: 260px 1fr; }
  .side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--card); overflow-y: auto; }
  .side .brand { padding: 0 8px; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-nav .nav-btn { flex-direction: row; gap: 12px; font-size: 16px; padding: 10px 12px; min-height: 48px; justify-content: flex-start; }
  .side-nav .nav-btn svg { width: 24px; height: 24px; }
  .side-nav .nav-btn.active { background: var(--bg2); }
  .side-nav .nav-btn.active svg { width: 24px; background: none; stroke: var(--text); }
  .side-nav .nav-btn.active:first-child svg path { fill: var(--accent); stroke: var(--text); }
  .side-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 0 8px 8px; }
  .side-addr { display: flex; flex-direction: column; gap: 6px; }
  .side-addr .chip { justify-content: flex-start; border-radius: 12px; height: 46px; }
  .side-addr .chip span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
  .side-foot { margin-top: auto; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
  .tabbar, .top { display: none; }
  .main { padding: 18px 32px 40px; max-width: none; width: 100%; }
  .now-grid { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(360px, 1fr); gap: 0 22px; align-items: start; }
  .now-grid .src { display: none; }
  .hero h1 { font-size: 40px; }
  .countdown { font-size: 54px; }
  .page-h h2 { font-size: 30px; }
  .toast { bottom: 28px; }
  /* auth: two columns */
  .auth { flex-direction: row; }
  .auth-hero { flex: 1.1; border-radius: 0; padding: 56px 56px; display: flex; flex-direction: column; justify-content: center; }
  .auth-hero h1 { font-size: 44px; max-width: 560px; }
  .pluses { display: block; font-size: 18px; margin-top: 8px; }
  .auth-demo { max-width: 560px; margin-top: 26px; }
  .auth-main { flex: 1; align-items: center; }
}
@media (min-width: 1300px) {
  .main { padding: 24px 48px 48px; }
}

/* «Узнать очередь по свету» */
.obs-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.obs-btns .btn { min-height: 52px; }
.obs-btns .btn svg.bulb { width: 26px; height: 26px; }
.obs-res { margin-top: 12px; }
.obs-res.warn { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--maybe) 18%, var(--card)); font-weight: 600; }
.obs-res.ok { color: var(--ok); font-weight: 600; }
.obs .small { font-size: 13px; margin-top: 10px; }
.obs .link { font-size: 13px; }
.qchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.qchip { min-width: 52px; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); font-weight: 700; font-size: 16px; }
.qchip.mine { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); opacity: 1; }
.qchip:disabled { cursor: default; }
.qlist li.cand .ql { text-decoration: underline; text-decoration-color: var(--ok); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.obs-btns .bulb.off .glass, .obs-btns .bulb.off .base, .obs-btns .bulb.off .fil { stroke: var(--muted); }
.obs-btns .bulb.on .glow { animation: none; opacity: .5; }

/* Администрирование */
.page-h.row { display: flex; align-items: center; gap: 6px; }
.page-h.row .icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ulist { list-style: none; margin: 0; padding: 0; }
.ulist > li { padding: 14px 0; border-top: 1px solid var(--line); }
.ulist > li:first-child { border-top: 0; }
.ulist > li.blocked .u-h b { opacity: .6; }
.u-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 16px; }
.u-l { color: var(--muted); font-size: 14px; margin-top: 2px; word-break: break-all; }
.u-m { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.5; }
.ulist .row-btns { margin-top: 10px; }
.ulist .btn svg { width: 18px; height: 18px; }
.utag { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg2); color: var(--muted); }
.utag.adm { background: var(--accent); color: var(--accent-ink); }
.utag.blk { background: color-mix(in srgb, var(--err) 18%, var(--card)); color: var(--err); }
.ask { margin-top: 10px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--err) 10%, var(--card)); }
.chk { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 14px; }
.chk input { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.u-ban { display: flex; align-items: center; gap: 10px; }
.u-ban span { flex: 1; min-width: 0; word-break: break-all; }
.u-ban small { display: block; color: var(--muted); }
.muted.small { font-size: 13px; margin-top: 8px; }
.reg-closed { margin-top: 14px; font-size: 14px; }

/* Размер интерфейса */
.size-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.size-pick button { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-height: 84px; padding: 10px 4px 9px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--text); cursor: pointer; }
.size-pick b { font-weight: 750; line-height: 1; }
.size-pick small { font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.2; }
.size-pick button[data-scale="100"] b { font-size: 18px; }
.size-pick button[data-scale="115"] b { font-size: 24px; }
.size-pick button[data-scale="130"] b { font-size: 30px; }
.size-pick button[data-scale="150"] b { font-size: 38px; }
.size-pick button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.size-note { margin: 8px 2px 0; font-size: 13px; color: var(--muted); }
.size-row { margin-top: 6px; align-items: flex-end; }
.size-row button[data-scale="100"] { font-size: 14px; }
.size-row button[data-scale="115"] { font-size: 17px; }
.size-row button[data-scale="130"] { font-size: 20px; }
.size-row button[data-scale="150"] { font-size: 24px; }
/* Narrow screens and the enlarged interface (this query is scaled with the zoom in applyScale) */
@media (max-width: 380px) {
  .hero { gap: 12px; padding: 18px 16px; align-items: flex-start; }
  .hero-ic { width: 46px; height: 46px; }
  .hero h1 { font-size: 28px; }
  .countdown { font-size: 34px; }
  .obs-btns { grid-template-columns: 1fr; }
  .qaxis em:nth-child(2n) { display: none; }
}

/* Поблагодарить разработчика */
.thanks-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; margin-top: 14px; padding: 9px 14px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, #E5484D 45%, var(--line)); background: color-mix(in srgb, #E5484D 8%, var(--card)); color: #D13B40; font-weight: 700; font-size: 15px; cursor: pointer; }
.thanks-btn:active { transform: scale(.98); }
svg.ic-heart { width: 18px; height: 18px; fill: currentColor; stroke: none; animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(.96); } 45% { transform: scale(1.08); } }
.dev-line { margin: 12px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.dev-line b { color: var(--text); font-weight: 700; }
.auth-dev { margin-top: 18px; }
.side-dev { padding: 8px 8px 0; }
.side-dev .thanks-btn { min-height: 40px; font-size: 14px; margin-top: 8px; }
.side-dev .dev-line { margin-top: 8px; font-size: 12.5px; }
.thanks-hero { display: flex; gap: 14px; align-items: center; margin: 2px 0 16px; }
.thanks-hero p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.thanks-heart { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #FF6B6B, #E5484D); }
.thanks-heart svg.ic-heart { width: 28px; height: 28px; }
.pay-card { border-radius: 20px; padding: 16px; margin-bottom: 14px; }
.pay-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pay-top b { font-size: 17px; }
.pay-top span { font-size: 13px; font-weight: 600; opacity: .85; }
.pay-mono { color: #fff; background: linear-gradient(135deg, #1b1b1f 0%, #3a3a44 100%); }
.pay-num { font-size: 24px; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; margin: 4px 0 16px; white-space: nowrap; }
.pay-usdt { background: var(--bg); border: 1.5px solid var(--line); text-align: center; }
.pay-usdt .pay-top { text-align: left; }
.pay-qr { display: block; width: 212px; height: 212px; margin: 2px auto 12px; padding: 8px; border-radius: 14px; background: #fff; image-rendering: pixelated; }
.pay-addr { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 15px; font-weight: 600; line-height: 1.45; word-break: break-all; margin-bottom: 14px; }
.pay-copy { width: 100%; font-weight: 700; border: 0; }
.pay-copy svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.pay-mono .pay-copy { background: #fff; color: #17171c; }
.pay-usdt .pay-copy { background: #0b7a5f; color: #fff; }
.pay-copy.copied { background: var(--ok) !important; color: #fff !important; }
.pay-warn { margin: 12px 2px 0; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: left; }
@media (max-width: 380px) { .pay-num { font-size: 20px; } .thanks-hero { align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { svg.ic-heart { animation: none; } }

/* Циферблат: 24 ч / 12 ч, прошедшее — серым */
.ticks text.h12 { font-size: 15px; font-weight: 700; fill: var(--text); }
.lg.past { background: var(--muted); opacity: .55; }
.half-seg { max-width: 360px; margin: 8px auto 0; }
.mode-seg { max-width: 360px; margin: 12px auto 0; }
.mode-seg button, .half-seg button { min-height: 40px; font-weight: 600; }
.ticks text.h12.top { font-size: 14px; }
.seg-p.s9 { fill: var(--line); cursor: default; }
.lg.s9 { background: var(--line); }
.ticks text.h12.next { fill: var(--muted); }
.ticks text.h24 { font-size: 10.5px; }
.ticks text.h24.major { font-size: 12.5px; fill: var(--text); font-weight: 700; }
.c-now { display: inline-flex; align-items: baseline; gap: 5px; margin-bottom: 6px; padding: 3px 10px; border-radius: 999px; background: var(--bg2); font-size: 13px; color: var(--muted); white-space: nowrap; }
.c-now b { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }
