/* ==========================================================================
   Calix Knowledge Base — customer-facing styles (Phase 4)

   One token layer, then components built from it. Every rule is scoped under
   .kbh so nothing can leak into the surrounding theme.

   Brand colours come from Settings and are injected per knowledge base as
   --kbh-accent / --kbh-navy on the .kbh-wrap element, so two knowledge bases
   on one page can be branded differently. Everything else is derived.
   ========================================================================== */

.kbh {
	/* Spacing — 4px base. */
	--kbh-s1: 4px;  --kbh-s2: 8px;  --kbh-s3: 12px; --kbh-s4: 16px;
	--kbh-s5: 20px; --kbh-s6: 24px; --kbh-s8: 32px; --kbh-s10: 40px;
	--kbh-s12: 48px; --kbh-s16: 64px;

	/* Fluid type: readable on a phone, confident on a desktop. */
	--kbh-text-xs:   0.75rem;
	--kbh-text-sm:   0.8125rem;
	--kbh-text-base: 0.9375rem;
	--kbh-text-md:   1rem;
	--kbh-text-lg:   1.125rem;
	--kbh-text-xl:   clamp(1.125rem, 0.95rem + 0.7vw, 1.375rem);
	--kbh-text-2xl:  clamp(1.375rem, 1.1rem + 1.1vw, 1.75rem);
	--kbh-text-3xl:  clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);

	--kbh-lh-tight: 1.2;
	--kbh-lh-snug: 1.4;
	--kbh-lh-body: 1.65;
	--kbh-measure: 68ch;

	--kbh-r-sm: 6px; --kbh-r-md: 10px; --kbh-r-lg: 14px; --kbh-r-xl: 20px; --kbh-r-pill: 999px;

	/* Neutrals. */
	--kbh-surface:    #fff;
	--kbh-surface-2:  #f7f8fa;
	--kbh-surface-3:  #eef0f4;
	--kbh-border:     rgba(16, 23, 42, 0.10);
	--kbh-border-strong: rgba(16, 23, 42, 0.18);
	--kbh-ink:        #10182A;
	--kbh-ink-muted:  #4B5468;
	/* 4.5:1 against the search-results surface (#F7F8FA); #6B7384 measured 4.48. */
	--kbh-ink-subtle: #646970;

	/* Brand (overridden inline per knowledge base). */
	--kbh-accent: #2A5FE0;
	--kbh-navy:   #101B33;
	--kbh-accent-soft: color-mix(in srgb, var(--kbh-accent) 8%, #fff);
	--kbh-accent-line: color-mix(in srgb, var(--kbh-accent) 24%, #fff);
	--kbh-accent-ink:  color-mix(in srgb, var(--kbh-accent) 82%, #000);

	--kbh-shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
	--kbh-shadow-md: 0 4px 12px rgba(16,24,40,.07);
	--kbh-shadow-lg: 0 18px 40px rgba(16,24,40,.12);
	--kbh-ring: 0 0 0 2px #fff, 0 0 0 4px var(--kbh-accent);

	box-sizing: border-box;
	font-family: inherit;
	color: var(--kbh-ink);
	line-height: var(--kbh-lh-body);
}

@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.kbh { --kbh-accent-soft: #eef2fd; --kbh-accent-line: #c8d6f8; --kbh-accent-ink: #1f4bc0; }
}

.kbh *, .kbh *::before, .kbh *::after { box-sizing: border-box; }
.kbh a { text-decoration: none; color: inherit; }
.kbh button { font-family: inherit; cursor: pointer; }
.kbh img { max-width: 100%; height: auto; }

/* One focus treatment for everything interactive. The previous stylesheet
   had no :focus rules at all and removed the search field's outline. */
.kbh a:focus-visible,
.kbh button:focus-visible,
.kbh input:focus-visible,
.kbh select:focus-visible,
.kbh textarea:focus-visible,
.kbh [tabindex]:focus-visible {
	outline: none;
	box-shadow: var(--kbh-ring);
	border-radius: var(--kbh-r-sm);
}

@media (prefers-reduced-motion: reduce) {
	.kbh *, .kbh *::before, .kbh *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}
}

.kbh-sr {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* The wrapper's width must never come from its content. Real pages put the
   shortcode inside centred flex "Stack"/"Row" groups, grids with
   justify-items:center, fit-content wrappers and beside floats; in those the
   width is content-derived and an element whose intrinsic width is zero (as
   any size-contained element is) collapses to a strip at the page centre --
   the failure seen on the live test site with TEST-BUILD-3. So: an explicit
   100% width, stretch in flex and grid parents, auto margins to centre, and
   clear of floats. No container queries anywhere in this stylesheet. */
.kbh.kbh-wrap {
	display: block; width: 100%; max-width: var(--kbh-maxwidth, 1160px); min-width: 0;
	box-sizing: border-box; margin-left: auto; margin-right: auto;
	flex: 0 0 100%; align-self: stretch; justify-self: stretch; float: none; clear: both;
}
/* "Page width: full page": the wrapper leaves a narrow theme column. The
   script measures the column's offset and sets --kbh-shift / --kbh-vw, so
   this works whether or not the column is centred on the page. */
.kbh.kbh-wrap.kbh-breakout {
	width: var(--kbh-vw, 100vw); max-width: none; flex: 0 0 var(--kbh-vw, 100vw);
	margin-left: calc(-1 * var(--kbh-shift, 0px)); margin-right: 0;
	padding-left: max(var(--kbh-s5), calc((var(--kbh-vw, 100vw) - var(--kbh-maxwidth, 1160px)) / 2));
	padding-right: max(var(--kbh-s5), calc((var(--kbh-vw, 100vw) - var(--kbh-maxwidth, 1160px)) / 2));
}

/* ==========================================================================
   Layout rhythm
   ========================================================================== */

.kbh-wrap { --kbh-section-gap: clamp(32px, 5vw, 56px); }
.kbh-wrap > * + * { margin-top: var(--kbh-section-gap); }

/* ==========================================================================
   Hero
   ========================================================================== */

.kbh-hero {
	position: relative;
	padding: clamp(var(--kbh-s8), 5vw, 72px) clamp(var(--kbh-s5), 4vw, var(--kbh-s12));
	border-radius: var(--kbh-r-xl);
	background:
		radial-gradient(90% 120% at 0% 0%, var(--kbh-accent-soft) 0%, transparent 55%),
		linear-gradient(180deg, var(--kbh-surface-2), var(--kbh-surface));
	border: 1px solid var(--kbh-border);
}
.kbh-hero-inner { position: relative; max-width: 46rem; }
.kbh-align-center .kbh-hero-inner { margin: 0 auto; text-align: center; }
.kbh-eyebrow {
	display: inline-block; margin-bottom: var(--kbh-s3);
	font-size: var(--kbh-text-xs); font-weight: 700; letter-spacing: .1em;
	text-transform: uppercase; color: var(--kbh-accent-ink);
}
.kbh-headline {
	margin: 0 0 var(--kbh-s3);
	font-size: var(--kbh-text-3xl); line-height: var(--kbh-lh-tight);
	font-weight: 700; letter-spacing: -0.025em; color: var(--kbh-ink);
}
.kbh-subhead {
	margin: 0 0 var(--kbh-s6);
	font-size: var(--kbh-text-lg); line-height: var(--kbh-lh-body);
	color: var(--kbh-ink-muted); max-width: var(--kbh-measure);
}
.kbh-align-center .kbh-subhead { margin-left: auto; margin-right: auto; }

/* ==========================================================================
   Search
   ========================================================================== */

.kbh-search-box {
	position: relative;
	display: flex; align-items: center; gap: var(--kbh-s2);
	max-width: 38rem; min-height: 56px; padding: var(--kbh-s1) var(--kbh-s1) var(--kbh-s1) var(--kbh-s5);
	background: var(--kbh-surface);
	border: 1px solid var(--kbh-border-strong);
	border-radius: var(--kbh-r-pill);
	box-shadow: var(--kbh-shadow-md);
	color: var(--kbh-ink-subtle);
	transition: box-shadow .15s ease, border-color .15s ease;
}
.kbh-align-center .kbh-search-box { margin-inline: auto; }
.kbh-search-box:focus-within {
	border-color: var(--kbh-accent);
	box-shadow: 0 0 0 4px var(--kbh-accent-soft), var(--kbh-shadow-md);
}
.kbh-search-box > svg { flex-shrink: 0; width: 20px; height: 20px; }
.kbh-search-input {
	flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
	font: inherit; font-size: var(--kbh-text-md); color: var(--kbh-ink);
	padding: var(--kbh-s2) 0;
}
.kbh-search-input::placeholder { color: var(--kbh-ink-subtle); }
.kbh-search-submit {
	flex-shrink: 0; height: 44px; padding: 0 var(--kbh-s6);
	border: 0; border-radius: var(--kbh-r-pill);
	background: var(--kbh-accent); color: #fff;
	font-size: var(--kbh-text-sm); font-weight: 600;
	transition: background-color .15s ease;
}
.kbh-search-submit:hover { background: var(--kbh-accent-ink); }
.kbh-search-clear {
	flex-shrink: 0; width: 34px; height: 34px; display: grid; place-items: center;
	border: 0; border-radius: 50%; background: var(--kbh-surface-3); color: var(--kbh-ink-muted);
}
.kbh-search-clear:hover { background: var(--kbh-border-strong); color: var(--kbh-ink); }

/* Results overlay — grouped, keyboard driven. */
.kbh-search-results {
	position: relative; margin-top: var(--kbh-s4);
	background: var(--kbh-surface);
	border: 1px solid var(--kbh-border);
	border-radius: var(--kbh-r-lg);
	box-shadow: var(--kbh-shadow-lg);
	overflow: hidden; text-align: left;
}
.kbh-search-results[hidden] { display: none; }
.kbh-search-results-header {
	display: flex; align-items: center; justify-content: space-between; gap: var(--kbh-s3);
	padding: var(--kbh-s3) var(--kbh-s5);
	border-bottom: 1px solid var(--kbh-border);
	background: var(--kbh-surface-2);
}
.kbh-search-results-title { margin: 0; font-size: var(--kbh-text-sm); font-weight: 600; color: var(--kbh-ink-muted); }
.kbh-clear-search-link {
	border: 0; background: none; color: var(--kbh-accent);
	font-size: var(--kbh-text-sm); font-weight: 600; padding: var(--kbh-s1) var(--kbh-s2);
	border-radius: var(--kbh-r-sm);
}
.kbh-clear-search-link:hover { background: var(--kbh-accent-soft); }

.kbh-result-group-label {
	padding: var(--kbh-s3) var(--kbh-s5) var(--kbh-s1);
	font-size: var(--kbh-text-xs); font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; color: var(--kbh-ink-subtle);
}
.kbh-search-result-row {
	display: flex; width: 100%; gap: var(--kbh-s3); align-items: flex-start;
	padding: var(--kbh-s3) var(--kbh-s5);
	border: 0; border-top: 1px solid var(--kbh-border);
	background: none; text-align: left; color: inherit;
}
.kbh-result-group-label + .kbh-search-result-row { border-top: 0; }
.kbh-search-result-row:hover,
.kbh-search-result-row.is-highlighted { background: var(--kbh-accent-soft); }
.kbh-search-result-row.is-highlighted { box-shadow: inset 3px 0 0 var(--kbh-accent); }
.kbh-search-result-copy { display: grid; gap: 2px; min-width: 0; }
.kbh-result-question { font-size: var(--kbh-text-base); font-weight: 600; color: var(--kbh-ink); }
.kbh-result-question mark { background: var(--kbh-accent-line); color: inherit; padding: 0 2px; border-radius: 3px; }
.kbh-result-answer {
	font-size: var(--kbh-text-sm); color: var(--kbh-ink-muted);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kbh-result-topic-chip {
	flex-shrink: 0; align-self: flex-start;
	padding: 2px var(--kbh-s2); border-radius: var(--kbh-r-pill);
	background: var(--kbh-surface-3); color: var(--kbh-ink-muted);
	font-size: var(--kbh-text-xs); font-weight: 600;
}
.kbh-search-hint {
	display: flex; gap: var(--kbh-s4); justify-content: space-between;
	padding: var(--kbh-s2) var(--kbh-s5);
	border-top: 1px solid var(--kbh-border); background: var(--kbh-surface-2);
	font-size: var(--kbh-text-xs); color: var(--kbh-ink-subtle);
}
.kbh-search-hint kbd {
	font: inherit; padding: 1px 5px; border: 1px solid var(--kbh-border-strong);
	border-bottom-width: 2px; border-radius: 4px; background: #fff;
}

.kbh-empty-state { padding: var(--kbh-s10) var(--kbh-s4); text-align: center; }
.kbh-empty-state[hidden] { display: none; }
.kbh-empty-state p { margin: 0 auto var(--kbh-s4); max-width: 46ch; color: var(--kbh-ink-muted); }

/* ==========================================================================
   Buttons (plugin chrome)
   ========================================================================== */

.kbh-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--kbh-s2);
	min-height: 44px; padding: var(--kbh-s2) var(--kbh-s5);
	border-radius: var(--kbh-r-pill); border: 1px solid transparent;
	font-size: var(--kbh-text-base); font-weight: 600; line-height: 1.2;
	transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.kbh-btn-accent { background: var(--kbh-accent); color: #fff; }
.kbh-btn-accent:hover { background: var(--kbh-accent-ink); color: #fff; }
.kbh-btn:active { transform: translateY(1px); }

/* ==========================================================================
   Topic cards
   ========================================================================== */

.kbh-topics {
	display: grid;
	/* The Settings column count is a maximum: a card is never narrower than
	   230px, so a narrow theme column gets two or three columns and a phone
	   gets one, from the grid itself rather than from a viewport query. */
	--kbh-card-min: max(230px, calc((100% - (var(--kbh-columns, 4) - 1) * var(--kbh-s5)) / var(--kbh-columns, 4) - 1px));
	grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--kbh-card-min)), 1fr));
	gap: var(--kbh-s5);
	margin: var(--kbh-section-gap) 0;
}
.kbh-topic-card {
	display: flex; flex-direction: column; gap: var(--kbh-s2);
	padding: var(--kbh-s6);
	background: var(--kbh-surface);
	border: 1px solid var(--kbh-border);
	border-radius: var(--kbh-r-lg);
	box-shadow: var(--kbh-shadow-sm);
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.kbh-topic-card:hover {
	border-color: var(--kbh-accent-line);
	box-shadow: var(--kbh-shadow-md);
	transform: translateY(-2px);
}
.kbh-topic-icon {
	display: grid; place-items: center;
	width: 48px; height: 48px; margin-bottom: var(--kbh-s3);
	border-radius: var(--kbh-r-md);
	background: var(--kbh-accent-soft); color: var(--kbh-accent);
}
.kbh-topic-icon svg { width: 22px; height: 22px; }
.kbh-topic-icon img { width: 26px; height: 26px; object-fit: contain; }
.kbh-topic-title {
	font-size: var(--kbh-text-lg); font-weight: 650; line-height: var(--kbh-lh-snug);
	color: var(--kbh-ink); letter-spacing: -0.012em;
}
.kbh-topic-desc {
	font-size: var(--kbh-text-sm); color: var(--kbh-ink-muted); line-height: var(--kbh-lh-body);
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.kbh-topic-foot {
	display: flex; align-items: center; justify-content: space-between; gap: var(--kbh-s2);
	margin-top: auto; padding-top: var(--kbh-s4);
	font-size: var(--kbh-text-sm); font-weight: 600; color: var(--kbh-accent);
}
.kbh-topic-arrow { transition: transform .15s ease; }
.kbh-topic-card:hover .kbh-topic-arrow { transform: translateX(3px); }

/* Product-image cards keep a steady aspect so a grid never goes ragged. */
.kbh-topic-card.kbh-card-style-product .kbh-topic-icon,
.kbh-topic-card.kbh-card-style-feature .kbh-topic-icon {
	width: 100%; height: auto; aspect-ratio: 4 / 3; background: var(--kbh-surface-2);
	border-radius: var(--kbh-r-md); overflow: hidden;
}
.kbh-topic-card.kbh-card-style-product .kbh-topic-icon img,
.kbh-topic-card.kbh-card-style-feature .kbh-topic-icon img { width: 100%; height: 100%; }
.kbh-topic-card.kbh-card-style-horizontal { flex-direction: row; align-items: flex-start; gap: var(--kbh-s4); }
.kbh-topic-card.kbh-card-style-horizontal .kbh-topic-icon { margin-bottom: 0; flex-shrink: 0; }

.kbh-title-align-center .kbh-topic-title, .kbh-topic-card.kbh-title-align-center { text-align: center; }
.kbh-title-align-right .kbh-topic-title { text-align: right; }
.kbh-excerpt-align-center .kbh-topic-desc { text-align: center; }
.kbh-excerpt-align-right .kbh-topic-desc { text-align: right; }
.kbh-footer-align-center .kbh-topic-foot { justify-content: center; }
.kbh-footer-align-right .kbh-topic-foot { justify-content: flex-end; }

/* ==========================================================================
   Browse area — tabs + panels (default preset)
   ========================================================================== */

.kbh-app { margin: var(--kbh-section-gap) 0; }
.kbh-browse {
	/* Topic list beside the content while there is room for both; the
	   content drops below the list when the column is narrow. */
	display: flex; flex-wrap: wrap; align-items: flex-start;
	gap: var(--kbh-s8);
	padding: var(--kbh-s8);
	background: var(--kbh-surface);
	border: 1px solid var(--kbh-border);
	border-radius: var(--kbh-r-xl);
	box-shadow: var(--kbh-shadow-sm);
}
.kbh-browse[hidden] { display: none; }

.kbh-tabs { display: flex; flex-direction: column; gap: 2px; align-content: start; flex: 1 1 220px; max-width: 260px; min-width: 0; }
.kbh-tab {
	display: flex; align-items: center; gap: var(--kbh-s2);
	padding: 10px var(--kbh-s4);
	border-radius: var(--kbh-r-md);
	font-size: var(--kbh-text-base); font-weight: 500; color: var(--kbh-ink-muted);
	border-left: 3px solid transparent;
	transition: background-color .12s ease, color .12s ease;
}
.kbh-tab:hover { background: var(--kbh-surface-2); color: var(--kbh-ink); }
.kbh-tab.is-active,
.kbh-tab[aria-selected="true"] {
	background: var(--kbh-accent-soft); color: var(--kbh-accent-ink);
	font-weight: 650; border-left-color: var(--kbh-accent);
}

.kbh-panels { min-width: 0; flex: 999 1 min(100%, 440px); }
.kbh-panel { display: none; }
.kbh-panel.is-active { display: block; }
.kbh-panel:focus-visible { outline: none; box-shadow: none; }
.kbh-panel-title {
	margin: 0 0 var(--kbh-s2);
	font-size: var(--kbh-text-2xl); font-weight: 700; letter-spacing: -0.02em;
	line-height: var(--kbh-lh-tight); color: var(--kbh-ink);
}
.kbh-panel-desc {
	margin: 0 0 var(--kbh-s6); max-width: var(--kbh-measure);
	font-size: var(--kbh-text-md); color: var(--kbh-ink-muted);
}
.kbh-panel-empty { color: var(--kbh-ink-subtle); font-size: var(--kbh-text-base); }

/* ==========================================================================
   Questions & answers
   ========================================================================== */

.kbh-content-flow { display: flex; flex-direction: column; }
.kbh-faq-row { border-bottom: 1px solid var(--kbh-border); }
.kbh-faq-row:first-child { border-top: 1px solid var(--kbh-border); }
.kbh-faq-q {
	display: flex; align-items: flex-start; justify-content: space-between; gap: var(--kbh-s4);
	width: 100%; padding: var(--kbh-s4) var(--kbh-s2);
	background: none; border: 0; text-align: left; border-radius: var(--kbh-r-sm);
	font-size: var(--kbh-text-md); font-weight: 600; line-height: var(--kbh-lh-snug);
	color: var(--kbh-ink);
	transition: color .12s ease, background-color .12s ease;
}
.kbh-faq-q:hover { color: var(--kbh-accent-ink); background: var(--kbh-surface-2); }
.kbh-faq-q svg {
	flex-shrink: 0; width: 28px; height: 28px; padding: 6px; margin-top: -2px;
	border-radius: 50%; background: var(--kbh-surface-3); color: var(--kbh-ink-muted);
	transition: transform .2s ease, color .12s ease, background-color .12s ease;
}
.kbh-faq-q[aria-expanded="true"] svg { transform: rotate(180deg); color: #fff; background: var(--kbh-accent); }
.kbh-faq-q[aria-expanded="true"] { color: var(--kbh-accent-ink); }
.kbh-faq-a { padding: var(--kbh-s1) var(--kbh-s2) var(--kbh-s6); color: var(--kbh-ink-muted); }
.kbh-faq-a[hidden] { display: none; }
.kbh-faq-row.kbh-search-highlight { background: var(--kbh-accent-soft); border-radius: var(--kbh-r-sm); }

/* Rich content inside an answer. */
.kbh-rich-grid { display: flex; flex-wrap: wrap; gap: var(--kbh-s4); }
.kbh-rich-grid-item { flex: 1 1 100%; min-width: 0; }
/* A half or third block is that width even when it sits alone on its row --
   flex-grow would otherwise stretch it back to full width. */
.kbh-rich-grid-item.kbh-rich-grid-half { flex: 0 0 calc(50% - var(--kbh-s2)); }
.kbh-rich-grid-item.kbh-rich-grid-third { flex: 0 0 calc(33.333% - var(--kbh-s3)); }
.kbh-rich-front { max-width: var(--kbh-measure); line-height: var(--kbh-lh-body); }
.kbh-rich-front p { margin: 0 0 var(--kbh-s3); }
.kbh-rich-front p:last-child { margin-bottom: 0; }
.kbh-rich-list { padding-left: 1.25em; margin: 0 0 var(--kbh-s3); }
.kbh-rich-list li { margin-bottom: var(--kbh-s1); }
.kbh-rich-subheading { margin: var(--kbh-s4) 0 var(--kbh-s2); line-height: var(--kbh-lh-snug); }
.kbh-rich-divider { margin: var(--kbh-s5) 0; border: 0; border-top: 1px solid var(--kbh-border); }
.kbh-rich-inline-button {
	display: inline-flex; align-items: center; gap: var(--kbh-s2);
	min-height: 40px; padding: var(--kbh-s2) var(--kbh-s5);
	background: var(--kbh-accent); color: #fff;
	border-radius: var(--kbh-r-pill); font-size: var(--kbh-text-sm); font-weight: 600;
}
.kbh-rich-inline-button:hover { background: var(--kbh-accent-ink); color: #fff; }
.kbh-rich-qr img { border: 1px solid var(--kbh-border); border-radius: var(--kbh-r-md); background: #fff; padding: var(--kbh-s2); }

.kbh-inline-topic { padding: var(--kbh-s5) 0; border-bottom: 1px solid var(--kbh-border); }
.kbh-inline-topic h4 { margin: 0 0 var(--kbh-s2); line-height: var(--kbh-lh-snug); }

/* ==========================================================================
   Videos
   ========================================================================== */

.kbh-videos-heading, .kbh-docs-heading {
	margin: var(--kbh-s8) 0 var(--kbh-s4);
	font-size: var(--kbh-text-xs); font-weight: 700; letter-spacing: .09em;
	text-transform: uppercase; color: var(--kbh-ink-subtle);
}
.kbh-videos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: var(--kbh-s5); }
.kbh-video-card {
	display: flex; flex-direction: column;
	background: var(--kbh-surface);
	border: 1px solid var(--kbh-border);
	border-radius: var(--kbh-r-lg);
	overflow: hidden;
	box-shadow: var(--kbh-shadow-sm);
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.kbh-video-card:hover { border-color: var(--kbh-accent-line); box-shadow: var(--kbh-shadow-md); transform: translateY(-2px); }
.kbh-video-thumb {
	position: relative; aspect-ratio: 16 / 9;
	background-color: var(--kbh-surface-3);
	background-size: cover; background-position: center;
	display: grid; place-items: center;
}
.kbh-video-thumb::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, transparent 45%, rgba(16,23,42,.5) 100%);
	opacity: .6; transition: opacity .15s ease; pointer-events: none;
}
.kbh-video-card:hover .kbh-video-thumb::after { opacity: .9; }
.kbh-video-poster-frame { width: 100%; height: 100%; object-fit: cover; }
.kbh-video-play-badge {
	position: relative; z-index: 1;
	width: 56px; height: 56px; display: grid; place-items: center;
	border-radius: 50%; background: rgba(255,255,255,.94); color: var(--kbh-accent);
	box-shadow: var(--kbh-shadow-md); transition: transform .15s ease;
}
.kbh-video-card:hover .kbh-video-play-badge { transform: scale(1.06); }
.kbh-video-duration {
	position: absolute; right: var(--kbh-s3); bottom: var(--kbh-s3); z-index: 1;
	padding: 2px var(--kbh-s2); border-radius: var(--kbh-r-sm);
	background: rgba(16,23,42,.85); color: #fff;
	font-size: var(--kbh-text-xs); font-weight: 600; font-variant-numeric: tabular-nums;
}
.kbh-video-error {
	position: relative; z-index: 1;
	padding: var(--kbh-s2) var(--kbh-s3); border-radius: var(--kbh-r-pill);
	background: var(--kbh-surface); color: var(--kbh-ink-muted);
	font-size: var(--kbh-text-sm); font-weight: 600; border: 1px solid var(--kbh-border);
}
.kbh-video-unavailable .kbh-video-thumb { background: repeating-linear-gradient(45deg, var(--kbh-surface-2), var(--kbh-surface-2) 10px, var(--kbh-surface-3) 10px, var(--kbh-surface-3) 20px); }
.kbh-video-unavailable .kbh-video-thumb::after { display: none; }
.kbh-video-meta { display: flex; flex-direction: column; gap: var(--kbh-s3); padding: var(--kbh-s4) var(--kbh-s4) var(--kbh-s5); }
.kbh-video-title { font-size: var(--kbh-text-base); font-weight: 600; line-height: var(--kbh-lh-snug); color: var(--kbh-ink); }
.kbh-video-actions { display: flex; flex-wrap: wrap; gap: var(--kbh-s2); }
.kbh-video-actions button {
	min-height: 36px; padding: var(--kbh-s1) var(--kbh-s4);
	border: 1px solid var(--kbh-border-strong); border-radius: var(--kbh-r-pill);
	background: var(--kbh-surface); color: var(--kbh-ink);
	font-size: var(--kbh-text-sm); font-weight: 600;
	transition: background-color .12s ease, border-color .12s ease;
}
.kbh-video-actions button:hover { background: var(--kbh-accent-soft); border-color: var(--kbh-accent-line); color: var(--kbh-accent-ink); }
.kbh-video-inline-stage { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; }
.kbh-video-inline-stage[hidden] { display: none; }
.kbh-video-inline-stage iframe, .kbh-video-inline-stage video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Modal */
.kbh-video-modal { position: fixed; inset: 0; z-index: 999999; display: grid; place-items: center; padding: var(--kbh-s5); }
.kbh-video-modal[hidden] { display: none !important; }
.kbh-video-modal-backdrop { position: absolute; inset: 0; background: rgba(8,12,22,.84); backdrop-filter: blur(6px); border: 0; }
.kbh-video-modal-dialog {
	position: relative; z-index: 1; width: min(1040px, 94vw);
	background: #0d1322; border-radius: var(--kbh-r-lg); overflow: hidden;
	box-shadow: var(--kbh-shadow-lg);
}
.kbh-video-modal-head {
	display: flex; align-items: center; justify-content: space-between; gap: var(--kbh-s4);
	min-height: 56px; padding: var(--kbh-s3) var(--kbh-s3) var(--kbh-s3) var(--kbh-s5); color: #fff;
}
.kbh-video-modal-title { font-size: var(--kbh-text-base); font-weight: 600; line-height: var(--kbh-lh-snug); }
.kbh-video-modal-close {
	width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0;
	border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 24px; line-height: 1;
}
.kbh-video-modal-close:hover { background: rgba(255,255,255,.22); }
.kbh-video-modal-close:focus-visible { box-shadow: 0 0 0 2px #0d1322, 0 0 0 4px #fff; }
.kbh-video-modal-stage { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; }
.kbh-video-modal-stage iframe, .kbh-video-modal-stage video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
body.kbh-modal-open { overflow: hidden; }

/* ==========================================================================
   Documents
   ========================================================================== */

.kbh-docs-list { display: grid; gap: var(--kbh-s3); }
.kbh-doc-row {
	display: flex; align-items: center; gap: var(--kbh-s4);
	padding: var(--kbh-s4) var(--kbh-s5);
	background: var(--kbh-surface);
	border: 1px solid var(--kbh-border);
	border-radius: var(--kbh-r-md);
	transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.kbh-doc-row:hover { border-color: var(--kbh-accent-line); box-shadow: var(--kbh-shadow-sm); }
.kbh-doc-row > svg {
	flex-shrink: 0; width: 40px; height: 40px; padding: 10px; border-radius: var(--kbh-r-md);
	background: var(--kbh-accent-soft); color: var(--kbh-accent);
}
.kbh-doc-info { display: grid; gap: 2px; min-width: 0; flex: 1; }
.kbh-doc-title { font-size: var(--kbh-text-base); font-weight: 600; color: var(--kbh-ink); }
.kbh-doc-desc { font-size: var(--kbh-text-sm); color: var(--kbh-ink-muted); }
.kbh-doc-type, .kbh-doc-size {
	display: inline-block; margin-right: var(--kbh-s2); margin-top: 2px;
	font-size: var(--kbh-text-xs); font-weight: 700; letter-spacing: .05em;
	color: var(--kbh-ink-subtle); text-transform: uppercase;
}
.kbh-doc-actions { display: flex; gap: var(--kbh-s2); flex-shrink: 0; }
.kbh-doc-actions a {
	min-height: 36px; display: inline-flex; align-items: center; padding: 0 var(--kbh-s4);
	border: 1px solid var(--kbh-border-strong); border-radius: var(--kbh-r-pill);
	font-size: var(--kbh-text-sm); font-weight: 600; color: var(--kbh-ink); background: var(--kbh-surface);
	transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.kbh-doc-actions a:hover { background: var(--kbh-accent-soft); border-color: var(--kbh-accent-line); color: var(--kbh-accent-ink); }

/* ==========================================================================
   Promo band
   ========================================================================== */

.kbh-cta {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--kbh-s5);
	margin: var(--kbh-section-gap) 0 0; padding: clamp(var(--kbh-s6), 3vw, var(--kbh-s10));
	background: var(--kbh-navy); border-radius: var(--kbh-r-xl);
}
.kbh-cta-card { padding: var(--kbh-s6); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: var(--kbh-r-lg); }
.kbh-cta-icon { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: var(--kbh-s4); border-radius: var(--kbh-r-md); background: rgba(255,255,255,.1); color: #fff; }
.kbh-cta-icon svg { width: 20px; height: 20px; }
.kbh-cta-heading { margin: 0 0 var(--kbh-s2); font-size: var(--kbh-text-xl); font-weight: 700; color: #fff; line-height: var(--kbh-lh-snug); letter-spacing: -0.01em; }
.kbh-cta-body { margin: 0 0 var(--kbh-s4); font-size: var(--kbh-text-base); color: rgba(255,255,255,.78); }
.kbh-cta-bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--kbh-s2); }
.kbh-cta-bullets li { font-size: var(--kbh-text-sm); color: rgba(255,255,255,.74); padding-left: 1.25em; position: relative; }
.kbh-cta-bullets li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--kbh-accent); }
.kbh-cta-bullets strong { color: #fff; font-weight: 650; }

.kbh-admin-notice {
	padding: var(--kbh-s4); border: 1px dashed var(--kbh-border-strong);
	border-radius: var(--kbh-r-md); color: var(--kbh-ink-muted); font-size: var(--kbh-text-sm);
}

/* ==========================================================================
   Preset: sidebar — a persistent topic list, good for large knowledge bases
   ========================================================================== */

.kbh-layout-sidebar .kbh-topics { display: none; }
.kbh-layout-sidebar .kbh-tabs {
	flex-basis: 240px; max-width: 290px;
	position: sticky; top: var(--kbh-s4);
	max-height: calc(100vh - 2 * var(--kbh-s4)); overflow-y: auto;
	padding-right: var(--kbh-s4); border-right: 1px solid var(--kbh-border);
}

/* ==========================================================================
   Preset: accordion only — every topic as a collapsible section
   ========================================================================== */

.kbh-layout-accordion .kbh-topics { display: none; }
.kbh-layout-accordion .kbh-browse { display: block; padding: var(--kbh-s2) var(--kbh-s6); }
.kbh-layout-accordion .kbh-tabs { display: none; }
.kbh-layout-accordion .kbh-panel { display: block; border-bottom: 1px solid var(--kbh-border); }
.kbh-layout-accordion .kbh-panel:last-child { border-bottom: 0; }
.kbh-layout-accordion .kbh-panel-title { position: relative; font-size: var(--kbh-text-xl); margin: 0; }
/* The heading's text becomes a real button (kbh-frontend.js); it must read
   as the row itself, not as a theme-styled form button. The chevron sits on
   the heading because plugin buttons never carry pseudo-elements. */
.kbh-layout-accordion .kbh-panel-toggle {
	display: flex; align-items: center; justify-content: space-between; gap: var(--kbh-s4);
	width: 100%; padding: var(--kbh-s5) var(--kbh-s10) var(--kbh-s5) var(--kbh-s1);
	background: none; border: 0; border-radius: var(--kbh-r-sm);
	font: inherit; font-size: inherit; font-weight: 700; letter-spacing: -0.015em; line-height: var(--kbh-lh-snug);
	color: var(--kbh-ink); text-align: left; cursor: pointer;
	transition: color .12s ease, background-color .12s ease;
}
.kbh-layout-accordion .kbh-panel-toggle:hover { color: var(--kbh-accent-ink); }
.kbh-layout-accordion .kbh-panel-toggle[aria-expanded="true"] { color: var(--kbh-accent-ink); }
.kbh-layout-accordion .kbh-panel-title::after {
	content: ""; position: absolute; right: var(--kbh-s2); top: 50%;
	width: 28px; height: 28px; margin-top: -14px; border-radius: 50%;
	background: var(--kbh-surface-3) center / 14px no-repeat;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B5468' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	pointer-events: none; transition: transform .2s ease, background-color .12s ease;
}
.kbh-layout-accordion .kbh-panel-title:has(.kbh-panel-toggle[aria-expanded="true"])::after {
	transform: rotate(180deg); background-color: var(--kbh-accent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.kbh-layout-accordion .kbh-panel-body { padding: 0 var(--kbh-s1) var(--kbh-s6); }
.kbh-layout-accordion .kbh-panel-body[hidden] { display: none; }
.kbh-layout-accordion .kbh-panel-desc { margin-top: var(--kbh-s1); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
	.kbh-topics { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
	.kbh-browse { flex-direction: column; gap: var(--kbh-s5); padding: var(--kbh-s5); }
	.kbh-tabs, .kbh-layout-sidebar .kbh-tabs { flex: 0 0 auto; max-width: none; width: 100%; position: static; max-height: none; border-right: 0; padding-right: 0; }
	.kbh-panels { flex: 0 0 auto; width: 100%; }
	/* Tabs become a horizontal scroller when they sit above the content. */
	.kbh-tabs {
		flex-direction: row; overflow-x: auto; gap: var(--kbh-s1);
		padding-bottom: var(--kbh-s2); border-bottom: 1px solid var(--kbh-border);
		scrollbar-width: thin; -webkit-overflow-scrolling: touch;
		/* A row of nowrap tabs must never set the knowledge base's minimum
		   width (inside a fit-content wrapper it forced ~800px on a phone):
		   width 0 + min-width 100% gives the strip no intrinsic size of its
		   own while it still fills the row. */
		width: 0; min-width: 100%;
	}
	.kbh-tab { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; border-radius: var(--kbh-r-sm) var(--kbh-r-sm) 0 0; }
	.kbh-tab.is-active, .kbh-tab[aria-selected="true"] { border-left: 0; border-bottom-color: var(--kbh-accent); }
}

@media (max-width: 768px) {
	.kbh-wrap { --kbh-section-gap: 28px; }
	.kbh-videos-grid { grid-template-columns: 1fr; }
	.kbh-rich-grid-item.kbh-rich-grid-half,
	.kbh-rich-grid-item.kbh-rich-grid-third { flex-basis: 100%; }
	.kbh-doc-row { flex-wrap: wrap; }
	.kbh-doc-actions { width: 100%; }
	.kbh-doc-actions a { flex: 1; justify-content: center; }
	.kbh-browse { padding: var(--kbh-s4); }
	.kbh-layout-accordion .kbh-browse { padding: 0 var(--kbh-s4); }
}

@media (max-width: 480px) {
	.kbh-topics { grid-template-columns: 1fr; gap: var(--kbh-s3); }
	.kbh-hero { border-radius: var(--kbh-r-lg); }
	.kbh-search-box { flex-wrap: wrap; border-radius: var(--kbh-r-lg); padding: var(--kbh-s2); min-height: 0; }
	.kbh-search-input { flex-basis: calc(100% - 40px); }
	.kbh-search-submit { flex: 1; }
	.kbh-video-modal { padding: var(--kbh-s2); }
	.kbh-search-hint { display: none; }
	.kbh-topic-card { padding: var(--kbh-s5); }
}

@media (prefers-reduced-motion: reduce) {
	.kbh *, .kbh *::before, .kbh *::after { transition: none !important; }
	.kbh-topic-card:hover, .kbh-video-card:hover { transform: none; }
}

/* Focus sentinels: focusable, but not visible and not announced. They must
   keep a real box so the browser can place focus on them, hence the 1px
   rather than display:none. */
.kbh-focus-sentinel {
	position: absolute;
	width: 1px; height: 1px;
	margin: 0; padding: 0; border: 0;
	overflow: hidden; clip-path: inset(50%);
	opacity: 0;
}

/* ==========================================================================
   Theme isolation
   ==========================================================================
   The knowledge base renders inside whatever theme the site uses, and many
   themes and page builders style links, buttons, headings and focus GLOBALLY
   at a specificity that beats a plain `.kbh a` -- `.entry-content a`,
   `article a::after`, `button`, `*:focus`, `*:focus-within`, `:target`.

   Two symptoms were seen on a real site and are reproduced by
   bin/test-theme-compat.js: a line drawn through pill buttons (a theme
   underline or ::after bar on an anchor), and the whole content panel outlined
   after clicking a sidebar item (a theme :focus-within rule on an ancestor).

   Every selector here carries two class levels (.kbh.kbh-wrap ...) so it
   outranks the common theme patterns. `!important` is used only where a
   container or a button-styled anchor must never carry the property at all,
   because some builders reach those elements through an ID selector. Plugin
   focus rings (:focus-visible, above) are left intact.
   ======================================================================== */

/* Anchors that are buttons or navigation, never prose links. */
.kbh.kbh-wrap a.kbh-btn,
.kbh.kbh-wrap a.kbh-tab,
.kbh.kbh-wrap a.kbh-topic-card,
.kbh.kbh-wrap a.kbh-custom-button,
.kbh.kbh-wrap a.kbh-rich-inline-button,
.kbh.kbh-wrap a.kbh-doc-view,
.kbh.kbh-wrap a.kbh-doc-download,
.kbh.kbh-wrap a.kbh-search-result-row,
.kbh.kbh-wrap .kbh-empty-state a {
	text-decoration: none !important;
	border-bottom-width: 0;
	border-top-width: 0;
	box-shadow: none;
	background-image: none;
	text-transform: none;
	letter-spacing: normal;
	font-family: inherit;
}
.kbh.kbh-wrap a.kbh-btn:hover, .kbh.kbh-wrap a.kbh-tab:hover,
.kbh.kbh-wrap a.kbh-topic-card:hover, .kbh.kbh-wrap a.kbh-custom-button:hover,
.kbh.kbh-wrap a.kbh-rich-inline-button:hover, .kbh.kbh-wrap a.kbh-doc-view:hover,
.kbh.kbh-wrap a.kbh-doc-download:hover { text-decoration: none !important; border-bottom-width: 0; }
/* Re-assert the borders these controls genuinely own. */
.kbh.kbh-wrap a.kbh-tab { border-left-width: 3px; }
.kbh.kbh-wrap a.kbh-topic-card { border-top-width: 1px; border-bottom-width: 1px; box-shadow: var(--kbh-shadow-sm); }
.kbh.kbh-wrap a.kbh-doc-view, .kbh.kbh-wrap a.kbh-doc-download { border-top-width: 1px; border-bottom-width: 1px; }
.kbh.kbh-wrap a.kbh-custom-button { border-top-width: var(--kbh-btn-bw, 0); border-bottom-width: var(--kbh-btn-bw, 0); }

/* Pseudo-element decorations a theme hangs on links and buttons: underline
   bars, arrows, icons. The plugin draws none of its own this way. */
.kbh.kbh-wrap a.kbh-btn::before,    .kbh.kbh-wrap a.kbh-btn::after,
.kbh.kbh-wrap a.kbh-tab::before,    .kbh.kbh-wrap a.kbh-tab::after,
.kbh.kbh-wrap a.kbh-topic-card::before, .kbh.kbh-wrap a.kbh-topic-card::after,
.kbh.kbh-wrap a.kbh-custom-button::before, .kbh.kbh-wrap a.kbh-custom-button::after,
.kbh.kbh-wrap a.kbh-rich-inline-button::before, .kbh.kbh-wrap a.kbh-rich-inline-button::after,
.kbh.kbh-wrap a.kbh-doc-view::before, .kbh.kbh-wrap a.kbh-doc-view::after,
.kbh.kbh-wrap a.kbh-doc-download::before, .kbh.kbh-wrap a.kbh-doc-download::after,
.kbh.kbh-wrap button::before, .kbh.kbh-wrap button::after { content: none !important; }

/* Real <button> elements: themes set thick borders, inset shadows, uppercase,
   serif faces and square corners on every button on the site. */
.kbh.kbh-wrap button {
	appearance: none; -webkit-appearance: none;
	text-transform: none; letter-spacing: normal; font-family: inherit;
	box-shadow: none; background-image: none;
}
.kbh.kbh-wrap button.kbh-faq-q,
.kbh.kbh-wrap button.kbh-search-submit,
.kbh.kbh-wrap button.kbh-search-clear,
.kbh.kbh-wrap button.kbh-clear-search-link { border: 0; }
.kbh.kbh-wrap button.kbh-search-submit { background: var(--kbh-accent); color: #fff; border-radius: var(--kbh-r-pill); padding: 0 var(--kbh-s4); }
.kbh.kbh-wrap button.kbh-search-clear  { background: var(--kbh-surface-3); color: var(--kbh-ink-muted); border-radius: 50%; padding: 0; }
.kbh.kbh-wrap button.kbh-faq-q { background: none; padding: var(--kbh-s4) var(--kbh-s1); border-radius: 0; }
.kbh.kbh-wrap button.kbh-clear-search-link { background: none; color: var(--kbh-accent); padding: 0; }
.kbh.kbh-wrap .kbh-video-actions button { border: 1px solid var(--kbh-border-strong); border-radius: var(--kbh-r-pill); background: var(--kbh-surface); color: var(--kbh-ink); padding: var(--kbh-s1) var(--kbh-s4); }
.kbh.kbh-wrap .kbh-video-actions button:hover { background: var(--kbh-accent-soft); border-color: var(--kbh-accent-line); color: var(--kbh-accent-ink); }
.kbh.kbh-wrap button.kbh-video-modal-close { border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; padding: 0; }

/* Containers are never a focus target of their own. A theme's *:focus-within
   or :target rule must not outline the whole panel because a control inside
   it was clicked. Keyboard focus on the control itself is untouched. */
.kbh.kbh-wrap, .kbh .kbh-app, .kbh .kbh-browse, .kbh .kbh-panels, .kbh .kbh-panel,
.kbh .kbh-tabs, .kbh .kbh-content-flow, .kbh .kbh-hero, .kbh .kbh-topics,
.kbh .kbh-videos-grid, .kbh .kbh-documents, .kbh .kbh-search-results, .kbh .kbh-faq-row,
.kbh.kbh-wrap:focus-within, .kbh .kbh-app:focus-within, .kbh .kbh-browse:focus-within,
.kbh .kbh-panels:focus-within, .kbh .kbh-panel:focus-within, .kbh .kbh-tabs:focus-within,
.kbh .kbh-content-flow:focus-within, .kbh .kbh-hero:focus-within, .kbh .kbh-faq-row:focus-within,
.kbh .kbh-panel:target, .kbh .kbh-faq-row:target, .kbh .kbh-panel:focus, .kbh .kbh-panel:focus-visible {
	outline: none !important;
}
.kbh .kbh-faq-row:target { background: transparent; }
.kbh .kbh-panel:target { background: transparent; }

/* A mouse click should select, not ring. The ring is reserved for keyboard
   focus (:focus-visible), which the rules near the top of this file provide. */
.kbh.kbh-wrap a:focus:not(:focus-visible),
.kbh.kbh-wrap button:focus:not(:focus-visible),
.kbh.kbh-wrap [tabindex]:focus:not(:focus-visible) { outline: none !important; box-shadow: none; }

/* Ghost buttons (a question row, an accordion heading, a search result, the
   "clear" link) are text with a hit area. Twenty Twenty-One and similar
   themes paint every <button> with a dark fill and white text; these must
   stay transparent, with the plugin's own colours. */
.kbh.kbh-wrap .kbh-panels button.kbh-faq-q,
.kbh.kbh-wrap .kbh-panels button.kbh-panel-toggle,
.kbh.kbh-wrap .kbh-search-results button.kbh-search-result-row,
.kbh.kbh-wrap .kbh-search-results button.kbh-clear-search-link {
	background-color: transparent; background-image: none; border: 0; border-radius: var(--kbh-r-sm);
	color: var(--kbh-ink); line-height: var(--kbh-lh-snug); min-height: 0; text-transform: none; letter-spacing: normal;
}
.kbh.kbh-wrap .kbh-panels button.kbh-faq-q:hover { background-color: var(--kbh-surface-2); color: var(--kbh-accent-ink); }
.kbh.kbh-wrap .kbh-panels button.kbh-faq-q[aria-expanded="true"],
.kbh.kbh-wrap .kbh-panels button.kbh-panel-toggle:hover,
.kbh.kbh-wrap .kbh-panels button.kbh-panel-toggle[aria-expanded="true"] { color: var(--kbh-accent-ink); }
.kbh.kbh-wrap .kbh-search-results button.kbh-search-result-row:hover,
.kbh.kbh-wrap .kbh-search-results button.kbh-search-result-row.is-highlighted { background-color: var(--kbh-accent-soft); }
.kbh.kbh-wrap .kbh-search-results button.kbh-clear-search-link { color: var(--kbh-accent); }
.kbh.kbh-wrap .kbh-search-results button.kbh-clear-search-link:hover { background-color: var(--kbh-accent-soft); }

/* Typography inside the knowledge base belongs to the knowledge base. */
.kbh.kbh-wrap h1, .kbh.kbh-wrap h2, .kbh.kbh-wrap h3, .kbh.kbh-wrap h4, .kbh.kbh-wrap h5, .kbh.kbh-wrap h6,
.kbh.kbh-wrap .kbh-panel-toggle {
	/* One typeface throughout: a theme's serif display font on the headings
	   next to the plugin's sans body reads as two products. */
	font-family: inherit; text-transform: none; letter-spacing: inherit; border-bottom: 0; padding-bottom: 0;
	font-style: normal; text-decoration: none;
}
.kbh.kbh-wrap .kbh-headline { letter-spacing: -0.025em; }
.kbh.kbh-wrap .kbh-panel-title { letter-spacing: -0.02em; }
.kbh.kbh-wrap .kbh-rich-list { list-style: disc; padding-left: 1.25em; }
.kbh.kbh-wrap ol.kbh-rich-list, .kbh.kbh-wrap .kbh-rich-list[data-type="numbered"] { list-style: decimal; }
.kbh.kbh-wrap img { border: 0; box-shadow: none; }
.kbh.kbh-wrap .kbh-rich-qr img { border: 1px solid var(--kbh-border); }
.kbh.kbh-wrap table { border: 0; }

/* The isolation resets above include `box-shadow: none`, which at their
   specificity would also cancel the plugin's own keyboard focus ring. Restate
   the ring last, at the same specificity, so keyboard users keep it. */
.kbh.kbh-wrap a:focus-visible,
.kbh.kbh-wrap button:focus-visible,
.kbh.kbh-wrap input:focus-visible,
.kbh.kbh-wrap select:focus-visible,
.kbh.kbh-wrap textarea:focus-visible,
.kbh.kbh-wrap [tabindex]:focus-visible {
	outline: none;
	box-shadow: var(--kbh-ring);
}

/* The content panel (role="tabpanel", tabindex="0") is a focus target for
   screen-reader and keyboard navigation -- it must keep receiving focus --
   but it is a region, not a control: it never shows a ring. Without this
   the generic [tabindex] ring above drew a bright blue rectangle around the
   whole content area whenever the panel was focused (keyboard, a theme's
   anchor-scroll script, or fragment navigation). The active topic is already
   highlighted in the sidebar. The same applies to the search results region
   and accordion bodies. Rings on the controls inside stay as they are. */
.kbh.kbh-wrap .kbh-panel:focus, .kbh.kbh-wrap .kbh-panel:focus-visible, .kbh.kbh-wrap .kbh-panel:focus-within,
.kbh.kbh-wrap .kbh-panels:focus, .kbh.kbh-wrap .kbh-panels:focus-visible, .kbh.kbh-wrap .kbh-panels:focus-within,
.kbh.kbh-wrap .kbh-panel-body:focus, .kbh.kbh-wrap .kbh-panel-body:focus-visible,
.kbh.kbh-wrap .kbh-search-results:focus, .kbh.kbh-wrap .kbh-search-results:focus-visible, .kbh.kbh-wrap .kbh-search-results:focus-within,
.kbh.kbh-wrap .kbh-content-flow:focus-within, .kbh.kbh-wrap .kbh-faq-a:focus-within {
	outline: none !important; box-shadow: none !important;
}
.kbh.kbh-wrap .kbh-browse:focus-within, .kbh.kbh-wrap .kbh-browse:focus { outline: none !important; box-shadow: var(--kbh-shadow-sm) !important; }

/* Video posters: the image fills a true 16:9 frame, cropped rather than
   stretched. YouTube's hq posters are 4:3 with letterbox bars, so covering a
   16:9 box is exactly what removes the bars. */
.kbh.kbh-wrap .kbh-video-thumb { background-size: cover; background-position: center; image-rendering: auto; }
.kbh.kbh-wrap .kbh-video-poster-frame { object-fit: cover; object-position: center; }

/* One play indicator per thumbnail. The 1.5.6 stylesheet dressed the plain
   "\25B6" glyph as a white disc; that rule was lost in the front-end rewrite,
   so the glyph rendered as a bare black triangle under the SVG badge. Restore
   the disc for the no-badge case, and hide the glyph whenever the badge is
   rendered so there is never a second triangle. */
.kbh.kbh-wrap .kbh-video-poster-play {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3;
	width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
	padding-left: 3px; background: rgba(255,255,255,.94); color: var(--kbh-accent); font-size: 19px;
	box-shadow: 0 10px 28px rgba(0,0,0,.22); pointer-events: none;
}
.kbh.kbh-wrap .kbh-video-play-badge ~ .kbh-video-poster-play { display: none; }

/* Button icons. These rules shipped in 1.5.6 and were lost in the front-end
   rewrite, so the editor's icon size, text gap, icon colour and left/right
   placement were saved but never applied. Restored with the isolation
   selector so a theme's own button styles cannot override them. */
.kbh.kbh-wrap .kbh-custom-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--kbh-icon-gap, 8px); }
.kbh.kbh-wrap .kbh-custom-button .kbh-button-icon { font-size: var(--kbh-icon-size, 16px); line-height: 1; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--kbh-icon-color, currentColor); }
.kbh.kbh-wrap .kbh-custom-button .kbh-button-text { display: inline-block; }
.kbh.kbh-wrap .kbh-custom-button.kbh-icon-left, .kbh.kbh-wrap .kbh-custom-button.kbh-icon-right { flex-direction: row; }

/* ==========================================================================
   Button groups (the "Buttons" element)
   ==========================================================================
   1.5.6 laid these out on a grid with a 12px gap. The front-end rewrite kept
   the markup (.kbh-buttons-layout-*, -size-*, -align-*, -count-*) but lost
   every rule for it, so buttons rendered inline with no spacing -- the
   "crowded buttons" seen on the live site. Rebuilt here, driven by the
   editor's spacing controls through custom properties on the group:
     --kbh-btn-gap-x / --kbh-btn-gap-y   gap BETWEEN buttons
     --kbh-btn-min-h                      minimum height (overrides size)
     --kbh-btn-w                          custom width
   Padding INSIDE a button stays on the button's inline style. */
.kbh.kbh-wrap .kbh-custom-buttons {
	display: grid; align-items: stretch; justify-items: stretch;
	gap: var(--kbh-btn-gap-y, 12px) var(--kbh-btn-gap-x, 12px);
	margin: var(--kbh-s4) 0; padding: 0; border: 0; list-style: none;
	--kbh-btn-size-h: 44px;
}
.kbh.kbh-wrap .kbh-custom-buttons:first-child { margin-top: 0; }
.kbh.kbh-wrap .kbh-buttons-layout-stack, .kbh.kbh-wrap .kbh-buttons-layout-full { grid-template-columns: minmax(0, 1fr); }
.kbh.kbh-wrap .kbh-buttons-layout-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kbh.kbh-wrap .kbh-buttons-layout-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kbh.kbh-wrap .kbh-custom-buttons.kbh-buttons-count-1 { grid-template-columns: minmax(0, 1fr); }
.kbh.kbh-wrap .kbh-buttons-layout-three.kbh-buttons-count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Size presets set the height; an explicit minimum height wins. */
.kbh.kbh-wrap .kbh-buttons-size-small  { --kbh-btn-size-h: 36px; }
.kbh.kbh-wrap .kbh-buttons-size-large  { --kbh-btn-size-h: 52px; }
.kbh.kbh-wrap .kbh-custom-buttons .kbh-custom-button {
	min-height: var(--kbh-btn-min-h, var(--kbh-btn-size-h)); min-width: 0; max-width: 100%;
	margin: 0; text-align: center; line-height: 1.25; overflow-wrap: anywhere;
	font-weight: 600; transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.kbh.kbh-wrap .kbh-custom-buttons .kbh-custom-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.kbh.kbh-wrap .kbh-custom-buttons .kbh-custom-button:active { transform: translateY(0); filter: brightness(.97); }
/* Width: fill the column (default), fit the text, or a fixed width. */
.kbh.kbh-wrap .kbh-buttons-width-fill .kbh-custom-button, .kbh.kbh-wrap .kbh-buttons-size-full .kbh-custom-button { width: 100%; }
.kbh.kbh-wrap .kbh-buttons-width-auto .kbh-custom-button { width: auto; }
.kbh.kbh-wrap .kbh-buttons-width-custom .kbh-custom-button { width: min(100%, var(--kbh-btn-w, 200px)); }
/* Alignment applies when a button does not fill its column. */
.kbh.kbh-wrap .kbh-buttons-align-left   { justify-items: start; }
.kbh.kbh-wrap .kbh-buttons-align-center { justify-items: center; }
.kbh.kbh-wrap .kbh-buttons-align-right  { justify-items: end; }
.kbh.kbh-wrap .kbh-buttons-width-fill.kbh-buttons-align-left, .kbh.kbh-wrap .kbh-buttons-width-fill.kbh-buttons-align-center, .kbh.kbh-wrap .kbh-buttons-width-fill.kbh-buttons-align-right { justify-items: stretch; }
/* Phones: three across becomes two, then everything stacks; the vertical gap
   keeps separating them. */
@media (max-width: 768px) { .kbh.kbh-wrap .kbh-buttons-layout-three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .kbh.kbh-wrap .kbh-buttons-layout-two, .kbh.kbh-wrap .kbh-buttons-layout-three, .kbh.kbh-wrap .kbh-buttons-layout-three.kbh-buttons-count-2 { grid-template-columns: minmax(0, 1fr); } }
