/* Shared /kh chrome + palette overrides for geo-themed content pages.
   Content blocks still use site.css structural classes; variables remapped to cream theme. */
body.kh-shell {
  --bg: #F5F1E6;
  --scaffold: #ECE4CF;
  --surface: #ECE4CF;
  --card: #ffffff;
  --text: #171512;
  --text-secondary: #6E6759;
  --brand: #218071;
  --brand-light: #E1492F;
  --amber: #F0A63A;
  --border: rgba(23, 21, 18, 0.1);
  --kh-ink: #171512;
  --kh-cream: #F5F1E6;
  --kh-muted: #6E6759;
  --kh-lantern: #E1492F;
  --kh-marigold: #F0A63A;
  --kh-jade: #218071;
  --kh-line: rgba(23, 21, 18, 0.1);
  background: var(--bg);
  color: var(--text);
}

body.kh-shell .legal-eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.kh-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

.kh-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(245, 241, 230, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--kh-line);
  will-change: transform;
}

.kh-header.is-nav-hidden {
  pointer-events: none;
}

.kh-nav {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.kh-logo {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--kh-ink);
  text-decoration: none;
  flex-shrink: 0;
}

.kh-logo__mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
}

.kh-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 22px;
  flex: 1 1 auto;
  min-width: 0;
}

.kh-nav-links a {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--kh-ink);
  opacity: 0.7;
  text-decoration: none;
}

.kh-nav-links a:hover {
  opacity: 1;
}

.kh-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.kh-pill {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 14px;
  background: var(--kh-ink);
  color: var(--kh-cream);
  padding: 10px 20px;
  border-radius: 99px;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.kh-pill:hover {
  transform: scale(1.05);
}

.kh-get-app {
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.kh-get-app__mark {
  width: 18px;
  height: 18px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  flex-shrink: 0;
  overflow: hidden;
}

.kh-nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--kh-line);
  background: transparent;
  color: var(--kh-ink);
  border-radius: 10px;
  font-size: 1.35rem;
  cursor: pointer;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.kh-nav-toggle .nav-menu-toggle__close {
  display: none;
}

.kh-header.is-menu-open .kh-nav-toggle .nav-menu-toggle__open {
  display: none;
}

.kh-header.is-menu-open .kh-nav-toggle .nav-menu-toggle__close {
  display: inline;
}

.kh-nav-mobile {
  display: none;
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--kh-line);
  background: var(--bg, var(--kh-cream));
}

.kh-header.is-menu-open .kh-nav-mobile {
  display: block;
  max-height: min(70vh, 520px);
  overflow-y: auto;
}

.kh-nav-mobile__panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 28px 20px;
}

.kh-nav-mobile__panel > a:not(.kh-pill) {
  color: var(--kh-ink);
  opacity: 0.75;
  padding: 12px 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.kh-nav-mobile__panel > a:not(.kh-pill):hover {
  opacity: 1;
}

.kh-nav-mobile__cta {
  margin-top: 8px;
  width: fit-content;
}

.kh-mobile-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .kh-nav-links,
  .kh-nav-actions {
    display: none !important;
  }

  .kh-nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }
}

@media (min-width: 821px) {
  .kh-nav-toggle,
  .kh-nav-mobile {
    display: none !important;
  }
}

/* Language switcher - pixel match webapp KhLangSwitcher (desktop + mobile menu) */
.kh-header .lang-switcher,
.kh-nav-actions .lang-switcher,
.nav-actions .lang-switcher {
  position: relative;
  flex-shrink: 0;
  display: block;
}
.kh-header .lang-btn,
.kh-nav .lang-btn,
.nav-actions .lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  max-width: 7.5rem;
  padding: 0 12px;
  border: 1px solid #d0d0cb;
  border-radius: 999px;
  background: #efefed;
  color: #141414;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease;
  width: auto;
  justify-content: flex-start;
}
@media (min-width: 640px) {
  .kh-header .lang-btn,
  .kh-nav .lang-btn,
  .nav-actions .lang-btn {
    max-width: none;
    padding: 0 14px;
    font-size: 14px;
  }
}
.kh-header .lang-btn:hover,
.kh-nav .lang-btn:hover,
.nav-actions .lang-btn:hover {
  border-color: #b8b8b2;
}
.kh-header .lang-icon,
.kh-nav .lang-icon,
.nav-actions .lang-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: #6e6e69;
}
.kh-header .lang-current,
.kh-nav .lang-current,
.nav-actions .lang-current {
  font-size: inherit;
  line-height: 1.2;
  display: inline-block;
  font-weight: 600;
  max-width: 4.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kh-header .lang-chevron,
.kh-nav .lang-chevron,
.nav-actions .lang-chevron {
  width: 14px;
  height: 14px;
  color: #6e6e69;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.kh-header .lang-switcher.open .lang-chevron,
.kh-nav .lang-switcher.open .lang-chevron,
.nav-actions .lang-switcher.open .lang-chevron {
  transform: rotate(180deg);
}
.kh-header .lang-dropdown,
.kh-nav .lang-dropdown,
.nav-actions .lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: auto;
  transform: none;
  width: min(14rem, calc(100vw - 2rem));
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border: 1px solid #e6e6e2;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(20, 20, 20, 0.08), 0 10px 24px -8px rgba(20, 20, 20, 0.18);
  z-index: 300;
  overflow: hidden;
  color: #141414;
  text-align: left;
}
.kh-header .kh-nav-actions .lang-dropdown,
.kh-nav-actions .lang-dropdown,
.nav-actions .lang-dropdown {
  left: auto;
  right: 0;
}
.kh-header .lang-switcher.open .lang-dropdown,
.kh-nav .lang-switcher.open .lang-dropdown,
.nav-actions .lang-switcher.open .lang-dropdown {
  display: block;
}
.kh-header .lang-dropdown-label,
.kh-nav .lang-dropdown-label,
.nav-actions .lang-dropdown-label {
  margin: 0;
  padding: 4px 10px 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6e6e69;
}
.kh-header .lang-dropdown button,
.kh-nav .lang-dropdown button,
.nav-actions .lang-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #141414;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease;
}
.kh-header .lang-option-name,
.kh-nav .lang-option-name,
.nav-actions .lang-option-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kh-header .lang-option-code,
.kh-nav .lang-option-code,
.nav-actions .lang-option-code {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6e6e69;
}
.kh-header .lang-option-check,
.kh-nav .lang-option-check,
.nav-actions .lang-option-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #0d7a5f;
}
.kh-header .lang-option-check-spacer,
.kh-nav .lang-option-check-spacer,
.nav-actions .lang-option-check-spacer {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.kh-header .lang-dropdown button:hover,
.kh-nav .lang-dropdown button:hover,
.nav-actions .lang-dropdown button:hover {
  background: #efefed;
}
.kh-header .lang-dropdown button.is-active,
.kh-nav .lang-dropdown button.is-active,
.nav-actions .lang-dropdown button.is-active {
  background: rgba(13, 122, 95, 0.15);
  font-weight: 600;
}

/* Soften dark-theme card chrome on cream pages */
body.kh-shell .section-panel,
body.kh-shell .feature-card,
body.kh-shell .contact-card {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--kh-line);
}

body.kh-shell .site-footer {
  display: none;
}

/* CTA buttons: white label on brand fill (site.css uses dark ink for .btn-primary) */
body.kh-shell .btn,
body.kh-shell .btn:hover,
body.kh-shell .btn-primary,
body.kh-shell .btn-primary:hover,
body.kh-shell a.btn,
body.kh-shell button.btn {
  color: #fff;
}
html[data-kh-theme="dark"] body.kh-shell .btn-outline,
html[data-kh-theme="dark"] body.kh-shell a.btn-outline {
  color: var(--kh-ink);
  border-color: var(--kh-line);
}

/* site.css .form-input hardcodes a dark fill (#0e1a15) for the global theme.
   Remapped --text/--border alone aren't enough - override bg on KH cream pages only. */
body.kh-shell .form-input {
  background: #fff;
  color: var(--kh-ink);
  border: 1px solid var(--kh-line);
  box-shadow: none;
}

body.kh-shell .form-input::placeholder {
  color: var(--kh-muted);
  opacity: 0.85;
}

body.kh-shell .form-input:focus {
  outline: none;
  border-color: var(--kh-jade);
  box-shadow: 0 0 0 3px rgba(33, 128, 113, 0.2);
}

body.kh-shell .form-label {
  color: var(--kh-muted);
}

body.kh-shell .form-error {
  color: #B42318;
}

body.kh-shell .form-success {
  color: var(--kh-jade);
}

/* ---------- Theme toggle ---------- */
.kh-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: 1px solid var(--kh-line, rgba(23, 21, 18, 0.1));
  background: var(--surface, #ece4cf);
  color: var(--kh-ink, #171512);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.kh-theme-btn:hover {
  border-color: var(--kh-lantern, #e1492f);
  color: var(--kh-lantern, #e1492f);
}
.kh-theme-btn__sun,
.kh-theme-btn__moon {
  line-height: 1;
}
html[data-kh-theme="dark"] .kh-theme-btn__moon,
html:not([data-kh-theme="dark"]) .kh-theme-btn__sun {
  display: none;
}

/* ---------- Dark mode (night market) ---------- */
html[data-kh-theme="dark"] {
  color-scheme: dark;
}

html[data-kh-theme="dark"] body.kh-shell,
html[data-kh-theme="dark"] body[data-region="kh"] {
  --bg: #12100e;
  --scaffold: #1a1714;
  --surface: #1c1914;
  --card: #1c1914;
  --text: #f5f1e6;
  --text-secondary: #a39e90;
  --brand: #3aa892;
  --brand-light: #e1492f;
  --amber: #f0a63a;
  --border: rgba(245, 241, 230, 0.12);
  --kh-ink: #f5f1e6;
  --kh-cream: #f5f1e6;
  --kh-muted: #a39e90;
  --kh-lantern: #e1492f;
  --kh-marigold: #f0a63a;
  --kh-jade: #3aa892;
  --kh-line: rgba(245, 241, 230, 0.12);
  background: var(--bg);
  color: var(--text);
}

html[data-kh-theme="dark"] .kh-header {
  background: rgba(18, 16, 14, 0.9);
  border-bottom-color: var(--kh-line);
}

html[data-kh-theme="dark"] .kh-pill {
  background: var(--kh-cream);
  color: #171512;
}

html[data-kh-theme="dark"] .kh-header .lang-btn,
html[data-kh-theme="dark"] .kh-nav .lang-btn,
html[data-kh-theme="dark"] .nav-actions .lang-btn {
  border-color: rgba(245, 241, 230, 0.16);
  background: #1c1914;
  color: #f5f1e6;
}
html[data-kh-theme="dark"] .kh-header .lang-btn:hover,
html[data-kh-theme="dark"] .kh-nav .lang-btn:hover,
html[data-kh-theme="dark"] .nav-actions .lang-btn:hover {
  border-color: rgba(245, 241, 230, 0.32);
}
html[data-kh-theme="dark"] .kh-header .lang-icon,
html[data-kh-theme="dark"] .nav-actions .lang-icon,
html[data-kh-theme="dark"] .kh-nav .lang-icon,
html[data-kh-theme="dark"] .kh-header .lang-chevron,
html[data-kh-theme="dark"] .kh-nav .lang-chevron,
html[data-kh-theme="dark"] .nav-actions .lang-chevron {
  color: #a39e90;
}
html[data-kh-theme="dark"] .kh-header .lang-dropdown,
html[data-kh-theme="dark"] .kh-nav .lang-dropdown,
html[data-kh-theme="dark"] .nav-actions .lang-dropdown {
  background: #1c1914;
  border-color: rgba(245, 241, 230, 0.14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 12px 28px -8px rgba(0, 0, 0, 0.5);
  color: #f5f1e6;
}
html[data-kh-theme="dark"] .kh-header .lang-dropdown-label,
html[data-kh-theme="dark"] .kh-nav .lang-dropdown-label,
html[data-kh-theme="dark"] .nav-actions .lang-dropdown-label,
html[data-kh-theme="dark"] .kh-header .lang-option-code,
html[data-kh-theme="dark"] .kh-nav .lang-option-code,
html[data-kh-theme="dark"] .nav-actions .lang-option-code {
  color: #a39e90;
}
html[data-kh-theme="dark"] .kh-header .lang-dropdown button,
html[data-kh-theme="dark"] .kh-nav .lang-dropdown button,
html[data-kh-theme="dark"] .nav-actions .lang-dropdown button {
  color: #f5f1e6;
}
html[data-kh-theme="dark"] .kh-header .lang-dropdown button:hover,
html[data-kh-theme="dark"] .kh-nav .lang-dropdown button:hover,
html[data-kh-theme="dark"] .nav-actions .lang-dropdown button:hover {
  background: rgba(245, 241, 230, 0.08);
}
html[data-kh-theme="dark"] .kh-header .lang-dropdown button.is-active,
html[data-kh-theme="dark"] .kh-nav .lang-dropdown button.is-active,
html[data-kh-theme="dark"] .nav-actions .lang-dropdown button.is-active {
  background: rgba(58, 168, 146, 0.22);
}
html[data-kh-theme="dark"] .kh-header .lang-option-check,
html[data-kh-theme="dark"] .kh-nav .lang-option-check,
html[data-kh-theme="dark"] .nav-actions .lang-option-check {
  color: #3aa892;
}

html[data-kh-theme="dark"] body.kh-shell .section-panel,
html[data-kh-theme="dark"] body.kh-shell .feature-card,
html[data-kh-theme="dark"] body.kh-shell .contact-card {
  background: rgba(28, 25, 20, 0.92);
  border-color: var(--kh-line);
}

html[data-kh-theme="dark"] body.kh-shell .form-input {
  background: #1c1914;
  color: var(--kh-ink);
  border-color: var(--kh-line);
}

html[data-kh-theme="dark"] body.kh-shell .form-input:focus {
  border-color: var(--kh-jade);
  box-shadow: 0 0 0 3px rgba(58, 168, 146, 0.25);
}

/* Business pricing cards (inline on /kh/business) */
html[data-kh-theme="dark"] .biz-pricing-v2-card,
html[data-kh-theme="dark"] .biz-pricing-v2-card--highlight {
  background: #1c1914;
  border-color: rgba(245, 241, 230, 0.14);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  color: #f5f1e6;
}
html[data-kh-theme="dark"] .biz-pricing-v2-subtitle,
html[data-kh-theme="dark"] .biz-pricing-v2-price-note {
  color: #a39e90;
}
html[data-kh-theme="dark"] .biz-pricing-v2-badge {
  color: #9fdbcb;
  background: rgba(58, 168, 146, 0.18);
  border-color: rgba(58, 168, 146, 0.35);
}
html[data-kh-theme="dark"] .biz-pricing-v2-early-note {
  color: #9fdbcb;
}


/* Non-home KH pages only (body.kh-shell): center mobile content + 50/50 paired CTAs.
   Homepage (/kh) does not use .kh-shell — leave its mobile layout unchanged. */
@media (max-width: 767.98px) {
  body.kh-shell .hero-grid,
  body.kh-shell .hero-grid > div:first-child,
  body.kh-shell main > section .container > h2,
  body.kh-shell main > section .container > .lead,
  body.kh-shell .section-panel,
  body.kh-shell .feature-card,
  body.kh-shell .showcase-row,
  body.kh-shell .explore-panel,
  body.kh-shell .contact-card,
  body.kh-shell .page-legal main,
  body.kh-shell.page-legal main,
  body.kh-shell .legal-content,
  body.kh-shell .kh-nav-mobile__panel {
    text-align: center;
  }

  body.kh-shell .hero .eyebrow {
    margin-left: auto;
    margin-right: auto;
  }

  body.kh-shell .lead,
  body.kh-shell .showcase-row p {
    margin-left: auto;
    margin-right: auto;
  }

  body.kh-shell .cta-row {
    justify-content: center;
    width: 100%;
  }

  body.kh-shell .cta-row:has(> .btn:nth-child(2)):not(:has(> .btn:nth-child(3))) {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
  }

  body.kh-shell .cta-row:has(> .btn:nth-child(2)):not(:has(> .btn:nth-child(3))) > .btn {
    flex: 1 1 0;
    width: 50%;
    max-width: 50%;
    min-width: 0;
    box-sizing: border-box;
    justify-content: center;
    text-align: center;
  }

  body.kh-shell .hero-store-badges,
  body.kh-shell .app-buttons,
  body.kh-shell .store-buttons {
    display: flex !important;
    flex-direction: row !important;
    width: 100%;
    justify-content: center !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
  }

  body.kh-shell .hero-store-badges > a,
  body.kh-shell .app-buttons > a,
  body.kh-shell .store-buttons > a {
    flex: 1 1 0;
    min-width: 0;
    width: 50%;
    max-width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  body.kh-shell .hero-store-badges .store-badge,
  body.kh-shell .app-buttons .store-badge,
  body.kh-shell .store-buttons .store-badge {
    width: 100% !important;
    height: auto !important;
    max-height: 48px;
    object-fit: contain;
    object-position: center;
  }

  body.kh-shell .kh-nav-mobile__panel {
    align-items: center;
  }

  body.kh-shell .kh-nav-mobile__panel > a:not(.kh-pill) {
    width: 100%;
    text-align: center;
  }

  body.kh-shell .kh-nav-mobile__cta {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  body.kh-shell .kh-mobile-tools {
    justify-content: center;
    width: 100%;
  }

  body.kh-shell .contact-form,
  body.kh-shell .waitlist-form,
  body.kh-shell .biz-venue-form,
  body.kh-shell .faq-question {
    text-align: left;
  }
}
