:root {
  --kepma-ebony-950: #0e0b09;
  --kepma-ebony-900: #15100d;
  --kepma-ebony-800: #221b17;
  --kepma-line: #3a2e27;
  --kepma-bone: #f5efe4;
  --kepma-muted: #b9ada3;
  --kepma-subtle: #9a8c82;
  --kepma-copper: #d19b5c;
  --kepma-copper-hi: #e3b784;
  --kepma-copper-dark: #75491a;
  --kepma-serif: "Songti SC", STSong, "Noto Serif CJK SC", "Times New Roman", serif;
  --kepma-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* Shared cinematic hero used by home, product, news and dealer pages in every language. */
#kepma-hero {
  --kh-bg: var(--kepma-ebony-950) !important;
  --kh-accent: var(--kepma-copper) !important;
  --kh-accent-light: var(--kepma-copper-hi) !important;
  --kh-text: var(--kepma-bone) !important;
  --kh-muted: var(--kepma-muted) !important;
}
#kepma-hero :is(a, button):focus-visible,
#kt-root :is(a, button, input):focus-visible,
kepma-product:focus-visible {
  outline: 2px solid var(--kepma-copper-hi) !important;
  outline-offset: 3px !important;
}
body :is(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--kepma-copper-hi) !important;
  outline-offset: 3px !important;
}
.skip-link.screen-reader-text:focus {
  clip: auto !important;
  clip-path: none !important;
  width: auto !important;
  height: auto !important;
  top: 12px !important;
  left: 12px !important;
  z-index: 100000 !important;
  padding: 12px 16px !important;
  color: var(--kepma-ebony-950) !important;
  background: var(--kepma-copper-hi) !important;
  border: 2px solid var(--kepma-bone) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .36) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

/* Bring the standalone tools experience onto the canonical Kepma palette. */
#kt-root {
  --kt-bg: var(--kepma-ebony-950) !important;
  --kt-bg-soft: var(--kepma-ebony-900) !important;
  --kt-panel: var(--kepma-ebony-800) !important;
  --kt-ink: var(--kepma-bone) !important;
  --kt-copy: var(--kepma-muted) !important;
  --kt-muted: var(--kepma-subtle) !important;
  --kt-bronze: var(--kepma-copper) !important;
  --kt-line: rgba(209, 155, 92, .28) !important;
  --kt-line-soft: rgba(245, 239, 228, .12) !important;
  --kt-serif: var(--kepma-serif) !important;
  --kt-sans: var(--kepma-sans) !important;
}
kepma-tools-page .kt {
  --kt-bg: var(--kepma-ebony-950) !important;
  --kt-bg-soft: var(--kepma-ebony-900) !important;
  --kt-panel: var(--kepma-ebony-800) !important;
  --kt-ink: var(--kepma-bone) !important;
  --kt-copy: var(--kepma-muted) !important;
  --kt-muted: var(--kepma-subtle) !important;
  --kt-bronze: var(--kepma-copper) !important;
  --kt-line: rgba(209, 155, 92, .28) !important;
  --kt-line-soft: rgba(245, 239, 228, .12) !important;
}
kepma-tools-page .kt h1 { color: var(--kepma-bone) !important; }
kepma-tools-page .kt__manifesto blockquote { color: var(--kepma-bone) !important; background: transparent !important; box-shadow: none !important; }
kepma-tools-page .kt__manifesto blockquote p { color: var(--kepma-bone) !important; }
#kt-root .kt__sidebar h2,
#kt-root .kt__content > .kt__toolbar h2,
#kt-root .kt__contributions-head h2,
kepma-tools-page .kt__sidebar h2,
kepma-tools-page .kt__content > .kt__toolbar h2,
kepma-tools-page .kt__contributions-head h2 { color: var(--kepma-copper) !important; }
#kt-root .kt__launch,
#kt-root .kt__contribution-row--head,
kepma-tools-page .kt__launch,
kepma-tools-page .kt__contribution-row--head { color: var(--kepma-copper-hi) !important; }
#kt-root .kt__launch:hover,
kepma-tools-page .kt__launch:hover { color: var(--kepma-ebony-950) !important; background: var(--kepma-copper-hi) !important; }
#kt-root :is(.kt__manifesto cite, .kt__category-count, .kt__tool-kicker),
kepma-tools-page :is(.kt__manifesto cite, .kt__category-count, .kt__tool-kicker) { color: var(--kepma-muted) !important; }
#kt-root :is(.kt__category-tab, .kt__details-toggle),
kepma-tools-page :is(.kt__category-tab, .kt__details-toggle) { color: var(--kepma-muted) !important; }
#kt-root .kt__search::placeholder,
kepma-tools-page .kt__search::placeholder { color: var(--kepma-subtle) !important; }
#kt-root :is(.kt__tool-index small, .kt__metadata, .kt__footnote),
kepma-tools-page :is(.kt__tool-index small, .kt__metadata, .kt__footnote) { color: var(--kepma-subtle) !important; }

/* Korean tools still uses the legacy editorial template; align it without changing its content. */
body.page-id-3197 #main,
body.page-id-3197 #page { background: var(--kepma-ebony-950) !important; }
body.page-id-3197 #content {
  width: min(100%, 1120px) !important;
  margin-inline: auto !important;
  padding: clamp(40px, 7vw, 88px) clamp(24px, 6vw, 72px) !important;
  color: var(--kepma-muted) !important;
  font-family: var(--kepma-sans) !important;
  font-size: 16px !important;
  line-height: 1.8 !important;
}
body.page-id-3197 #content :is(h1, h2, h3, strong) { color: var(--kepma-bone) !important; }
body.page-id-3197 #content :is(p, li) { color: var(--kepma-muted) !important; }
body.page-id-3197 #content a { color: var(--kepma-copper-hi) !important; text-underline-offset: 3px; }
body.page-id-3197 #content .wp-block-pullquote {
  margin: 0 0 clamp(42px, 7vw, 72px) !important;
  padding: clamp(28px, 5vw, 52px) !important;
  border: 0 !important;
  border-left: 2px solid var(--kepma-copper) !important;
  background: var(--kepma-ebony-900) !important;
  box-shadow: none !important;
  text-align: left !important;
}
body.page-id-3197 #content .wp-block-pullquote blockquote {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.page-id-3197 #content .wp-block-pullquote p {
  color: var(--kepma-bone) !important;
  font-family: var(--kepma-serif) !important;
  font-size: clamp(22px, 3vw, 34px) !important;
  line-height: 1.5 !important;
}
body.page-id-3197 #content .wp-block-pullquote cite { color: var(--kepma-copper) !important; }
body.page-id-3197 #content .wp-block-separator { border-color: var(--kepma-line) !important; opacity: 1 !important; }
body.page-id-3197 #sidebar {
  margin: 0 !important;
  padding: 56px clamp(24px, 6vw, 72px) !important;
  color: var(--kepma-muted) !important;
  background: var(--kepma-ebony-900) !important;
  border-color: var(--kepma-line) !important;
}
body.page-id-3197 #sidebar :is(h1, h2, h3, strong) { color: var(--kepma-bone) !important; }
body.page-id-3197 #sidebar a { color: var(--kepma-copper-hi) !important; }

/* Contact and after-sales embeds fill the entire viewport in every language. */
.kepma-fullheight-container {
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  margin-right: calc(50% - 50vw) !important;
  margin-left: calc(50% - 50vw) !important;
  padding: 0 !important;
  display: block !important;
  position: relative !important;
  z-index: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  background: #fff !important;
}
.kepma-fullheight-container iframe {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  position: relative !important;
  z-index: 0 !important;
  border: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

/* Keep the persistent contact affordance visually identical across all templates. */
#fixed-contact-button {
  color: var(--kepma-ebony-950) !important;
  background: var(--kepma-copper) !important;
  border-color: var(--kepma-copper) !important;
  box-shadow: none !important;
}
#fixed-contact-button:hover,
#fixed-contact-button:focus-visible {
  color: var(--kepma-ebony-950) !important;
  background: var(--kepma-copper-hi) !important;
  border-color: var(--kepma-copper-hi) !important;
}
body:has(.kepma-fullheight-container) #fixed-contact-button {
  display: none !important;
}
/* Keep every desktop and mobile navigation layer above the embedded document. */
body:has(.kepma-fullheight-container) :is(.masthead, #phantom, .sticky-header, .mobile-header-bar) {
  z-index: 10000 !important;
  overflow: visible !important;
}
body:has(.kepma-fullheight-container) .masthead :is(.main-nav, .sub-nav) {
  z-index: 10001 !important;
  pointer-events: auto !important;
}
body:has(.kepma-fullheight-container) .masthead .menu-item-has-children:is(:hover, :focus-within) > .sub-nav {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
/* Site-wide dropdown fallback: keep desktop sub-menus open on hover/focus even
   if The7's hover JS never binds (vc race guard is the primary fix). */
.masthead .main-nav .menu-item-has-children:is(:hover, :focus-within) > .sub-nav {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Embedded pages in every language: keep the mobile drawer (9602) and its close button
   above the masthead. The desktop iframe fallback remains unchanged. */
@media (max-width: 992px) {
  body:has(.kepma-fullheight-container) :is(.masthead, #phantom, .sticky-header, .mobile-header-bar) {
    z-index: 102 !important;
  }
}

@media (max-width: 1024px) {
  .dt-mobile-menu-icon,
  .scroll-top { min-width: 44px !important; min-height: 44px !important; }
  #fixed-contact-button {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #kepma-hero *, #kt-root * { scroll-behavior: auto !important; }
}