/* ============================================================
   KHC CoupleCare OS — Design System v2
   Palette: deep navy #122744, warm gold #C9A24B,
            soft green #5E8C6A, rich cream #FAF6EE
   Mobile-first. SVG icons. No external fonts or libraries.
   ============================================================ */

/* ---------- Tokens ---------- */
.khc-app {
	--khc-navy:      #122744;
	--khc-navy-soft: #1d3a63;
	--khc-navy-dim:  rgba(18, 39, 68, 0.08);
	--khc-gold:      #C9A24B;
	--khc-gold-soft: #E4C77F;
	--khc-gold-dim:  rgba(201, 162, 75, 0.14);
	--khc-green:     #5E8C6A;
	--khc-green-dim: rgba(94, 140, 106, 0.12);
	--khc-cream:     #FAF6EE;
	--khc-ink:       #1a2a40;
	--khc-muted:     #5a6a82;
	--khc-border:    rgba(18, 39, 68, 0.11);
	--khc-danger:    #c0392b;
	--khc-white:     #ffffff;
	--khc-radius:    16px;
	--khc-radius-sm: 10px;
	--khc-shadow:    0 4px 24px rgba(18, 39, 68, 0.10);
	--khc-shadow-lg: 0 12px 40px rgba(18, 39, 68, 0.16);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--khc-ink);
	background: var(--khc-cream);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.khc-app *, .khc-app *::before, .khc-app *::after { box-sizing: border-box; }
.khc-app img { max-width: 100%; height: auto; display: block; }
.khc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Topbar ---------- */
.khc-topbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 20px;
	height: 60px;
	background: var(--khc-navy);
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 2px 16px rgba(18, 39, 68, 0.22);
}

.khc-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	flex-shrink: 0;
}
.khc-brand-logo { height: 32px; width: auto; border-radius: 6px; }
.khc-brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: var(--khc-gold);
	color: var(--khc-navy);
	font-size: 17px;
	font-weight: 800;
	flex-shrink: 0;
}
.khc-brand-name {
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	letter-spacing: -0.2px;
}

/* ---------- Top nav (desktop quick-links) ---------- */
.khc-topnav {
	display: none;
	margin-left: auto;
	gap: 2px;
	align-items: center;
}
.khc-navlink {
	text-decoration: none;
	color: rgba(255,255,255,0.75);
	padding: 7px 14px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	transition: background 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}
.khc-navlink:hover { background: rgba(255,255,255,0.12); color: #fff; }
.khc-navlink.is-active { background: var(--khc-gold); color: var(--khc-navy); font-weight: 700; }

/* ---------- Hamburger ---------- */
.khc-menu-toggle {
	margin-left: auto;
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	background: rgba(255,255,255,0.10);
	border: 1px solid rgba(255,255,255,0.18);
	padding: 8px 10px;
	cursor: pointer;
	border-radius: 8px;
	flex-shrink: 0;
}
.khc-menu-toggle:hover { background: rgba(255,255,255,0.18); }
.khc-menu-toggle span:not(.khc-sr) {
	display: block;
	width: 20px;
	height: 2px;
	border-radius: 2px;
	background: #fff;
	transition: transform 0.2s ease, opacity 0.15s ease;
}
.khc-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.khc-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.khc-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Slide-in Drawer ---------- */
.khc-drawer {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	justify-content: flex-end;
	pointer-events: none;
}
.khc-drawer[hidden] { display: none; }
.khc-drawer:not([hidden]) { display: flex; }

.khc-drawer-inner {
	position: relative;
	z-index: 2;
	width: 300px;
	max-width: 90vw;
	height: 100%;
	background: var(--khc-navy);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	pointer-events: all;
	display: flex;
	flex-direction: column;
}

.khc-drawer-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.55);
	z-index: 1;
	pointer-events: all;
	cursor: pointer;
}

.khc-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	border-bottom: 1px solid rgba(255,255,255,0.1);
	position: sticky;
	top: 0;
	background: var(--khc-navy);
	z-index: 1;
	flex-shrink: 0;
}
.khc-drawer-brand { font-weight: 700; font-size: 15px; color: var(--khc-gold); }
.khc-drawer-close {
	background: rgba(255,255,255,0.08);
	border: 1px solid rgba(255,255,255,0.15);
	color: rgba(255,255,255,0.7);
	cursor: pointer;
	padding: 5px 9px;
	border-radius: 6px;
	font-size: 16px;
	line-height: 1;
}
.khc-drawer-close:hover { background: rgba(255,255,255,0.16); color: #fff; }

.khc-drawer-nav { padding: 8px 0 32px; flex: 1; }

.khc-drawer-group { padding: 4px 0 8px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.khc-drawer-group:last-child { border-bottom: none; }
.khc-drawer-group-label {
	display: block;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	color: var(--khc-gold);
	padding: 12px 18px 4px;
	opacity: 0.7;
}
.khc-drawer-nav .khc-navlink {
	display: block;
	padding: 10px 18px;
	border-radius: 0;
	font-size: 14.5px;
	color: rgba(255,255,255,0.78);
	border-left: 3px solid transparent;
	font-weight: 400;
}
.khc-drawer-nav .khc-navlink:hover {
	background: rgba(255,255,255,0.07);
	border-left-color: var(--khc-gold);
	color: #fff;
}
.khc-drawer-nav .khc-navlink.is-active {
	background: rgba(201,162,75,0.15);
	border-left-color: var(--khc-gold);
	color: #fff;
	font-weight: 600;
}
.khc-drawer-auth { padding: 16px 18px 12px; }
.khc-drawer-auth .khc-navlink { padding: 0; border-left: none; }
.khc-navlink--logout { font-size: 13.5px; color: rgba(255,255,255,0.45); }
.khc-navlink--logout:hover { color: #ff8a80 !important; background: transparent !important; border-left: none !important; }

/* ---------- Main ---------- */
.khc-main {
	width: 100%;
	max-width: 1040px;
	margin: 0 auto;
	padding: 28px 18px 120px;
	flex: 1;
}

/* ---------- Typography ---------- */
.khc-h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.18; color: var(--khc-navy); margin: 0 0 14px; font-weight: 800; letter-spacing: -0.5px; }
.khc-h2 { font-size: clamp(19px, 3.5vw, 26px); color: var(--khc-navy); margin: 0 0 14px; font-weight: 750; letter-spacing: -0.2px; }
.khc-h3 { font-size: 17px; color: var(--khc-navy); margin: 0 0 8px; font-weight: 700; }
.khc-lead { font-size: 16.5px; color: var(--khc-muted); margin: 0 0 20px; line-height: 1.7; }
.khc-center { text-align: center; }
.khc-eyebrow {
	display: inline-block;
	font-size: 11.5px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--khc-gold);
	font-weight: 700;
	margin-bottom: 10px;
}

/* ---------- Hero ---------- */
.khc-hero {
	text-align: center;
	padding: 44px 12px 32px;
}
.khc-hero-title {
	font-size: clamp(30px, 7vw, 52px);
	line-height: 1.12;
	color: var(--khc-navy);
	margin: 0 0 16px;
	font-weight: 900;
	letter-spacing: -0.8px;
}
.khc-hero-sub {
	max-width: 600px;
	margin: 0 auto 28px;
	font-size: 17.5px;
	color: var(--khc-muted);
	line-height: 1.7;
}
.khc-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- Buttons ---------- */
.khc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 26px;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 650;
	text-decoration: none;
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: transform 0.14s ease, box-shadow 0.18s ease, opacity 0.15s ease;
	letter-spacing: 0.1px;
}
.khc-btn:hover { transform: translateY(-2px); }
.khc-btn:active { transform: translateY(0); }
.khc-btn--primary {
	background: var(--khc-navy);
	color: #fff;
	box-shadow: 0 6px 20px rgba(18, 39, 68, 0.30);
}
.khc-btn--primary:hover { background: var(--khc-navy-soft); color: #fff; box-shadow: 0 10px 28px rgba(18, 39, 68, 0.36); }
.khc-btn--gold {
	background: var(--khc-gold);
	color: #1a1200;
	box-shadow: 0 6px 20px rgba(201, 162, 75, 0.38);
	font-weight: 700;
}
.khc-btn--gold:hover { box-shadow: 0 10px 28px rgba(201, 162, 75, 0.46); color: #1a1200; }
.khc-btn--ghost {
	background: transparent;
	color: var(--khc-navy);
	border-color: rgba(18, 39, 68, 0.28);
}
.khc-btn--ghost:hover { background: var(--khc-navy-dim); }
.khc-btn--block { width: 100%; }

.khc-link { color: var(--khc-navy); font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--khc-gold-soft); padding-bottom: 1px; transition: border-color 0.15s; }
.khc-link:hover { border-color: var(--khc-gold); color: var(--khc-navy-soft); }

/* ---------- Cards ---------- */
.khc-section { margin: 32px 0; }
.khc-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }

.khc-card {
	background: #fff;
	border: 1px solid var(--khc-border);
	border-radius: var(--khc-radius);
	box-shadow: var(--khc-shadow);
	padding: 22px;
	position: relative;
}
.khc-card p { margin: 0 0 10px; color: var(--khc-ink); }
.khc-card p:last-child { margin-bottom: 0; }

.khc-card--action {
	display: block;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.16s ease;
}
.khc-card--action:hover {
	transform: translateY(-4px);
	box-shadow: var(--khc-shadow-lg);
	border-color: var(--khc-gold);
}
.khc-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }

.khc-card--tint { background: rgba(94, 140, 106, 0.07); border-color: rgba(94, 140, 106, 0.22); }
.khc-card--gold { background: rgba(201, 162, 75, 0.09); border-color: rgba(201, 162, 75, 0.30); }
.khc-card--navy { background: var(--khc-navy); color: #fff; border-color: var(--khc-navy); }
.khc-card--navy .khc-h1, .khc-card--navy .khc-h2, .khc-card--navy .khc-h3 { color: #fff; }
.khc-card--navy .khc-lead, .khc-card--navy p { color: rgba(255,255,255,0.78); }
.khc-card--safety { border-left: 4px solid var(--khc-danger); background: rgba(192, 57, 43, 0.04); }

/* Card accent bar at top */
.khc-card--accented { border-top: 3px solid var(--khc-gold); }

/* ---------- Badges ---------- */
.khc-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	white-space: nowrap;
}
.khc-badge--free { background: rgba(94, 140, 106, 0.15); color: #2d5a38; }
.khc-badge--premium, .khc-badge--paid, .khc-badge--upgrade { background: rgba(201, 162, 75, 0.18); color: #7a5c17; }
.khc-badge--soon { background: var(--khc-navy-dim); color: var(--khc-navy); }
.khc-badge--anonymous, .khc-badge--private { background: var(--khc-navy); color: #fff; }
.khc-badge--book { background: var(--khc-navy); color: var(--khc-gold-soft); }

/* ---------- Forms ---------- */
.khc-form { display: flex; flex-direction: column; }
.khc-label { font-size: 13.5px; font-weight: 650; color: var(--khc-navy); margin: 14px 0 5px; display: block; }
.khc-input {
	width: 100%;
	padding: 12px 14px;
	border-radius: var(--khc-radius-sm);
	border: 1.5px solid rgba(18, 39, 68, 0.18);
	background: #fefefe;
	font-size: 15px;
	color: var(--khc-ink);
	font-family: inherit;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.khc-input:focus { outline: none; border-color: var(--khc-gold); box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.18); }
.khc-input::placeholder { color: var(--khc-muted); opacity: 0.7; }
.khc-check { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; font-size: 14px; color: var(--khc-ink); line-height: 1.5; }
.khc-check input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; width: 16px; height: 16px; }
.khc-form .khc-btn { margin-top: 8px; }
.khc-fineprint { font-size: 12.5px; color: var(--khc-muted); margin-top: 10px; text-align: center; }
.khc-hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; overflow: hidden; }

.khc-notice { border-radius: var(--khc-radius-sm); padding: 12px 16px; margin: 0 0 16px; font-size: 14px; line-height: 1.5; }
.khc-notice--warn { background: rgba(192, 57, 43, 0.08); color: #7c2c1f; border: 1px solid rgba(192, 57, 43, 0.22); }
.khc-notice--good { background: rgba(94, 140, 106, 0.10); color: #2d5a38; border: 1px solid rgba(94, 140, 106, 0.28); }

/* ---------- Auth & tabs ---------- */
.khc-auth { max-width: 460px; margin: 10px auto 0; }
.khc-tabs { background: #fff; border: 1px solid var(--khc-border); border-radius: var(--khc-radius); box-shadow: var(--khc-shadow); padding: 24px; }
.khc-tabbar { display: flex; background: var(--khc-navy-dim); border-radius: 999px; padding: 4px; margin-bottom: 12px; gap: 2px; }
.khc-tab {
	flex: 1;
	border: 0;
	background: transparent;
	padding: 10px 10px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	color: var(--khc-muted);
	cursor: pointer;
	font-family: inherit;
	transition: background 0.18s ease, color 0.18s ease;
}
.khc-tab.is-active { background: #fff; color: var(--khc-navy); box-shadow: 0 2px 8px rgba(18, 39, 68, 0.12); }
.khc-tabpanel { display: none; }
.khc-tabpanel.is-active { display: block; animation: khc-fade 0.22s ease; }

@keyframes khc-fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------- Dashboard ---------- */
.khc-dash-head { margin-bottom: 10px; }
.khc-dash-grid .khc-card { min-height: 120px; }

/* ---------- Score ring ---------- */
.khc-ring {
	--pct: 0;
	width: 136px;
	height: 136px;
	border-radius: 50%;
	display: inline-grid;
	place-items: center;
	position: relative;
	background: conic-gradient(var(--khc-green) calc(var(--pct) * 1%), var(--khc-navy-dim) 0);
	margin: 12px auto;
}
.khc-ring::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: #fff; }
.khc-ring span { position: relative; font-size: 26px; font-weight: 800; color: var(--khc-navy); }

/* ---------- Progress bar ---------- */
.khc-progress {
	height: 8px;
	background: var(--khc-navy-dim);
	border-radius: 999px;
	overflow: hidden;
	margin: 6px 0 14px;
}
.khc-progress span {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--khc-green), var(--khc-gold));
	border-radius: 999px;
	transition: width 0.5s ease;
}

/* ---------- Bottom nav (mobile fixed bar) ---------- */
.khc-bottomnav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-around;
	align-items: stretch;
	background: var(--khc-navy);
	border-top: 1px solid rgba(255,255,255,0.10);
	padding: 0 2px calc(env(safe-area-inset-bottom, 0px));
	z-index: 100;
	box-shadow: 0 -4px 20px rgba(18, 39, 68, 0.20);
}
.khc-bn-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	text-decoration: none;
	color: rgba(255,255,255,0.50);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.2px;
	padding: 9px 4px;
	flex: 1;
	min-width: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	font-family: inherit;
	transition: color 0.15s ease, background 0.15s ease;
}
.khc-bn-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}
.khc-bn-icon svg { width: 22px; height: 22px; display: block; }
.khc-bn-label { font-size: 10px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 54px; }
.khc-bn-item:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.07); }
.khc-bn-item.is-active { color: var(--khc-gold); }
.khc-bn-item.is-active .khc-bn-icon svg { stroke: var(--khc-gold); }

/* ---------- Footer ---------- */
.khc-footer {
	padding: 12px 20px calc(74px + env(safe-area-inset-bottom, 0px));
	text-align: center;
	border-top: 1px solid var(--khc-border);
	background: #fff;
}
.khc-copyright { font-size: 12px; color: var(--khc-muted); margin: 0; line-height: 1.6; }
.khc-footer-link { color: var(--khc-muted); text-decoration: underline; text-underline-offset: 2px; }
.khc-footer-link:hover { color: var(--khc-navy); }

/* ---------- Module placeholder ---------- */
.khc-module-soon { max-width: 620px; margin: 24px auto; padding: 34px 26px; }

/* ---------- Mobile explicit: hide desktop topnav ---------- */
@media (max-width: 781px) {
	.khc-app .khc-topnav { display: none !important; }
}

/* ---------- Desktop ---------- */
@media (min-width: 782px) {
	.khc-topnav { display: flex !important; }
	.khc-bottomnav { display: none !important; }
	.khc-main { padding-bottom: 44px; }
	.khc-footer { padding-bottom: 26px; }
	.khc-grid--2 { grid-template-columns: repeat(2, 1fr); }
	.khc-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Accessibility ---------- */
.khc-app a:focus-visible,
.khc-app button:focus-visible,
.khc-app input:focus-visible,
.khc-app select:focus-visible,
.khc-app textarea:focus-visible {
	outline: 3px solid var(--khc-gold);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	.khc-app * { animation: none !important; transition: none !important; }
}

/* ---------- Print ---------- */
@media print {
	.khc-topbar, .khc-drawer, .khc-bottomnav, .khc-footer, .khc-noprint,
	.khc-btn--ghost, .khc-step-actions, .khc-peace-progress { display: none !important; }
	.khc-app { background: #fff; }
}

/* ============================================================
   Phase 2 — Assessment & Report
   ============================================================ */

/* Stage selection */
.khc-stage-grid { display: grid; gap: 10px; grid-template-columns: 1fr; margin-top: 6px; }
@media (min-width: 640px) { .khc-stage-grid { grid-template-columns: repeat(2, 1fr); } }
.khc-stage-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px 15px;
	border: 1.5px solid rgba(18, 39, 68, 0.16);
	border-radius: 13px;
	background: #fff;
	cursor: pointer;
	font-size: 15px;
	transition: border-color 0.2s ease, background 0.2s ease;
}
.khc-stage-option:hover { border-color: var(--khc-gold); }
.khc-stage-option input { accent-color: var(--khc-navy); width: 17px; height: 17px; flex: none; }
.khc-stage-option:has(input:checked) { border-color: var(--khc-navy); background: rgba(18, 39, 68, 0.05); }

/* Progress bar */
.khc-progress {
	width: 100%;
	height: 9px;
	border-radius: 999px;
	background: rgba(18, 39, 68, 0.10);
	overflow: hidden;
	margin: 12px 0 4px;
}
.khc-progress span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--khc-gold), var(--khc-green));
	transition: width 0.4s ease;
}

/* Question cards */
.khc-assess-step { max-width: 680px; margin: 0 auto; }
.khc-step-head { margin-bottom: 16px; }
.khc-question { margin-bottom: 14px; padding: 18px 20px; }
.khc-question--safety { border-left: 4px solid var(--khc-gold); }
.khc-q-cat {
	font-size: 11.5px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--khc-gold);
	font-weight: 750;
	margin-bottom: 6px;
}
.khc-q-text { font-size: 16px; font-weight: 600; color: var(--khc-navy); margin: 0 0 12px; line-height: 1.5; }
.khc-options { display: flex; flex-direction: column; gap: 7px; }
.khc-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 13px;
	border-radius: 11px;
	border: 1.5px solid rgba(18, 39, 68, 0.12);
	background: #fff;
	cursor: pointer;
	font-size: 14.5px;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.khc-option:hover { border-color: var(--khc-gold); }
.khc-option input { accent-color: var(--khc-navy); width: 16px; height: 16px; flex: none; }
.khc-option:has(input:checked) { border-color: var(--khc-navy); background: rgba(18, 39, 68, 0.05); font-weight: 600; }

.khc-step-actions { display: flex; gap: 12px; justify-content: space-between; margin-top: 8px; }
.khc-step-actions .khc-btn--primary { margin-left: auto; }

/* Report */
.khc-report { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.khc-report-scorewrap { display: flex; align-items: center; gap: 20px; margin: 14px 0; flex-wrap: wrap; }
/* khc-ring position set in base */
.khc-band-label { font-size: 18px; font-weight: 750; color: var(--khc-navy); margin: 0 0 4px; }

.khc-scorebar-row { margin-bottom: 12px; }
.khc-scorebar-label { font-size: 14.5px; font-weight: 600; color: var(--khc-navy); margin-bottom: 5px; }
.khc-scorebar {
	width: 100%;
	height: 10px;
	border-radius: 999px;
	background: rgba(18, 39, 68, 0.08);
	overflow: hidden;
}
.khc-scorebar span { display: block; height: 100%; border-radius: 999px; }

.khc-cat-block { padding: 14px 0; border-bottom: 1px solid rgba(18, 39, 68, 0.08); }
.khc-cat-block:last-child { border-bottom: 0; }
.khc-cat-about { font-size: 13.5px; color: var(--khc-muted); margin: 4px 0 8px; }

.khc-day-block { padding: 16px 0; border-bottom: 1px solid rgba(18, 39, 68, 0.08); }
.khc-day-block:last-child { border-bottom: 0; }
.khc-day-block p { margin: 0 0 7px; font-size: 14.5px; }

.khc-unlock-cta { border: 2px solid rgba(201, 162, 75, 0.55); }
.khc-locked-preview { position: relative; filter: blur(3px); opacity: 0.55; pointer-events: none; user-select: none; display: flex; flex-direction: column; gap: 16px; }

/* Print styles: clean printable report */
@media print {
	.khc-topbar, .khc-drawer, .khc-bottomnav, .khc-footer, .khc-noprint,
	.khc-unlock-cta, .khc-locked-preview, .khc-hero-actions { display: none !important; }
	.khc-app { background: #fff; }
	.khc-main { padding: 0; max-width: 100%; }
	.khc-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; background: #fff; }
	.khc-report { gap: 10px; }
}

/* ============================================================
   Phase 3 — Checkout
   ============================================================ */
.khc-checkout-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-top: 6px; }
.khc-coupon-input { max-width: 260px; }
.khc-book-pay {
	max-width: 420px;
	margin: 14px auto 6px;
	text-align: left;
	background: rgba(201, 162, 75, 0.10);
	border: 1px solid rgba(201, 162, 75, 0.35);
	border-radius: var(--khc-radius);
	padding: 18px 20px;
}
.khc-book-pay .khc-checkout-form { align-items: stretch; }

/* ============================================================
   Phase 4 — Premarital Academy
   ============================================================ */
.khc-notice--good { background: rgba(94, 140, 106, 0.14); color: #2c5237; border: 1px solid rgba(94, 140, 106, 0.35); }
.khc-notice--good a { color: #2c5237; font-weight: 700; }

.khc-pm-list { display: flex; flex-direction: column; gap: 12px; max-width: 760px; margin: 18px auto 0; }
.khc-pm-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; }
.khc-pm-row--locked { opacity: 0.55; }
.khc-pm-row-main { flex: 1; min-width: 0; }
.khc-pm-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }

.khc-pm-module { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.khc-scripture {
	font-style: italic;
	color: var(--khc-muted);
	border-left: 3px solid var(--khc-gold);
	padding-left: 14px;
	margin: 10px 0 0;
	font-size: 14.5px;
}
.khc-lesson h3 { font-size: 18px; color: var(--khc-navy); margin: 22px 0 8px; font-weight: 750; }
.khc-lesson h3:first-child { margin-top: 0; }
.khc-lesson p { margin: 0 0 14px; line-height: 1.75; }
.khc-lesson p:last-child { margin-bottom: 0; }

/* Certificate */
.khc-certificate {
	background: #fff;
	border: 3px solid var(--khc-gold);
	border-radius: 6px;
	padding: 10px;
	max-width: 820px;
	margin: 0 auto;
	box-shadow: var(--khc-shadow);
}
.khc-cert-inner {
	border: 1.5px solid var(--khc-navy);
	padding: 46px 34px;
	text-align: center;
}
.khc-cert-brand { letter-spacing: 3px; text-transform: uppercase; font-size: 13px; color: var(--khc-gold); font-weight: 750; margin: 0 0 12px; }
.khc-cert-title { font-size: clamp(26px, 5vw, 40px); color: var(--khc-navy); margin: 0 0 20px; font-weight: 800; }
.khc-cert-line { color: var(--khc-muted); margin: 6px 0; font-size: 15px; max-width: 560px; margin-left: auto; margin-right: auto; }
.khc-cert-name { font-size: clamp(24px, 4.6vw, 34px); color: var(--khc-navy); font-weight: 750; margin: 10px 0; border-bottom: 2px solid var(--khc-gold); display: inline-block; padding: 0 26px 6px; }
.khc-cert-course { font-size: 21px; color: var(--khc-gold); font-weight: 750; margin: 12px 0; }
.khc-cert-footer { display: flex; justify-content: space-around; gap: 20px; margin-top: 42px; flex-wrap: wrap; }
.khc-cert-sig { border-top: 1.5px solid var(--khc-ink); padding: 8px 26px 0; margin: 0; font-weight: 650; color: var(--khc-navy); }
.khc-cert-sub { font-size: 12px; color: var(--khc-muted); margin: 4px 0 0; }
.khc-cert-id { font-size: 11px; color: #a9a9a9; margin: 30px 0 0; letter-spacing: 1px; }

@media print {
	.khc-certificate { border-color: #C9A24B; box-shadow: none; max-width: 100%; }
	.khc-pm-module .khc-card--gold, .khc-pm-list { display: none; }
}

/* ============================================================
   Phase 5 — Care Hub & Addiction Support
   ============================================================ */
.khc-options--row { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.khc-options--row .khc-option { flex: 1 1 calc(50% - 4px); min-width: 120px; justify-content: flex-start; }
@media (min-width: 640px) {
	.khc-options--row .khc-option { flex: 1 1 0; }
}

/* ============================================================
   Phase 6 — Listening Room & Answered Issues
   ============================================================ */
.khc-code-box {
	background: rgba(201, 162, 75, 0.1);
	border: 2px dashed var(--khc-gold);
	border-radius: var(--khc-radius-sm);
	padding: 18px;
	margin: 18px 0;
}
.khc-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: clamp(18px, 4.4vw, 26px);
	font-weight: 750;
	letter-spacing: 2px;
	color: var(--khc-navy);
	margin: 0;
	word-break: break-all;
	cursor: pointer;
	user-select: all;
}

.khc-thread { display: flex; flex-direction: column; gap: 12px; margin: 4px 0; }
.khc-msg {
	background: var(--khc-card);
	border: 1px solid var(--khc-border);
	border-radius: var(--khc-radius-sm);
	padding: 14px 16px;
	box-shadow: var(--khc-shadow-soft);
	max-width: 92%;
}
.khc-msg--user { align-self: flex-start; border-left: 3px solid var(--khc-gold); }
.khc-msg--admin { align-self: flex-end; background: rgba(18, 39, 68, 0.05); border-left: 3px solid var(--khc-navy); }
.khc-msg-meta { font-size: 11.5px; color: var(--khc-muted); margin-bottom: 6px; letter-spacing: 0.4px; text-transform: uppercase; }
.khc-msg p { margin: 0; }

.khc-recorder { background: rgba(18, 39, 68, 0.04); border: 1px solid var(--khc-border); border-radius: var(--khc-radius-sm); padding: 14px; }
.khc-rec-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.khc-rec-timer { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; color: #b32d2e; }

.khc-optional { border: 1px solid var(--khc-border); border-radius: var(--khc-radius-sm); padding: 12px 14px; background: #fff; }
.khc-optional summary { cursor: pointer; font-weight: 650; color: var(--khc-navy); }
.khc-optional .khc-label { margin-top: 10px; }

/* ============================================================
   Phase 7 — Couple Comparison, Peace Room, Agreement
   ============================================================ */
.khc-cmp-row { padding: 12px 0; border-bottom: 1px solid var(--khc-border); }
.khc-cmp-row:last-child { border-bottom: none; }
.khc-cmp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.khc-gap { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.3px; }
.khc-gap--aligned { background: rgba(94, 140, 106, 0.16); color: #2c5237; }
.khc-gap--moderate { background: rgba(201, 162, 75, 0.18); color: #7a5c14; }
.khc-gap--large { background: rgba(179, 45, 46, 0.12); color: #b32d2e; }
.khc-cmp-bars { display: flex; flex-direction: column; gap: 6px; }
.khc-cmp-bar { position: relative; background: rgba(18, 39, 68, 0.07); border-radius: 999px; height: 18px; overflow: hidden; }
.khc-cmp-bar em { position: absolute; right: 8px; top: 0; line-height: 18px; font-size: 11px; font-style: normal; font-weight: 700; color: var(--khc-navy); }
.khc-cmp-fill { display: block; height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.khc-cmp-fill--a { background: var(--khc-navy); }
.khc-cmp-fill--b { background: var(--khc-gold); }

.khc-peace-progress { background: rgba(18, 39, 68, 0.08); border-radius: 999px; height: 8px; margin-bottom: 16px; overflow: hidden; }
.khc-peace-progress span { display: block; height: 100%; background: var(--khc-green); border-radius: 999px; transition: width 0.4s ease; }
.khc-peace-step { margin-bottom: 14px; }

.khc-agreement {
	background: #fff;
	border: 2px solid var(--khc-gold);
	border-radius: var(--khc-radius-sm);
	padding: 18px;
	white-space: pre-wrap;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13.5px;
	line-height: 1.7;
	color: var(--khc-ink);
	overflow-x: auto;
}
@media print {
	.khc-peace-progress, .khc-peace .khc-step-actions { display: none; }
}
