/*
 * Shared CALE public dark/light theme.
 * Loaded AFTER page-specific styles to preserve the visual language of CALE.
 */
:root[data-theme="light"]{color-scheme:light}
:root[data-theme="dark"]{color-scheme:dark}

.cm-theme-toggle {
  width:37px;height:37px;min-width:37px;
  display:inline-flex;align-items:center;justify-content:center;
  margin-left:auto;padding:0;
  border-radius:11px;border:1px solid #d9dcd6;
  background:#fff;color:#4b5a4c;cursor:pointer;
  font:600 19px/1 "Inter",system-ui,sans-serif;
  box-shadow:0 1px 3px #131d1708;
  transition:background .18s,border-color .18s,color .18s;
}
.cm-theme-toggle:hover{background:#f0f2ef;border-color:#bfc9bd}
.cm-theme-toggle:focus-visible{outline:2px solid #7fada0;outline-offset:3px}
.cm-nav-inner > .cm-theme-toggle{margin-left:0}
.cm-auth-top > .cm-theme-toggle,
.cale-legal-page header .nav > .cm-theme-toggle {margin-left:auto}
@media(max-width:720px){
  .cm-nav-inner{gap:10px!important}
  .cm-nav-inner > .cm-theme-toggle{margin-left:auto}
  .cm-nav-actions,.cm-nav-auth{gap:8px!important}
  .cm-nav-actions a.cm-btn,.cm-nav-auth a.cm-btn{padding-inline:10px}
}

/* Public marketing & account pages */
html[data-theme="dark"] body.cale-marketing,
html[data-theme="dark"] body.cale-auth-page {
  --cm-ink:#f0f1ec;
  --cm-muted:#a8afa7;
  --cm-line:#32362f;
  --cm-bg:#141512;
  --cm-soft:#222520;
  --cm-accent:#232f2b;
  --cm-white:#1b1c19;
  background:#141512!important;
  color:#f0f1ec!important;
}
html[data-theme="dark"] .cm-theme-toggle {
  color:#e4e9e0;background:#252822;border-color:#43483f;
  box-shadow:none;
}
html[data-theme="dark"] .cm-theme-toggle:hover{background:#30342d}
html[data-theme="dark"] body.cale-marketing .cm-nav{
  background:#181a17f2;border-color:#32362f;
}
html[data-theme="dark"] body.cale-marketing .cm-nav-links a,
html[data-theme="dark"] body.cale-marketing .cm-nav-actions a:not(.cm-btn),
html[data-theme="dark"] body.cale-marketing .cm-nav-auth a:not(.cm-btn) {color:#c0c6be}
html[data-theme="dark"] body.cale-marketing .cm-nav-links a:hover,
html[data-theme="dark"] body.cale-marketing .cm-nav-actions a:not(.cm-btn):hover {color:#f3f4f0}
html[data-theme="dark"] body.cale-marketing .cm-brand-icon,
html[data-theme="dark"] body.cale-auth-page .cm-brand-icon {
  background:#252822;color:#f2f2ed;border-color:#444a40;box-shadow:none;
}
html[data-theme="dark"] body.cale-marketing .cm-btn,
html[data-theme="dark"] body.cale-auth-page .cm-btn {
  background:#292c27;color:#e9ece6!important;border-color:#43483e;
  box-shadow:none;
}
html[data-theme="dark"] body.cale-marketing .cm-btn:hover,
html[data-theme="dark"] body.cale-auth-page .cm-btn:hover {
  background:#353931;color:#fff!important;border-color:#5a6155;
}
html[data-theme="dark"] body.cale-marketing .cm-btn-primary,
html[data-theme="dark"] body.cale-auth-page .cm-btn-primary {
  background:#363d34;border-color:#566151;color:#f5f5f0!important;
}
html[data-theme="dark"] body.cale-marketing .cm-btn-primary:hover,
html[data-theme="dark"] body.cale-auth-page .cm-btn-primary:hover {
  background:#434f41;border-color:#6b7967;
}
html[data-theme="dark"] body.cale-marketing .cm-kicker,
html[data-theme="dark"] body.cale-auth-page .cm-kicker {color:#9cb7ab}
html[data-theme="dark"] body.cale-marketing .cm-kicker:before,
html[data-theme="dark"] body.cale-auth-page .cm-kicker:before {background:#86baaa}
html[data-theme="dark"] body.cale-marketing .cm-hero-copy h1 em,
html[data-theme="dark"] body.cale-auth-page .cm-auth-story h1 em {color:#9cafaa}
html[data-theme="dark"] body.cale-marketing .cm-hero-copy p,
html[data-theme="dark"] body.cale-auth-page .cm-auth-story>p,
html[data-theme="dark"] body.cale-marketing .cm-section-head p {color:#b0b8ae}
html[data-theme="dark"] body.cale-marketing .cm-hero-foot span,
html[data-theme="dark"] body.cale-marketing .cm-steps span {
  color:#aeb9af;background:#20231e;border-color:#393e37;
}
html[data-theme="dark"] body.cale-marketing .cm-search-panel,
html[data-theme="dark"] body.cale-marketing .cm-feature,
html[data-theme="dark"] body.cale-marketing .cm-faq details,
html[data-theme="dark"] body.cale-auth-page .cm-auth-card{
  background:#1c1e1a;color:#f0f1ec;border-color:#343830;box-shadow:0 12px 34px #00000020;
}
html[data-theme="dark"] body.cale-marketing .cm-search-panel label,
html[data-theme="dark"] body.cale-marketing .cm-demo-caption,
html[data-theme="dark"] body.cale-marketing .cm-search-hint,
html[data-theme="dark"] body.cale-marketing .cm-feature p,
html[data-theme="dark"] body.cale-marketing .cm-faq details p {color:#a4afa5}
html[data-theme="dark"] body.cale-marketing .cm-search-panel textarea {
  background:transparent!important;border:0;color:#eeeee8!important;
}
html[data-theme="dark"] body.cale-marketing .cm-search-panel textarea::placeholder {color:#8f9b92}
html[data-theme="dark"] body.cale-marketing .cm-demo-panel{
  background:linear-gradient(145deg,#1d2926,#20221e 65%,#25241f);
  border-color:#343e36;box-shadow:0 20px 45px #00000020;
}
html[data-theme="dark"] body.cale-marketing .cm-demo-orbit{border-color:#3b514a}
html[data-theme="dark"] body.cale-marketing .cm-demo-box,
html[data-theme="dark"] body.cale-marketing .cm-floating-note,
html[data-theme="dark"] body.cale-marketing .cm-demo-tabs span {
  background:#1b1e1b;border-color:#3b4039;color:#e8eee7;box-shadow:none;
}
html[data-theme="dark"] body.cale-marketing .cm-demo-tabs span:first-child{
  background:#2b3a30;color:#c7e0cb;border-color:#45664e;
}
html[data-theme="dark"] body.cale-marketing .cm-demo-result{border-color:#323830}
html[data-theme="dark"] body.cale-marketing .cm-demo-result small {color:#9da99e}
html[data-theme="dark"] body.cale-marketing .cm-demo-pill {
  background:#2a392d;color:#b2d7ba;border-color:#435c48;
}
html[data-theme="dark"] body.cale-marketing .cm-floating-note>span{color:#a9cbb1}
html[data-theme="dark"] body.cale-marketing .cm-feature-index {
  background:#29362d;border-color:#3c5141;color:#b7d4b9;
}
html[data-theme="dark"] body.cale-marketing .cm-feature h3,
html[data-theme="dark"] body.cale-marketing .cm-demo-top strong,
html[data-theme="dark"] body.cale-marketing .cm-demo-result strong {color:#f0f1ec}
html[data-theme="dark"] body.cale-marketing .cm-price-card {
  background:linear-gradient(105deg,#1c211c,#212924);
  border-color:#39463a;color:#eff0eb;
}
html[data-theme="dark"] body.cale-marketing .cm-price-card p,
html[data-theme="dark"] body.cale-marketing .cm-price small,
html[data-theme="dark"] body.cale-marketing .cm-price-action small{color:#adb8ad}
html[data-theme="dark"] body.cale-marketing .cm-section,
html[data-theme="dark"] body.cale-marketing .cm-footer,
html[data-theme="dark"] body.cale-auth-page .cm-switch {
  border-color:#343830;
}
html[data-theme="dark"] body.cale-marketing .cm-footer small,
html[data-theme="dark"] body.cale-marketing .cm-footer-links a{color:#a4ada4}
html[data-theme="dark"] body.cale-marketing .cm-footer-links a:hover{color:#e7ece6}

/* Auth forms and visual preview */
html[data-theme="dark"] body.cale-auth-page .cm-auth-intro,
html[data-theme="dark"] body.cale-auth-page .cm-auth-note,
html[data-theme="dark"] body.cale-auth-page .cm-switch,
html[data-theme="dark"] body.cale-auth-page .cm-auth-bottom,
html[data-theme="dark"] body.cale-auth-page .cm-auth-legal {color:#aab4a9}
html[data-theme="dark"] body.cale-auth-page .cm-auth-back{color:#b6c4b6!important}
html[data-theme="dark"] body.cale-auth-page .cm-auth-back:hover{color:#f5f5ef!important}
html[data-theme="dark"] body.cale-auth-page .cm-auth-mini{
  background:linear-gradient(130deg,#1b2a24,#242823);
  border-color:#3d4b3e;
}
html[data-theme="dark"] body.cale-auth-page .cm-auth-mini-row{
  background:#1b1e1a;border-color:#3c4439;color:#e5e9e1;
}
html[data-theme="dark"] body.cale-auth-page .cm-auth-mini-head span,
html[data-theme="dark"] body.cale-auth-page .cm-auth-mini-row span{color:#aac5ac}
html[data-theme="dark"] body.cale-auth-page .cm-google{
  background:#22251f;color:#ecefe8;border-color:#464d43;
}
html[data-theme="dark"] body.cale-auth-page .cm-google:hover{
  background:#2c3029;border-color:#5e695b;
}
html[data-theme="dark"] body.cale-auth-page .cm-divider{color:#a2aaa0}
html[data-theme="dark"] body.cale-auth-page .cm-divider:before,
html[data-theme="dark"] body.cale-auth-page .cm-divider:after{background:#3a4138}
html[data-theme="dark"] body.cale-auth-page .cm-field label{color:#bdc8bb}
html[data-theme="dark"] body.cale-auth-page .cm-field input{
  background:#232620!important;color:#f3f4ef!important;border-color:#424a3e!important;
}
html[data-theme="dark"] body.cale-auth-page .cm-field input:focus{
  border-color:#7a9b7c!important;box-shadow:0 0 0 3px #59755b30;
}
html[data-theme="dark"] body.cale-auth-page .cm-field input::placeholder{color:#879487}
html[data-theme="dark"] body.cale-auth-page .cm-field-help,
html[data-theme="dark"] body.cale-auth-page .cm-auth-card .auth-note{color:#a6b0a5}
html[data-theme="dark"] body.cale-auth-page .cm-inline-end a,
html[data-theme="dark"] body.cale-auth-page .cm-switch a,
html[data-theme="dark"] body.cale-auth-page .cm-auth-legal a{color:#b6d0b8}
html[data-theme="dark"] body.cale-auth-page .cm-auth-bottom a:hover{color:#f3f5ef}
html[data-theme="dark"] body.cale-auth-page .cm-auth-card .auth-note.error{color:#f0a6a1!important}
html[data-theme="dark"] body.cale-auth-page .cm-auth-card .auth-note.success{color:#a3d2ae!important}

/* Legal pages were previously hard-coded to dark. Make them follow CALE. */
body.cale-legal-page {
  font-family:"Inter",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
html[data-theme="light"] body.cale-legal-page{
  background:#f8f8f6;color:#242624;
}
html[data-theme="light"] body.cale-legal-page header,
html[data-theme="light"] body.cale-legal-page footer{border-color:#e5e5df}
html[data-theme="light"] body.cale-legal-page .brand,
html[data-theme="light"] body.cale-legal-page .contact-email,
html[data-theme="light"] body.cale-legal-page a{color:#2d3730}
html[data-theme="light"] body.cale-legal-page .home,
html[data-theme="light"] body.cale-legal-page .footer-links a{color:#757e74}
html[data-theme="light"] body.cale-legal-page p,
html[data-theme="light"] body.cale-legal-page li,
html[data-theme="light"] body.cale-legal-page .intro {color:#616d61}
html[data-theme="light"] body.cale-legal-page .eyebrow,
html[data-theme="light"] body.cale-legal-page .updated,
html[data-theme="light"] body.cale-legal-page .contact-label,
html[data-theme="light"] body.cale-legal-page .contact-note{color:#859185}
html[data-theme="light"] body.cale-legal-page .contact-card{
  background:#fff;border-color:#e1e5df;
}
html[data-theme="light"] body.cale-legal-page .section-divider{border-color:#e3e7df}
html[data-theme="light"] body.cale-legal-page hr{border-color:#e3e7df}
html[data-theme="light"] body.cale-legal-page a:hover{color:#111a11}
html[data-theme="dark"] body.cale-legal-page{background:#141512;color:#f0f1ec}
html[data-theme="dark"] body.cale-legal-page header,
html[data-theme="dark"] body.cale-legal-page footer{border-color:#343830}
html[data-theme="dark"] body.cale-legal-page .contact-card{
  background:#1c1e1a;border-color:#343b33;
}
html[data-theme="dark"] body.cale-legal-page .section-divider,
html[data-theme="dark"] body.cale-legal-page hr{border-color:#343830}
html[data-theme="dark"] body.cale-legal-page .brand,
html[data-theme="dark"] body.cale-legal-page .contact-email,
html[data-theme="dark"] body.cale-legal-page a{color:#e6eee4}
html[data-theme="dark"] body.cale-legal-page .home,
html[data-theme="dark"] body.cale-legal-page .footer-links a{color:#b0b9af}
html[data-theme="dark"] body.cale-legal-page p,
html[data-theme="dark"] body.cale-legal-page li,
html[data-theme="dark"] body.cale-legal-page .intro{color:#bdc7bb}
html[data-theme="dark"] body.cale-legal-page .eyebrow,
html[data-theme="dark"] body.cale-legal-page .updated,
html[data-theme="dark"] body.cale-legal-page .contact-label,
html[data-theme="dark"] body.cale-legal-page .contact-note{color:#a5b0a4}


/* Shared CALE switch — warm neutral thumb instead of a standalone icon */
.cm-theme-toggle,.cm-theme-toggle:hover,html[data-theme="dark"] .cm-theme-toggle {
  width:56px;min-width:56px;height:32px;min-height:32px;
  padding:0;border:0;background:transparent;box-shadow:none;border-radius:999px;
}
.cm-theme-track{width:56px;height:32px;display:inline-flex;position:relative;align-items:center;
  justify-content:space-between;padding:0 9px;border:1px solid #ded9d0;
  border-radius:999px;background:#f0ede7;transition:background .2s,border-color .2s}
.cm-theme-symbol{z-index:1;color:#8d8275;font-size:12px;line-height:1}
.cm-theme-thumb{width:24px;height:24px;position:absolute;left:3px;top:3px;
  border-radius:50%;background:#c8bdad;box-shadow:0 1px 3px #231f251e;
  transition:transform .2s,background .2s}
html[data-theme="dark"] .cm-theme-track{background:#322f2a;border-color:#514b42}
html[data-theme="dark"] .cm-theme-symbol{color:#bfb5a6}
html[data-theme="dark"] .cm-theme-thumb{background:#c9bdaa;transform:translateX(24px)}
.cm-theme-toggle:focus-visible .cm-theme-track{outline:2px solid #a49278;outline-offset:3px}
.cm-password-wrap{display:block;position:relative;width:100%}
.cale-auth-page .cm-password-wrap input{width:100%;padding-right:48px}
.cm-password-toggle{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;
  position:absolute;right:4px;top:50%;transform:translateY(-50%);
  border:0;border-radius:9px;background:transparent;color:#89877f;cursor:pointer}
.cm-password-toggle:hover{background:#eeece6;color:#383d37}
.cm-password-toggle:focus-visible{outline:2px solid #9da99b;outline-offset:0}
html[data-theme="dark"] .cm-password-toggle{color:#adb6a8}
html[data-theme="dark"] .cm-password-toggle:hover{background:#343a32;color:#f0f2ea}
@media(prefers-reduced-motion:reduce){.cm-theme-track,.cm-theme-thumb{transition:none}}
