/* Тёмная тема: включается атрибутом data-theme="dark" на <html> (модуль «Тема») */
html[data-theme=dark]{color-scheme:dark;
  --paper:#070e19;--white:#0e1a2a;--ink:#dbe6f2;--muted:#8fa3ba;--line:#1d2e45;--tint:color-mix(in srgb,var(--teal) 16%,#0e1a2a);
  --warm:#3a2f17;--rose:#3a1d1b;--blue:#16293a;--rose-d:#ff8f84;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 22px 44px -12px rgba(0,0,0,.6);--shadow-s:0 1px 2px rgba(0,0,0,.35),0 8px 18px -8px rgba(0,0,0,.5);--focus:rgba(21,184,172,.3)}
html[data-theme=dark] body{background:var(--paper);color:var(--ink)}
html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3,html[data-theme=dark] h4{color:#eef4fa}
html[data-theme=dark] a{color:#5fd3c6}
html[data-theme=dark] label{color:#a9bfca}
html[data-theme=dark] .skip,
html[data-theme=dark] .card,html[data-theme=dark] .table-wrap,html[data-theme=dark] .kpi,html[data-theme=dark] .day,html[data-theme=dark] .stats,
html[data-theme=dark] .pc,html[data-theme=dark] .slot,html[data-theme=dark] .tcard,html[data-theme=dark] .trial form,html[data-theme=dark] .steps div,
html[data-theme=dark] .login-card,html[data-theme=dark] .kcard,html[data-theme=dark] .slotrow,html[data-theme=dark] .rank,html[data-theme=dark] details.quick .pop,
html[data-theme=dark] .topbar,html[data-theme=dark] .thumbs button,html[data-theme=dark] .seg label{background:var(--white);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .topbar{background:rgba(7,14,25,.8);border-bottom-color:var(--line)}
html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea,html[data-theme=dark] .top-search input{background:#0a1522;color:var(--ink);border-color:#2a3f58}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#6f8795}
html[data-theme=dark] input:focus,html[data-theme=dark] select:focus,html[data-theme=dark] textarea:focus{border-color:#15b8ac;box-shadow:0 0 0 3px var(--focus)}
html[data-theme=dark] .btn{background:#15263a;color:#dbe6f2;border-color:#2c425c}
html[data-theme=dark] .btn:hover{background:#1b3149;border-color:#44627f}
html[data-theme=dark] .btn.primary{background:var(--grad);border-color:transparent;color:#fff}
html[data-theme=dark] .btn.primary:hover{background:var(--grad)}
html[data-theme=dark] .btn.gold{background:var(--gold-grad);color:#3a2505;border-color:transparent}
html[data-theme=dark] .btn.danger{background:#2a1a1b;color:#ff9b91;border-color:#6b3b3a}
html[data-theme=dark] .btn.ghost{background:transparent;border-color:transparent}
html[data-theme=dark] th{background:#101f33;color:#9fb3c8;border-bottom-color:var(--line)}
html[data-theme=dark] td{border-top-color:#182a40}
html[data-theme=dark] tbody tr:hover{background:#112238}
html[data-theme=dark] .chip,html[data-theme=dark] .seat{background:var(--tint);color:#7ee0d4}
html[data-theme=dark] .badge,html[data-theme=dark] .b-attendance-excused,html[data-theme=dark] .b-post-draft{background:#22364a;color:#b9ccd8}
html[data-theme=dark] .b-session-planned,html[data-theme=dark] .b-lead-new,html[data-theme=dark] .b-sub-frozen,html[data-theme=dark] .b-payment-pending,html[data-theme=dark] .b-booking-pending,html[data-theme=dark] .b-hw-done,html[data-theme=dark] .b-reward-pending{background:#18324a;color:#8cc4f2}
html[data-theme=dark] .b-session-done,html[data-theme=dark] .b-lead-enrolled,html[data-theme=dark] .b-attendance-present,html[data-theme=dark] .b-outbox-sent,html[data-theme=dark] .b-post-published,html[data-theme=dark] .b-student-active,html[data-theme=dark] .b-lead-attended,html[data-theme=dark] .b-sub-active,html[data-theme=dark] .b-payment-paid,html[data-theme=dark] .b-booking-confirmed,html[data-theme=dark] .b-task-done,html[data-theme=dark] .b-hw-checked,html[data-theme=dark] .b-reward-rewarded{background:#143a2b;color:#7fe0a8}
html[data-theme=dark] .b-session-cancelled,html[data-theme=dark] .b-lead-lost,html[data-theme=dark] .b-attendance-absent,html[data-theme=dark] .b-outbox-failed,html[data-theme=dark] .b-student-left,html[data-theme=dark] .b-sub-expired,html[data-theme=dark] .b-payment-failed,html[data-theme=dark] .b-booking-cancelled,html[data-theme=dark] .b-reward-rejected,html[data-theme=dark] .b-sub-cancelled,html[data-theme=dark] .seat.full{background:#3d1f1e;color:#ff9b91}
html[data-theme=dark] .b-lead-trial_booked{background:#2a2447;color:#c3b4ff}
html[data-theme=dark] .flash.ok{background:#143a2b;color:#8ee6b3;border-color:#25694d}
html[data-theme=dark] .flash.err,html[data-theme=dark] .alert.err{background:#3d1f1e;color:#ffb3aa;border-color:#7a3b38}
html[data-theme=dark] .tabs a:hover{background:var(--tint);color:#7ee0d4}
html[data-theme=dark] .lang-sw{background:rgba(255,255,255,.08)}html[data-theme=dark] .lang-sw a.on{box-shadow:0 0 0 2px #0e1a2a,0 0 0 3.5px var(--gold)}
html[data-theme=dark] details.quick .pop a{color:var(--ink)}html[data-theme=dark] details.quick .pop a:hover{background:#1b3340}
html[data-theme=dark] .lesson{background:var(--tint);color:var(--ink)}
html[data-theme=dark] .lesson.cancelled{background:#3a2020}html[data-theme=dark] .lesson.done{background:#17262f}html[data-theme=dark] .lesson.moved{background:#3a3016}
html[data-theme=dark] .kcol,html[data-theme=dark] .embed{background:#0b1726}
html[data-theme=dark] .progress,html[data-theme=dark] .bar>span:nth-child(2),html[data-theme=dark] .rung .bar2{background:#1b2d45}
html[data-theme=dark] .switch span{background:#3a5568}
html[data-theme=dark] .userbox b{color:#eaf3f6}
html[data-theme=dark] .muted,html[data-theme=dark] .page-head p{color:var(--muted)}
html[data-theme=dark] code{background:#1a2f3d;color:#bfe3ea}
html[data-theme=dark] hr{border-color:var(--line)}
html[data-theme=dark] .crumb a{color:#5fd3c6}
html[data-theme=dark] .page-top{background:transparent}
html[data-theme=dark] details{color:var(--ink)}
html[data-theme=dark] .empty{color:var(--muted)}
html[data-theme=dark] .hero .btn.out,html[data-theme=dark] .btn.out{background:transparent;color:#fff;border-color:#ffffff66}
/* кнопка переключения */
.theme-btn{min-width:38px;justify-content:center;font-size:16px;padding:6px 10px}
html[data-theme=dark] .stats div{border-left-color:var(--line)}html[data-theme=dark] .stats span{color:var(--muted)}
@media(max-width:860px){html[data-theme=dark] .stats div{border-top-color:var(--line)}}
html[data-theme=dark] .hero .btn.primary{background:var(--gold-grad);color:#3a2505;border-color:transparent}
html[data-theme=dark] .steps div b,html[data-theme=dark] .tcard h3{color:#eaf3f6}
.chess-live.loading{opacity:.65;transition:opacity .2s}

html[data-theme=dark] .calc-form,html[data-theme=dark] .calc-res{background:var(--white);border-color:var(--line)}
html[data-theme=dark] .choice{background:#0a1522}html[data-theme=dark] .choice label{color:#9fb3c8}html[data-theme=dark] .choice input:checked+label{background:#1a2f48;color:#7ee0d4}
html[data-theme=dark] .next{color:#cfe6f5}html[data-theme=dark] .tabs a{color:#9fb3c8}
html[data-theme=dark] .login-demo{background:var(--tint);border-color:#2a4a52}
html[data-theme=dark] .section-h h2,html[data-theme=dark] .page-top h1,html[data-theme=dark] .day-title,html[data-theme=dark] .pc h3{color:#eef4fa}
html[data-theme=dark] .tcard .ph{box-shadow:0 0 0 5px var(--white),0 0 0 6px var(--line)}
html[data-theme=dark] .avatar{color:#fff}
html[data-theme=dark] .article .body{color:#c3d1e0}
/* шапка сайта всегда тёмная — перебиваем общие правила ссылок тёмной темы */
html[data-theme=dark] .s-nav a,html[data-theme=dark] .s-brand{color:#c3d3e8}
html[data-theme=dark] .s-nav a:hover,html[data-theme=dark] .s-nav a.active,html[data-theme=dark] .s-brand{color:#fff}
html[data-theme=dark] .s-nav .btn.primary{color:#fff}html[data-theme=dark] .s-nav .btn:not(.primary){background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.18);color:#fff}
html[data-theme=dark] .s-foot a{color:#c3d3e8}html[data-theme=dark] .s-foot a:hover{color:#fff}
/* акцентные градиентные тексты светлее на тёмном фоне */
html[data-theme=dark] .kicker,html[data-theme=dark] .kpi b,html[data-theme=dark] .stats b,html[data-theme=dark] .slot .t,html[data-theme=dark] .calc-res .lvl,html[data-theme=dark] .err-page .code{background-image:linear-gradient(135deg,#6ff0dc,#8fb4ff)}
html[data-theme=dark] .stats{background:var(--white)}

html[data-theme=dark] .secbar{background:rgba(7,14,25,.86);border-bottom-color:var(--line)}
html[data-theme=dark] .secbar a{color:#9fb3c8}html[data-theme=dark] .secbar a:hover,html[data-theme=dark] .secbar a.active{color:#7ee0d4}
html[data-theme=dark] .sum-all{background:#0e1c2c;border-color:#1d3045}

html[data-theme=dark] .b-outbox-logged{background:#1f2c40;color:#9cc0f0}
