
:root{
  --kh-bg: #f6f7fb;
  --kh-bg2:#ffffff;
  --kh-card: #ffffff;
  --kh-card2:#f2f4ff;
  --kh-text: #0b0b10;
  --kh-muted: #5b6472;
  --kh-accent: #ff9a22;
  --kh-primary: #6a5af9;
  --kh-primary2:#8f7cff;
  --kh-border: rgba(15,23,42,.10);
  --kh-shadow: 0 14px 44px rgba(15,23,42,.10);
  --kh-radius: 18px;
  --kh-radius-sm: 14px;
}

*{box-sizing:border-box}
html,body{height:100%}
html{background: var(--kh-bg);}
body{
  margin:0;
  font-family: 'Sora', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: transparent;
  color: var(--kh-text);
  font-size: 18px;
  line-height: 1.65;
  position:relative;
  min-height:100%;
  isolation:isolate;
}

/* Fixed viewport background to avoid mobile gradient seam/banding */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:
    radial-gradient(1500px 980px at 12% -18%, rgba(106,90,249,.18) 0%, rgba(106,90,249,.08) 50%, rgba(106,90,249,0) 80%),
    radial-gradient(1200px 780px at 92% -12%, rgba(255,154,34,.16) 0%, rgba(255,154,34,.06) 48%, rgba(255,154,34,0) 80%),
    radial-gradient(1400px 900px at 50% 68%, rgba(106,90,249,.05) 0%, rgba(106,90,249,0) 66%),
    linear-gradient(180deg, var(--kh-bg) 0%, var(--kh-bg) 100%);
}

a{color: #4f46e5; text-decoration:none}
a:hover{opacity:.95; text-decoration:underline}

.kh-container{
  width:min(1180px, 92vw);
  margin-inline:auto;
}

.kh-skip{position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden}
.kh-skip:focus{left:16px; top:16px; width:auto; height:auto; padding:10px 14px; background:#111; color:#fff; border-radius:10px; z-index:9999}

/* HEADER */
.kh-header{
  position:sticky; top:0; z-index:1000;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,.80);
  border-bottom: 1px solid var(--kh-border);
}
.kh-header__inner{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 0;
  gap: 14px;
}
.kh-brand{
  display:flex; align-items:center; gap:12px;
  min-width: 180px;
}
.kh-brand img{height:40px; width:auto; display:block}
@media (max-width: 520px){
  .kh-brand img{height:34px}
}
.kh-nav{
  display:flex; align-items:center; gap: 18px;
}
.kh-menu{
  display:flex; gap: 10px;
  list-style:none; padding:0; margin:0;
  align-items:center;
}
.kh-menu a{
  display:inline-flex; padding:10px 12px; border-radius: 999px;
  color: var(--kh-text);
  border: 1px solid transparent;
}
.kh-menu a:hover{
  border-color: var(--kh-border);
  background: rgba(15,23,42,.04);
  text-decoration:none;
}

/* Desktop dropdown menus (sub-menu) */
.kh-menu li{position:relative}
.kh-menu .sub-menu{
  display:none;
  position:absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 260px;
  padding: 8px;
  margin: 0;
  list-style: none;
  border: 1px solid var(--kh-border);
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  box-shadow: var(--kh-shadow);
  z-index: 1400;
}
.kh-menu .sub-menu li{margin:0; padding:0}
.kh-menu .sub-menu a{
  display:flex;
  width:100%;
  justify-content:space-between;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
}
.kh-menu .sub-menu a:hover{
  background: rgba(15,23,42,.04);
  border-color: var(--kh-border);
}
.kh-menu li:hover > .sub-menu,
.kh-menu li:focus-within > .sub-menu{display:block}

/* 3rd level flyout */
.kh-menu .sub-menu .sub-menu{
  top: 0;
  left: calc(100% + 10px);
}

/* Optional caret for parents */
.kh-menu > li.menu-item-has-children > a::after{
  content: "▾";
  font-size: 12px;
  margin-left: 8px;
  opacity: .7;
}
.kh-cta{
  display:inline-flex; align-items:center; gap:10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--kh-primary), var(--kh-primary2));
  color:#fff;
  box-shadow: 0 10px 24px rgba(106,90,249,.18);
  border: 1px solid rgba(255,255,255,.25);
}
.kh-cta:hover{text-decoration:none; transform: translateY(-1px)}

/* Mobile menu button */
.kh-burger{
  display:none;
  width:44px; height:44px;
  border-radius: 14px;
  border:1px solid var(--kh-border);
  background: rgba(15,23,42,.04);
  color: var(--kh-text);
}
.kh-burger svg{width:22px; height:22px}
@media (max-width: 980px){
  .kh-menu{display:none}
  .kh-burger{display:inline-flex; align-items:center; justify-content:center}
}

/* Mobile drawer */
.kh-drawer{
  position:fixed; inset:0;
  background: rgba(15,23,42,.28);
  display:none;
  z-index:1200;
}
.kh-drawer.is-open{display:block}
.kh-drawer__panel{
  position:absolute; right:0; top:0; height:100%;
  width:min(420px, 92vw);
  background: rgba(255,255,255,.98);
  border-left: 1px solid var(--kh-border);
  box-shadow: var(--kh-shadow);
  padding: 16px;
  overflow:auto;
}
.kh-drawer__top{
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px;
}
.kh-close{
  width:44px; height:44px;
  border-radius: 14px;
  border:1px solid var(--kh-border);
  background: rgba(15,23,42,.04);
  color: var(--kh-text);
}
.kh-drawer__title{font-size:18px; font-weight:700}
.kh-mobile-menu ul{list-style:none; padding:0; margin:14px 0 0}
.kh-mobile-menu li{border-top:1px solid var(--kh-border)}
.kh-mobile-menu a{
  display:flex; justify-content:space-between; align-items:center;
  padding: 12px 10px;
  color: var(--kh-text);
}
.kh-mobile-menu a:hover{text-decoration:none; background: rgba(15,23,42,.04); border-radius:12px}
.kh-submenu-toggle{
  width:38px; height:38px;
  border-radius: 12px;
  border:1px solid var(--kh-border);
  background: rgba(15,23,42,.04);
  color: var(--kh-text);
}
.kh-mobile-menu .sub-menu{display:none; padding-left: 10px}
.kh-mobile-menu .is-open > .sub-menu{display:block}

/* HERO */
.kh-hero{
  padding: 34px 0 18px;
}
.kh-hero__card{
  border: 1px solid var(--kh-border);
  background: linear-gradient(135deg, rgba(106,90,249,.14), rgba(255,154,34,.10));
  border-radius: 26px;
  padding: 24px;
  box-shadow: var(--kh-shadow);
}
.kh-hero h1{
  margin:0 0 10px;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.15;
}
.kh-hero p{
  margin:0;
  color: var(--kh-muted);
  max-width: 78ch;
}

/* Category blocks */
.kh-section-title{
  display:flex; align-items:center; gap:10px;
  margin: 28px 0 14px;
  font-weight: 900;
  font-size: 22px;
}
.kh-chip-row{
  display:flex; flex-wrap:wrap; gap: 12px;
}
.kh-chip{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.85);
  color: var(--kh-text);
  min-height: 46px;
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
}
.kh-chip:hover{
  text-decoration:none;
  background: linear-gradient(135deg, rgba(106,90,249,.12), rgba(143,124,255,.08));
  border-color: rgba(106,90,249,.18);
}
@media (max-width: 520px){
  .kh-chip{width:100%}
}

/* Cards */
.kh-card{
  border:1px solid var(--kh-border);
  background: rgba(255,255,255,.88);
  border-radius: var(--kh-radius);
  box-shadow: var(--kh-shadow);
}

/* SINGLE Calculator */
.kh-page-title{
  margin: 16px 0 10px;
  font-size: clamp(26px, 2.6vw, 40px);
  line-height:1.2;
  font-weight: 900;
}

.kh-calculator-box{
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(15,23,42,.10);
  background: linear-gradient(135deg, rgba(106,90,249,.14), rgba(143,124,255,.08));
  box-shadow: 0 14px 44px rgba(15,23,42,.10);
}

.kh-calculator-inner{
  background: rgba(255,255,255,.85);
  border:1px solid rgba(15,23,42,.10);
  border-radius: 18px;
  padding: 16px;
}

.kh-disclaimer{
  margin-top: 14px;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.88);
  color: var(--kh-text);
}
.kh-disclaimer strong{font-weight: 900}
.kh-disclaimer.warning{border-left: 5px solid var(--kh-accent)}
.kh-disclaimer.health{border-left: 5px solid #ff4d4d}

.kh-toc{
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid var(--kh-border);
  background: rgba(255,255,255,.88);
  overflow:hidden;
}
.kh-toc__title{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding: 12px 14px;
  font-weight: 900;
  background: rgba(15,23,42,.03);
  border:0;
  border-bottom: 1px solid var(--kh-border);
  color: var(--kh-text);
  font-family: inherit;
  text-align:left;
}
.kh-toc__label{font-size: 18px; line-height: 1.15}
.kh-toc__title:hover{cursor:pointer; background: rgba(15,23,42,.05)}
.kh-toc__icon{
  width:28px; height:28px;
  display:grid; place-items:center;
  border-radius:10px;
  border:1px solid var(--kh-border);
  background: rgba(15,23,42,.04);
  font-size:18px;
  line-height:1;
}
.kh-toc__list{
  margin:0;
  padding: 12px 16px 14px;
  list-style-position: inside;
}
.kh-toc__list a{color: var(--kh-text); overflow-wrap:anywhere; word-break:break-word}
.kh-toc__list li{margin: 8px 0; overflow-wrap:anywhere; word-break:break-word}

@media (max-width: 560px){
  .kh-toc__label{font-size: 19px}
  .kh-toc__title{padding: 14px 14px}
  .kh-toc__list{padding: 12px 14px 14px}
}

.kh-accordion{
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid var(--kh-border);
  overflow:hidden;
}
.kh-accordion__btn{
  width:100%;
  display:flex; justify-content:space-between; align-items:center;
  padding: 14px 16px;
  background: rgba(15,23,42,.03);
  color: var(--kh-text);
  border:0;
  font-family: inherit;
  font-weight: 900;
  font-size: 16px;
}
.kh-accordion__btn:hover{cursor:pointer; background: rgba(15,23,42,.05)}
.kh-accordion__content{
  display:none;
  padding: 16px;
  background: rgba(255,255,255,.88);
}
.kh-accordion.is-open .kh-accordion__content{display:block}

/* Blog single */
.kh-featured{
  border-radius: 22px;
  overflow:hidden;
  border: 1px solid var(--kh-border);
  margin-top: 10px;
  background:#fff;
}
.kh-featured img{width:100%; height:auto; display:block}
.kh-meta{
  color: var(--kh-muted);
  font-size: 14px;
  margin: 10px 0 16px;
}

/* Content styling */
.entry-content h2{margin-top: 26px}
.entry-content h3{margin-top: 22px}
.entry-content blockquote{
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 5px solid rgba(106,90,249,.7);
  background: rgba(106,90,249,.06);
  border-radius: 14px;
}
.entry-content code{
  background: rgba(15,23,42,.06);
  padding: 2px 6px;
  border-radius: 8px;
}
.entry-content ul, .entry-content ol{padding-left: 22px}
.entry-content li{margin: 6px 0}
.entry-content strong{font-weight: 900}
.entry-content em{opacity:.95}

/* Contact form */
.kh-form{
  display:grid; gap: 12px;
  padding: 16px;
}
.kh-field label{
  display:block; font-weight:900; margin-bottom: 6px;
}
.kh-field input, .kh-field textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.95);
  color: var(--kh-text);
  font-family: inherit;
  outline:none;
}
.kh-field input:focus, .kh-field textarea:focus{
  border-color: rgba(106,90,249,.55);
  box-shadow: 0 0 0 4px rgba(106,90,249,.14);
}
.kh-check{
  display:flex; gap: 10px; align-items:flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.02);
}
.kh-check input{margin-top: 4px}
.kh-submit{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.25);
  background: linear-gradient(135deg, var(--kh-primary), var(--kh-primary2));
  color:#fff;
  font-weight: 900;
  cursor:pointer;
}
.kh-submit:hover{transform: translateY(-1px)}

/* Footer */
.kh-footer{
  border-top: 1px solid var(--kh-border);
  margin-top: 44px;
  padding: 28px 0 34px;
  background: rgba(255,255,255,.70);
}
.kh-footer__grid{
  display:grid; gap: 18px;
  grid-template-columns: 1.2fr 1fr 1fr;
}
@media (max-width: 820px){
  .kh-footer__grid{grid-template-columns:1fr}
}
.kh-footer h4{
  margin:0 0 10px;
  font-size: 16px;
  font-weight: 900;
}
.kh-footer ul{list-style:none; padding:0; margin:0}
.kh-footer a{color: var(--kh-text); opacity:.9}
.kh-footer a:hover{opacity:1}
.kh-footer__bottom{
  margin-top: 18px;
  color: var(--kh-muted);
  font-size: 13px;
}

/* Cookie banner */
.kh-cookie{
  position:fixed;
  left: 16px; right: 16px; bottom: 16px;
  max-width: 980px;
  margin-inline:auto;
  display:none;
  z-index:1400;
}
.kh-cookie.is-open{display:block}
.kh-cookie__card{
  border:1px solid var(--kh-border);
  background: rgba(255,255,255,.98);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--kh-shadow);
  display:flex;
  gap: 12px;
  align-items:flex-start;
  justify-content:space-between;
}
.kh-cookie__text{color: var(--kh-muted); font-size: 14px}
.kh-cookie__actions{
  display:flex; gap: 10px; flex-wrap:wrap;
}
.kh-btn{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(15,23,42,.04);
  color: var(--kh-text);
  font-weight: 900;
  font-family: inherit;
  cursor:pointer;
}
.kh-btn.primary{
  background: linear-gradient(135deg, var(--kh-primary), var(--kh-primary2));
  color:#fff;
  border-color: rgba(255,255,255,.25);
}
.kh-btn.danger{
  background: rgba(255,77,77,.12);
  border-color: rgba(255,77,77,.25);
}
