/* theme switch (both themes) and the dark theme on top of cabinet.css + app.css: the client cabinet and the admin panel
   (admin.css has its own layer in admin-theme.css). theme.js sets html[data-theme]; rules are :where()-prefixed so they
   only beat the same selector in the files above, which load earlier */
html:not([data-theme]) .theme-tg,html:not([data-theme]) .theme-seg{display:none}
.theme-tg{display:inline-grid;place-items:center;flex:none;width:42px;height:42px;margin-left:6px;padding:0;border:0;border-radius:50%;background:var(--canvas);color:var(--fg);cursor:pointer;transition:background-color .15s ease}
.theme-tg:hover{background:var(--press)}
.theme-tg svg{width:20px;height:20px}
html[data-theme=dark] .theme-tg .i-moon,html:not([data-theme=dark]) .theme-tg .i-sun{display:none}
.au-acts .theme-tg{margin-left:0}
.theme-seg{display:inline-flex;gap:2px;padding:3px;border-radius:999px;background:var(--canvas)}
.theme-seg button{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border:0;border-radius:999px;background:none;color:var(--mute);font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:background-color .15s ease,color .15s ease}
.theme-seg button:hover{color:var(--fg)}
.theme-seg button[aria-pressed=true]{background:var(--card);color:var(--fg);box-shadow:0 1px 2px rgba(11,18,32,.12)}
.theme-seg svg{width:15px;height:15px}
.card .theme-seg{align-self:center}
.foot-end{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
@media (max-width:420px){
  .foot-end .theme-seg button span{display:none}
  .foot-end .theme-seg button{padding:7px 10px}
}

/* dark: tokens */
/* blue-grey, the same values as the landing's theme.css: stage (wells) < canvas < card < press; brand-ink panels the card lifted
   towards the text, popovers (--pop) a step above the cards; a selection is a yellow ring, not a yellow wash */
html[data-theme=dark]{color-scheme:dark;
  --stage:#070A11;--canvas:#0D121C;--card:#171D2A;--press:#262D3D;--press-2:#323A4C;--fg:#ECEEF3;--fg-2:#C9CED9;--mute:#959CAD;
  --sep:rgba(255,255,255,.08);--hair:rgba(160,180,230,.08);--paper:#171D2A;--ink-soft:#959CAD;--line-dark:rgba(255,255,255,.1);
  --line:rgba(255,255,255,.08);--line-strong:#4A5266;--top-bg:rgba(23,29,42,.86);--ink-bg:color-mix(in srgb,var(--fg) 7%,var(--card));--ink-line:color-mix(in srgb,var(--fg) 12%,transparent);
  --pop:#1E2535;--sel-ring:var(--yellow);--sel-bg:rgba(246,202,47,.06);
  --ok:#5FD38A;--bad:#FF8A80;--warn:#F2C14E;
  --tint-y:rgba(246,202,47,.1);--tint-g:rgba(52,199,89,.13);--tint-r:rgba(255,90,79,.13)}
:where(html[data-theme=dark]) ::selection{background:rgba(246,202,47,.35)}

/* header, menus */
:where(html[data-theme=dark]) .top .wrap{background:var(--top-bg);box-shadow:0 0 0 1px var(--sep)}
:where(html[data-theme=dark]) .acct-menu,:where(html[data-theme=dark]) .app-menu{background:var(--pop);box-shadow:0 0 0 1px var(--ink-line),0 24px 48px -20px rgba(0,0,0,.6)}
:where(html[data-theme=dark]) .acct-menu a:hover,:where(html[data-theme=dark]) .acct-menu button:hover,:where(html[data-theme=dark]) .acct-menu a[aria-current],
:where(html[data-theme=dark]) .app-menu li a:hover,:where(html[data-theme=dark]) .app-menu li a:focus-visible{background:var(--press)}
@media (max-width:960px){
  :where(html[data-theme=dark]) .menu{background:var(--card);box-shadow:0 0 0 1px var(--sep),0 24px 48px -24px rgba(0,0,0,.7)}
}
:where(html[data-theme=dark]) .menu-link:hover{background:var(--press)}

/* buttons and fields */
:where(html[data-theme=dark]) .btn{background:var(--fg);color:#0B1220}
:where(html[data-theme=dark]) .btn:hover{background:#fff;color:#0B1220}
:where(html[data-theme=dark]) .btn-vk,:where(html[data-theme=dark]) .btn-vk:hover{background:#0077ff;border-color:#0077ff;color:#fff}
:where(html[data-theme=dark]) .btn-tg,:where(html[data-theme=dark]) .btn-tg:hover{background:#2aabee;border-color:#2aabee;color:#fff}
:where(html[data-theme=dark]) .btn-ghost,:where(html[data-theme=dark]) .btn-ghost.btn-wide{background:var(--card);color:var(--fg)}
:where(html[data-theme=dark]) .btn-ghost:hover{background:var(--press);color:var(--fg)}
:where(html[data-theme=dark]) .card .btn-ghost,:where(html[data-theme=dark]) .card .btn-ghost.btn-wide,:where(html[data-theme=dark]) .menu-end .btn-ghost,
:where(html[data-theme=dark]) .menu-guest .btn-ghost,:where(html[data-theme=dark]) .au .btn-ghost,:where(html[data-theme=dark]) .au .btn-ghost.btn-wide{background:var(--press)}
:where(html[data-theme=dark]) .card .btn-ghost:hover,:where(html[data-theme=dark]) .menu-end .btn-ghost:hover,:where(html[data-theme=dark]) .au .btn-ghost:hover{background:var(--press-2)}
:where(html[data-theme=dark]) .btn-yellow:hover,:where(html[data-theme=dark]) .foot .btn-yellow:hover{background:#fff;color:#06111F}
:where(html[data-theme=dark]) .btn.done,:where(html[data-theme=dark]) .btn.done:hover{background:#1F7A3D;border-color:#1F7A3D;color:#fff}
:where(html[data-theme=dark]) input:focus,:where(html[data-theme=dark]) select:focus,:where(html[data-theme=dark]) textarea:focus{border-color:var(--fg);background:var(--stage)}
:where(html[data-theme=dark]) .methods label:has(input:checked){background:var(--fg);color:#0B1220}
:where(html[data-theme=dark]) .consent input,:where(html[data-theme=dark]) .adm-check input{accent-color:var(--yellow)}
:where(html[data-theme=dark]) .switch{background:var(--line-strong)}
:where(html[data-theme=dark]) .spinner{border-top-color:var(--fg)}
:where(html[data-theme=dark]) :focus-visible{outline-color:var(--fg)}

/* brand-ink blocks: the card lifted towards the text colour with a hairline, so they follow any dark palette */
:where(html[data-theme=dark]) .card.notice,:where(html[data-theme=dark]) .note,:where(html[data-theme=dark]) .pd,:where(html[data-theme=dark]) .plan-detail{
  background:var(--ink-bg);box-shadow:inset 0 0 0 1px var(--ink-line)}
:where(html[data-theme=dark]) .plan-detail .pd{box-shadow:none}
:where(html[data-theme=dark]) .pill.on{background:var(--fg);color:#0B1220}

/* plans */
:where(html[data-theme=dark]) .pr-dot{border-color:var(--line-strong);background:var(--card)}
:where(html[data-theme=dark]) :is(#pm1:checked~.plan-list [for=pm1],#pm2:checked~.plan-list [for=pm2],#pm3:checked~.plan-list [for=pm3],
  #pm6:checked~.plan-list [for=pm6],#pm12:checked~.plan-list [for=pm12]){background:var(--sel-bg);box-shadow:inset 0 0 0 2px var(--sel-ring)}
:where(html[data-theme=dark]) :is(#pm1:checked~.plan-list [for=pm1],#pm2:checked~.plan-list [for=pm2],#pm3:checked~.plan-list [for=pm3],
  #pm6:checked~.plan-list [for=pm6],#pm12:checked~.plan-list [for=pm12]) .pr-dot{border-color:var(--yellow)}
:where(html[data-theme=dark]) :is(#pm1:checked~.plan-list [for=pm1],#pm2:checked~.plan-list [for=pm2],#pm3:checked~.plan-list [for=pm3],
  #pm6:checked~.plan-list [for=pm6],#pm12:checked~.plan-list [for=pm12]) .pr-save:not(.is-base){color:#06111F}
:where(html[data-theme=dark]) .promo-on{background:var(--sel-bg);box-shadow:inset 0 0 0 2px var(--sel-ring)}
:where(html[data-theme=dark]) .tk-msg.is-staff{background:var(--sel-bg);box-shadow:inset 0 0 0 1px rgba(246,202,47,.25)}

/* cards: a hairline, as white cards get from the grey canvas in the light theme */
:where(html[data-theme=dark]) :where(.card,.plans,.foot>.wrap,.strip,.methods label,.pwa-sheet){box-shadow:inset 0 0 0 1px var(--hair)}

/* statuses */
:where(html[data-theme=dark]) .pill.ok,:where(html[data-theme=dark]) .app-menu li .pill.ok{background:var(--tint-g)}
:where(html[data-theme=dark]) .pill.bad{background:var(--tint-r)}
:where(html[data-theme=dark]) .pill.warn{background:var(--tint-y);color:var(--warn)}
:where(html[data-theme=dark]) .app-menu-copy.done{background:var(--tint-g);color:var(--ok)}
:where(html[data-theme=dark]) .pt-how-steps li.is-done::before{background:var(--tint-g);color:var(--ok)}
:where(html[data-theme=dark]) .warn-text,:where(html[data-theme=dark]) .sub-card.is-soon .sub-warn{color:var(--warn)}
:where(html[data-theme=dark]) .sub-card.is-soon{border-color:var(--warn)}
:where(html[data-theme=dark]) .foot .net-dot.ok,:where(html[data-theme=dark]) .au-foot .net-dot.ok{background:var(--ok);box-shadow:0 0 0 4px rgba(95,211,138,.14)}
:where(html[data-theme=dark]) .bar .fill{fill:var(--fg)}
:where(html[data-theme=dark]) .bar.hot .fill{fill:var(--bad)}

/* text and lines that used the old ink */
:where(html[data-theme=dark]) .adm-tabs .pill,:where(html[data-theme=dark]) .adm-form label.adm-check{color:var(--fg)}
:where(html[data-theme=dark]) .pt-periods .pill{color:var(--fg)}
:where(html[data-theme=dark]) .pt-periods .pill.on{background:var(--fg);color:#0B1220}
:where(html[data-theme=dark]) .check-table td,:where(html[data-theme=dark]) .router-how{border-color:var(--sep)}

/* bookmark demo on the router page: a light browser window stays light */
:where(html[data-theme=dark]) .bmx-win,:where(html[data-theme=dark]) .bmx-bar>.bmx-slot{color:#0B1220}
:where(html[data-theme=dark]) .bmx-win{border-color:transparent}
:where(html[data-theme=dark]) .router-how kbd{background:var(--card)}

/* theme switch in the dark */
:where(html[data-theme=dark]) .theme-tg{background:var(--press)}
:where(html[data-theme=dark]) .theme-tg:hover{background:var(--press-2)}
:where(html[data-theme=dark]) .theme-seg button[aria-pressed=true]{background:var(--press);box-shadow:none}
:where(html[data-theme=dark]) .card .theme-seg{background:var(--canvas)}
:where(html[data-theme=dark]) .wlp-vs .plus b{color:#F472B6}
@media (max-width:359px){.theme-seg button{gap:4px;padding:6px 8px}}
