/* Castlance Quality Layer v13.0.0
   Visual-only QA layer: theme contrast, typography, spacing, symmetry and responsive consistency.
   No business logic, API, form names/actions or data behavior lives here. */

/* =========================================================
   1) GLOBAL TOKENS — WCAG-friendly contrast in both themes
   ========================================================= */
html[data-theme="dark"]{
  --q-bg:#08111f;--q-bg2:#0b1625;--q-surface:#0f1b2b;--q-surface2:#132238;--q-surface3:#182a42;
  --q-text:#f2f6fb;--q-muted:#9badc2;--q-faint:#7f93aa;--q-line:#26384d;--q-line-strong:#35506d;
  --q-brand:#76a0ff;--q-brand-strong:#5f86ff;--q-success:#55d7ad;--q-warning:#f4c56d;--q-danger:#ff8ca0;
  --q-shadow:0 18px 44px rgba(0,0,0,.22);--q-soft-shadow:0 10px 28px rgba(0,0,0,.14);
  color-scheme:dark;
}
html[data-theme="light"]{
  --q-bg:#f4f7fb;--q-bg2:#edf2f7;--q-surface:#ffffff;--q-surface2:#f7f9fc;--q-surface3:#edf3f8;
  --q-text:#102033;--q-muted:#5b6f86;--q-faint:#77889b;--q-line:#d8e2ec;--q-line-strong:#c4d2e0;
  --q-brand:#2d67e8;--q-brand-strong:#245ad0;--q-success:#087553;--q-warning:#9a6500;--q-danger:#b4233f;
  --q-shadow:0 16px 40px rgba(19,39,69,.075);--q-soft-shadow:0 8px 24px rgba(19,39,69,.055);
  color-scheme:light;
}

html[data-admin-theme="dark"]{
  --qa-bg:#08111f;--qa-bg2:#0b1625;--qa-surface:#0f1b2b;--qa-surface2:#132238;--qa-surface3:#182a42;
  --qa-text:#f2f6fb;--qa-muted:#9badc2;--qa-line:#26384d;--qa-line-strong:#35506d;--qa-brand:#76a0ff;
  color-scheme:dark;
}
html[data-admin-theme="light"]{
  --qa-bg:#f4f7fb;--qa-bg2:#edf2f7;--qa-surface:#ffffff;--qa-surface2:#f7f9fc;--qa-surface3:#edf3f8;
  --qa-text:#102033;--qa-muted:#5b6f86;--qa-line:#d8e2ec;--qa-line-strong:#c4d2e0;--qa-brand:#2d67e8;
  color-scheme:light;
}

/* =========================================================
   2) PUBLIC SITE — typography + rhythm + consistent surfaces
   ========================================================= */
html[data-theme] body.castlance-public-v8{
  background:var(--q-bg)!important;color:var(--q-text)!important;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;
  font-size:15px!important;line-height:1.6!important;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
}
html[data-theme] body.castlance-public-v8 .container{width:min(1180px,calc(100% - 48px))!important;margin-inline:auto!important}
html[data-theme] body.castlance-public-v8 main{background:var(--q-bg)!important;color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 .section{padding:72px 0!important}
html[data-theme] body.castlance-public-v8 .section-intro{max-width:760px!important;margin:0 auto 32px!important;padding:0!important}
html[data-theme] body.castlance-public-v8 .section-intro.left{margin-left:0!important;text-align:left!important}
html[data-theme] body.castlance-public-v8 :is(h1,h2,h3,h4,h5,h6){color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important;text-wrap:balance}
html[data-theme] body.castlance-public-v8 :is(p,small,.muted,.subtitle,.description,.hint,.help){color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important}
html[data-theme] body.castlance-public-v8 .section-intro h2{font-size:clamp(30px,3.1vw,40px)!important;line-height:1.12!important;letter-spacing:-.035em!important;margin:8px 0 10px!important}
html[data-theme] body.castlance-public-v8 .section-intro p{font-size:15px!important;line-height:1.7!important}
html[data-theme] body.castlance-public-v8 .eyebrow{font-size:10px!important;line-height:1!important;letter-spacing:.15em!important;font-weight:850!important;color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important}

/* Header is themed explicitly instead of relying on legacy dark-only rules. */
html[data-theme="dark"] body.castlance-public-v8 .site-header{background:rgba(8,17,31,.94)!important;border-color:var(--q-line)!important}
html[data-theme="light"] body.castlance-public-v8 .site-header{background:rgba(255,255,255,.94)!important;border-color:var(--q-line)!important;box-shadow:0 5px 20px rgba(20,45,75,.045)!important}
html[data-theme] body.castlance-public-v8 .site-header :is(.brand,.site-nav a){color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important}
html[data-theme] body.castlance-public-v8 .site-header .brand b,
html[data-theme] body.castlance-public-v8 .site-header .site-nav a:is(:hover,.active){color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 :is(.lang-switch,.c11-theme-toggle,.menu-btn){background:var(--q-surface2)!important;border-color:var(--q-line)!important;color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 .lang-switch a{color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important}
html[data-theme] body.castlance-public-v8 .lang-switch a.active{background:var(--q-surface)!important;color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}

/* Generic surface registry. Keeping this explicit prevents white/dark leftovers. */
html[data-theme] body.castlance-public-v8 :is(
 .card,.panel,.box,.empty-state,.account-card,.checkout-card,.order-card,.payment-success-card,
 .blog-card-v5,.blog-body-v5,.article-shell-v5,.article-content-v5,.article-side-v5,
 .legal-content-v5,.faq-content-v43,.faq-sidebar-v43,.faq-support-card,.faq-bottom-help,
 .faq-accordion-v43 details,.pricing-card-v43,.pricing-hero-card,.pricing-compare-v43,.compare-table-wrap,
 .download-platform,.release-card,.requirements-grid>article,.os-detect,.bank-note,.bank-grid>div,
 .delivery-note,.license-delivery-box,.try-card,.release-callout-box,.final-box,.roi-card,
 .versus-card,.journey article,.premium-features article,.platform-cards article,.value-grid>div
){
  background:var(--q-surface)!important;background-color:var(--q-surface)!important;
  color:var(--q-text)!important;border-color:var(--q-line)!important;box-shadow:var(--q-soft-shadow)!important;
}
html[data-theme] body.castlance-public-v8 :is(
 .card,.panel,.box,.empty-state,.account-card,.checkout-card,.order-card,.payment-success-card,
 .blog-card-v5,.article-shell-v5,.article-content-v5,.article-side-v5,.legal-content-v5,
 .faq-content-v43,.faq-sidebar-v43,.faq-support-card,.faq-bottom-help,.faq-accordion-v43 details,
 .pricing-card-v43,.pricing-hero-card,.pricing-compare-v43,.download-platform,.release-card,
 .requirements-grid>article,.bank-note,.delivery-note,.license-delivery-box,.roi-card,.versus-card,
 .journey article,.premium-features article,.platform-cards article
) :is(h1,h2,h3,h4,h5,h6,b,strong,label,summary,li,th){color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 :is(
 .card,.panel,.box,.empty-state,.account-card,.checkout-card,.order-card,.payment-success-card,
 .blog-card-v5,.article-shell-v5,.article-content-v5,.article-side-v5,.legal-content-v5,
 .faq-content-v43,.faq-sidebar-v43,.faq-support-card,.faq-bottom-help,.faq-accordion-v43 details,
 .pricing-card-v43,.pricing-hero-card,.pricing-compare-v43,.download-platform,.release-card,
 .requirements-grid>article,.bank-note,.delivery-note,.license-delivery-box,.roi-card,.versus-card,
 .journey article,.premium-features article,.platform-cards article
) :is(p,small,td,.muted){color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important}

/* Forms and tables — visible in BOTH themes. */
html[data-theme] body.castlance-public-v8 :is(input,select,textarea){background:var(--q-surface)!important;color:var(--q-text)!important;border:1px solid var(--q-line-strong)!important;box-shadow:none!important}
html[data-theme] body.castlance-public-v8 :is(input,textarea)::placeholder{color:var(--q-faint)!important;opacity:1!important}
html[data-theme] body.castlance-public-v8 :is(input,select,textarea):focus{outline:3px solid color-mix(in srgb,var(--q-brand) 16%,transparent)!important;border-color:var(--q-brand)!important}
html[data-theme] body.castlance-public-v8 :is(table,thead,tbody,tr,th,td){border-color:var(--q-line)!important}
html[data-theme] body.castlance-public-v8 table{background:var(--q-surface)!important;color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 th{background:var(--q-surface2)!important;color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 td{background:var(--q-surface)!important;color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important}
html[data-theme] body.castlance-public-v8 .compare-table-wrap{overflow:auto!important;border:1px solid var(--q-line)!important;border-radius:16px!important}
html[data-theme] body.castlance-public-v8 .compare-table-wrap table{min-width:640px!important;margin:0!important}

/* Buttons. */
html[data-theme] body.castlance-public-v8 .btn{min-height:42px!important;padding:10px 16px!important;border-radius:10px!important;font-size:12px!important;font-weight:800!important;line-height:1.1!important}
html[data-theme] body.castlance-public-v8 .btn.primary{background:linear-gradient(135deg,#2d67e8,#6d50df)!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border-color:transparent!important}
html[data-theme] body.castlance-public-v8 :is(.btn.ghost,.btn.white,.btn.dark-ghost){background:var(--q-surface)!important;color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important;border-color:var(--q-line-strong)!important}

/* =========================================================
   3) FAQ — symmetry / alignment / density
   ========================================================= */
html[data-theme] body.castlance-public-v8 .faq-hero-v43{padding:68px 0!important;background:var(--q-bg2)!important;color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 .faq-hero-grid{display:grid!important;grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr)!important;gap:24px!important;align-items:stretch!important}
html[data-theme] body.castlance-public-v8 .faq-hero-grid>div:first-child{display:flex!important;flex-direction:column!important;justify-content:center!important;min-width:0!important}
html[data-theme] body.castlance-public-v8 .faq-hero-v43 h1{font-size:clamp(38px,4.3vw,58px)!important;line-height:1.04!important;letter-spacing:-.045em!important;margin:12px 0 14px!important}
html[data-theme] body.castlance-public-v8 .faq-hero-v43 p{max-width:720px!important;font-size:15px!important;line-height:1.7!important;margin:0!important}
html[data-theme] body.castlance-public-v8 .faq-hero-actions{display:flex!important;gap:10px!important;flex-wrap:wrap!important;margin-top:22px!important}
html[data-theme] body.castlance-public-v8 .faq-support-card{min-height:100%!important;padding:26px!important;border:1px solid var(--q-line)!important;border-radius:18px!important;display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:flex-start!important}
html[data-theme] body.castlance-public-v8 .faq-support-card>b{width:46px!important;height:46px!important;display:grid!important;place-items:center!important;border-radius:13px!important;background:color-mix(in srgb,var(--q-brand) 12%,var(--q-surface2))!important;color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important;font-size:22px!important;margin:10px 0 14px!important}
html[data-theme] body.castlance-public-v8 .faq-support-card h3{font-size:19px!important;margin:0 0 7px!important}
html[data-theme] body.castlance-public-v8 .faq-support-card p{font-size:13px!important;margin:0 0 14px!important}
html[data-theme] body.castlance-public-v8 .faq-support-card a{color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important;font-weight:800!important}
html[data-theme] body.castlance-public-v8 .faq-section-v43{background:var(--q-bg)!important}
html[data-theme] body.castlance-public-v8 .faq-layout-v43{display:grid!important;grid-template-columns:232px minmax(0,1fr)!important;gap:24px!important;align-items:start!important}
html[data-theme] body.castlance-public-v8 .faq-sidebar-v43{position:sticky!important;top:96px!important;padding:13px!important;border:1px solid var(--q-line)!important;border-radius:16px!important;display:grid!important;gap:5px!important;min-width:0!important}
html[data-theme] body.castlance-public-v8 .faq-sidebar-v43>span{padding:8px 10px 6px!important;color:var(--q-faint)!important;-webkit-text-fill-color:var(--q-faint)!important;font-size:9px!important;font-weight:850!important;letter-spacing:.12em!important}
html[data-theme] body.castlance-public-v8 .faq-sidebar-v43 a{display:flex!important;align-items:center!important;min-height:42px!important;padding:9px 11px!important;border-radius:9px!important;color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important;font-size:12px!important;font-weight:750!important}
html[data-theme] body.castlance-public-v8 .faq-sidebar-v43 a:is(:hover,.active){background:color-mix(in srgb,var(--q-brand) 10%,var(--q-surface2))!important;color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 .faq-content-v43{padding:22px!important;border:1px solid var(--q-line)!important;border-radius:18px!important;min-width:0!important}
html[data-theme] body.castlance-public-v8 .faq-topline{display:flex!important;align-items:flex-end!important;justify-content:space-between!important;gap:16px!important;margin:0 0 18px!important;padding:0 0 16px!important;border-bottom:1px solid var(--q-line)!important}
html[data-theme] body.castlance-public-v8 .faq-topline h2{font-size:26px!important;line-height:1.15!important;margin:6px 0 0!important}
html[data-theme] body.castlance-public-v8 .faq-topline>span{flex:0 0 auto!important;padding:7px 10px!important;border:1px solid var(--q-line)!important;border-radius:999px!important;background:var(--q-surface2)!important;color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important;font-size:10px!important;font-weight:800!important}
html[data-theme] body.castlance-public-v8 .faq-accordion-v43{display:grid!important;gap:10px!important}
html[data-theme] body.castlance-public-v8 .faq-accordion-v43 details{margin:0!important;border:1px solid var(--q-line)!important;border-radius:13px!important;overflow:hidden!important;box-shadow:none!important}
html[data-theme] body.castlance-public-v8 .faq-accordion-v43 details[open]{background:var(--q-surface2)!important}
html[data-theme] body.castlance-public-v8 .faq-accordion-v43 summary{display:grid!important;grid-template-columns:38px minmax(0,1fr) 28px!important;gap:11px!important;align-items:center!important;min-height:62px!important;padding:12px 16px!important;cursor:pointer!important}
html[data-theme] body.castlance-public-v8 .faq-accordion-v43 summary>span{display:grid!important;place-items:center!important;width:31px!important;height:31px!important;border-radius:9px!important;background:var(--q-surface2)!important;color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important;font-size:10px!important;font-weight:850!important}
html[data-theme] body.castlance-public-v8 .faq-accordion-v43 summary>b{font-size:13px!important;line-height:1.45!important;color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important;overflow-wrap:anywhere!important}
html[data-theme] body.castlance-public-v8 .faq-accordion-v43 summary>i{display:grid!important;place-items:center!important;width:27px!important;height:27px!important;border-radius:8px!important;background:var(--q-surface2)!important;color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important;font-style:normal!important;font-size:16px!important}
html[data-theme] body.castlance-public-v8 .faq-answer-v43{padding:2px 56px 18px 65px!important;color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important;font-size:13px!important;line-height:1.75!important}
html[data-theme] body.castlance-public-v8 .faq-bottom-help{margin-top:18px!important;padding:20px!important;border:1px solid var(--q-line)!important;border-radius:14px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:20px!important}
html[data-theme] body.castlance-public-v8 .faq-bottom-help h3{font-size:18px!important;margin:4px 0!important}
html[data-theme] body.castlance-public-v8 .faq-bottom-help p{font-size:12px!important;margin:0!important}

/* =========================================================
   4) BLOG / ARTICLE — equal cards, clean hierarchy
   ========================================================= */
html[data-theme] body.castlance-public-v8 .subhero-v5{padding:64px 0!important;background:var(--q-bg2)!important;color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 .subhero-grid{display:grid!important;grid-template-columns:minmax(0,1fr) 210px!important;gap:28px!important;align-items:center!important}
html[data-theme] body.castlance-public-v8 .subhero-v5 h1{font-size:clamp(36px,4vw,54px)!important;line-height:1.06!important;letter-spacing:-.04em!important;margin:11px 0 13px!important}
html[data-theme] body.castlance-public-v8 .subhero-v5 p{max-width:720px!important;margin:0!important;font-size:15px!important;line-height:1.7!important}
html[data-theme] body.castlance-public-v8 .subhero-badge{min-height:150px!important;padding:22px!important;border:1px solid var(--q-line)!important;border-radius:17px!important;background:var(--q-surface)!important;display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:flex-start!important;box-shadow:var(--q-soft-shadow)!important}
html[data-theme] body.castlance-public-v8 .subhero-badge small{color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important;font-size:9px!important;font-weight:850!important;letter-spacing:.12em!important}
html[data-theme] body.castlance-public-v8 .subhero-badge b{font-size:34px!important;line-height:1!important;margin:10px 0 5px!important;color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 .subhero-badge span{color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important;font-size:11px!important}
html[data-theme] body.castlance-public-v8 .blog-grid-v5{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:18px!important;align-items:stretch!important}
html[data-theme] body.castlance-public-v8 .blog-card-v5{display:flex!important;flex-direction:column!important;min-width:0!important;border:1px solid var(--q-line)!important;border-radius:17px!important;overflow:hidden!important;box-shadow:var(--q-soft-shadow)!important}
html[data-theme] body.castlance-public-v8 .blog-thumb-v5{height:160px!important;min-height:160px!important;padding:18px!important;background:linear-gradient(145deg,color-mix(in srgb,var(--q-brand) 18%,var(--q-surface2)),var(--q-surface3))!important;border-bottom:1px solid var(--q-line)!important;color:var(--q-text)!important;display:flex!important;flex-direction:column!important;justify-content:space-between!important}
html[data-theme] body.castlance-public-v8 .blog-thumb-v5>span{font-size:9px!important;font-weight:850!important;letter-spacing:.14em!important;color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important}
html[data-theme] body.castlance-public-v8 .blog-thumb-v5>b{font-size:48px!important;line-height:1!important;color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important;opacity:.9!important}
html[data-theme] body.castlance-public-v8 .blog-body-v5{display:flex!important;flex:1!important;flex-direction:column!important;padding:20px!important;background:var(--q-surface)!important;box-shadow:none!important}
html[data-theme] body.castlance-public-v8 .blog-body-v5 small{font-size:10px!important;color:var(--q-faint)!important;-webkit-text-fill-color:var(--q-faint)!important}
html[data-theme] body.castlance-public-v8 .blog-body-v5 h2{font-size:18px!important;line-height:1.3!important;margin:8px 0!important;letter-spacing:-.015em!important}
html[data-theme] body.castlance-public-v8 .blog-body-v5 p{font-size:12.5px!important;line-height:1.65!important;margin:0 0 16px!important;display:-webkit-box!important;-webkit-line-clamp:4!important;-webkit-box-orient:vertical!important;overflow:hidden!important}
html[data-theme] body.castlance-public-v8 .blog-body-v5 a{margin-top:auto!important;color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important;font-size:12px!important;font-weight:850!important}
html[data-theme] body.castlance-public-v8 .mini-cta-v5{padding:30px 0!important;background:var(--q-bg2)!important;border-top:1px solid var(--q-line)!important}
html[data-theme] body.castlance-public-v8 .mini-cta-v5>.container{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:24px!important;padding:24px 28px!important;border:1px solid var(--q-line)!important;border-radius:17px!important;background:var(--q-surface)!important;box-shadow:var(--q-soft-shadow)!important}
html[data-theme] body.castlance-public-v8 .mini-cta-v5 h2{font-size:23px!important;margin:5px 0 0!important}
html[data-theme] body.castlance-public-v8 .mini-cta-v5 span{color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important;font-size:9px!important;font-weight:850!important;letter-spacing:.12em!important}

html[data-theme] body.castlance-public-v8 .article-hero-v5,
html[data-theme] body.castlance-public-v8 .legal-hero-v5{background:var(--q-bg2)!important;color:var(--q-text)!important;border-bottom:1px solid var(--q-line)!important}
html[data-theme] body.castlance-public-v8 .article-layout-v5,
html[data-theme] body.castlance-public-v8 .legal-layout-v5{gap:24px!important;align-items:start!important}
html[data-theme] body.castlance-public-v8 .article-content-v5,
html[data-theme] body.castlance-public-v8 .legal-content-v5{font-size:14px!important;line-height:1.8!important}

/* =========================================================
   5) PRICING — equal geometry and readable comparison
   ========================================================= */
html[data-theme] body.castlance-public-v8 .pricing-hero-v43{padding:68px 0!important;background:var(--q-bg2)!important;color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 .pricing-hero-grid{display:grid!important;grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr)!important;gap:24px!important;align-items:stretch!important}
html[data-theme] body.castlance-public-v8 .pricing-hero-v43 h1{font-size:clamp(38px,4.3vw,58px)!important;line-height:1.04!important;letter-spacing:-.045em!important;margin:12px 0 14px!important}
html[data-theme] body.castlance-public-v8 .pricing-hero-v43 p{font-size:15px!important;line-height:1.7!important;margin:0!important}
html[data-theme] body.castlance-public-v8 .pricing-benefits{display:flex!important;flex-wrap:wrap!important;gap:8px!important;margin-top:18px!important}
html[data-theme] body.castlance-public-v8 .pricing-benefits span{padding:7px 10px!important;border:1px solid var(--q-line)!important;border-radius:999px!important;background:var(--q-surface)!important;color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important;font-size:10px!important;font-weight:750!important}
html[data-theme] body.castlance-public-v8 .pricing-hero-card{padding:26px!important;border:1px solid var(--q-line)!important;border-radius:18px!important;display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:flex-start!important;min-height:100%!important}
html[data-theme] body.castlance-public-v8 .pricing-hero-card>small{color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important;font-weight:850!important}
html[data-theme] body.castlance-public-v8 .pricing-hero-card>b{font-size:44px!important;line-height:1!important;margin:10px 0 3px!important;color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 .pricing-main-v43{background:var(--q-bg)!important}
html[data-theme] body.castlance-public-v8 .pricing-grid-v43{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(270px,1fr))!important;gap:18px!important;align-items:stretch!important}
html[data-theme] body.castlance-public-v8 .pricing-grid-v43.single-plan{grid-template-columns:minmax(0,560px)!important;justify-content:center!important}
html[data-theme] body.castlance-public-v8 .pricing-card-v43{display:flex!important;flex-direction:column!important;padding:27px!important;border:1px solid var(--q-line)!important;border-radius:18px!important;min-height:100%!important;position:relative!important}
html[data-theme] body.castlance-public-v8 .pricing-card-v43.featured{border-color:color-mix(in srgb,var(--q-brand) 62%,var(--q-line))!important;box-shadow:0 18px 48px color-mix(in srgb,var(--q-brand) 13%,transparent)!important}
html[data-theme] body.castlance-public-v8 .pricing-card-v43 h2{font-size:21px!important;margin:12px 0 5px!important}
html[data-theme] body.castlance-public-v8 .pricing-card-v43 .plan-desc{font-size:12.5px!important;line-height:1.65!important;min-height:62px!important;margin:0!important}
html[data-theme] body.castlance-public-v8 .plan-price{display:flex!important;align-items:flex-end!important;gap:7px!important;margin:18px 0 10px!important}
html[data-theme] body.castlance-public-v8 .plan-price b{font-size:34px!important;line-height:1!important;color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 .plan-price span{font-size:11px!important;color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important;padding-bottom:3px!important}
html[data-theme] body.castlance-public-v8 .plan-message-quota{margin:0 0 14px!important;padding:9px 11px!important;border:1px solid var(--q-line)!important;border-radius:10px!important;background:var(--q-surface2)!important;color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important;font-size:11px!important;font-weight:850!important;text-align:center!important}
html[data-theme] body.castlance-public-v8 .pricing-card-v43 ul{flex:1!important;display:grid!important;align-content:start!important;gap:8px!important;margin:6px 0 22px!important;padding:0!important;list-style:none!important}
html[data-theme] body.castlance-public-v8 .pricing-card-v43 li{font-size:12px!important;line-height:1.45!important;color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important}
html[data-theme] body.castlance-public-v8 .pricing-card-v43 .btn{margin-top:auto!important;width:100%!important}
html[data-theme] body.castlance-public-v8 .pricing-trust-row{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important;margin:22px 0 0!important}
html[data-theme] body.castlance-public-v8 .pricing-trust-row>div{min-height:82px!important;padding:14px!important;border:1px solid var(--q-line)!important;border-radius:13px!important;background:var(--q-surface)!important;color:var(--q-text)!important;display:flex!important;align-items:center!important;gap:10px!important}
html[data-theme] body.castlance-public-v8 .pricing-trust-row strong{color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 .pricing-trust-row small{color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important}
html[data-theme] body.castlance-public-v8 .pricing-compare-v43{margin-top:54px!important;padding:22px!important;border:1px solid var(--q-line)!important;border-radius:18px!important}
html[data-theme] body.castlance-public-v8 .pricing-demo-cta{padding:34px 0!important;background:var(--q-bg2)!important}
html[data-theme] body.castlance-public-v8 .pricing-demo-box{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;align-items:center!important;gap:20px!important;padding:24px 26px!important;border:1px solid var(--q-line)!important;border-radius:18px!important;background:var(--q-surface)!important;color:var(--q-text)!important;box-shadow:var(--q-soft-shadow)!important}
html[data-theme] body.castlance-public-v8 .pricing-demo-box h2{font-size:23px!important;margin:4px 0 5px!important}
html[data-theme] body.castlance-public-v8 .pricing-demo-box p{font-size:12.5px!important;margin:0!important}
html[data-theme] body.castlance-public-v8 .demo-calendar{width:58px!important;height:58px!important;display:grid!important;place-items:center!important;border-radius:14px!important;background:color-mix(in srgb,var(--q-brand) 12%,var(--q-surface2))!important;color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important;font-size:21px!important;font-weight:900!important}

/* =========================================================
   6) DOWNLOAD / LEGAL / CHECKOUT / SUCCESS pages
   ========================================================= */
html[data-theme] body.castlance-public-v8 .download-platform-grid{gap:18px!important;align-items:stretch!important}
html[data-theme] body.castlance-public-v8 .download-platform{padding:24px!important;border-radius:18px!important;display:flex!important;flex-direction:column!important;min-height:410px!important}
html[data-theme] body.castlance-public-v8 .download-platform .btn{margin-top:auto!important}
html[data-theme] body.castlance-public-v8 .requirements-grid{gap:14px!important;align-items:stretch!important}
html[data-theme] body.castlance-public-v8 .requirements-grid>article{min-height:140px!important;padding:20px!important;border-radius:15px!important}
html[data-theme] body.castlance-public-v8 .release-card{padding:22px!important;border-radius:17px!important}
html[data-theme] body.castlance-public-v8 :is(.checkout-card,.order-card,.payment-success-card,.bank-note,.license-delivery-box){border:1px solid var(--q-line)!important;border-radius:17px!important}
html[data-theme] body.castlance-public-v8 :is(.checkout-grid,.bank-grid,.delivery-grid){gap:18px!important;align-items:start!important}
html[data-theme] body.castlance-public-v8 .bank-warning{background:color-mix(in srgb,var(--q-warning) 9%,var(--q-surface))!important;color:var(--q-text)!important;border-color:color-mix(in srgb,var(--q-warning) 35%,var(--q-line))!important}

/* =========================================================
   7) PORTAL — both themes, consistent cards/text/forms
   ========================================================= */
html[data-theme] body.castlance-portal-v8{background:var(--q-bg)!important;color:var(--q-text)!important;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;-webkit-font-smoothing:antialiased}
html[data-theme] body.castlance-portal-v8 :is(.wrap,.shell){color:var(--q-text)!important}
html[data-theme] body.castlance-portal-v8 .topbar{background:color-mix(in srgb,var(--q-surface) 94%,transparent)!important;border-color:var(--q-line)!important;color:var(--q-text)!important;box-shadow:0 5px 20px rgba(0,0,0,.06)!important}
html[data-theme] body.castlance-portal-v8 .topbar :is(.brand,b,a,button){color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-portal-v8 :is(.card,.saas-card,.panel,.release-center,.download-card,.portal-v64-title,.portal-v64-quick,.portal-pop,.portal-notification-center,.saas-notification-center,.portal-accordion,.portal-new-ticket,.profile-collapse,.profile-collapse-body,.setup-guide,.setup-step,.setup-note,.transfer-form,.email-license-note,.quota-overview,.premium-quota,.table-wrap,.stat){background:var(--q-surface)!important;color:var(--q-text)!important;border-color:var(--q-line)!important;box-shadow:var(--q-soft-shadow)!important}
html[data-theme] body.castlance-portal-v8 :is(.card,.saas-card,.panel,.release-center,.download-card,.portal-v64-title,.portal-v64-quick,.portal-pop,.portal-accordion,.portal-new-ticket,.profile-collapse,.setup-guide,.setup-step,.quota-overview,.premium-quota) :is(h1,h2,h3,h4,b,strong,label,summary,th){color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-portal-v8 :is(p,small,.muted,td,.portal-pop-status){color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important}
html[data-theme] body.castlance-portal-v8 :is(input,select,textarea){background:var(--q-surface2)!important;color:var(--q-text)!important;border-color:var(--q-line-strong)!important}
html[data-theme] body.castlance-portal-v8 :is(input,textarea)::placeholder{color:var(--q-faint)!important;opacity:1!important}
html[data-theme] body.castlance-portal-v8 :is(table,thead,tbody,tr,th,td){border-color:var(--q-line)!important}
html[data-theme] body.castlance-portal-v8 th{background:var(--q-surface2)!important;color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-portal-v8 td{background:var(--q-surface)!important;color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important}
html[data-theme] body.castlance-portal-v8 .hero-license{background:linear-gradient(135deg,var(--q-surface),color-mix(in srgb,var(--q-brand) 8%,var(--q-surface2)))!important;color:var(--q-text)!important;border-color:var(--q-line)!important}
html[data-theme] body.castlance-portal-v8 .portal-pop a,
html[data-theme] body.castlance-portal-v8 .portal-accordion-body,
html[data-theme] body.castlance-portal-v8 .portal-chat,
html[data-theme] body.castlance-portal-v8 .chat-bubble{background:var(--q-surface2)!important;color:var(--q-text)!important;border-color:var(--q-line)!important}
html[data-theme] body.castlance-portal-v8 .chat-bubble.customer{background:color-mix(in srgb,var(--q-brand) 14%,var(--q-surface2))!important}
html[data-theme] body.castlance-portal-v8 .portal-mobile-nav{background:var(--q-surface)!important;color:var(--q-text)!important;border-color:var(--q-line)!important}
html[data-theme] body.castlance-portal-v8 .portal-mobile-group a{color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-portal-v8 .portal-mobile-group{background:var(--q-surface2)!important;border-color:var(--q-line)!important}

/* =========================================================
   8) ADMIN — final light/dark sanitation + geometry
   ========================================================= */
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2{
  --bg:var(--qa-bg)!important;--surface:var(--qa-surface)!important;--surface2:var(--qa-surface2)!important;
  --text:var(--qa-text)!important;--muted:var(--qa-muted)!important;--line:var(--qa-line)!important;
  background:var(--qa-bg)!important;color:var(--qa-text)!important;-webkit-font-smoothing:antialiased;
}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .main{background:var(--qa-bg)!important;color:var(--qa-text)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(.card,.section,.saas-card,.kpi,.an-kpi,.an-card,.finance-kpi,.lic-card,.lic-box,.section-note,.empty,.invoice-empty){background:var(--qa-surface)!important;color:var(--qa-text)!important;border-color:var(--qa-line)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(.card,.section,.saas-card,.kpi,.an-kpi,.an-card,.finance-kpi,.lic-card,.lic-box) :is(h1,h2,h3,h4,b,strong,label,th){color:var(--qa-text)!important;-webkit-text-fill-color:var(--qa-text)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(.card,.section,.saas-card,.kpi,.an-kpi,.an-card,.finance-kpi,.lic-card,.lic-box) :is(p,small,.muted,td){color:var(--qa-muted)!important;-webkit-text-fill-color:var(--qa-muted)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(input,select,textarea){background:var(--qa-surface2)!important;color:var(--qa-text)!important;border-color:var(--qa-line-strong)!important;box-shadow:none!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(input,textarea)::placeholder{color:var(--qa-muted)!important;opacity:.82!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(input,select,textarea):focus{outline:3px solid color-mix(in srgb,var(--qa-brand) 16%,transparent)!important;border-color:var(--qa-brand)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(table,thead,tbody,tr,th,td){border-color:var(--qa-line)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 th{background:var(--qa-surface2)!important;color:var(--qa-text)!important;-webkit-text-fill-color:var(--qa-text)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 td{background:var(--qa-surface)!important;color:var(--qa-muted)!important;-webkit-text-fill-color:var(--qa-muted)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .top{border-color:var(--qa-line)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .top h1{font-size:30px!important;line-height:1.1!important;letter-spacing:-.03em!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .top .subtitle{font-size:12px!important;line-height:1.55!important;color:var(--qa-muted)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .section>.section-head{border-color:var(--qa-line)!important;padding:15px 17px!important;gap:14px!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .section>.section-head h2{font-size:17px!important;line-height:1.2!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .form-row{gap:12px!important;align-items:end!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .field label{font-size:10px!important;line-height:1.35!important;margin-bottom:6px!important;color:var(--qa-muted)!important;-webkit-text-fill-color:var(--qa-muted)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(input,select){min-height:42px!important;border-radius:10px!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 textarea{min-height:104px!important;border-radius:10px!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .table{max-height:min(640px,68vh)!important;overflow:auto!important;border:1px solid var(--qa-line)!important;border-radius:12px!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .table table{margin:0!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .table th{position:sticky!important;top:0!important;z-index:3!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .saas-action{background:var(--qa-surface2)!important;border-color:var(--qa-line)!important;color:var(--qa-text)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .saas-action b{color:var(--qa-text)!important;-webkit-text-fill-color:var(--qa-text)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .saas-action small{color:var(--qa-muted)!important;-webkit-text-fill-color:var(--qa-muted)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .lic-card{background:var(--qa-surface)!important;border-color:var(--qa-line)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .lic-box,
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .lic-more{background:var(--qa-surface2)!important;border-color:var(--qa-line)!important;color:var(--qa-text)!important;-webkit-text-fill-color:var(--qa-text)!important}

/* Catch the few legacy inline light surfaces in admin security/CMS blocks. */
html[data-admin-theme="dark"] body.castlance-admin-v8.cast-ui-v2 [style*="background:#f4f7fb"],
html[data-admin-theme="dark"] body.castlance-admin-v8.cast-ui-v2 [style*="background: #f4f7fb"],
html[data-admin-theme="dark"] body.castlance-admin-v8.cast-ui-v2 [style*="background:#f8fafc"],
html[data-admin-theme="dark"] body.castlance-admin-v8.cast-ui-v2 [style*="background: #f8fafc"],
html[data-admin-theme="dark"] body.castlance-admin-v8.cast-ui-v2 [style*="background:#fff"],
html[data-admin-theme="dark"] body.castlance-admin-v8.cast-ui-v2 [style*="background: #fff"]{background:var(--qa-surface2)!important;color:var(--qa-text)!important;border-color:var(--qa-line)!important}
html[data-admin-theme="light"] body.castlance-admin-v8.cast-ui-v2 [style*="background:#0"],
html[data-admin-theme="light"] body.castlance-admin-v8.cast-ui-v2 [style*="background: #0"]{color:var(--qa-text)!important}

/* =========================================================
   9) RESPONSIVE — deterministic symmetry
   ========================================================= */
@media(max-width:980px){
 html[data-theme] body.castlance-public-v8 .faq-hero-grid,
 html[data-theme] body.castlance-public-v8 .pricing-hero-grid{grid-template-columns:1fr!important}
 html[data-theme] body.castlance-public-v8 .faq-layout-v43{grid-template-columns:1fr!important}
 html[data-theme] body.castlance-public-v8 .faq-sidebar-v43{position:static!important;display:flex!important;overflow-x:auto!important;gap:7px!important;padding:9px!important;scrollbar-width:thin}
 html[data-theme] body.castlance-public-v8 .faq-sidebar-v43>span{display:none!important}
 html[data-theme] body.castlance-public-v8 .faq-sidebar-v43 a{white-space:nowrap!important;flex:0 0 auto!important}
 html[data-theme] body.castlance-public-v8 .blog-grid-v5{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html[data-theme] body.castlance-public-v8 .pricing-trust-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html[data-theme] body.castlance-public-v8 .subhero-grid{grid-template-columns:minmax(0,1fr) 180px!important}
}
@media(max-width:720px){
 html[data-theme] body.castlance-public-v8 .container{width:min(100% - 28px,1180px)!important}
 html[data-theme] body.castlance-public-v8 .section{padding:52px 0!important}
 html[data-theme] body.castlance-public-v8 .faq-hero-v43,
 html[data-theme] body.castlance-public-v8 .pricing-hero-v43,
 html[data-theme] body.castlance-public-v8 .subhero-v5{padding:50px 0!important}
 html[data-theme] body.castlance-public-v8 .subhero-grid{grid-template-columns:1fr!important}
 html[data-theme] body.castlance-public-v8 .subhero-badge{min-height:0!important;padding:18px!important}
 html[data-theme] body.castlance-public-v8 .blog-grid-v5{grid-template-columns:1fr!important;gap:14px!important}
 html[data-theme] body.castlance-public-v8 .faq-content-v43{padding:14px!important}
 html[data-theme] body.castlance-public-v8 .faq-topline{align-items:flex-start!important}
 html[data-theme] body.castlance-public-v8 .faq-accordion-v43 summary{grid-template-columns:32px minmax(0,1fr) 26px!important;padding:11px 12px!important;gap:8px!important}
 html[data-theme] body.castlance-public-v8 .faq-answer-v43{padding:2px 14px 16px!important}
 html[data-theme] body.castlance-public-v8 .faq-bottom-help{flex-direction:column!important;align-items:flex-start!important;padding:17px!important}
 html[data-theme] body.castlance-public-v8 .faq-bottom-help .btn{width:100%!important}
 html[data-theme] body.castlance-public-v8 .pricing-grid-v43{grid-template-columns:1fr!important}
 html[data-theme] body.castlance-public-v8 .pricing-card-v43{padding:22px!important}
 html[data-theme] body.castlance-public-v8 .pricing-card-v43 .plan-desc{min-height:0!important}
 html[data-theme] body.castlance-public-v8 .pricing-trust-row{grid-template-columns:1fr!important}
 html[data-theme] body.castlance-public-v8 .pricing-demo-box{grid-template-columns:1fr!important;padding:20px!important;align-items:start!important}
 html[data-theme] body.castlance-public-v8 .pricing-demo-box .btn{width:100%!important}
 html[data-theme] body.castlance-public-v8 .mini-cta-v5>.container{flex-direction:column!important;align-items:flex-start!important;padding:20px!important}
 html[data-theme] body.castlance-public-v8 .mini-cta-v5 .btn{width:100%!important}
}
@media(max-width:520px){
 html[data-theme] body.castlance-public-v8{font-size:14px!important}
 html[data-theme] body.castlance-public-v8 .container{width:min(100% - 22px,1180px)!important}
 html[data-theme] body.castlance-public-v8 .faq-hero-v43 h1,
 html[data-theme] body.castlance-public-v8 .pricing-hero-v43 h1,
 html[data-theme] body.castlance-public-v8 .subhero-v5 h1{font-size:35px!important}
 html[data-theme] body.castlance-public-v8 .faq-hero-actions{display:grid!important;grid-template-columns:1fr!important}
 html[data-theme] body.castlance-public-v8 .faq-hero-actions .btn{width:100%!important}
 html[data-theme] body.castlance-public-v8 .faq-topline{flex-direction:column!important;gap:9px!important}
}

/* Reduced motion stays respected. */
@media(prefers-reduced-motion:reduce){html[data-theme] body.castlance-public-v8 *,html[data-theme] body.castlance-portal-v8 *,html[data-admin-theme] body.castlance-admin-v8 *{transition:none!important;animation:none!important}}

/* =========================================================
   10) COMPLETENESS PASS — legacy components not allowed to leak theme colors
   ========================================================= */
/* Public: secondary chips, article/legal, checkout/bank/success states. */
html[data-theme] body.castlance-public-v8 :is(.popular-v43,.pricing-icon-v43,.recommended-pill,.platform-icon,.os-dot,.back-link-v5,.article-meta-v5,.pricing-benefits span){border-color:var(--q-line)!important}
html[data-theme] body.castlance-public-v8 :is(.popular-v43,.pricing-icon-v43,.recommended-pill,.back-link-v5){background:color-mix(in srgb,var(--q-brand) 11%,var(--q-surface2))!important;color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important}
html[data-theme] body.castlance-public-v8 :is(.article-head-v5,.article-meta-v5,.legal-layout-v5,.checkout-list,.checkout-note,.delivery-actions,.delivery-grid,.release-meta,.terms-row){color:var(--q-text)!important;border-color:var(--q-line)!important}
html[data-theme] body.castlance-public-v8 :is(.article-meta-v5,.checkout-note,.delivery-note,.bank-note,.terms-row){background:var(--q-surface2)!important}
html[data-theme] body.castlance-public-v8 :is(.article-side-v5 a,.legal-content-v5 a,.article-content-v5 a,.back-link-v5){color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important}
html[data-theme] body.castlance-public-v8 :is(.checkout-price,.license-key-row,.copy-btn,.pay-methods,.pay-methods>*,.provider-soon){background:var(--q-surface2)!important;color:var(--q-text)!important;border-color:var(--q-line)!important}
html[data-theme] body.castlance-public-v8 :is(.success-check,.pending-icon){background:color-mix(in srgb,var(--q-success) 12%,var(--q-surface2))!important;color:var(--q-success)!important;-webkit-text-fill-color:var(--q-success)!important}

/* Public footer: explicit in both modes. */
html[data-theme] body.castlance-public-v8 :is(.site-footer,.footer-payments,.footer-bottom){background:var(--q-surface)!important;color:var(--q-muted)!important;border-color:var(--q-line)!important}
html[data-theme] body.castlance-public-v8 .site-footer :is(h2,h3,b,strong){color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-public-v8 .site-footer :is(p,span,small,a){color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important}
html[data-theme] body.castlance-public-v8 .site-footer a:hover{color:var(--q-brand)!important;-webkit-text-fill-color:var(--q-brand)!important}
html[data-theme] body.castlance-public-v8 .payment-logo{background:var(--q-surface2)!important;border-color:var(--q-line)!important;color:var(--q-text)!important}

/* Portal full registry: login, notifications, quota, rows and nested utility blocks. */
html[data-theme] body.castlance-portal-v8 :is(
 .login-card,.login-shell,.login-langs,.portal-notice,.saas-notice,.portal-action-required,.quota-note,.quota-title,
 .quota-remaining,.quota-saas-grid>div,.release-meta>div,.row,.list,.download-grid>*,.profile-grid>*,.setup-progress,
 .portal-pop-head,.portal-pop-status,.portal-mobile-head,.portal-mobile-groups,.mobile-nav-group,.section-card-head,.panel-head
){background:var(--q-surface)!important;color:var(--q-text)!important;border-color:var(--q-line)!important}
html[data-theme] body.castlance-portal-v8 :is(.login-card,.login-shell,.portal-notice,.saas-notice,.portal-action-required,.quota-note,.quota-saas-grid>div,.release-meta>div,.row,.setup-progress) :is(h1,h2,h3,b,strong,label,span){color:var(--q-text)!important;-webkit-text-fill-color:var(--q-text)!important}
html[data-theme] body.castlance-portal-v8 :is(.login-note,.quota-note,.row-side,.release-meta small,.profile-grid small,.portal-mobile-group>span){color:var(--q-muted)!important;-webkit-text-fill-color:var(--q-muted)!important}
html[data-theme] body.castlance-portal-v8 :is(.langs,.login-langs,.portal-bell summary,.portal-theme-toggle,.portal-menu-btn,.portal-mobile-theme-toggle,.portal-mobile-close){background:var(--q-surface2)!important;border-color:var(--q-line)!important;color:var(--q-text)!important}
html[data-theme] body.castlance-portal-v8 .portal-badge{color:#fff!important;-webkit-text-fill-color:#fff!important}
html[data-theme] body.castlance-portal-v8 .pill.ok{background:color-mix(in srgb,var(--q-success) 13%,var(--q-surface2))!important;color:var(--q-success)!important;-webkit-text-fill-color:var(--q-success)!important}
html[data-theme] body.castlance-portal-v8 .pill.bad{background:color-mix(in srgb,var(--q-danger) 13%,var(--q-surface2))!important;color:var(--q-danger)!important;-webkit-text-fill-color:var(--q-danger)!important}

/* Admin full registry: all known utility cards, accordions, language and support surfaces. */
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(
 .admin-accordion,.admin-accordion-body,.lang-block,.lang-tabs,.lang-head,.support-thread,.support-ticket-grid,.support-toolbar,
 .ticket-list,.ticket-meta,.support-empty,.support-kpis,.health,.health-grid,.home-admin-extra,.checks,.check,.alert,
 .mini-list,.mini,.invoice-toolbar,.invoice-actions,.an-row,.an-health>div,.release-kpis .kpi,.site-preview
){background:var(--qa-surface)!important;color:var(--qa-text)!important;border-color:var(--qa-line)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(.admin-accordion,.lang-block,.support-thread,.ticket-list,.health,.site-preview,.an-row,.an-health>div) :is(h1,h2,h3,b,strong,label,summary,span){color:var(--qa-text)!important;-webkit-text-fill-color:var(--qa-text)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(.admin-accordion,.lang-block,.support-thread,.ticket-list,.health,.site-preview,.an-row,.an-health>div) :is(p,small,.muted){color:var(--qa-muted)!important;-webkit-text-fill-color:var(--qa-muted)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(.admin-accordion-body,.lang-tabs,.support-toolbar,.ticket-meta,.mini,.an-row,.an-health>div){background:var(--qa-surface2)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(.lang-tabs button,.ui-toolbar-btn,.mobile-menu){background:var(--qa-surface2)!important;color:var(--qa-text)!important;border-color:var(--qa-line)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .lang-tabs button.active{background:color-mix(in srgb,var(--qa-brand) 14%,var(--qa-surface2))!important;color:var(--qa-text)!important;border-color:color-mix(in srgb,var(--qa-brand) 45%,var(--qa-line))!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .section-note{background:var(--qa-surface2)!important;color:var(--qa-muted)!important;border-color:var(--qa-line)!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .key{color:var(--qa-text)!important;-webkit-text-fill-color:var(--qa-text)!important}

/* Compact visual cadence across cards: no accidental giant whitespace. */
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(.grid2,.grid3,.health-grid,.an-grid){gap:12px!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 :is(.card,.an-card){padding:16px!important;border-radius:14px!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .card>h2,
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .card>h3{margin-top:0!important;margin-bottom:8px!important;line-height:1.25!important}
html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .card>p{margin-top:0!important;line-height:1.55!important}

/* Mobile type and spacing guardrails. */
@media(max-width:720px){
 html[data-theme] body.castlance-portal-v8 :is(.card,.saas-card,.panel,.release-center,.download-card){border-radius:13px!important}
 html[data-theme] body.castlance-portal-v8 :is(.card,.saas-card,.panel){padding-left:14px!important;padding-right:14px!important}
 html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .main{padding:14px 12px 30px!important}
 html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .top h1{font-size:25px!important}
 html[data-admin-theme] body.castlance-admin-v8.cast-ui-v2 .section>.section-head{padding:13px 14px!important}
}
