/* =============================================================================
   ANS Helpdesk — help center stylesheet
   Same design language as ansmusic.io custom pages (Privacy, Terms, Agreements,
   Content Delivery Policy, Account Deletion): dark surfaces, 18px cards,
   Space Grotesk headings, Inter body, JetBrains Mono for technical bits.
   Colour semantics: red = errors / critical only · green = success / tips ·
   amber = warnings / notes · violet = informational.
   ============================================================================= */

:root {
	--bg: #0b0b10;
	--bg-2: #0e0e14;
	--s1: #14141b;
	--s2: #17171f;
	--s3: #1c1c25;
	--ln: rgba(255,255,255,0.09);
	--lns: rgba(255,255,255,0.06);
	--lnh: rgba(255,255,255,0.16);
	--w: #f4f4f5;
	--t: #a7a7b1;
	--t2: #cfcfd6;
	--m: #6e6e78;

	--r: #f43f5e;
	--rh: #e11d2e;
	--rs: #fda4af;
	--rbg: rgba(225,29,46,0.12);
	--rln: rgba(251,113,133,0.28);

	--g: #4ade80;
	--gbg: rgba(34,197,94,0.1);
	--gln: rgba(134,239,172,0.24);

	--am: #fbbf24;
	--ambg: rgba(251,191,36,0.09);
	--amln: rgba(251,191,36,0.25);

	--vi: #a78bfa;
	--vibg: rgba(167,139,250,0.1);
	--viln: rgba(167,139,250,0.26);

	--radius: 18px;
	--radius-sm: 14px;
	--radius-xs: 10px;

	--font-head: 'Space Grotesk', 'Inter', sans-serif;
	--font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

	--header-h: 68px;
	--container: 1200px;
	--gutter: 20px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { overflow-x: hidden; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }
body.ans-hd {
	margin: 0;
	background: var(--bg);
	color: var(--t);
	font-family: var(--font-body);
	font-size: 15.5px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: clip;
}
body.admin-bar { --header-h: 100px; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--w); margin: 0; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: break-word; text-wrap: balance; }
p { margin: 0; }
a { color: var(--rs); text-decoration: none; transition: color .18s ease; }
a:hover { color: #fff; }
img, svg, video { max-width: 100%; height: auto; display: block; }
svg { flex: none; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--r); outline-offset: 2px; border-radius: 6px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.kb-skip:focus { position: fixed; top: 10px; left: 10px; width: auto; height: auto; clip: auto; background: var(--rh); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 9999; }
.kb-container { max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.kb-page { padding-top: 28px; padding-bottom: 72px; }
.kb-page-narrow { max-width: 820px; }
.kb-section { padding-top: 40px; padding-bottom: 8px; }
.kb-muted { color: var(--m); }
.kb-mono { font-family: var(--font-mono); font-size: 12.5px; }
.kb-hide-sm { }
.kb-hp { position: absolute; left: -9999px; }

/* ---------- Buttons & chips ---------- */
.kb-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
	border: 1px solid var(--ln); background: rgba(255,255,255,0.04); color: var(--w);
	cursor: pointer; text-decoration: none; white-space: nowrap;
	transition: border-color .2s, background .2s, transform .2s, color .2s;
}
.kb-btn svg { width: 16px; height: 16px; }
.kb-btn:hover { border-color: var(--lnh); background: rgba(255,255,255,0.07); color: #fff; transform: translateY(-1px); }
.kb-btn-primary { background: linear-gradient(135deg, var(--rh), #a3122b); border-color: transparent; box-shadow: 0 8px 22px rgba(225,29,46,0.28); }
.kb-btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--rh), #a3122b); }
.kb-btn-ghost { background: transparent; }
.kb-btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }

.kb-chip {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
	padding: 4px 10px; border-radius: 999px; border: 1px solid var(--ln); color: var(--t2); background: rgba(255,255,255,0.04);
	line-height: 1.5; text-decoration: none;
}
.kb-chip-red    { color: var(--rs); background: var(--rbg); border-color: var(--rln); }
.kb-chip-green  { color: #bbf7d0; background: var(--gbg); border-color: var(--gln); }
.kb-chip-amber  { color: #fde68a; background: var(--ambg); border-color: var(--amln); }
.kb-chip-violet { color: #ddd6fe; background: var(--vibg); border-color: var(--viln); }

.kb-eyebrow {
	display: inline-flex; align-items: center; gap: 9px;
	font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #e4e4e7;
	border: 1px solid rgba(255,255,255,0.14); border-radius: 999px; padding: 8px 18px;
	background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
	box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}
.kb-eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--r); animation: kb-ping 2.2s ease-out infinite; }
@keyframes kb-ping { 0% { box-shadow: 0 0 0 0 rgba(244,63,94,0.5); } 70% { box-shadow: 0 0 0 9px rgba(244,63,94,0); } 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0); } }

.kb-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--rs); margin-bottom: 14px; }
.kb-kicker::before { content: ''; width: 24px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--r)); }

/* Accent helpers used by category icons / cards */
.kb-accent-red    { --acc: var(--r);  --accbg: var(--rbg);  --accln: var(--rln); }
.kb-accent-green  { --acc: var(--g);  --accbg: var(--gbg);  --accln: var(--gln); }
.kb-accent-amber  { --acc: var(--am); --accbg: var(--ambg); --accln: var(--amln); }
.kb-accent-violet { --acc: var(--vi); --accbg: var(--vibg); --accln: var(--viln); }

/* ---------- Header ---------- */
.kb-header {
	position: sticky; top: 0; z-index: 200;
	background: rgba(11,11,16,0.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
	border-bottom: 1px solid var(--lns);
}
body.admin-bar .kb-header { top: 32px; }
.kb-header-inner { display: flex; align-items: center; gap: 18px; height: 68px; }
.kb-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--w); text-decoration: none; flex: none; }
.kb-brand img, .kb-brand .kb-logo { display: block; height: 36px; max-height: 36px; width: auto; max-width: 180px; object-fit: contain; }
.kb-brand-mark { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--rh), #a3122b); color: #fff; box-shadow: 0 6px 16px rgba(225,29,46,0.3); }
.kb-brand-mark svg { width: 18px; height: 18px; }
.kb-brand-name { font-family: var(--font-head); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.kb-brand-badge { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t); border: 1px solid var(--ln); border-radius: 999px; padding: 3px 8px; }

.kb-nav { flex: 1; min-width: 0; }
.kb-nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.kb-nav-list > li { position: relative; }
.kb-nav-list a, .kb-nav-sub-toggle {
	display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px;
	font-size: 14px; font-weight: 500; color: var(--t2); text-decoration: none; background: none; border: 0; cursor: pointer;
	transition: color .18s, background .18s;
}
.kb-nav-list a:hover, .kb-nav-sub-toggle:hover, .kb-nav-list .current-menu-item > a { color: #fff; background: rgba(255,255,255,0.06); }
.kb-nav-sub, .kb-nav-list .sub-menu {
	position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; padding: 8px; margin: 0; list-style: none;
	background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-radius: var(--radius-sm);
	box-shadow: 0 18px 40px rgba(0,0,0,0.45); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s;
}
.kb-nav-sub a, .kb-nav-list .sub-menu a { display: flex; width: 100%; padding: 9px 12px; font-size: 13.5px; }
.kb-nav-has-sub:hover > .kb-nav-sub, .kb-nav-has-sub:focus-within > .kb-nav-sub, .kb-nav-sub-toggle[aria-expanded="true"] + .kb-nav-sub,
.menu-item-has-children:hover > .sub-menu, .menu-item-has-children:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.kb-header-actions { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.kb-header-search { width: 240px; }
.kb-nav-toggle { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--ln); background: transparent; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.kb-nav-toggle span { width: 18px; height: 2px; background: var(--w); border-radius: 2px; transition: transform .2s, opacity .2s; }
.kb-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.kb-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.kb-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Search ---------- */
.kb-search { position: relative; }
.kb-search input[type="search"] {
	width: 100%; font-family: inherit; color: var(--w); background: rgba(255,255,255,0.04);
	border: 1px solid var(--ln); border-radius: 999px; padding: 11px 16px 11px 42px; font-size: 14px;
	transition: border-color .2s, box-shadow .2s, background .2s; -webkit-appearance: none; appearance: none;
}
.kb-search input::placeholder { color: var(--m); }
.kb-search input:focus { outline: none; border-color: var(--rln); background: rgba(225,29,46,0.05); box-shadow: 0 0 0 3px rgba(244,63,94,0.12); }
.kb-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.kb-search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--m); pointer-events: none; }
.kb-search-hero input { padding: 18px 60px 18px 54px; font-size: 16.5px; border-radius: 18px; background: rgba(20,20,27,0.9); box-shadow: 0 20px 50px rgba(0,0,0,0.45); }
.kb-search-hero .kb-search-icon { left: 20px; width: 21px; height: 21px; }
.kb-search-kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 12px; color: var(--m); border: 1px solid var(--ln); border-radius: 6px; padding: 2px 7px; }
.kb-search-page input { padding: 14px 18px 14px 48px; font-size: 15px; border-radius: 14px; }
.kb-search-results {
	position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 300;
	background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-radius: var(--radius-sm);
	box-shadow: 0 24px 60px rgba(0,0,0,0.5); padding: 6px; max-height: 60vh; overflow: auto; text-align: left;
}
.kb-search-results[hidden] { display: none; }
.kb-search-result { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--t); }
.kb-search-result:hover, .kb-search-result.is-active { background: rgba(255,255,255,0.05); color: var(--t); }
.kb-search-result strong { display: block; font-family: var(--font-head); font-size: 14.5px; color: var(--w); font-weight: 600; margin-bottom: 2px; }
.kb-search-result small { display: block; font-size: 12.5px; color: var(--t); line-height: 1.5; }
.kb-search-result .kb-chip { margin-bottom: 4px; font-size: 10px; }
.kb-search-results mark, .kb-prose mark, [data-kb-highlight] mark { background: rgba(251,191,36,0.22); color: #fde68a; border-radius: 3px; padding: 0 2px; }
.kb-search-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px 6px; border-top: 1px dashed var(--ln); margin-top: 4px; font-size: 13px; color: var(--m); }
.kb-search-footer a { font-weight: 600; }
.kb-search-empty { padding: 16px 12px; font-size: 13.5px; color: var(--t); }

/* ---------- Hero ---------- */
.kb-hero { position: relative; padding: clamp(56px, 8vw, 96px) 0 clamp(34px, 5vw, 56px); text-align: center; isolation: isolate; overflow: hidden; }
.kb-hero-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: radial-gradient(ellipse 62% 60% at 50% -10%, rgba(225,29,46,0.16), transparent 62%), radial-gradient(ellipse 40% 45% at 88% 20%, rgba(120,90,240,0.07), transparent 60%); }
.kb-hero-glow::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse 60% 60% at 50% 0%, #000, transparent 70%); -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 0%, #000, transparent 70%); }
.kb-hero-inner { max-width: 760px; }
.kb-hero h1 { font-size: clamp(32px, 5.2vw, 54px); font-weight: 700; line-height: 1.08; margin: 22px 0 14px; }
.kb-hero-sub { font-size: clamp(15px, 1.6vw, 17.5px); color: #b8b8c0; max-width: 560px; margin: 0 auto 28px; text-wrap: pretty; }
.kb-hero-search { max-width: 680px; margin: 0 auto; }
.kb-hero-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; font-size: 13px; color: var(--m); align-items: center; }
.kb-hero-quick a { color: var(--t2); border: 1px solid var(--ln); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; background: rgba(255,255,255,0.03); }
.kb-hero-quick a:hover { color: #fff; border-color: var(--lnh); }

/* ---------- Section heads ---------- */
.kb-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.kb-section-head h2 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; }
.kb-link-more { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--rs); }
.kb-link-more svg { width: 15px; height: 15px; transition: transform .2s; }
.kb-link-more:hover svg { transform: translateX(3px); }
.kb-h-sm { font-size: 17px; font-weight: 700; margin: 6px 0 14px; }

/* ---------- Cards: category ---------- */
.kb-category-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.kb-category-card { grid-column: span 2; }
/* 8 of 8 → the last two share the final row */
.kb-category-card:nth-last-child(2):nth-child(3n+1), .kb-category-card:last-child:nth-child(3n+2) { grid-column: span 3; }
.kb-category-card {
	position: relative; display: flex; flex-direction: column; gap: 12px;
	background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-radius: var(--radius);
	padding: 22px 22px 18px; transition: border-color .25s, transform .25s, box-shadow .25s;
}
.kb-category-card::before { content: ''; position: absolute; top: 0; left: 24px; right: 24px; height: 1px; background: linear-gradient(90deg, transparent, var(--acc, var(--r)), transparent); opacity: .45; }
.kb-category-card:hover { border-color: var(--lnh); transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0,0,0,0.35); }
.kb-category-card-head { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.kb-category-icon { flex: none; width: 46px; height: 46px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; color: var(--acc, var(--r)); background: var(--accbg, var(--rbg)); border: 1px solid var(--accln, var(--rln)); }
.kb-category-icon svg { width: 22px; height: 22px; }
.kb-category-title h3 { font-size: 17px; font-weight: 700; }
.kb-category-count { display: block; font-family: var(--font-mono); font-size: 11.5px; color: var(--m); margin-top: 2px; }
.kb-category-desc { font-size: 13.5px; color: var(--t); line-height: 1.6; }
.kb-category-links { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.kb-category-links a { display: block; font-size: 13.5px; color: var(--t2); padding: 6px 10px; margin: 0 -10px; border-radius: 8px; border-left: 2px solid transparent; }
.kb-category-links a:hover { color: #fff; background: rgba(255,255,255,0.05); border-left-color: var(--acc, var(--r)); }
.kb-category-more { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--rs); }
.kb-category-more svg { width: 14px; height: 14px; }

/* A trailing odd card (e.g. the 7th of 7) spans the row as a wide banner instead of sitting alone (desktop only). */
@media (min-width: 1081px) {
	.kb-category-card:last-child:nth-child(3n+1) { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.4fr; grid-template-areas: "head links" "desc links" "more links"; column-gap: 32px; align-items: start; }
	.kb-category-card:last-child:nth-child(3n+1) .kb-category-card-head { grid-area: head; }
	.kb-category-card:last-child:nth-child(3n+1) .kb-category-desc { grid-area: desc; }
	.kb-category-card:last-child:nth-child(3n+1) .kb-category-links { grid-area: links; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin-top: 0; }
	.kb-category-card:last-child:nth-child(3n+1) .kb-category-more { grid-area: more; margin-top: 0; }
}

/* ---------- Cards: article ---------- */
.kb-article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kb-article-list { display: flex; flex-direction: column; gap: 12px; }
.kb-article-card {
	display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--t);
	background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-radius: var(--radius-sm);
	padding: 20px 22px; transition: border-color .25s, transform .25s, background .25s;
}
.kb-article-card:hover { border-color: var(--rln); transform: translateY(-2px); color: var(--t); }
.kb-article-card .kb-chip { align-self: flex-start; }
.kb-article-card h3 { font-size: 16.5px; font-weight: 600; }
.kb-article-card:hover h3 { color: #fff; }
.kb-article-card-excerpt { font-size: 14px; line-height: 1.6; color: var(--t); }
.kb-article-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; font-family: var(--font-mono); font-size: 11.5px; color: var(--m); }
.kb-article-card-go { display: inline-flex; align-items: center; gap: 5px; color: var(--rs); font-family: var(--font-body); font-weight: 600; font-size: 13px; }
.kb-article-card-go svg { width: 14px; height: 14px; transition: transform .2s; }
.kb-article-card:hover .kb-article-card-go svg { transform: translateX(3px); }

/* ---------- Tools ---------- */
.kb-tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kb-tool-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-radius: var(--radius); padding: 22px; transition: border-color .25s, transform .25s; }
.kb-tool-card:hover { border-color: var(--lnh); transform: translateY(-3px); }
.kb-tool-card .kb-chip { align-self: flex-start; }
.kb-tool-card h3 { font-size: 17px; }
.kb-tool-card p { font-size: 13.5px; color: var(--t); }

/* ---------- Contact CTA ---------- */
.kb-contact {
	position: relative; overflow: hidden; margin-top: 40px;
	background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-radius: var(--radius); padding: clamp(24px, 4vw, 36px);
	display: grid; grid-template-columns: 1.1fr 1.4fr; gap: 28px; align-items: center;
}
.kb-contact::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--rh), transparent); }
.kb-contact::after { content: ''; position: absolute; top: -90px; left: 20%; width: 360px; height: 220px; background: radial-gradient(ellipse, rgba(225,29,46,0.12), transparent 70%); pointer-events: none; }
.kb-contact h2 { font-size: clamp(20px, 2.6vw, 26px); margin-bottom: 8px; }
.kb-contact-text p { font-size: 14.5px; color: var(--t); }
.kb-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; }
.kb-contact-card { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 13px; border: 1px solid var(--ln); background: rgba(255,255,255,0.03); text-decoration: none; color: var(--w); transition: border-color .2s, background .2s, transform .2s; }
.kb-contact-card:hover { border-color: var(--rln); background: var(--rbg); transform: translateY(-2px); color: #fff; }
.kb-contact-card strong { display: block; font-size: 14px; font-weight: 600; }
.kb-contact-card small { display: block; font-size: 12px; color: var(--t); margin-top: 1px; }
.kb-contact-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); border: 1px solid var(--ln); color: var(--rs); }
.kb-contact-icon svg { width: 17px; height: 17px; }
.kb-contact-primary { background: linear-gradient(135deg, rgba(225,29,46,0.22), rgba(225,29,46,0.08)); border-color: var(--rln); }
.kb-contact-primary .kb-contact-icon { background: linear-gradient(135deg, var(--rh), #a3122b); color: #fff; border-color: transparent; }

/* ---------- Layouts ---------- */
.kb-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; align-items: start; }
.kb-layout-article { grid-template-columns: minmax(0, 1fr) 280px; }
.kb-layout-no-toc { grid-template-columns: minmax(0, 1fr) 260px; }
.kb-sidebar { position: relative; }
.kb-sticky { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent; display: flex; flex-direction: column; gap: 18px; padding-right: 4px; }
.kb-side-title { font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--m); margin: 0 0 10px; }
.kb-side-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.kb-side-nav ul ul { padding-left: 34px; margin-top: 2px; }
.kb-side-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; color: var(--t2); border-left: 2px solid transparent; }
.kb-side-nav a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.kb-side-nav li.is-active > a { color: #fff; background: rgba(255,255,255,0.05); border-left-color: var(--r); }
.kb-side-icon { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: var(--acc, var(--r)); background: var(--accbg, var(--rbg)); border: 1px solid var(--accln, var(--rln)); }
.kb-side-icon svg { width: 13px; height: 13px; }
.kb-side-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Breadcrumbs ---------- */
.kb-breadcrumbs ol { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--m); }
.kb-breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; }
.kb-breadcrumbs li + li::before { content: '/'; color: var(--m); opacity: .6; }
.kb-breadcrumbs a { color: var(--t); }
.kb-breadcrumbs a:hover { color: #fff; }
.kb-breadcrumbs [aria-current] span { color: var(--t2); }

/* ---------- Archive head ---------- */
.kb-archive-head { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--lns); }
.kb-archive-head h1 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 700; }
.kb-archive-desc { font-size: 15px; color: var(--t); margin-top: 6px; max-width: 720px; text-wrap: pretty; }
.kb-archive-head .kb-category-icon { width: 56px; height: 56px; border-radius: 16px; }
.kb-archive-head .kb-category-icon svg { width: 26px; height: 26px; }
.kb-subcats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.kb-subcat { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--ln); font-size: 13.5px; color: var(--t2); }
.kb-subcat span { font-family: var(--font-mono); font-size: 11px; color: var(--m); }
.kb-subcat:hover { border-color: var(--lnh); color: #fff; }

/* Legal documents grid */
.kb-docs-grid-wrap { margin-bottom: 30px; }
.kb-docs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.kb-doc-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid var(--amln); background: var(--ambg); text-decoration: none; color: var(--t2); transition: transform .2s, border-color .2s; }
.kb-doc-tile:hover { transform: translateY(-2px); border-color: var(--am); }
.kb-doc-tile strong { font-family: var(--font-head); font-size: 15px; color: var(--w); }
.kb-doc-tile span { font-size: 13px; color: #e8dcc0; }
.kb-doc-tile em { font-style: normal; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #fde68a; margin-top: 6px; }
.kb-doc-tile em svg { width: 13px; height: 13px; }

/* ---------- Article ---------- */
.kb-article-head { margin-bottom: 24px; }
.kb-article-head .kb-chip { margin-bottom: 14px; }
.kb-article-head h1 { font-size: clamp(27px, 3.8vw, 40px); font-weight: 700; line-height: 1.12; }
.kb-article-lede { font-size: 16.5px; color: #b8b8c0; margin-top: 12px; text-wrap: pretty; max-width: 700px; }
.kb-article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 16px; font-size: 13px; color: var(--m); }
.kb-article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.kb-article-meta svg { width: 14px; height: 14px; }
.kb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 30px; }
.kb-tags a { font-family: var(--font-mono); font-size: 12px; color: var(--t); border: 1px solid var(--ln); border-radius: 999px; padding: 3px 10px; }
.kb-tags a:hover { color: #fff; border-color: var(--lnh); }

/* TOC */
.kb-toc details > summary { list-style: none; cursor: pointer; font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--m); display: flex; align-items: center; justify-content: space-between; }
.kb-toc details > summary::-webkit-details-marker { display: none; }
.kb-toc ol { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--lns); }
.kb-toc li a { display: block; font-size: 13px; color: var(--t); padding: 5px 12px; margin-left: -1px; border-left: 2px solid transparent; line-height: 1.45; transition: color .15s, border-color .15s; }
.kb-toc li.kb-toc-l3 a { padding-left: 24px; font-size: 12.5px; }
.kb-toc li a:hover { color: #fff; }
.kb-toc li a.is-active { color: var(--w); border-left-color: var(--r); }
.kb-toc-inline { display: none; margin-bottom: 26px; }
.kb-toc-mobile { background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-radius: var(--radius-sm); padding: 14px 16px; }
.kb-toc-mobile details > summary::after { content: '+'; font-family: var(--font-mono); font-size: 16px; color: var(--rs); }
.kb-toc-mobile details[open] > summary::after { content: '−'; }

/* ---------- Prose (article body) ---------- */
.kb-prose { font-size: 15.5px; line-height: 1.75; color: var(--t2); }
.kb-prose > * + * { margin-top: 16px; }
.kb-prose h2 { font-size: clamp(20px, 2.4vw, 24px); font-weight: 700; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--lns); position: relative; }
.kb-prose h3 { font-size: 17.5px; font-weight: 700; margin-top: 30px; }
.kb-prose h4 { font-size: 15px; font-weight: 700; margin-top: 22px; color: var(--w); }
.kb-prose h2 + *, .kb-prose h3 + *, .kb-prose h4 + * { margin-top: 12px; }
.kb-anchor { margin-left: 8px; color: var(--m); font-family: var(--font-mono); font-size: .8em; opacity: 0; text-decoration: none; transition: opacity .15s; }
.kb-heading:hover .kb-anchor, .kb-anchor:focus { opacity: 1; }
.kb-prose p { color: var(--t2); text-wrap: pretty; }
.kb-prose a { color: var(--rs); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.kb-prose a:hover { color: #fff; }
.kb-prose strong { color: var(--w); font-weight: 600; }
.kb-prose ul, .kb-prose ol { padding-left: 0; margin-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.kb-prose ul li, .kb-prose ol li { position: relative; padding-left: 26px; }
.kb-prose ul li::before { content: '•'; position: absolute; left: 8px; top: 0; color: var(--rs); font-weight: 700; }
.kb-prose ol { counter-reset: kb-li; }
.kb-prose ol li { counter-increment: kb-li; padding-left: 30px; }
.kb-prose ol li::before { content: counter(kb-li); position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 6px; font-family: var(--font-mono); font-size: 11px; color: #fff; background: rgba(255,255,255,0.12); display: inline-flex; align-items: center; justify-content: center; }
.kb-prose li ul, .kb-prose li ol { margin-top: 8px; }
.kb-prose hr { border: 0; border-top: 1px dashed var(--ln); margin: 30px 0; }
.kb-prose blockquote { margin: 0; padding: 12px 18px; border-left: 3px solid var(--vi); background: var(--vibg); border-radius: 0 12px 12px 0; color: var(--t2); font-style: normal; }
.kb-prose img { border-radius: var(--radius-sm); border: 1px solid var(--ln); }
.kb-prose figure { margin: 0; }
.kb-prose figcaption { font-size: 12.5px; color: var(--m); margin-top: 8px; text-align: center; }
.kb-prose kbd { font-family: var(--font-mono); font-size: 12.5px; color: var(--w); background: rgba(255,255,255,0.08); border: 1px solid var(--ln); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; }

/* Steps (ANS numbered red chips) */
.kb-steps { counter-reset: kb-step; }
.kb-prose .kb-steps li { counter-increment: kb-step; padding-left: 44px; min-height: 30px; }
.kb-prose .kb-steps li::before { content: counter(kb-step); left: 0; top: 1px; width: 30px; height: 30px; border-radius: 9px; font-size: 12.5px; background: linear-gradient(135deg, var(--rh), #a3122b); box-shadow: 0 5px 14px rgba(225,29,46,0.28); }
.kb-prose .kb-steps li + li { margin-top: 6px; }
.kb-prose .kb-steps li strong:first-child { display: block; color: var(--w); margin-bottom: 2px; }

/* Callouts — colour = meaning */
.kb-callout { border: 1px solid var(--cln); background: var(--cbg); border-radius: var(--radius-sm); padding: 14px 18px 14px 16px; margin: 18px 0; }
.kb-callout-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ctx); margin-bottom: 6px; }
.kb-callout-head svg { width: 16px; height: 16px; }
/* Callouts written as plain HTML (from the visual editor) get the same icon via CSS */
.kb-callout-head:not(:has(svg))::before { content: ''; width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: var(--cicon) center / contain no-repeat; mask: var(--cicon) center / contain no-repeat; }
.kb-note   { --cicon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E"); }
.kb-tip    { --cicon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3Cpath d='M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .23 2.23 1.5 3.5A4.61 4.61 0 0 1 8.91 14'/%3E%3C/svg%3E"); }
.kb-warn   { --cicon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E"); }
.kb-danger { --cicon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E"); }
.kb-callout-body { font-size: 14.5px; color: var(--cbody); }
.kb-callout-body > * + * { margin-top: 8px; }
.kb-callout-body p { color: var(--cbody); }
.kb-callout-body strong { color: #fff; }
.kb-callout-body a { color: #fff; }
.kb-note   { --cln: var(--viln); --cbg: var(--vibg); --ctx: #ddd6fe; --cbody: #e4e0f5; }
.kb-tip    { --cln: var(--gln);  --cbg: var(--gbg);  --ctx: #bbf7d0; --cbody: #d4f4e0; }
.kb-warn   { --cln: var(--amln); --cbg: var(--ambg); --ctx: #fde68a; --cbody: #e8dcc0; }
.kb-danger { --cln: var(--rln);  --cbg: var(--rbg);  --ctx: var(--rs); --cbody: #f5d0d5; }
.kb-prose .kb-callout ul li::before { color: var(--ctx); }

/* Quick facts */
.kb-facts { background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-radius: var(--radius-sm); padding: 16px 18px; margin: 18px 0 26px; }
.kb-facts-title { font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--m); margin-bottom: 10px; }
.kb-prose .kb-facts ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 20px; }
.kb-prose .kb-facts li { padding-left: 0; font-size: 14px; color: var(--t2); }
.kb-prose .kb-facts li::before { display: none; }
.kb-prose .kb-facts li strong { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--m); font-weight: 500; margin-bottom: 1px; }

/* Do / Don't */
.kb-dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.kb-dodont > div { border-radius: var(--radius-sm); padding: 16px 18px; border: 1px solid; }
.kb-dodont .kb-do { background: var(--gbg); border-color: var(--gln); }
.kb-dodont .kb-dont { background: var(--rbg); border-color: var(--rln); }
.kb-dodont h4 { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.kb-dodont .kb-do h4 { color: #bbf7d0; }
.kb-dodont .kb-dont h4 { color: var(--rs); }
.kb-prose .kb-dodont ul { gap: 6px; }
.kb-prose .kb-dodont li { font-size: 14px; }
.kb-prose .kb-do li::before { content: '✓'; color: var(--g); }
.kb-prose .kb-dont li::before { content: '✕'; color: var(--r); }

/* Screenshot placeholder */
.kb-screenshot { margin: 20px 0; }
.kb-screenshot-placeholder .kb-screenshot-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 180px; border: 2px dashed var(--amln); background: repeating-linear-gradient(-45deg, rgba(251,191,36,0.04) 0 10px, transparent 10px 20px), var(--ambg); border-radius: var(--radius-sm); padding: 24px; text-align: center; color: #fde68a; }
.kb-screenshot-placeholder svg { width: 28px; height: 28px; opacity: .8; }
.kb-screenshot-label { font-family: var(--font-mono); font-size: 12.5px; }

/* Doc card */
.kb-doc-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin: 22px 0; border-radius: var(--radius-sm); border: 1px solid var(--amln); background: var(--ambg); text-decoration: none !important; color: var(--t2); transition: transform .2s, border-color .2s; }
.kb-doc-card:hover { transform: translateY(-2px); border-color: var(--am); color: var(--t2); }
.kb-doc-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(251,191,36,0.14); color: #fde68a; }
.kb-doc-icon svg { width: 20px; height: 20px; }
.kb-doc-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.kb-doc-text strong { font-family: var(--font-head); color: var(--w); font-size: 15px; }
.kb-doc-text span { font-size: 13px; color: #e8dcc0; }
.kb-doc-go { flex: none; font-weight: 600; font-size: 13px; color: #fde68a; }

/* Editorial note (things the team must confirm before publishing) */
.kb-confirm { display: inline-block; font-family: var(--font-mono); font-size: 12px; color: #fde68a; background: var(--ambg); border: 1px dashed var(--amln); border-radius: 6px; padding: 2px 8px; }

/* Tables */
.kb-table-wrap { overflow-x: auto; border: 1px solid var(--ln); border-radius: 13px; margin: 18px 0; -webkit-overflow-scrolling: touch; }
.kb-table, .kb-prose table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 480px; margin: 0; }
.kb-prose th { text-align: left; font-family: var(--font-head); font-size: 12px; letter-spacing: 0.04em; color: var(--w); background: rgba(255,255,255,0.04); padding: 11px 14px; border-bottom: 1px solid var(--ln); white-space: nowrap; }
.kb-prose td { padding: 11px 14px; border-bottom: 1px solid var(--lns); color: var(--t2); vertical-align: top; }
.kb-prose tr:last-child td { border-bottom: 0; }
.kb-prose td code { white-space: nowrap; }
.kb-badge { display: inline-block; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 7px; border: 1px solid; white-space: nowrap; }
.kb-badge-fast { color: #bbf7d0; background: var(--gbg); border-color: var(--gln); }
.kb-badge-std  { color: #ddd6fe; background: var(--vibg); border-color: var(--viln); }
.kb-badge-mid  { color: #fde68a; background: var(--ambg); border-color: var(--amln); }
.kb-badge-long { color: var(--rs); background: var(--rbg); border-color: var(--rln); }

/* Code */
.kb-prose code { font-family: var(--font-mono); font-size: 13px; color: #fecdd3; background: rgba(255,255,255,0.06); border: 1px solid var(--lns); border-radius: 6px; padding: 1px 6px; }
.kb-prose pre { position: relative; margin: 18px 0; padding: 18px 18px 16px; background: #0a0a0f; border: 1px solid var(--ln); border-radius: var(--radius-sm); overflow: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.65; color: #e4e4e7; tab-size: 2; }
.kb-prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.kb-prose pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 10px; left: 14px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--m); }
.kb-prose pre[data-lang] { padding-top: 34px; }
.kb-copy { position: absolute; top: 8px; right: 8px; font-family: var(--font-body); font-size: 12px; font-weight: 600; color: var(--t2); background: rgba(255,255,255,0.06); border: 1px solid var(--ln); border-radius: 8px; padding: 5px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s, border-color .15s; }
.kb-copy:hover { background: rgba(255,255,255,0.1); color: #fff; }
.kb-copy.is-copied { color: #bbf7d0; border-color: var(--gln); background: var(--gbg); }
.kb-copy svg { width: 13px; height: 13px; }
.kb-endpoint { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 14px; color: var(--w); background: #0a0a0f; border: 1px solid var(--ln); border-radius: 12px; padding: 10px 14px; margin: 10px 0; flex-wrap: wrap; }
.kb-method { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 7px; }
.kb-method-post { color: #bbf7d0; background: var(--gbg); border: 1px solid var(--gln); }
.kb-method-get { color: #ddd6fe; background: var(--vibg); border: 1px solid var(--viln); }
.kb-status { font-family: var(--font-mono); font-weight: 600; }
.kb-status-2 { color: var(--g); }
.kb-status-4 { color: var(--am); }
.kb-status-5 { color: var(--r); }

/* Prism — ANS dark token colours */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6e6e78; }
.token.punctuation { color: #a7a7b1; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #fda4af; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin { color: #bbf7d0; }
.token.operator, .token.entity, .token.url, .token.variable { color: #e4e4e7; }
.token.atrule, .token.attr-value, .token.keyword { color: #c4b5fd; }
.token.function, .token.class-name { color: #fde68a; }
.token.regex, .token.important { color: #fbbf24; }
.language-http .token.request-line .token.property { color: #bbf7d0; }

/* ---------- Feedback ---------- */
.kb-feedback { margin-top: 44px; background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-radius: var(--radius); padding: 22px 24px; }
.kb-feedback-ask { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.kb-feedback-q { font-family: var(--font-head); font-weight: 700; font-size: 16px; color: var(--w); }
.kb-feedback-btns { display: flex; gap: 8px; }
.kb-feedback-btns .kb-btn.is-selected { border-color: var(--gln); background: var(--gbg); color: #bbf7d0; }
.kb-feedback-btns .kb-btn[data-helpful="0"].is-selected { border-color: var(--amln); background: var(--ambg); color: #fde68a; }
.kb-feedback-more { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.kb-feedback-more[hidden] { display: none; }
.kb-feedback-more label { font-size: 14px; color: var(--t2); }
.kb-feedback-more textarea { width: 100%; font-family: inherit; font-size: 14px; color: var(--w); background: rgba(255,255,255,0.04); border: 1px solid var(--ln); border-radius: 12px; padding: 12px 14px; resize: vertical; }
.kb-feedback-more textarea:focus { outline: none; border-color: var(--rln); box-shadow: 0 0 0 3px rgba(244,63,94,0.12); }
.kb-feedback-more-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kb-feedback-thanks { margin-top: 12px; color: #bbf7d0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.kb-feedback-thanks::before { content: '✓'; font-weight: 700; }
.kb-feedback-thanks[hidden] { display: none; }

/* ---------- Related ---------- */
.kb-related { margin-top: 40px; }
.kb-related h2 { font-size: 20px; margin-bottom: 14px; }
.kb-related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kb-related-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid var(--ln); background: linear-gradient(170deg, var(--s2), var(--s1)); color: var(--t); transition: border-color .2s, transform .2s; }
.kb-related-card:hover { border-color: var(--rln); transform: translateY(-2px); color: var(--t); }
.kb-related-card .kb-chip { align-self: flex-start; }
.kb-related-card h3 { font-size: 15px; font-weight: 600; }
.kb-related-card p { font-size: 13px; }

/* ---------- Search page / filters ---------- */
.kb-search-head { margin-bottom: 26px; display: flex; flex-direction: column; gap: 14px; }
.kb-search-head h1 { font-size: clamp(24px, 3.4vw, 34px); }
.kb-search-page-form { max-width: 640px; }
.kb-filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-filter { font-family: inherit; font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--ln); background: rgba(255,255,255,0.03); color: var(--t); cursor: pointer; text-decoration: none; transition: color .2s, border-color .2s, background .2s; }
.kb-filter:hover { color: #fff; border-color: var(--lnh); background: rgba(255,255,255,0.06); }
.kb-filter.is-active { background: var(--rbg); border-color: var(--rln); color: var(--rs); font-weight: 600; }
.kb-empty { text-align: center; padding: 40px 20px; border: 1px dashed var(--ln); border-radius: var(--radius); }
.kb-empty h2 { font-size: 22px; margin-bottom: 8px; }
.kb-empty p { max-width: 520px; margin: 0 auto 18px; }
.kb-empty-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.pagination, .kb-pagination { margin-top: 26px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-links .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--ln); font-size: 13.5px; color: var(--t2); }
.nav-links .page-numbers.current { background: var(--rbg); border-color: var(--rln); color: var(--rs); font-weight: 600; }
.nav-links a.page-numbers:hover { color: #fff; border-color: var(--lnh); }
.screen-reader-text + .nav-links { margin-top: 0; }
.navigation h2 { display: none; }

/* ---------- FAQ page ---------- */
.kb-faq-controls { position: sticky; top: calc(var(--header-h) + 8px); z-index: 50; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; margin-bottom: 26px; background: rgba(11,11,16,0.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--lns); border-radius: var(--radius-sm); }
.kb-faq-group { margin-bottom: 34px; }
.kb-faq-group[hidden] { display: none; }
.kb-faq-item { background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; transition: border-color .2s; }
.kb-faq-item[hidden] { display: none; }
.kb-faq-item:hover { border-color: var(--lnh); }
.kb-faq-item[open] { border-color: var(--rln); }
.kb-faq-item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 20px; font-family: var(--font-head); font-size: 15.5px; font-weight: 600; color: var(--w); }
.kb-faq-item summary::-webkit-details-marker { display: none; }
.kb-faq-item summary::after { content: '+'; flex: none; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); color: var(--rs); background: var(--rbg); border: 1px solid var(--rln); transition: transform .25s; }
.kb-faq-item[open] summary::after { transform: rotate(45deg); }
.kb-faq-body { padding: 0 20px 18px; font-size: 14.5px; color: var(--t2); border-top: 1px dashed var(--ln); margin: 0 20px; padding-left: 0; padding-right: 0; padding-top: 12px; }
.kb-faq-body p { margin-bottom: 10px; }

/* ---------- 404 ---------- */
.kb-404 { text-align: center; max-width: 720px; padding-top: 70px; }
.kb-404 h1 { font-size: clamp(28px, 4.5vw, 44px); margin: 18px 0 10px; }
.kb-404 .kb-hero-search { margin-top: 26px; }

/* ---------- Footer ---------- */
.kb-footer { margin-top: 40px; border-top: 1px solid var(--lns); background: var(--bg-2); padding: 56px 0 28px; }
.kb-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.kb-footer-brand p { margin: 16px 0 18px; font-size: 14px; max-width: 360px; }
.kb-footer-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.kb-footer-col h3 { font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--m); margin-bottom: 14px; }
.kb-footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.kb-footer-col a { font-size: 14px; color: var(--t2); }
.kb-footer-col a:hover { color: #fff; }
.kb-footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--lns); font-size: 12.5px; color: var(--m); }
.kb-footer-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; }
.kb-footer-menu a { color: var(--t); }

.kb-top { position: fixed; right: 20px; bottom: 20px; z-index: 150; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--ln); background: rgba(20,20,27,0.9); color: var(--w); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); box-shadow: 0 10px 26px rgba(0,0,0,0.4); transition: opacity .2s, transform .2s; }
.kb-top[hidden] { display: none; }
.kb-top:hover { border-color: var(--rln); }
.kb-top svg { width: 18px; height: 18px; }


/* ---------- Icon buttons ---------- */
.kb-icon-btn { width: 42px; height: 42px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--ln); background: rgba(255,255,255,0.04); color: var(--w); cursor: pointer; transition: border-color .2s, background .2s; }
.kb-icon-btn:hover { border-color: var(--lnh); background: rgba(255,255,255,0.08); }
.kb-icon-btn svg { width: 18px; height: 18px; }
.kb-search-open { display: none; }
.kb-btn-ticket svg { width: 16px; height: 16px; display: none; }
.kb-link-sm { background: none; border: 0; color: var(--rs); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; margin-left: 8px; text-transform: none; letter-spacing: 0; }
body.kb-lock { overflow: hidden; }

/* ---------- Search overlay ---------- */
.kb-search-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(11,11,16,0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); opacity: 0; transition: opacity .18s ease; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom); }
.kb-search-overlay[hidden] { display: none; }
.kb-search-overlay.is-open { opacity: 1; }
.kb-search-overlay-inner { max-width: 760px; padding-top: 18px; padding-bottom: 40px; transform: translateY(10px); transition: transform .22s ease; }
.kb-search-overlay.is-open .kb-search-overlay-inner { transform: none; }
.kb-search-overlay-bar { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0 12px; }
.kb-search-overlay-bar .kb-icon-btn { height: 50px; width: 50px; }
.kb-search-overlay:has(.kb-search-results:not([hidden])) .kb-search-overlay-body { display: none; }
.kb-search-overlay-bar .kb-search { flex: 1; }
.kb-search-overlay .kb-search input { padding: 15px 18px 15px 48px; font-size: 16px; border-radius: 14px; background: var(--s1); }
.kb-search-overlay .kb-search-results { position: static; margin-top: 8px; box-shadow: none; max-height: none; }
.kb-search-overlay-body { display: flex; flex-direction: column; gap: 26px; margin-top: 8px; }
.kb-search-overlay-body .kb-side-title { display: flex; align-items: center; margin-bottom: 10px; }
.kb-search-browse-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kb-search-browse-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--ln); background: var(--s1); color: var(--t2); font-size: 14px; font-weight: 500; }
.kb-search-browse-item:hover { color: #fff; border-color: var(--lnh); }

/* ---------- Reading progress ---------- */
.kb-progress { position: fixed; top: var(--header-h); left: 0; right: 0; height: 2px; z-index: 199; background: rgba(255,255,255,0.05); pointer-events: none; }
.kb-progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--rh), var(--r)); box-shadow: 0 0 10px rgba(244,63,94,0.5); }
body.admin-bar .kb-progress { top: var(--header-h); }

/* ---------- Article accent glow (category colour) ---------- */
.kb-article { position: relative; }
.kb-article::before { content: ''; position: absolute; top: -40px; left: 0; width: 60%; height: 320px; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 60% 55% at 15% 0%, var(--accbg, var(--rbg)), transparent 70%); opacity: .9; }

/* ---------- Prev / next ---------- */
.kb-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.kb-prevnext-link { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--ln); background: linear-gradient(170deg, var(--s2), var(--s1)); color: var(--t); text-decoration: none; transition: border-color .2s, transform .2s; }
.kb-prevnext-link:hover { border-color: var(--rln); transform: translateY(-2px); color: var(--t); }
.kb-prevnext-link.kb-next { text-align: right; align-items: flex-end; }
.kb-prevnext-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--m); }
.kb-prevnext-title { font-family: var(--font-head); font-weight: 600; font-size: 14.5px; color: var(--w); line-height: 1.35; }

/* ---------- List filter (category pages) ---------- */
.kb-list-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.kb-list-head .kb-h-sm { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.kb-count-badge { font-family: var(--font-mono); font-size: 11.5px; color: var(--m); border: 1px solid var(--ln); border-radius: 999px; padding: 1px 8px; font-weight: 500; }
.kb-list-filter { width: 280px; max-width: 100%; }
.kb-list-filter input { padding: 9px 14px 9px 38px; font-size: 13.5px; }
.kb-list-filter .kb-search-icon { left: 13px; width: 15px; height: 15px; }
.kb-article-card[hidden] { display: none; }

.kb-table-filter { width: 100%; max-width: 420px; margin: 0 0 12px; }
.kb-prose tr[hidden] { display: none; }
.kb-prose td a[href^="mailto:"] { font-family: var(--font-mono); font-size: 12.5px; text-decoration: none; color: #fecdd3; background: rgba(255,255,255,0.05); border: 1px solid var(--lns); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.kb-prose td a[href^="mailto:"]:hover { color: #fff; border-color: var(--rln); }

/* ---------- Recently updated (home) ---------- */
.kb-recent-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--ln); border-radius: var(--radius); overflow: hidden; background: linear-gradient(170deg, var(--s2), var(--s1)); }
.kb-recent-list li + li { border-top: 1px solid var(--lns); }
.kb-recent-list a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 13px 18px; color: var(--t2); text-decoration: none; transition: background .15s; }
.kb-recent-list a:hover { background: rgba(255,255,255,0.04); color: #fff; }
.kb-recent-title { font-weight: 500; font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-recent-date { color: var(--m); }

/* ---------- Table scroll hint ---------- */
.kb-table-wrap { position: relative; }
.kb-table-wrap.is-scrollable::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 44px; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(11,11,16,0.85)); border-radius: 0 13px 13px 0; transition: opacity .2s; }
.kb-table-wrap.is-scrollable.is-at-end::after { opacity: 0; }
.kb-table-wrap.is-scrollable::before { content: '⇢ swipe'; position: absolute; top: 8px; right: 12px; z-index: 1; font-family: var(--font-mono); font-size: 10.5px; color: var(--m); pointer-events: none; }
.kb-table-wrap.is-scrollable.is-at-end::before { display: none; }

/* ---------- Mobile TOC: FAB + bottom sheet ---------- */
.kb-toc-fab { pointer-events: none; position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 150; display: none; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--rln); background: rgba(20,20,27,0.94); color: var(--w); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; box-shadow: 0 12px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(225,29,46,0.12); backdrop-filter: blur(10px); opacity: 0; transition: opacity .2s, transform .2s; }
.kb-toc-fab svg { width: 16px; height: 16px; color: var(--rs); }
.kb-toc-fab.is-visible:not(.is-past-end) { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.kb-sheet { position: fixed; inset: 0; z-index: 420; }
.kb-sheet[hidden] { display: none; }
.kb-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); opacity: 0; transition: opacity .2s; }
.kb-sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow-y: auto; background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -20px 50px rgba(0,0,0,0.5); }
.kb-sheet.is-open .kb-sheet-backdrop { opacity: 1; }
.kb-sheet.is-open .kb-sheet-panel { transform: none; }
.kb-sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.18); margin: 4px auto 12px; }
.kb-sheet-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--w); margin-bottom: 6px; }
.kb-sheet .kb-toc details > summary { display: none; }
.kb-sheet .kb-toc ol { margin-top: 0; border-left: 0; gap: 2px; }
.kb-sheet .kb-toc li a { font-size: 15px; padding: 11px 12px; border-radius: 10px; border-left: 0; }
.kb-sheet .kb-toc li a.is-active { background: var(--rbg); color: #fff; }
.kb-sheet .kb-toc li.kb-toc-l3 a { padding-left: 28px; font-size: 14px; }

/* ---------- Card hover glow ---------- */
.kb-category-card { box-shadow: 0 0 0 0 transparent; }
.kb-category-card:hover { box-shadow: 0 18px 40px rgba(0,0,0,0.35), 0 0 0 1px var(--accln, var(--rln)); }
.kb-btn:active, .kb-icon-btn:active, .kb-filter:active { transform: scale(.97); }

/* ---------- Responsive video embed ---------- */
.kb-embed { position: relative; aspect-ratio: 16 / 9; margin: 18px 0; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--ln); background: #000; }
.kb-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Policy documents (full text pages) ---------- */
.kb-eyebrow-amber::before { background: var(--am); animation: none; }
.kb-policy-hero { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--lns); }
.kb-policy-hero h1 { font-size: clamp(27px, 3.8vw, 40px); font-weight: 700; margin-top: 16px; }
.kb-policy-hero .kb-article-lede { max-width: 760px; }
.kb-langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.kb-langs a { font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--ln); background: rgba(255,255,255,0.03); color: var(--t2); min-height: 38px; display: inline-flex; align-items: center; }
.kb-langs a:hover { color: #fff; border-color: var(--lnh); }
.kb-langs a.is-active { background: var(--ambg); border-color: var(--amln); color: #fde68a; font-weight: 600; }
.kb-policy-sec { background: linear-gradient(170deg, var(--s2), var(--s1)); border: 1px solid var(--ln); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px) clamp(16px, 3vw, 30px); margin-top: 18px; }
.kb-policy-sec:first-child { margin-top: 0; }
.kb-prose .kb-policy-sec > h2 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: clamp(16px, 2.1vw, 19px); margin-top: 0; padding: 0 0 14px; border-top: 0; border-bottom: 1px solid var(--lns); margin-bottom: 16px; }
.kb-num { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 32px; font-family: var(--font-mono); font-size: 12.5px; color: #fff; background: linear-gradient(135deg, var(--rh), #a3122b); border-radius: 10px; padding: 0 10px; box-shadow: 0 5px 16px rgba(225,29,46,0.3); letter-spacing: 0; }
.kb-plat { color: var(--rs); }
.kb-prose .kb-policy-sec ul ul { margin-top: 8px; gap: 5px; }
.kb-prose .kb-policy-sec li { font-size: 14.5px; }
.kb-prose .kb-policy-sec > h2 .kb-anchor { margin-left: auto; }
.kb-policy-foot { color: var(--t); font-size: 14px; }
.kb-prose .kb-checklist li::before { content: '✓'; color: var(--g); font-weight: 700; }
.kb-isrc-format { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.kb-isrc-part { text-align: center; padding: 14px 10px; border-radius: 12px; border: 1px solid var(--ln); background: rgba(255,255,255,0.03); }
.kb-isrc-code { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--rs); }
.kb-isrc-label { font-size: 12px; color: var(--t); margin-top: 6px; line-height: 1.4; }
.kb-ref-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kb-ref { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--ln); background: rgba(255,255,255,0.03); text-decoration: none !important; color: var(--t); transition: border-color .2s, transform .2s; }
.kb-ref:hover { border-color: var(--rln); transform: translateY(-2px); color: var(--t); }
.kb-ref strong { font-family: var(--font-head); color: var(--w); font-size: 15px; }
.kb-ref span { font-size: 13px; }
.kb-ref em { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--rs); margin-top: 4px; }
/* RTL (Arabic) */
[dir="rtl"] .kb-prose ul li, [dir="rtl"] .kb-prose ol li { padding-left: 0; padding-right: 26px; }
[dir="rtl"] .kb-prose ul li::before { left: auto; right: 8px; }
[dir="rtl"] .kb-prose ol li::before { left: auto; right: 0; }
[dir="rtl"] .kb-prose .kb-policy-sec > h2 .kb-anchor { margin-left: 0; margin-right: auto; }
[dir="rtl"] .kb-callout { border-left: 1px solid var(--cln); }
[dir="rtl"] .kb-breadcrumbs ol, [dir="rtl"] .kb-langs, [dir="rtl"] .kb-article-meta { direction: ltr; }
[dir="rtl"] .kb-prose { font-size: 16px; line-height: 1.9; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.kb-category-grid, .kb-article-grid, .kb-tools-grid { grid-template-columns: repeat(2, 1fr); }
	.kb-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 28px; }
	.kb-layout-article, .kb-layout-no-toc { grid-template-columns: minmax(0, 1fr) 240px; }
	.kb-header-search { width: 190px; }
}
@media (max-width: 900px) {
	.kb-nav { position: absolute; top: 100%; left: 0; right: 0; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); background: var(--bg); padding: 16px var(--gutter) 40px; overflow-y: auto; transform: translateX(-100%); visibility: hidden; transition: transform .25s ease, visibility .25s; z-index: 190; border-top: 1px solid var(--lns); }
	.kb-nav.is-open { transform: translateX(0); visibility: visible; }
	.kb-nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
	.kb-nav-list a, .kb-nav-sub-toggle { width: 100%; justify-content: space-between; padding: 12px 14px; font-size: 15.5px; }
	.kb-nav-sub, .kb-nav-list .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 6px 12px; display: none; min-width: 0; }
	.kb-nav-sub-toggle[aria-expanded="true"] + .kb-nav-sub, .kb-nav-list .menu-item-has-children.is-open > .sub-menu { display: block; }
	.kb-nav-sub { display: block; }
	.kb-nav-sub-toggle { pointer-events: none; font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--m); padding: 14px 14px 4px; }
	.kb-nav-sub-toggle svg { display: none; }
	.kb-nav-sub a { padding: 12px 14px; font-size: 15.5px; }
	.kb-nav-list > li:not(.kb-nav-has-sub) > a { border-top: 1px solid var(--lns); }
	.kb-nav-toggle { display: inline-flex; }
	.kb-header-search { display: none; }
	.kb-search-open { display: inline-flex; }
	.kb-toc-fab { display: inline-flex; }
	.kb-nav-toggle { width: 42px; height: 42px; }
	.kb-filter-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
	.kb-filter-chips::-webkit-scrollbar { display: none; }
	.kb-filter-chips .kb-filter { flex: none; }
	.kb-search-overlay-body .kb-filter-chips, .kb-empty-cats { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
	.kb-hero-quick { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
	.kb-hero-quick::-webkit-scrollbar { display: none; }
	.kb-hero-quick a, .kb-hero-quick span { flex: none; }
	.kb-list-filter { width: 100%; }
	.kb-article::before { width: 100%; }
	.kb-hide-sm { display: none; }
	.kb-layout, .kb-layout-article, .kb-layout-no-toc { grid-template-columns: minmax(0, 1fr); }
	.kb-sidebar:not(.kb-sidebar-article) { order: 2; }
	.kb-sidebar-article { display: none; }
	.kb-toc-inline { display: block; }
	.kb-contact { grid-template-columns: 1fr; }
	.kb-footer-grid { grid-template-columns: 1fr 1fr; }
	.kb-docs-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	:root { --gutter: 16px; }
	body.ans-hd { font-size: 15px; }
	.kb-header-inner { height: 60px; gap: 10px; }
	:root { --header-h: 60px; }
	body.admin-bar { --header-h: 106px; }
	.kb-brand-badge { display: none; }
	.kb-brand img, .kb-brand .kb-logo { height: 30px; max-height: 30px; max-width: 140px; }
	.kb-btn-primary.kb-btn { padding: 9px 13px; font-size: 13px; }
	.kb-header-actions { gap: 8px; }
	.kb-btn-ticket { width: 42px; height: 42px; padding: 0; border-radius: 12px; }
	.kb-btn-ticket span { display: none; }
	.kb-btn-ticket svg { display: block; }
	.kb-breadcrumbs ol { flex-wrap: nowrap; white-space: nowrap; }
	.kb-breadcrumbs li { flex: none; }
	.kb-breadcrumbs li[aria-current] { flex: 1 1 auto; min-width: 0; }
	.kb-breadcrumbs li[aria-current] span { display: block; overflow: hidden; text-overflow: ellipsis; }
	.kb-article-head h1 { font-size: 26px; }
	.kb-article-meta { gap: 6px 14px; }
	.kb-feedback-ask { flex-direction: column; align-items: stretch; }
	.kb-feedback-btns .kb-btn { flex: 1; min-height: 46px; }
	.kb-prevnext { grid-template-columns: 1fr; }
	.kb-prevnext-link.kb-next { text-align: left; align-items: flex-start; }
	.kb-contact-card { min-height: 60px; }
	.kb-search-browse-grid { grid-template-columns: 1fr; }
	.kb-recent-list a { grid-template-columns: 1fr auto; }
	.kb-recent-list .kb-chip { display: none; }
	.kb-side-nav a, .kb-toc li a, .kb-category-links a, .kb-footer-col a { min-height: 40px; display: flex; align-items: center; }
	.kb-top { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
	.kb-article .kb-top { bottom: calc(70px + env(safe-area-inset-bottom)); }
	.kb-facts { padding: 14px; }
	.kb-isrc-format { grid-template-columns: 1fr 1fr; }
	.kb-ref-grid { grid-template-columns: 1fr; }
	.kb-policy-sec { padding: 16px 14px; }
	.kb-prose .kb-facts ul { grid-template-columns: 1fr; gap: 10px; }
	.kb-callout { padding: 12px 14px; }
	.kb-prose pre { font-size: 12.5px; padding: 34px 14px 14px; border-radius: 12px; }
	.kb-screenshot-placeholder .kb-screenshot-inner { min-height: 120px; }
	.kb-category-grid, .kb-article-grid, .kb-tools-grid, .kb-related-grid, .kb-contact-grid, .kb-dodont { grid-template-columns: minmax(0, 1fr); }
	.kb-category-card { grid-column: auto; }
	.kb-hero { padding-top: 44px; }
	.kb-search-hero input { padding: 15px 16px 15px 46px; font-size: 15px; }
	.kb-search-kbd { display: none; }
	.kb-archive-head { flex-direction: column; align-items: flex-start; gap: 12px; }
	.kb-prose { font-size: 15px; }
	.kb-prose h2 { margin-top: 34px; }
	.kb-feedback { padding: 18px; }
	.kb-footer-grid { grid-template-columns: 1fr; gap: 26px; }
	.kb-faq-controls { position: static; }
	.kb-endpoint { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
	.kb-header, .kb-footer, .kb-sidebar, .kb-feedback, .kb-contact, .kb-top, .kb-hero-search, .kb-nav-toggle { display: none !important; }
	body.ans-hd { background: #fff; color: #111; }
	h1, h2, h3, h4, .kb-prose p, .kb-prose li { color: #111; }
	.kb-prose a { color: #b91c1c; }
}
