/* Crystal Wiki — accessible contrast layer for both theme modes.
   Loaded after legacy/wiki winter sheets; no changes to wiki.js or commands. */
html:not([data-theme="dark"]){
  --wiki-fg:#182958;--wiki-sub:#465c83;--wiki-panel:#f8fbff;--wiki-panel-alt:#ecf3ff;--wiki-line:#bccce8;--wiki-link:#1455b7;--wiki-soft:#e5eeff;
}
html[data-theme="dark"]{
  --wiki-fg:#f2f6ff;--wiki-sub:#c4d2eb;--wiki-panel:#16274c;--wiki-panel-alt:#1c315c;--wiki-line:#5272a9;--wiki-link:#a1d9ff;--wiki-soft:#1b3567;
}
html:not([data-theme="dark"]) body,html[data-theme="dark"] body{color:var(--wiki-fg)}
.wiki-sidebar,.wiki-main,.wiki-header,.wiki-section,.wiki-nav-scroll,.sidebar-brand,.wiki-header-content{color:var(--wiki-fg)}
/* Primary surfaces, layered cards and readable copy */
.wiki-nav-scroll,.sidebar-brand,.wiki-header,.cmd-block,.counter-item,.faq-item,.info-block,.vk-preview,.vip-feature,.role-row,.cmd-step,.related-cmd{
  color:var(--wiki-fg)!important;border-color:var(--wiki-line)!important;
}
.wiki-title,.wiki-section-title,.sidebar-brand-text,.wiki-section-title-wrap,.cmd-block-syntax,.cmd-block-title,.cmd-block-subtitle,.vip-feature-title,.faq-q,.faq-a,.role-row-name,.cmd-step-content,.wiki-lead{color:var(--wiki-fg)}
.wiki-subtitle,.wiki-section-desc,.cmd-block-desc,.cmd-param,.role-row-desc,.vip-feature-desc,.counter-label,.wiki-meta-item,.sidebar-section-title,.sidebar-brand-text small,.wiki-lead p{color:var(--wiki-sub)!important}
html:not([data-theme="dark"]) .sidebar-nav a{color:#274c82!important}
html:not([data-theme="dark"]) .sidebar-nav a:hover{background:#deebff!important;color:#103b86!important}
html:not([data-theme="dark"]) .sidebar-nav a.active{background:linear-gradient(120deg,#cfe7ff,#dedaff)!important;color:#173b91!important}
html[data-theme="dark"] .sidebar-nav a{color:#d0dfff!important}
html[data-theme="dark"] .sidebar-nav a:hover{background:#294879!important;color:#fff!important}
html[data-theme="dark"] .sidebar-nav a.active{background:linear-gradient(120deg,#234d9c,#51418b)!important;color:white!important}
html:not([data-theme="dark"]) .cmd-block,html:not([data-theme="dark"]) .faq-item,html:not([data-theme="dark"]) .info-block,html:not([data-theme="dark"]) .vip-feature,html:not([data-theme="dark"]) .role-row,html:not([data-theme="dark"]) .cmd-step{background:rgba(251,253,255,.96)!important}
html[data-theme="dark"] .cmd-block,html[data-theme="dark"] .faq-item,html[data-theme="dark"] .info-block,html[data-theme="dark"] .vip-feature,html[data-theme="dark"] .role-row,html[data-theme="dark"] .cmd-step{background:var(--wiki-panel)!important;color:var(--wiki-fg)!important}
/* Buttons: prevent a dark label on dark button / light label on light button */
html:not([data-theme="dark"]) .wiki-quicklink,html:not([data-theme="dark"]) .wiki-meta-item,html:not([data-theme="dark"]) .wiki-badge{background:#f2f7ff!important;color:#23447f!important;border:1px solid #a9bfdf!important}
html:not([data-theme="dark"]) .wiki-quicklink--primary{background:linear-gradient(105deg,#136ce2,#7151da)!important;color:#fff!important;border-color:#5685e8!important}
html[data-theme="dark"] .wiki-quicklink,html[data-theme="dark"] .wiki-meta-item,html[data-theme="dark"] .wiki-badge{background:#213961!important;color:#eaf5ff!important;border:1px solid #7193c7!important}
html[data-theme="dark"] .wiki-quicklink--primary{background:linear-gradient(105deg,#1468c8,#6e44cd)!important;color:#fff!important}
.wiki-quicklink:hover{filter:brightness(1.07)}
html:not([data-theme="dark"]) .wiki-search input{background:#fff!important;color:#142958!important;border:2px solid #aabedd!important}
html[data-theme="dark"] .wiki-search input{background:#152c54!important;color:#f4f8ff!important;border:2px solid #6282b7!important}
html:not([data-theme="dark"]) input::placeholder{color:#67799e!important;opacity:1}
html[data-theme="dark"] input::placeholder{color:#a0b4d5!important;opacity:1}
html:not([data-theme="dark"]) .cmd-block-syntax,html:not([data-theme="dark"]) .cmd-block-params,html:not([data-theme="dark"]) .cmd-meta-item,html:not([data-theme="dark"]) .cmd-param b,html:not([data-theme="dark"]) .related-cmd{background:#e4eeff!important;color:#193f87!important;border-color:#abc6ed!important}
html[data-theme="dark"] .cmd-block-syntax,html[data-theme="dark"] .cmd-block-params,html[data-theme="dark"] .cmd-meta-item,html[data-theme="dark"] .cmd-param b,html[data-theme="dark"] .related-cmd{background:#203f70!important;color:#d8edff!important;border-color:#6887bd!important}
.cmd-block-params .cmd-param,.cmd-block-params .cmd-param b,.cmd-meta-label,.cmd-meta-value{color:var(--wiki-fg)!important}
html:not([data-theme="dark"]) .cmd-block-role{background:#dfeaff!important;border:1px solid #aac4ed!important;color:#193f7c!important}
html[data-theme="dark"] .cmd-block-role{background:#294772!important;border:1px solid #6886b8!important;color:#edf5ff!important}
html:not([data-theme="dark"]) .cmd-block-role.vip-only{background:#fff1c9!important;color:#6b490c!important}
html[data-theme="dark"] .cmd-block-role.vip-only{background:#765020!important;color:#fff0c1!important}
html:not([data-theme="dark"]) .nav-count{background:#e2eaff!important;color:#21497e!important}
html[data-theme="dark"] .nav-count{background:#385586!important;color:#ecf5ff!important}
/* Alerts, preview, tutorial rows */
html:not([data-theme="dark"]) .info-block.warning{background:#fff3dd!important;color:#593909!important;border-color:#e7b855!important}
html:not([data-theme="dark"]) .info-block.danger{background:#fff0f1!important;color:#791f35!important;border-color:#ee9aab!important}
html:not([data-theme="dark"]) .info-block.info{background:#e3f1ff!important;color:#153f75!important;border-color:#8dbfec!important}
html:not([data-theme="dark"]) .info-block.vip{background:#fff5d8!important;color:#694915!important;border-color:#e9c971!important}
html[data-theme="dark"] .info-block.warning{background:#4b371b!important;color:#ffedc2!important;border-color:#ab843f!important}
html[data-theme="dark"] .info-block.danger{background:#4b2633!important;color:#ffdadf!important;border-color:#a45470!important}
html[data-theme="dark"] .info-block.info{background:#17365a!important;color:#d9eeff!important;border-color:#5389c7!important}
html[data-theme="dark"] .info-block.vip{background:#473a24!important;color:#fff1c3!important;border-color:#b09357!important}
html:not([data-theme="dark"]) .vk-preview-body,html:not([data-theme="dark"]) .vk-preview-header{background:#e5effb!important;color:#1e365e!important}
html[data-theme="dark"] .vk-preview-body,html[data-theme="dark"] .vk-preview-header{background:#142b53!important;color:#e8f4ff!important}
html:not([data-theme="dark"]) .vk-msg,.wiki-footer,.counter-item{color:#234376!important}
html[data-theme="dark"] .vk-msg,.wiki-footer,.counter-item{color:#e3edff!important}
/* Original VK chat bubbles stay intentionally high contrast in both modes */
.vk-bubble.user,.vk-bubble.bot{color:#fff!important}
html:not([data-theme="dark"]) .vk-bubble.bot{background:#24527a!important}
html:not([data-theme="dark"]) .vk-bubble.user{background:#2760a6!important}
html[data-theme="dark"] .vk-bubble.bot{background:#22547d!important}
html[data-theme="dark"] .vk-bubble.user{background:#234984!important}
html:not([data-theme="dark"]) .wiki-header .wiki-title{color:#162b65!important}
html[data-theme="dark"] .wiki-header .wiki-title{color:#f2f8ff!important}
.wiki-section a:not(.cmd-block-syntax),.wiki-footer a,.inline-link{color:var(--wiki-link)!important;text-decoration-color:currentColor}
.wiki-section a:focus-visible,.wiki-quicklink:focus-visible,.wiki-search input:focus-visible,.sidebar-nav a:focus-visible{outline:3px solid #48c8ff;outline-offset:3px}
@media(prefers-reduced-motion:reduce){.wiki-nav-scroll a,.wiki-quicklink{transition:none!important}}

/* Keep decorative robot from obscuring Wiki action and counters */
.wiki-hero-decoration{width:29%!important;max-width:305px!important;right:-2%!important;bottom:-25px!important;opacity:.74;z-index:0!important;mask-image:linear-gradient(90deg,transparent 0%,#000 37%);-webkit-mask-image:linear-gradient(90deg,transparent 0%,#000 37%)}
.wiki-header-content{z-index:2!important;position:relative}
@media(max-width:768px){.wiki-hero-decoration{width:180px!important;opacity:.35!important;bottom:-20px!important}}
