/* 128mb UI tokens and light/dark surfaces, brandbook v1.1 (lilac-graphite palette). Loaded AFTER page CSS. */
/* User-produced images, VK cover preview canvases, and provider logos are deliberately excluded. */
:root {
  color-scheme: light;
  --bg:#f7f6fa; --card:#ffffff; --text:#201c29; --muted:#6c6875;
  --line:#e8e3f0; --accent:#6842b9; --accent2:#58339f;
  --action-bg:#6842b9; --action-bg-hover:#58339f; --on-action:#ffffff;
  --field-bg:#ffffff; --field-border:#91889d; --surface-soft:#faf9fd;
  --surface-highlight:#f2edfa; --surface-track:#eeeaf4; --surface-placeholder:#eeebf4;
  --panel-hover:#f5f0fc; --menu-bg:#ffffff; --notice-border:#e8e3f0;
  --ok:#168552; --bad:#bf2b2b; --ok-bg:#e6f5ee; --bad-bg:#fff1ed;
  --ok-border:#c7e7d9; --bad-border:#f0caca;
  --illustration-surface:#f0eafa; --illustration-outline:#d8c6ed;
  --info-tint:#f6f0ff; --success-tint:#f0f5ff;
  --shadow:0 14px 40px rgba(20,25,35,.07);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg:#15131d; --card:#231f30; --text:#f5f1fc; --muted:#bab3cb;
  --line:#463c58; --accent:#d0b7ff; --accent2:#d0b7ff;
  --action-bg:#7853c7; --action-bg-hover:#6843b5; --on-action:#ffffff;
  --field-bg:#1b1727; --field-border:#7b6a98; --surface-soft:#2b253a;
  --surface-highlight:#36294b; --surface-track:#3a314c; --surface-placeholder:#30283f;
  --panel-hover:#382c4a; --menu-bg:#2b243a; --notice-border:#5b4d72;
  --ok:#6ae0ac; --bad:#ff8e99; --ok-bg:#193a31; --bad-bg:#442932;
  --ok-border:#356954; --bad-border:#84515c;
  --illustration-surface:#352b4a; --illustration-outline:#74608f;
  --info-tint:#30243f; --success-tint:#28283d;
  --shadow:0 14px 40px rgba(0,0,0,.23);
}
@media(prefers-color-scheme:dark) {
  html:not([data-theme]) { color-scheme:dark; }
}
/* Brand gradients only for site illustrations, not produced VK images. */
:root { --brand-gradient-start:#6c43b8; --brand-gradient-end:#ac85d8; }
html[data-theme="dark"] { --brand-gradient-start:#57368f; --brand-gradient-end:#996bc7; }
/* Predictable controls and contrast across legacy pages */
html { color:var(--text); background:var(--bg); }
body { background:var(--bg); color:var(--text); }
input, select, textarea { background:var(--field-bg); border-color:var(--field-border); color:var(--text); }
input::placeholder, textarea::placeholder { color:var(--muted); opacity:.9; }
button, option { color:inherit; }
.primary,button.primary,.linkbtn.primary {background:var(--action-bg); color:var(--on-action);}
.primary:hover,button.primary:hover,.linkbtn.primary:hover {background:var(--action-bg-hover);}
.balance,.avatar,.secondary,.task-center,.account-chip,.account-menu,.task-list-card,.catalog-owner,
.ok-album,.album { background:var(--card); color:var(--text); }
.notice { background:var(--surface-soft); color:var(--text); border-color:var(--notice-border); }
.notice.bad,.error,.lc-message.error { color:var(--bad); }
.notice.ok,.success,.lc-message.success { color:var(--ok); }
.notice.bad { border-color:var(--bad-border); }
.notice.ok { border-color:var(--ok-border); }
.owner-fallback,.account-fallback,.task-group-title span,.resolve-steps span.active {background:var(--surface-highlight);}
.album-cover,.ok-preview img { background:var(--surface-placeholder); }
.progress,.pipeline i,.task-center-bar,.resolve-steps span {background:var(--surface-track);}
.ok-album:hover,.catalog-owner:hover,.account-menu a:hover,.account-menu button:hover {background:var(--panel-hover);}
.catalog-owner:hover,.task-list-card:hover,.task-center:hover,.account-chip:hover {border-color:var(--field-border);}
.radio-ui {border-color:var(--field-border);}
.catalog-owner small,.ok-album small {color:var(--muted);}
.cookie {background:var(--menu-bg); color:var(--text);border:1px solid var(--line);}
.cookie span {color:var(--muted);}
.lcl-label {color:var(--accent2);}
.lcl-restore {background:linear-gradient(120deg,var(--info-tint),var(--success-tint));border-color:var(--line);}
.lcl-hero-art stop:first-child {stop-color:var(--brand-gradient-start);}
.lcl-hero-art stop:last-child {stop-color:var(--brand-gradient-end);}
.lcl-hero-art rect[fill="#edf4ff"] {fill:var(--illustration-surface);}
.lcl-hero-art rect[stroke="#cfdff0"] {stroke:var(--illustration-outline);}
.lcl-examples article,.lcl-three article {background:var(--card);color:var(--text);}
.vkws-day {background:var(--card);}
.vkws-calendar-task {color:#382052;background:#eee3fb;border-color:#c7a7df;} /* Lilac planner; other semantic colors preserved */
html[data-theme="dark"] .vkws-calendar-task {background:#48335d;border-color:#ad89d1;color:#f8f1ff;}
html[data-theme="dark"] .vkws-calendar-color-1 {background:#1e493b;border-color:#50b38c;color:#d3ffee;}
html[data-theme="dark"] .vkws-calendar-color-2 {background:#433054;border-color:#b487dc;color:#f6e9ff;}
html[data-theme="dark"] .vkws-calendar-color-3 {background:#4d3e26;border-color:#d0a85e;color:#fff3d2;}
/* Dark-only corrections for fixed legacy light surfaces. Not applied to VK mockups. */
html[data-theme="dark"] .catalog-owner {background:var(--card);}
html[data-theme="dark"] .album:hover {box-shadow:0 5px 18px rgba(0,0,0,.25);}
html[data-theme="dark"] .account-menu {box-shadow:0 16px 30px rgba(0,0,0,.35);}
html[data-theme="dark"] .task-list-card:hover {box-shadow:0 7px 22px rgba(0,0,0,.26);}
html[data-theme="dark"] .lc-template {color:#fff;} /* Preset itself must remain visually accurate */
html[data-theme="dark"] .lc-view-toggle button.active {background:var(--action-bg);border-color:var(--action-bg);color:var(--on-action);}
html[data-theme="dark"] .vkws-scene-list button:hover,
html[data-theme="dark"] .vkws-projects button:hover {border-color:var(--accent);}
html[data-theme="dark"] .account-status-error {background:var(--bad-bg);color:var(--bad);}
html[data-theme="dark"] .account-status-success {background:var(--ok-bg);color:var(--ok);}
/* Remaining legacy light panels, feedback and calendar statuses */
.archive-options,.catalog-section,.avatar-cleanup {background:var(--surface-soft);color:var(--text);}
.avatar-preview-box,.cover-image-wrap {background:var(--surface-placeholder);}
.account-message.bad {background:var(--bad-bg);color:var(--bad);border-color:var(--bad-border);}
.account-message.good {background:var(--ok-bg);color:var(--ok);border-color:var(--ok-border);}
.account-identity .account-tag {color:var(--ok);}
.account-tabs button.active {background:var(--action-bg);border-color:var(--action-bg);color:var(--on-action);}
.account-menu button:hover,.account-menu>a:hover {background:var(--panel-hover);}
/* Recolor existing interaction states without changing content/preview images. */
.album:hover,.album:has(input:checked),.service-card:hover {border-color:var(--field-border);}
.album:has(input:checked) {box-shadow:0 0 0 3px rgba(104,66,185,.13);}
.resolve-steps span.active,.pipeline .active i {background:var(--surface-highlight);color:var(--accent);}
.progress.indeterminate i {background:linear-gradient(90deg,var(--action-bg),var(--accent),var(--action-bg));}
.album:has(input[type=checkbox]:checked) .radio-ui {background:var(--surface-highlight);}
.pipeline .active i,.pipeline .complete i,.done-icon {background:var(--surface-highlight);}
.pipeline .complete i,.done-icon {color:var(--ok);background:var(--ok-bg);}
.pipeline>div,.resolve-steps span,.album-placeholder {color:var(--muted);}
.vkws-conflict {color:var(--bad)!important;}
.vkws-ok {color:var(--ok)!important;}
/* Shared accessible theme switch; injected into existing header without changing server templates. */
.top {height:auto;min-height:64px;gap:10px;}
.top-right {align-items:center;flex-wrap:wrap;justify-content:flex-end;}
.theme-toggle {display:inline-flex;align-items:center;justify-content:center;flex:0 0 38px;
  height:38px;width:38px;cursor:pointer;border:1px solid var(--line);border-radius:12px;
  background:var(--card);color:var(--text);transition:background .16s,border-color .16s;}
.theme-toggle:hover {background:var(--surface-highlight);border-color:var(--field-border);}
.theme-toggle:focus-visible {outline:2px solid var(--accent);outline-offset:3px;}
.theme-toggle svg {width:19px;height:19px;display:block;fill:none;stroke:currentColor;
  stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
@media(max-width:620px) {
  .top {padding:10px 14px;align-items:flex-start;}
  .top-right {gap:6px;}
  .theme-toggle {width:36px;height:36px;flex-basis:36px;}
}
@media(prefers-reduced-motion:reduce) {
  .theme-toggle {transition:none;}
}

/* Approved 128mb linked-frame vector identity; two explicit theme assets. */
.logo.brand-logo {display:inline-flex;align-items:center;flex:0 0 auto;min-width:0;text-decoration:none;}
.logo.brand-logo img {width:152px;height:auto;max-width:100%;display:block;flex:0 0 auto;}
.logo.brand-logo .brand-logo-dark {display:none;}
html[data-theme="dark"] .logo.brand-logo .brand-logo-light {display:none;}
html[data-theme="dark"] .logo.brand-logo .brand-logo-dark {display:block;}
.brand-logo-sr {position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
@media(max-width:620px) {.logo.brand-logo img {width:120px;}}
/* Unified Robokassa-ready public header/footer (v0.19). */
.top-right .site-links{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-right:8px}
.site-links a{color:var(--text);font-size:13px;font-weight:650;text-decoration:none;white-space:nowrap}
.site-links a:hover,.site-footer a:hover{color:var(--accent);text-decoration:underline}
.site-footer{display:flex;flex-direction:column;align-items:stretch;gap:12px;border-top:1px solid var(--line);padding:22px 0;margin-top:34px;color:var(--muted);font-size:13px}
.site-footer-links,.site-footer-details{display:flex;flex-wrap:wrap;align-items:center;gap:10px 20px}
.site-footer a{color:var(--text);text-decoration:none}
.site-footer-details{font-size:12px;color:var(--muted)}
.site-footer-details a{color:var(--accent)}
@media(max-width:850px){.top{flex-wrap:wrap;gap:10px}.top-right{flex-wrap:wrap;justify-content:flex-end}.top-right .site-links{order:3;width:100%;justify-content:flex-end;margin-right:0}}
@media(max-width:420px){.site-links a{font-size:12px}.top-right .site-links{gap:7px}.site-footer{padding:18px 0}}
