:root{
  --navy:#12274a; --navy2:#1b3763; --or:#f28c28; --orl:#fff1e0; --orT:#b85f0a;
  --bg:#f4f6fa; --card:#fff; --ink:#1f2a3d; --muted:#5f6b7d; --line:#dfe5ee; --zebra:#f6f8fb;
  --ok:#1f9d55; --okl:#e3f6ea; --bad:#d64545; --badl:#fde8e8; --acc:#12a3a0; --acc2:#5b5fd6;
  --head:"Poppins","Lato",system-ui,sans-serif; --body:"Lato",system-ui,-apple-system,"Segoe UI",sans-serif;
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --bg:#0f1726; --card:#17223a; --ink:#e6ebf3; --muted:#9aa7bb; --line:#2a3854; --zebra:#1b2842;
  --orl:#3a2a17; --orT:#ffb469; --okl:#163a27; --badl:#3d1e22; --navy2:#22406f;
}}
:root[data-theme="dark"]{
  --bg:#0f1726; --card:#17223a; --ink:#e6ebf3; --muted:#9aa7bb; --line:#2a3854; --zebra:#1b2842;
  --orl:#3a2a17; --orT:#ffb469; --okl:#163a27; --badl:#3d1e22; --navy2:#22406f;
}
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{ margin:0; background:var(--bg); color:var(--ink); font:16px/1.55 var(--body); -webkit-font-smoothing:antialiased; }
button,input{ font:inherit; color:inherit; }
button{ cursor:pointer; }
a{ color:inherit; }
:focus-visible{ outline:3px solid var(--or); outline-offset:2px; border-radius:6px; }
img{ max-width:100%; display:block; }
[hidden]{ display:none !important; }

/* top bar */
.top{ position:sticky; top:0; z-index:20; background:var(--navy); color:#fff; display:flex; align-items:center; gap:10px; padding:10px 16px; border-bottom:4px solid var(--or); }
.logo{ font:800 19px var(--head); color:#fff; text-decoration:none; white-space:nowrap; }
.logo span{ color:var(--or); }
.top .sp{ flex:1; }
.tbtn{ background:transparent; border:1.5px solid rgba(255,255,255,.35); color:#fff; border-radius:10px; padding:6px 11px; font-weight:700; font-size:14px; text-decoration:none; white-space:nowrap; }
.tbtn:hover{ background:rgba(255,255,255,.1); }
.tbtn.solid{ background:var(--or); border-color:var(--or); }
/* выбранный вариант — заметно крупнее остальных */
.lang{ display:inline-flex; align-items:center; gap:2px; padding:3px; border:1.5px solid rgba(255,255,255,.35); border-radius:12px; }
.lang button{ border:0; background:transparent; color:#dfe6f3; padding:3px 7px; border-radius:8px; font-weight:700; font-size:12px; opacity:.75; transition:all .15s; }
.lang button:hover{ opacity:1; }
.lang button.on{ background:#fff; color:var(--navy); font-size:15px; padding:5px 11px; opacity:1; box-shadow:0 2px 8px rgba(0,0,0,.28); }
.tbtn{ display:inline-flex; align-items:center; gap:6px; }

/* иконки Lucide (спрайт /assets/icons.svg) */
.i{ width:1.2em; height:1.2em; flex:none; vertical-align:-.22em; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.chip{ display:inline-flex; align-items:center; gap:8px; color:#fff; text-decoration:none; font-weight:700; font-size:14px; max-width:220px; }
.chip .cname{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* avatar */
.av{ width:34px; height:34px; border-radius:50%; flex:none; object-fit:cover; background:var(--acc); color:#fff; display:grid; place-items:center; font:700 14px var(--head); border:2px solid rgba(255,255,255,.6); }
.av.lg{ width:120px; height:120px; font-size:42px; border:4px solid var(--card); box-shadow:0 0 0 3px var(--or); }

/* layout */
.wrap{ max-width:1080px; margin:0 auto; padding:22px 16px 60px; }
.card{ background:var(--card); border:1px solid var(--line); border-radius:20px; padding:20px; }
h1,h2,h3{ font-family:var(--head); line-height:1.2; }
h2.h{ font:700 22px var(--head); margin:30px 0 12px; }
.muted{ color:var(--muted); }
.btn{ border:0; border-radius:12px; padding:11px 20px; font:700 15px var(--head); background:var(--or); color:#fff; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.btn.alt{ background:var(--zebra); color:var(--ink); border:1.5px solid var(--line); }
.btn.bad{ background:transparent; color:var(--bad); border:1.5px solid var(--bad); }
.btn[disabled]{ opacity:.55; cursor:default; }

/* hero */
.hero{ background:var(--navy); color:#fff; border-radius:24px; padding:clamp(22px,4vw,40px); position:relative; overflow:hidden; }
.hero::before{ content:""; position:absolute; width:280px; height:280px; border-radius:50%; background:var(--or); right:-90px; top:-110px; }
.hero::after{ content:""; position:absolute; width:64px; height:64px; border-radius:50%; background:var(--acc); right:160px; top:110px; }
.hero > *{ position:relative; z-index:1; }
.hero h1{ font:800 clamp(30px,5.4vw,50px)/1.06 var(--head); margin:10px 0; max-width:16ch; }
.hero p{ color:#c9d3e6; margin:0 0 14px; max-width:58ch; }
.badge{ display:inline-block; background:var(--or); color:#fff; border-radius:8px; padding:4px 12px; font:700 13px var(--head); }
.facts{ display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.facts span{ background:var(--navy2); border-radius:12px; padding:8px 14px; font-size:14px; color:#dbe3f2; }
.facts b{ color:#ffb469; font-family:var(--head); }
.uptime{ margin-top:18px; display:inline-flex; flex-wrap:wrap; align-items:center; gap:10px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.18); border-radius:14px; padding:10px 14px; }
.uptime small{ color:#c9d3e6; font-weight:700; }
.uptime b{ font:800 22px var(--head); letter-spacing:.5px; font-variant-numeric:tabular-nums; }
@media (max-width:600px){ .hero::before{ width:130px; height:130px; right:-60px; top:-60px; } .hero::after{ display:none; } }

/* sections */
.pick{ display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px; margin-top:22px; }
.pickcard{ position:relative; overflow:hidden; display:grid; gap:6px; justify-items:start; text-align:left; border:0; border-radius:24px; padding:26px 24px; color:#fff; min-height:210px; box-shadow:0 10px 28px rgba(18,39,74,.18); transition:transform .15s; }
.pickcard:hover{ transform:translateY(-3px); }
.pickcard.pv{ background:linear-gradient(135deg,#12274a,#1f4b8a); }
.pickcard.pg{ background:linear-gradient(135deg,#12274a,#5b5fd6); }
.pickcard::after{ content:""; position:absolute; width:160px; height:160px; border-radius:50%; right:-50px; top:-60px; background:var(--or); opacity:.9; }
.pickcard.pg::after{ background:var(--acc); }
.pickcard > *{ position:relative; z-index:1; }
.pickcard .ic{ width:56px; height:56px; border-radius:16px; background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.22); display:grid; place-items:center; margin-bottom:4px; }
.pickcard .ic .i{ width:30px; height:30px; stroke-width:1.8; }
.pickcard b{ font:800 30px/1.1 var(--head); }
.pickcard span{ color:#d6deef; font-size:15px; }
.pickcard .go{ margin-top:auto; display:inline-flex; align-items:center; gap:8px; background:#fff; color:var(--navy); border-radius:12px; padding:8px 16px; font:700 15px var(--head); }
.pickcard .lock{ display:inline-flex; align-items:center; gap:6px; font-size:13px; color:#ffc58a; font-weight:700; }
.pickcard .lock span{ color:inherit; font-size:inherit; }

/* stats */
.stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr)); gap:12px; }
.stat{ background:var(--card); border:1px solid var(--line); border-radius:18px; padding:16px 18px; display:grid; gap:2px; }
.stat .k{ width:42px; height:42px; border-radius:12px; display:grid; place-items:center; background:var(--orl); color:var(--orT); margin-bottom:6px; }
.stat .k .i{ width:22px; height:22px; }
.stat:nth-child(2) .k{ background:color-mix(in srgb, var(--acc) 16%, transparent); color:var(--acc); }
.stat:nth-child(3) .k{ background:color-mix(in srgb, var(--acc2) 16%, transparent); color:var(--acc2); }
.stat:nth-child(4) .k{ background:var(--okl); color:var(--ok); }
h2.h{ display:flex; align-items:center; gap:10px; }
h2.h .i{ color:var(--or); }
.uptime .i{ color:#ffb469; width:22px; height:22px; }
.stat b{ font:800 30px/1.1 var(--head); font-variant-numeric:tabular-nums; }
.stat span{ color:var(--muted); font-size:14px; }
.stat small{ color:var(--muted); font-size:13px; }
.dot{ display:inline-block; width:9px; height:9px; border-radius:50%; background:var(--ok); margin-right:6px; box-shadow:0 0 0 3px var(--okl); }
.pbar{ height:10px; border-radius:99px; background:var(--zebra); border:1px solid var(--line); overflow:hidden; margin-top:6px; }
.pbar i{ display:block; height:100%; background:linear-gradient(90deg,var(--or),var(--acc)); }

/* top students */
.toplist{ display:grid; gap:8px; }
.trow{ display:grid; grid-template-columns:30px 44px 1fr auto; gap:12px; align-items:center; background:var(--card); border:1px solid var(--line); border-radius:16px; padding:10px 14px; }
.trow .n{ font:800 18px var(--head); color:var(--muted); text-align:center; }
.trow:nth-child(1) .n{ color:#d4a017; } .trow:nth-child(2) .n{ color:#8f9bb0; } .trow:nth-child(3) .n{ color:#c0773a; }
.trow .av{ width:44px; height:44px; border-color:var(--line); }
.trow .nm{ font-weight:700; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.trow .pbar{ max-width:260px; }
.trow .sc{ font:700 15px var(--head); text-align:right; white-space:nowrap; }
.trow .sc small{ display:block; color:var(--muted); font:400 12.5px var(--body); }
.empty{ text-align:center; color:var(--muted); padding:22px; border:2px dashed var(--line); border-radius:16px; }

/* forms */
.narrow{ max-width:460px; margin:0 auto; }
.formcard{ display:grid; gap:14px; }
.formcard h1{ font-size:26px; margin:0; }
label.f{ display:grid; gap:6px; font-weight:700; font-size:14px; }
label.f small{ font-weight:400; color:var(--muted); }
.in{ width:100%; border:2px solid var(--line); background:var(--card); border-radius:12px; padding:11px 13px; }
.in:focus{ outline:none; border-color:var(--or); }
.in.err{ border-color:var(--bad); }
.check{ display:flex; gap:10px; align-items:flex-start; font-size:15px; }
.check input{ width:20px; height:20px; margin-top:2px; accent-color:var(--or); flex:none; }
.msg{ border-radius:12px; padding:10px 14px; font-size:14.5px; }
.msg.err{ background:var(--badl); color:var(--bad); }
.msg.ok{ background:var(--okl); color:var(--ok); }
.or{ display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px; }
.or::before,.or::after{ content:""; flex:1; height:1px; background:var(--line); }
.social{ display:grid; gap:10px; justify-items:center; min-height:44px; }
.tabs{ display:flex; align-items:center; gap:4px; background:var(--zebra); border:1px solid var(--line); border-radius:14px; padding:4px; }
.tabs button{ flex:1; border:0; background:transparent; border-radius:10px; padding:7px; font:600 13px var(--head); color:var(--muted); transition:all .15s; }
.tabs button.on{ flex:1.3; background:var(--navy); color:#fff; font-size:16px; padding:11px 8px; box-shadow:0 4px 12px rgba(18,39,74,.25); }
.avedit{ display:grid; justify-items:center; gap:10px; }
.avedit .row{ display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }
.preview{ background:var(--zebra); border-radius:12px; padding:10px 14px; font-size:14px; display:flex; align-items:center; gap:10px; }
.preview .av{ width:32px; height:32px; border-color:var(--line); font-size:12px; }

footer{ text-align:center; color:var(--muted); font-size:13.5px; padding:30px 10px 10px; }
@media (max-width:560px){
  .top{ padding:8px 10px; gap:6px; }
  .chip .cname{ display:none; }
  .trow{ grid-template-columns:24px 38px 1fr; }
  .trow .av{ width:38px; height:38px; }
  .trow .sc{ grid-column:2 / -1; text-align:left; }
}
@media (prefers-reduced-motion: reduce){ *{ transition:none !important; } }
@media (max-width:560px){ #install span{ display:none; } }
.pickcard .go span{ color:inherit; font-size:inherit; }
.btn .i{ width:18px; height:18px; }

/* переключатель темы: в светлой теме — луна, в тёмной — солнце */
.themebtn{ padding:6px 8px; }
.themebtn .i{ width:18px; height:18px; }
.themebtn .t-sun{ display:none; }
:root[data-theme="dark"] .themebtn .t-sun{ display:block; }
:root[data-theme="dark"] .themebtn .t-moon{ display:none; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .themebtn .t-sun{ display:block; }
  :root:not([data-theme="light"]) .themebtn .t-moon{ display:none; }
}

/* профиль: блоки настроек */
.stack{ display:grid; gap:16px; }
.wrap.narrow{ max-width:492px; }
.ptitle{ font-size:26px; margin:0; }
h2.sec{ display:flex; align-items:center; gap:10px; font:700 18px var(--head); margin:0; }
h2.sec .i{ color:var(--or); width:22px; height:22px; }
h3.sub{ display:flex; align-items:center; gap:8px; font:700 16px var(--head); margin:0; }
h3.sub .i{ color:var(--muted); width:18px; height:18px; }
hr.sep{ border:0; border-top:1px solid var(--line); margin:4px 0; width:100%; }
.check small{ font-size:13.5px; }
.in:disabled, .btn:disabled{ opacity:.55; }
.preview{ flex-wrap:wrap; }
.preview #pv{ display:inline-flex; align-items:center; gap:8px; white-space:nowrap; }

/* ---------- панель аккаунта (клик по аватарке) ---------- */
.chip{ cursor:pointer; border-radius:999px; }
.chip:hover .av{ box-shadow:0 0 0 3px rgba(242,140,40,.6); }
.noscroll, .noscroll body{ overflow:hidden; }
.drawer{ position:fixed; inset:0; z-index:100; }
.drawer-bg{ position:absolute; inset:0; background:rgba(10,20,40,.5); opacity:0; transition:opacity .2s; }
.drawer-panel{ position:absolute; top:0; right:0; bottom:0; width:min(460px,100%); background:var(--bg);
  display:flex; flex-direction:column; box-shadow:-12px 0 40px rgba(0,0,0,.25);
  transform:translateX(100%); transition:transform .22s ease; }
.drawer.open .drawer-bg{ opacity:1; }
.drawer.open .drawer-panel{ transform:none; }
.drawer-head{ display:flex; align-items:center; gap:10px; padding:12px 16px; background:var(--navy); color:#fff; border-bottom:4px solid var(--or); }
.drawer-head h2{ flex:1; margin:0; font:700 18px var(--head); }
.iconbtn2{ display:inline-grid; place-items:center; width:38px; height:38px; border-radius:10px; border:1.5px solid rgba(255,255,255,.35); background:transparent; color:#fff; }
.iconbtn2:hover{ background:rgba(255,255,255,.1); }
.iconbtn2 .i{ width:20px; height:20px; }
.drawer-body{ flex:1; overflow-y:auto; overscroll-behavior:contain; padding:16px; padding-bottom:calc(24px + env(safe-area-inset-bottom,0px)); }
.drawer-body .card{ border-radius:16px; padding:16px; }
@media (prefers-reduced-motion: reduce){ .drawer-panel, .drawer-bg{ transition:none; } }
