/* Kintwill dark appearance V2: scoped to public pages; editor retains its own readable UI. */
.kw-mode-control{display:inline-flex;align-items:center;gap:6px;margin-left:auto;white-space:nowrap;font:inherit;color:var(--ink)}
.kw-mode-label{font-size:12px;color:var(--sub)}
.kw-mode-control select{min-height:36px;max-width:88px;border:1px solid var(--line);border-radius:9px;background:var(--card);color:var(--ink);padding:5px 6px;font:inherit;font-size:13px;cursor:pointer}
.kw-mode-control select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.site-header:has(.kw-mode-control){display:flex;align-items:center;flex-wrap:wrap;gap:10px}
@media(max-width:620px){.kw-mode-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.kw-mode-control{margin-left:auto}.kw-mode-control select{font-size:12px;min-height:36px}}
html[data-kw-mode="dark"]{color-scheme:dark}
html[data-kw-mode="dark"] body{
 --page:#111c26;--card:#21323e;--ink:#eaf3f1;--sub:#c4d6d4;--line:#5b827d;
 --light:#293e49;--accent:#94d1bf;--accent-dark:#b2e7d6;--accent-on:#10242b;
 --head-bg:#304854;--shadow:0 14px 42px rgba(0,0,0,.24);
 background:var(--page);color:var(--ink);
}
html[data-kw-mode="dark"] .shell{background:transparent;color:var(--ink)}
html[data-kw-mode="dark"] .panel{background:var(--card);border-color:var(--line);color:var(--ink)}
html[data-kw-mode="dark"] .panel-head{background:var(--head-bg);border-color:var(--line)}
html[data-kw-mode="dark"] .panel-title{color:#f0f7f5}
html[data-kw-mode="dark"] .brand,html[data-kw-mode="dark"] .wordmark,html[data-kw-mode="dark"] .tagline,html[data-kw-mode="dark"] .aside-content h2{color:var(--ink)}
html[data-kw-mode="dark"] .primary-nav a{color:var(--ink)}
html[data-kw-mode="dark"] .subline{color:#d1e1e3}
html[data-kw-mode="dark"] .intro{color:var(--ink);background:transparent}
html[data-kw-mode="dark"] .hero-copy::before{background:linear-gradient(90deg,var(--card) 0%,var(--card) 52%,color-mix(in srgb,var(--card) 72%,transparent) 76%,transparent 100%)}
html[data-kw-mode="dark"] .status{background:#304954;color:#e6f3ef;border-color:#72978d}
html[data-kw-mode="dark"] .beta-inner{background:#304854}
html[data-kw-mode="dark"] .beta h2,html[data-kw-mode="dark"] .beta-invite{color:#e9f5f2}
html[data-kw-mode="dark"] .beta .pending,html[data-kw-mode="dark"] .beta .pending a{color:#d7e9e5}
html[data-kw-mode="dark"] .cta{background:#76b9a7;border-color:#76b9a7;color:#10242b}
html[data-kw-mode="dark"] .cta:disabled{opacity:1;color:#10242b}
html[data-kw-mode="dark"] .custom-trigger{color:#c5f0e2;border-color:#79b9a8}
html[data-kw-mode="dark"] .custom-trigger svg{stroke:#c5f0e2}
html[data-kw-mode="dark"] .custom-blurb,html[data-kw-mode="dark"] .hero-footer{color:#c6dbd7}
html[data-kw-mode="dark"] .grow,html[data-kw-mode="dark"] .aside-fields dt{color:#b9ead9}
html[data-kw-mode="dark"] .aside-content p{color:#d0e0dc}
html[data-kw-mode="dark"] .site-footer,html[data-kw-mode="dark"] .site-footer a{color:#c5d9d4}
html[data-kw-mode="dark"] .kintwill-socials a{color:#a9c9c0}
html[data-kw-mode="dark"] .kw-mode-control select{background:#293e49;color:#edf6f3;border-color:#6d9991}
/* The original editor is intentionally light, independent of page appearance. */
html[data-kw-mode="dark"] .editor{color-scheme:light;background:#fffefa;color:#263332}
html[data-kw-mode="dark"] .editor :is(h2,legend,label,.editor-bottom small){color:#263332}
html[data-kw-mode="dark"] .editor .editor-top p{color:#526b63}
html[data-kw-mode="dark"] .editor .preset{background:#fffefa;color:#34584e;border-color:#c8d6cd}
html[data-kw-mode="dark"] .editor .preset[aria-pressed="true"]{background:#edf4ef;color:#34584e}
html[data-kw-mode="dark"] .editor .selects select{background:#fff;color:#263332}
html[data-kw-mode="dark"] .editor .color-field{color:#263332}
html[data-kw-mode="dark"] .editor .editor-status{color:#3a6449;background:#eef6ef}
html[data-kw-mode="dark"] .editor .editor-status.warning{color:#704922;background:#ffedde}
html[data-kw-mode="dark"] .editor .editor-bottom button,html[data-kw-mode="dark"] .editor .icon-btn{color:#315d52;background:#fffefa}
/* Keep Brevo's isolated iframe untouched; only style its outer dialog. */
html[data-kw-mode="dark"] .signup-dialog{color-scheme:light;background:#fffefa;color:#263332}
html[data-kw-mode="dark"] .signup-heading{color:#24383a}
html[data-kw-mode="dark"] .signup-description,html[data-kw-mode="dark"] .signup-note{color:#59726e}
html[data-kw-mode="dark"] .signup-help{background:#edf5f1;color:#34574d}
html[data-kw-mode="dark"] .signup-help a{color:#285b50}
html[data-kw-mode="dark"] .signup-close{background:#f4f8f5;color:#315d53}
html[data-kw-mode="dark"] .signup-frame{background:#fff}
/* Generic informational pages: inherit high contrast instead of V1 global overrides. */
html[data-kw-mode="dark"] :is(.callout,.info-box,.signup-box,.signup-card){background:var(--light);color:var(--ink)}
html[data-kw-mode="dark"] :is(.site-header,.header-strip){border-color:var(--line)}
@media(prefers-reduced-motion:reduce){.kw-mode-control select{scroll-behavior:auto}}

/* V3 contrast repair: cover hard-coded colors in secondary pages and layout V2.3.3. */
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) :is(.status,.status p,.status a,.aside-fields dd,.site-page-title,.site-page-section h2,.kw-alpha-story h2,.kw-alpha-story h1,.site-page-section h3,.kw-alpha-story strong,.site-page-section strong){color:#edf7f5}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) :is(.site-page-kicker,.kw-toc-heading,.kw-alpha-story .site-page-kicker){color:#a7e2d1}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) :is(.site-page-lede,.site-page-section p,.site-page-small,.kw-alpha-story p,.kw-alpha-story p.kw-alpha-deck,.kw-alpha-guide .aside-content p,.site-page-intro p,.site-page-body p,.site-page-body li){color:#d2e3e2}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) :is(.site-page-link,.site-page-email,.kw-alpha-guide .kw-toc a,.kw-alpha-next a,.site-page-body a:not(.site-page-button),.status a){color:#b5eadb}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .kw-alpha-guide .kw-toc li{border-color:#587a78}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .site-page-labels>div{background:#eaf3ef;border-color:#b4d1c7}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .site-page-labels :is(dt,dd){color:#243d42}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .site-page-button{background:#76b9a7;color:#10242b;border-color:#76b9a7}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .mobile-menu nav a[aria-current="page"]{background:#304854;color:#edf7f5}
/* The visitor editor presets are light palettes, even when the site preference is Dark. */
html[data-kw-custom="true"] body{background:var(--page);color:var(--ink)}
html[data-kw-custom="true"] :is(.shell,.panel){background:var(--card);color:var(--ink)}
html[data-kw-custom="true"] .panel-head{background:var(--head-bg)}
html[data-kw-custom="true"] :is(.panel-title,.aside-fields dd,.aside-content p,.site-page-title,.site-page-section h2,.kw-alpha-story h2,.kw-alpha-story h1,.site-page-section h3,.site-page-section p,.site-page-lede,.site-page-small,.kw-alpha-story p,.kw-alpha-story p.kw-alpha-deck,.kw-alpha-guide .aside-content p,.site-page-body li,.site-page-intro p,.site-page-body strong,.kw-alpha-story strong,.status,.status p,.brand,.wordmark,.subline,.intro,.custom-blurb,.hero-footer,.grow,.site-footer,.site-footer a,.kintwill-socials a){color:var(--ink)}
html[data-kw-custom="true"] :is(.site-page-kicker,.aside-fields dt,.kw-toc-heading,.kw-alpha-guide .kw-toc a,.site-page-email,.site-page-link,.site-page-body a:not(.site-page-button),.status a,.primary-nav a,.custom-trigger,.custom-trigger svg){color:var(--accent-dark);stroke:currentColor}
html[data-kw-custom="true"] .beta-inner{background:var(--head-bg)}
html[data-kw-custom="true"] :is(.beta h2,.beta-invite,.beta .pending,.beta .pending a){color:var(--ink)}
html[data-kw-custom="true"] .hero-copy::before{background:linear-gradient(90deg,var(--card) 0%,var(--card) 52%,color-mix(in srgb,var(--card) 72%,transparent) 76%,transparent 100%)}
html[data-kw-custom="true"] .status{background:var(--head-bg);border-color:var(--line)}
html[data-kw-custom="true"] .site-page-labels>div{background:var(--light);border-color:var(--line)}
html[data-kw-custom="true"] .site-page-labels :is(dt,dd){color:var(--ink)}
html[data-kw-custom="true"] .site-page-button,html[data-kw-custom="true"] .cta{background:var(--accent);color:var(--accent-on);border-color:var(--accent)}
html[data-kw-custom="true"] .kw-mode-control select{background:var(--card);color:var(--ink);border-color:var(--line)}
/* Non-custom dark layout also needs high-contrast text in the V2.3.3 sidebar. */
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) :is(.aside-fields dd,.aside-content p,.beta-inner p,.beta .pending,.beta .pending a,.status p){color:#e0eeeb}

/* V3.6: discovery copy uses a fixed pale foreground on dark cards, not the light-theme fallback. */
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .kw-alpha-discovery{background:#304854;border-color:#72978d;color:#edf7f5}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .kw-alpha-discovery strong{color:#f0f8f5}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .kw-alpha-discovery span{color:#d8e9e6}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .kw-alpha-discovery a{color:#b5eadb}
html[data-kw-custom="true"] .kw-alpha-discovery{background:var(--head-bg);border-color:var(--line);color:var(--ink)}
html[data-kw-custom="true"] .kw-alpha-discovery :is(strong,span){color:var(--ink)}
html[data-kw-custom="true"] .kw-alpha-discovery a{color:var(--accent-dark)}
/* V4.0: privacy reading surface follows dark mode unless a custom palette is active. */
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .wrap>main{color-scheme:dark;background:var(--card);color:var(--ink);border-color:var(--line)}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .wrap>main :is(h1,h2,p,li,strong){color:var(--ink)}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .wrap>main small{color:var(--sub)}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .wrap>main a{color:var(--accent-dark)}
html[data-kw-mode="dark"] .wrap>p>a{color:var(--accent-dark)}

/* V3.7 shared appearance controls */
.kw-mode-control{display:inline-flex;align-items:center;gap:2px;padding:3px;border:1px solid var(--line,#86a9a1);border-radius:12px;background:var(--card,#fff)}
.kw-mode-control button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:42px;min-height:38px;padding:6px 9px;border:0;border-radius:8px;background:transparent;color:var(--ink,#243638);font:600 13px system-ui,sans-serif;cursor:pointer}
.kw-mode-control button[aria-pressed="true"]{background:#47786e;color:#fff}
.kw-mode-control button:focus-visible{outline:2px solid #76b9a7;outline-offset:2px}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .kw-mode-control{background:#293e49;border-color:#6d9991}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .kw-mode-control button{color:#edf6f3}
html[data-kw-mode="dark"]:not([data-kw-custom="true"]) .kw-mode-control button[aria-pressed="true"]{background:#76b9a7;color:#10242b}
@media(max-width:620px){.kw-mode-text{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.kw-mode-control{gap:1px}.kw-mode-control button{min-width:36px;padding:6px}}
html[data-kw-custom="true"] .wrap>main,html[data-kw-mode="dark"][data-kw-custom="true"] .wrap>main{color-scheme:light;background:var(--card);color:var(--ink);border-color:var(--line,#a9c8bd);font-family:var(--profile-font);border-radius:var(--card-radius)}
html[data-kw-custom="true"] .wrap>main :is(h1,h2,p,li,strong,small),html[data-kw-mode="dark"][data-kw-custom="true"] .wrap>main :is(h1,h2,p,li,strong,small){color:var(--ink)}
html[data-kw-custom="true"] .wrap>main a,html[data-kw-mode="dark"][data-kw-custom="true"] .wrap>main a{color:var(--accent-dark)}
html[data-kw-custom="true"] .wrap>p>a{color:var(--accent-dark)}

/* V3.9: custom palettes get derived dark companions, never a fixed override. */
html[data-kw-mode="dark"][data-kw-custom="true"] body{
 --page:var(--kw-dark-page,#111c26);--card:var(--kw-dark-card,#21323e);
 --ink:var(--kw-dark-ink,#eaf3f1);--sub:#c4d6d4;--line:#5b827d;
 --light:var(--kw-dark-light,#293e49);--accent:var(--kw-dark-accent,#94d1bf);
 --accent-dark:var(--kw-dark-accent,#b2e7d6);--accent-on:#10242b;
 --head-bg:var(--kw-dark-head,#304854);
 background:var(--page);color:var(--ink);
}
html[data-kw-mode="dark"][data-kw-custom="true"] .shell{background:transparent}
html[data-kw-mode="dark"][data-kw-custom="true"] .wrap>main{color-scheme:dark;background:var(--card);color:var(--ink)}
html[data-kw-mode="dark"][data-kw-custom="true"] .kw-mode-control{background:#293e49;border-color:#6d9991}
html[data-kw-mode="dark"][data-kw-custom="true"] .kw-mode-control button{color:#edf6f3}
html[data-kw-mode="dark"][data-kw-custom="true"] .kw-mode-control button[aria-pressed="true"]{background:#76b9a7;color:#10242b}

/* V4.1: extend the active page color behind the rounded outer frame.
   The html canvas is visible above/below the shell on mobile; unlike body,
   it previously retained the older off-white background. */
html[data-kw-mode="light"]{background:var(--page,#fefffd)}
html[data-kw-mode="dark"]{background:#111c26}
html[data-kw-mode="dark"][data-kw-custom="true"]{background:var(--kw-dark-page,#111c26)}
