/* CyberToolkit V21 advanced theme systems. Keeps V18/V19 visual variables intact. */
html[data-site-theme="obsidian-crown"],body[data-theme-layout="obsidian-crown"]{--ct-a:#b58b35;--ct-b:#e2c36b;--ct-gold:#e2c36b;--ct-bg:#08090d;--ct-surface:#10131b;--ct-surface-2:#151925;--ct-text:#f7f4ec;--ct-muted:#a7adba;--ct-line:#292e3b;--ct-shadow:0 24px 70px rgba(0,0,0,.38)}
html[data-site-theme="aurora-glass"],body[data-theme-layout="aurora-glass"]{--ct-a:#7c5cff;--ct-b:#43d9d0;--ct-gold:#d6b85a;--ct-bg:#eef3ff;--ct-surface:rgba(255,255,255,.72);--ct-surface-2:rgba(245,248,255,.72);--ct-text:#182039;--ct-muted:#65708b;--ct-line:rgba(120,130,170,.22);--ct-shadow:0 24px 70px rgba(61,70,130,.15)}
html[data-site-theme="executive-pearl"],body[data-theme-layout="executive-pearl"]{--ct-a:#6d4d9b;--ct-b:#b69250;--ct-gold:#b69250;--ct-bg:#faf7f0;--ct-surface:#fffdf8;--ct-surface-2:#f5efe5;--ct-text:#2d2832;--ct-muted:#756b78;--ct-line:#e8dfd1;--ct-shadow:0 20px 55px rgba(79,63,45,.1)}
html[data-site-theme="titanium-noir"],body[data-theme-layout="titanium-noir"]{--ct-a:#5f7d9d;--ct-b:#d1a54a;--ct-gold:#d1a54a;--ct-bg:#0c1015;--ct-surface:#151b22;--ct-surface-2:#1b232c;--ct-text:#eef3f8;--ct-muted:#9ca8b5;--ct-line:#2c3641;--ct-shadow:0 24px 65px rgba(0,0,0,.42)}
html[data-site-theme="cyber-ice"],body[data-theme-layout="cyber-ice"]{--ct-a:#1976d2;--ct-b:#64c7ef;--ct-gold:#b58d36;--ct-bg:#f2f9ff;--ct-surface:#ffffff;--ct-surface-2:#eef7ff;--ct-text:#12253a;--ct-muted:#60758b;--ct-line:#d8e9f6;--ct-shadow:0 18px 55px rgba(28,91,140,.12)}
html[data-site-theme="royal-burgundy"],body[data-theme-layout="royal-burgundy"]{--ct-a:#8e2f52;--ct-b:#d0a64b;--ct-gold:#d0a64b;--ct-bg:#faf3f5;--ct-surface:#fffafb;--ct-surface-2:#f8eef1;--ct-text:#321a25;--ct-muted:#80636e;--ct-line:#ecd9df;--ct-shadow:0 20px 60px rgba(112,35,62,.12)}
html[data-site-theme="emerald-noir"],body[data-theme-layout="emerald-noir"]{--ct-a:#16b47d;--ct-b:#c8a33e;--ct-gold:#c8a33e;--ct-bg:#06110e;--ct-surface:#0d1b17;--ct-surface-2:#12241e;--ct-text:#ecfff7;--ct-muted:#9bb8ad;--ct-line:#213a31;--ct-shadow:0 25px 70px rgba(0,0,0,.42)}
html[data-site-theme="sapphire-night"],body[data-theme-layout="sapphire-night"]{--ct-a:#5c8cff;--ct-b:#d7b24f;--ct-gold:#d7b24f;--ct-bg:#060c18;--ct-surface:#0d1628;--ct-surface-2:#121e34;--ct-text:#f1f6ff;--ct-muted:#9aa9c4;--ct-line:#253650;--ct-shadow:0 25px 70px rgba(0,0,0,.45)}
html[data-site-theme="aurora-glass"] .tool-card,html[data-site-theme="aurora-glass"] .dash-v18-card,html[data-site-theme="aurora-glass"] .settings-v19-card{backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
html[data-site-theme="executive-pearl"] .hero-section,html[data-site-theme="executive-pearl"] .tool-card{border-radius:12px}
html[data-site-theme="titanium-noir"] .tool-card,html[data-site-theme="obsidian-crown"] .tool-card{border-radius:10px}
html[data-site-theme="cyber-ice"] .tool-open-btn,html[data-site-theme="sapphire-night"] .tool-open-btn{box-shadow:0 10px 25px color-mix(in srgb,var(--ct-a) 22%,transparent)}
html[data-site-theme="royal-burgundy"] .logo-icon{background:linear-gradient(135deg,var(--ct-a),#d0a64b)}
html[data-site-theme="emerald-noir"] .logo-icon{background:linear-gradient(135deg,var(--ct-a),#c8a33e)}
html[data-site-theme="sapphire-night"] .logo-icon{background:linear-gradient(135deg,var(--ct-a),#d7b24f)}
html[data-site-theme="obsidian-crown"] .main-header,html[data-site-theme="titanium-noir"] .main-header,html[data-site-theme="emerald-noir"] .main-header,html[data-site-theme="sapphire-night"] .main-header{background:color-mix(in srgb,var(--ct-surface) 88%,transparent);backdrop-filter:blur(16px)}
html[data-mode="dark"][data-site-theme="aurora-glass"]{--ct-bg:#080c19;--ct-surface:#11172a;--ct-surface-2:#18203a;--ct-text:#f5f7ff;--ct-muted:#aeb7cf;--ct-line:#2b3655}
html[data-mode="dark"][data-site-theme="executive-pearl"]{--ct-bg:#121014;--ct-surface:#1b171d;--ct-surface-2:#241e25;--ct-text:#fff8f0;--ct-muted:#c4b8be;--ct-line:#3a3038}
html[data-mode="dark"][data-site-theme="cyber-ice"]{--ct-bg:#07111d;--ct-surface:#0e1a28;--ct-surface-2:#142437;--ct-text:#eef8ff;--ct-muted:#a6bfd2;--ct-line:#28445b}
html[data-mode="dark"][data-site-theme="royal-burgundy"]{--ct-bg:#160a10;--ct-surface:#23101a;--ct-surface-2:#2d1521;--ct-text:#fff4f7;--ct-muted:#c9aab6;--ct-line:#4a2634}
html[data-mode="dark"][data-site-theme="aurora-glass"] body,html[data-mode="dark"][data-site-theme="executive-pearl"] body,html[data-mode="dark"][data-site-theme="cyber-ice"] body{background:var(--ct-bg)}
.theme-obsidian-crown .ct-theme-preview,.settings-theme-art.theme-obsidian-crown{background:linear-gradient(135deg,#030405,#242936,#d2a43c);color:#fff}
.theme-aurora-glass .ct-theme-preview,.settings-theme-art.theme-aurora-glass{background:linear-gradient(135deg,#dffcff,#e8dcff,#7c5cff);color:#26324b}
.theme-executive-pearl .ct-theme-preview,.settings-theme-art.theme-executive-pearl{background:linear-gradient(135deg,#fffdf8,#e9dcc7,#b69250);color:#493d33}
.theme-titanium-noir .ct-theme-preview,.settings-theme-art.theme-titanium-noir{background:linear-gradient(135deg,#080c11,#3a4a5b,#d1a54a);color:#fff}
.theme-cyber-ice .ct-theme-preview,.settings-theme-art.theme-cyber-ice{background:linear-gradient(135deg,#f7fcff,#c9e9fa,#1976d2);color:#12304a}
.theme-royal-burgundy .ct-theme-preview,.settings-theme-art.theme-royal-burgundy{background:linear-gradient(135deg,#2b0d19,#8e2f52,#d0a64b);color:#fff}
.theme-emerald-noir .ct-theme-preview,.settings-theme-art.theme-emerald-noir{background:linear-gradient(135deg,#04100d,#16b47d,#c8a33e);color:#fff}
.theme-sapphire-night .ct-theme-preview,.settings-theme-art.theme-sapphire-night{background:linear-gradient(135deg,#050b17,#315bc8,#d7b24f);color:#fff}

/* V22 rendering hardening: semantic contrast wins over legacy variables. */
html[data-site-theme] body,html[data-site-theme] .main-content,html[data-site-theme] .page-title,html[data-site-theme] .hero-title,html[data-site-theme] .tool-name,html[data-site-theme] .settings-v19-card,html[data-site-theme] .settings-v19-meta strong,html[data-site-theme] .ct-course-mini,html[data-site-theme] .course-card-v17,html[data-site-theme] .dashboard-v18,html[data-site-theme] .dash-v18-card{color:var(--ct-text)!important}
html[data-site-theme] .tool-card{background:var(--ct-surface)!important;color:var(--ct-text)!important;border-color:var(--ct-line)!important}
html[data-site-theme] .tool-name{color:var(--ct-text)!important}.tool-creator,.tool-type{color:var(--ct-muted)!important}
html[data-site-theme] .tool-type{background:var(--ct-surface-2)!important;border:1px solid var(--ct-line)}
html[data-site-theme] .tool-open-btn{color:#fff!important;background:linear-gradient(135deg,var(--ct-a),var(--ct-b))!important}
html[data-site-theme] input,html[data-site-theme] select,html[data-site-theme] textarea{background:var(--ct-surface)!important;color:var(--ct-text)!important;border-color:var(--ct-line)!important}
html[data-site-theme] ::placeholder{color:var(--ct-muted)!important;opacity:.85}
html[data-site-theme] .btn-ybt-outline{color:var(--ct-text)!important;background:var(--ct-surface)!important;border-color:var(--ct-line)!important}

/* V22 theme previews: actual visual cards, not plain text. */
.ct-theme-choice,.settings-v19-theme{isolation:isolate}.ct-theme-choice strong{color:var(--ct-text)!important}.ct-theme-choice small{color:var(--ct-muted)!important}
.ct-theme-preview{min-height:96px;border-radius:15px;position:relative;overflow:hidden;display:flex;align-items:flex-end;justify-content:space-between;padding:14px;border:1px solid rgba(255,255,255,.16);box-shadow:inset 0 1px 0 rgba(255,255,255,.15)}
.ct-theme-preview:after{content:"";position:absolute;inset:0;background:linear-gradient(115deg,transparent 0 42%,rgba(255,255,255,.18) 50%,transparent 58%);transform:translateX(-120%);transition:transform .7s ease;pointer-events:none}.ct-theme-choice:hover .ct-theme-preview:after{transform:translateX(120%)}
.ct-theme-choice .ct-theme-preview i{position:relative;z-index:2;font-size:1.55rem;color:inherit}.ct-theme-choice .ct-theme-preview em{position:relative;z-index:2;width:52px;height:8px;border-radius:99px;background:rgba(255,255,255,.65)}
.theme-obsidian-crown .ct-theme-preview{background:linear-gradient(135deg,#050608,#27303e,#e2c36b);color:#fff}.theme-aurora-glass .ct-theme-preview{background:linear-gradient(135deg,#0e1830,#5d5be9,#36d6ce);color:#fff}.theme-executive-pearl .ct-theme-preview{background:linear-gradient(135deg,#fffdf7,#e9dcc7,#b69250);color:#342b25}.theme-titanium-noir .ct-theme-preview{background:linear-gradient(135deg,#090d12,#3c4e62,#d1a54a);color:#fff}.theme-cyber-ice .ct-theme-preview{background:linear-gradient(135deg,#f9fdff,#bfe8fb,#1976d2);color:#12304a}.theme-royal-burgundy .ct-theme-preview{background:linear-gradient(135deg,#250a15,#8e2f52,#d0a64b);color:#fff}.theme-emerald-noir .ct-theme-preview{background:linear-gradient(135deg,#03100c,#16b47d,#c8a33e);color:#fff}.theme-sapphire-night .ct-theme-preview{background:linear-gradient(135deg,#040a16,#315bc8,#d7b24f);color:#fff}

/* V22 admin Design Studio */
.admin-theme-v22{display:grid;gap:20px}.admin-theme-v22 .v22-theme-hero{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(300px,.8fr);gap:18px;padding:24px;border-radius:26px;background:linear-gradient(135deg,var(--ct-surface),var(--ct-surface-2));border:1px solid var(--ct-line);box-shadow:var(--ct-shadow)}
.admin-theme-v22 .v22-live-preview{min-height:260px;border-radius:22px;padding:20px;background:#10131b;color:#fff;position:relative;overflow:hidden;box-shadow:0 25px 70px rgba(0,0,0,.2)}.admin-theme-v22 .v22-live-preview:before{content:"";position:absolute;inset:-30% 45% 45% -10%;background:radial-gradient(circle,rgba(255,255,255,.22),transparent 65%);filter:blur(20px)}
.admin-theme-v22 .v22-preview-bar{position:relative;display:flex;justify-content:space-between}.admin-theme-v22 .v22-preview-brand{width:90px;height:9px;border-radius:99px;background:rgba(255,255,255,.75)}.admin-theme-v22 .v22-preview-title{position:relative;margin-top:55px;font-size:2rem;font-weight:900;letter-spacing:-.04em}.admin-theme-v22 .v22-preview-copy{position:relative;color:rgba(255,255,255,.72);max-width:420px;margin-top:8px}.admin-theme-v22 .v22-preview-cards{position:relative;display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:30px}.admin-theme-v22 .v22-preview-cards i{height:52px;border-radius:13px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18)}
.admin-theme-v22 .v22-theme-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.admin-theme-v22 .v22-theme-option{border:1px solid var(--ct-line);border-radius:19px;padding:0;background:var(--ct-surface);overflow:hidden;cursor:pointer;color:var(--ct-text);transition:.22s}.admin-theme-v22 .v22-theme-option:hover,.admin-theme-v22 .v22-theme-option.is-active{transform:translateY(-4px);border-color:var(--ct-a);box-shadow:0 16px 45px color-mix(in srgb,var(--ct-a) 15%,transparent)}.admin-theme-v22 .v22-theme-option input{display:none}.admin-theme-v22 .v22-card-art{height:118px;padding:15px;display:flex;flex-direction:column;justify-content:space-between}.admin-theme-v22 .v22-card-art i{font-size:1.45rem}.admin-theme-v22 .v22-card-art strong{font-size:.82rem}.admin-theme-v22 .v22-card-meta{padding:11px 13px 14px}.admin-theme-v22 .v22-card-meta strong{display:block;color:var(--ct-text)}.admin-theme-v22 .v22-card-meta small{display:block;color:var(--ct-muted);margin-top:3px;font-size:.68rem}.admin-theme-v22 .v22-control-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.admin-theme-v22 .v22-control{padding:16px;border:1px solid var(--ct-line);border-radius:18px;background:var(--ct-surface)}.admin-theme-v22 .v22-control label{font-size:.75rem;font-weight:800;color:var(--ct-muted)}.admin-theme-v22 .v22-control select,.admin-theme-v22 .v22-control input[type=color]{width:100%;margin-top:8px}.admin-theme-v22 .v22-switch{display:flex;gap:8px;align-items:center;margin-top:12px;color:var(--ct-text);font-size:.78rem}.admin-theme-v22 .v22-switch input{width:auto}
@media(max-width:1050px){.admin-theme-v22 .v22-theme-hero{grid-template-columns:1fr}.admin-theme-v22 .v22-theme-grid{grid-template-columns:repeat(3,1fr)}.admin-theme-v22 .v22-control-grid{grid-template-columns:1fr 1fr}}@media(max-width:700px){.admin-theme-v22 .v22-theme-grid{grid-template-columns:1fr 1fr}.admin-theme-v22 .v22-control-grid{grid-template-columns:1fr}.admin-theme-v22 .v22-live-preview{min-height:220px}.admin-theme-v22 .v22-preview-title{font-size:1.55rem}}
.admin-theme-v22 .v22-live-preview.theme-royal-gold{background:linear-gradient(135deg,#171224,#5e3fa0,#d3a63c)}
.admin-theme-v22 .v22-live-preview.theme-ivory-luxe{background:linear-gradient(135deg,#fffdf7,#eadfc7,#8b5cf6);color:#342b42}
.admin-theme-v22 .v22-live-preview.theme-sapphire-royal{background:linear-gradient(135deg,#07152e,#315bc8,#d7b34c)}
.admin-theme-v22 .v22-live-preview.theme-emerald-royal{background:linear-gradient(135deg,#061a15,#087f5b,#c9a227)}
.admin-theme-v22 .v22-live-preview.theme-rose-royal{background:linear-gradient(135deg,#29111f,#b04d7a,#caa44b)}
.admin-theme-v22 .v22-live-preview.theme-platinum-royal{background:linear-gradient(135deg,#101622,#5b6477,#b58b35)}
.admin-theme-v22 .v22-live-preview.theme-obsidian-crown{background:linear-gradient(135deg,#050608,#27303e,#e2c36b)}
.admin-theme-v22 .v22-live-preview.theme-aurora-glass{background:linear-gradient(135deg,#0e1830,#5d5be9,#36d6ce)}
.admin-theme-v22 .v22-live-preview.theme-executive-pearl{background:linear-gradient(135deg,#fffdf7,#e9dcc7,#b69250);color:#342b25}
.admin-theme-v22 .v22-live-preview.theme-titanium-noir{background:linear-gradient(135deg,#090d12,#3c4e62,#d1a54a)}
.admin-theme-v22 .v22-live-preview.theme-cyber-ice{background:linear-gradient(135deg,#f9fdff,#bfe8fb,#1976d2);color:#12304a}
.admin-theme-v22 .v22-live-preview.theme-royal-burgundy{background:linear-gradient(135deg,#250a15,#8e2f52,#d0a64b)}
.admin-theme-v22 .v22-live-preview.theme-emerald-noir{background:linear-gradient(135deg,#03100c,#16b47d,#c8a33e)}
.admin-theme-v22 .v22-live-preview.theme-sapphire-night{background:linear-gradient(135deg,#040a16,#315bc8,#d7b24f)}
