/**
 * Kababayan Connect — UI components.
 *
 * Ported from the v21 design prototype. Loaded after tokens.css. Uses the
 * design tokens defined there (--kbn-blue, --kbn-ink, etc.) so visual
 * changes can be made by editing tokens, not by digging through here.
 *
 * Naming: every class is prefixed with `kbn-` to avoid colliding with any
 * theme styles that might somehow leak through (the homepage template
 * bypasses the theme, but plugins cannot fully assume so we namespace
 * defensively).
 */

/* ---------- Theme reset ----------
 * The active WordPress theme (e.g. Twenty Twenty-Five) sets `main { display: grid; … }`
 * globally. Even though we use template_include to bypass theme markup, the theme's
 * stylesheet is still enqueued and its global selectors leak into our templates,
 * shoving our content into unintended grid columns. Force any plugin-owned <main>
 * back to normal block flow.
 */
body main.kbn-events,
body main.kbn-listing,
body main.kbn-home,
body main.kbn-dashboard,
body main.kbn-page {
	display: block;
	grid-template-columns: none;
	grid-template-rows: none;
	max-width: var(--kbn-max-page);
	margin: 0 auto;
	gap: 0;
}

/* ---------- Topbar ---------- */
.kbn-topbar { border-bottom: 1px solid var(--kbn-rule); position: sticky; top: 0; z-index: var(--kbn-z-sticky); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); background: rgba(255,255,255,0.92); }
.kbn-topbar__inner { max-width: var(--kbn-max-page); margin: 0 auto; padding: 16px 32px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 32px; }
.kbn-topnav { display: flex; gap: 20px; font-size: 14px; align-items: center; justify-content: center; }
.kbn-topnav a { color: var(--kbn-ink-2); border-bottom: none; text-decoration: none; transition: color 120ms ease; }
.kbn-topnav a:hover { color: var(--kbn-ink); }
.kbn-topnav a.kbn-topnav__link--active,
.kbn-topnav a[aria-current="page"] { color: var(--kbn-ink); font-weight: 600; position: relative; }
.kbn-topnav a[aria-current="page"]::after { content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 2px; background: var(--kbn-blue); border-radius: 1px; }
.kbn-topbar__right { display: flex; align-items: center; gap: 12px; }

/* ---------- Buttons ---------- */
.kbn-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 999px; font-family: inherit; font-size: 13.5px; font-weight: 500; text-decoration: none; border: 1px solid transparent; transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease; cursor: pointer; line-height: 1; white-space: nowrap; }
.kbn-btn--ghost { color: var(--kbn-ink); border-color: var(--kbn-rule); background: transparent; }
.kbn-btn--ghost:hover { border-color: var(--kbn-ink); }
.kbn-btn--primary { color: #fff; background: var(--kbn-blue); border-color: var(--kbn-blue); }
.kbn-btn--primary:hover { background: var(--kbn-blue-deep, #002878); border-color: var(--kbn-blue-deep, #002878); transform: translateY(-1px); }
.kbn-btn--accent {
	color: #fff;
	background: var(--kbn-ink);
	border-color: var(--kbn-ink);
	font-weight: 600;
	box-shadow: 0 1px 0 rgba(11,14,19,0.04), 0 4px 12px -4px rgba(11,14,19,0.25);
}
.kbn-btn--accent:hover { background: #1A1F2A; border-color: #1A1F2A; transform: translateY(-1px); }
.kbn-btn--lg { padding: 12px 24px; font-size: 14px; }

/* ---------- Hamburger ---------- */
.kbn-menu-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--kbn-rule); border-radius: 4px; background: var(--kbn-canvas, #fff); color: var(--kbn-ink); cursor: pointer; align-items: center; justify-content: center; transition: border-color 120ms ease; }
.kbn-menu-btn:hover { border-color: var(--kbn-ink); }

@media (max-width: 1024px) {
	.kbn-topnav { display: none; }
	.kbn-menu-btn { display: inline-flex; }
	.kbn-btn[data-kbn-action="connect-expert"], .kbn-btn[data-kbn-action="write-review"] { display: none; }
}
@media (max-width: 600px) {
	.kbn-topbar__inner { padding: 12px 20px; gap: 12px; }
	.kbn-topbar__right .kbn-btn:not(.kbn-btn--primary) { display: none; }
}

/* ---------- Mobile drawer ---------- */
.kbn-drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(11,14,19,0.45); display: none; animation: kbn-fade-in 180ms ease; }
.kbn-drawer-backdrop[data-open="true"] { display: block; }
@keyframes kbn-fade-in { from { opacity: 0; } to { opacity: 1; } }

.kbn-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; width: min(360px, 86vw); background: var(--kbn-canvas, #fff); transform: translateX(100%); transition: transform 240ms ease; display: flex; flex-direction: column; padding: 24px; overflow-y: auto; }
.kbn-drawer[data-open="true"] { transform: translateX(0); }
.kbn-drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.kbn-drawer__nav { display: flex; flex-direction: column; gap: 4px; padding-bottom: 20px; border-bottom: 1px solid var(--kbn-rule); }
.kbn-drawer__nav a { padding: 12px 4px; color: var(--kbn-ink); border-bottom: none; font-size: 16px; text-decoration: none; }
.kbn-drawer__nav a:hover { color: var(--kbn-blue); }
.kbn-drawer__actions { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; }
.kbn-drawer__actions .kbn-btn { width: 100%; padding: 14px 16px; font-size: 14px; }

/* ---------- Modal close button (shared) ---------- */
.kbn-modal__close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; display: grid; place-items: center; border: none; background: transparent; cursor: pointer; color: var(--kbn-ink-3); border-radius: 4px; transition: background 120ms ease, color 120ms ease; }
.kbn-modal__close:hover { background: var(--kbn-canvas-2, #f8f9fb); color: var(--kbn-ink); }
/* When the close button is reused in the drawer head it doesn't need absolute positioning. */
.kbn-drawer__head .kbn-modal__close { position: static; }

/* ========== Voices section ========== */
.kbn-voices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 1024px) { .kbn-voices { grid-template-columns: repeat(2, 1fr); gap: 28px; } }
@media (max-width: 700px) { .kbn-voices { grid-template-columns: 1fr; gap: 24px; } }

.kbn-voice {
	display: flex; flex-direction: column;
	padding: 32px 4px 0;
	text-decoration: none; color: inherit;
	border-top: 1px solid var(--kbn-ink);
	transition: opacity 160ms ease;
}
.kbn-voice:hover { opacity: 0.85; }

.kbn-voice__stars { display: inline-flex; gap: 2px; color: var(--kbn-gold); margin-bottom: 18px; }
.kbn-voice__quote {
	font-family: var(--kbn-font-display); font-weight: 400;
	font-size: 1.5rem; line-height: 1.3; letter-spacing: -0.012em;
	color: var(--kbn-ink); margin: 0 0 24px;
}
.kbn-voice__quote::before {
	content: '"'; display: block;
	font-size: 3rem; line-height: 0.6; color: var(--kbn-blue);
	margin-bottom: 8px; font-family: var(--kbn-font-display);
}
.kbn-voice__attribution { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--kbn-rule); display: flex; align-items: center; gap: 12px; }
.kbn-voice__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--kbn-blue); color: #fff; display: grid; place-items: center; font-family: var(--kbn-font-display); font-weight: 500; font-size: 15px; flex-shrink: 0; }
.kbn-voice__author { font-size: 14px; font-weight: 500; color: var(--kbn-ink); margin: 0; line-height: 1.3; }
.kbn-voice__listing { font-size: 12.5px; color: var(--kbn-ink-3); margin: 2px 0 0; line-height: 1.3; }
.kbn-voice__listing strong { color: var(--kbn-ink-2); font-weight: 500; }

.kbn-voices-foot { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--kbn-rule); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.kbn-voices-foot__copy { font-size: 14px; color: var(--kbn-ink-2); max-width: 60ch; }

/* ========== Modal chrome (shared by auth, review, signup, event) ========== */
.kbn-modal-backdrop {
	position: fixed; inset: 0; z-index: 100;
	background: rgba(11,14,19,0.55);
	backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
	display: none;
	align-items: center; justify-content: center;
	padding: 24px;
	animation: kbn-fade-in 180ms ease;
}
.kbn-modal-backdrop[data-open="true"] { display: flex; }
@keyframes kbn-pop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.kbn-modal {
	background: var(--kbn-canvas, #fff);
	border-radius: 4px;
	width: 100%; max-width: 440px;
	padding: 40px 36px 32px;
	position: relative;
	animation: kbn-pop-in 220ms ease;
	box-shadow: 0 20px 60px rgba(11,14,19,0.18);
	max-height: calc(100vh - 48px); overflow-y: auto;
}
.kbn-modal--wide { max-width: 880px; padding: 40px 44px 32px; }
@media (max-width: 760px) { .kbn-modal--wide { padding: 32px 24px 24px; } }

.kbn-modal__eyebrow {
	font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
	color: var(--kbn-ink-3); margin: 0 0 12px;
	display: inline-flex; align-items: center; gap: 12px;
}
.kbn-modal__eyebrow::before { content: ''; display: inline-block; width: 24px; height: 2px; background: var(--kbn-gold); }
.kbn-modal__title {
	font-family: var(--kbn-font-display); font-weight: 500; font-size: 1.625rem;
	line-height: 1.15; letter-spacing: -0.018em;
	color: var(--kbn-ink); margin: 0 0 12px;
}
.kbn-modal__lede { font-size: 14px; color: var(--kbn-ink-2); line-height: 1.5; margin: 0 0 28px; }
.kbn-modal__fineprint { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--kbn-rule); font-size: 12px; color: var(--kbn-ink-3); line-height: 1.55; }
.kbn-modal__fineprint a { color: var(--kbn-ink-2); }
.kbn-modal__footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--kbn-rule); flex-wrap: wrap; }

/* ========== Auth providers ========== */
.kbn-auth-providers { display: flex; flex-direction: column; gap: 10px; }
.kbn-auth-btn {
	display: flex; align-items: center; gap: 12px;
	width: 100%; padding: 13px 16px;
	border: 1px solid var(--kbn-rule); border-radius: 4px;
	background: var(--kbn-canvas, #fff); color: var(--kbn-ink);
	font: inherit; font-size: 14.5px; font-weight: 500;
	cursor: pointer;
	transition: border-color 120ms ease, background 120ms ease;
}
.kbn-auth-btn:hover { border-color: var(--kbn-ink); background: var(--kbn-canvas-2, #f8f9fb); }
.kbn-auth-btn__label { flex: 1; text-align: left; }

/* ----- Auth modal email view ----- */
.kbn-auth-email-view { display: flex; flex-direction: column; gap: 12px; }
.kbn-auth-email-label { font-size: 13px; font-weight: 500; color: var(--kbn-ink-2); }
.kbn-auth-email-input {
	width: 100%; padding: 11px 14px; box-sizing: border-box;
	border: 1.5px solid var(--kbn-rule); border-radius: 6px;
	font: inherit; font-size: 14px; color: var(--kbn-ink);
	background: var(--kbn-canvas, #fff);
	transition: border-color .15s, box-shadow .15s;
}
.kbn-auth-email-input:focus { outline: none; border-color: var(--kbn-blue); box-shadow: 0 0 0 3px rgba(0,56,168,.1); }
.kbn-auth-email-submit {
	width: 100%; padding: 12px; border: none; border-radius: 6px;
	background: var(--kbn-blue); color: #fff;
	font: inherit; font-size: 14px; font-weight: 600;
	cursor: pointer; transition: background .15s;
}
.kbn-auth-email-submit:hover:not(:disabled) { background: #002e8a; }
.kbn-auth-email-submit:disabled { opacity: .55; cursor: wait; }
.kbn-auth-email-msg { font-size: 13px; color: var(--kbn-ink-2); min-height: 18px; text-align: center; }
.kbn-auth-email-msg--success { color: #1a7a3f; font-weight: 500; }
.kbn-auth-email-msg--error   { color: var(--kbn-red, #c0392b); }
.kbn-auth-email-back {
	display: flex; align-items: center; justify-content: center; gap: 5px;
	padding: 0; border: none; background: none;
	font: inherit; font-size: 13px; color: var(--kbn-ink-2);
	cursor: pointer; margin-top: 4px;
}
.kbn-auth-email-back:hover { color: var(--kbn-blue); }

/* ========== Review form ========== */
.kbn-reviewer-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 24px; background: var(--kbn-canvas-2, #f8f9fb); border: 1px solid var(--kbn-rule); border-radius: 4px; }
.kbn-reviewer-strip__avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--kbn-blue); color: #fff; display: grid; place-items: center; font-family: var(--kbn-font-display); font-size: 14px; font-weight: 500; }
.kbn-reviewer-strip__name { font-size: 14px; font-weight: 500; color: var(--kbn-ink); }
.kbn-reviewer-strip__meta { font-size: 12px; color: var(--kbn-ink-3); }

.kbn-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .kbn-form-grid { grid-template-columns: 1fr; gap: 20px; } }

.kbn-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.kbn-field__label { font-size: 14px; font-weight: 500; color: var(--kbn-ink); }
.kbn-field__hint { font-size: 12px; color: var(--kbn-ink-3); margin-top: -2px; }
.kbn-field__error { font-size: 12px; color: var(--kbn-red); margin-top: 4px; display: none; }
.kbn-field--invalid .kbn-field__error { display: block; }

.kbn-text-input, .kbn-select-input, .kbn-textarea-input {
	width: 100%; padding: 11px 14px;
	border: 1px solid var(--kbn-rule); border-radius: 4px;
	font: inherit; font-size: 14.5px; color: var(--kbn-ink);
	background: var(--kbn-canvas, #fff);
	transition: border-color 120ms ease, box-shadow 120ms ease;
}
.kbn-text-input:focus, .kbn-select-input:focus, .kbn-textarea-input:focus { outline: none; border-color: var(--kbn-blue); box-shadow: 0 0 0 3px rgba(0,56,168,0.08); }
.kbn-textarea-input { min-height: 120px; resize: vertical; font-family: inherit; line-height: 1.5; }
.kbn-field--invalid .kbn-text-input, .kbn-field--invalid .kbn-select-input, .kbn-field--invalid .kbn-textarea-input { border-color: var(--kbn-red); }

.kbn-radio-row { display: flex; gap: 12px; }
.kbn-radio-pill { flex: 1; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--kbn-rule); border-radius: 4px; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; font-size: 14.5px; }
.kbn-radio-pill:hover { border-color: var(--kbn-ink); }
.kbn-radio-pill input { accent-color: var(--kbn-blue); }
.kbn-radio-pill:has(input:checked) { border-color: var(--kbn-blue); background: rgba(0,56,168,0.04); }

.kbn-check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--kbn-ink-2); cursor: pointer; }
.kbn-check-row input { accent-color: var(--kbn-blue); }

/* Stars */
.kbn-stars { display: inline-flex; gap: 4px; }
.kbn-stars button { background: transparent; border: none; cursor: pointer; padding: 4px; color: var(--kbn-ink-4); transition: color 100ms ease, transform 100ms ease; line-height: 0; }
.kbn-stars button:hover { transform: scale(1.08); }
.kbn-stars[data-hover-up-to="1"] button:nth-child(-n+1),
.kbn-stars[data-hover-up-to="2"] button:nth-child(-n+2),
.kbn-stars[data-hover-up-to="3"] button:nth-child(-n+3),
.kbn-stars[data-hover-up-to="4"] button:nth-child(-n+4),
.kbn-stars[data-hover-up-to="5"] button:nth-child(-n+5),
.kbn-stars[data-rating="1"] button:nth-child(-n+1),
.kbn-stars[data-rating="2"] button:nth-child(-n+2),
.kbn-stars[data-rating="3"] button:nth-child(-n+3),
.kbn-stars[data-rating="4"] button:nth-child(-n+4),
.kbn-stars[data-rating="5"] button:nth-child(-n+5) { color: var(--kbn-gold); }
.kbn-stars-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.kbn-stars-label { font-size: 13px; color: var(--kbn-ink-2); font-weight: 500; min-width: 12ch; }

/* Listing autocomplete */
.kbn-autocomplete { position: relative; }
.kbn-autocomplete__list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 10; background: var(--kbn-canvas, #fff); border: 1px solid var(--kbn-rule); border-radius: 4px; max-height: 280px; overflow-y: auto; box-shadow: 0 8px 24px rgba(11,14,19,0.08); display: none; }
.kbn-autocomplete__list[data-open="true"] { display: block; }
.kbn-autocomplete__item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--kbn-rule); }
.kbn-autocomplete__item:last-child { border-bottom: none; }
.kbn-autocomplete__item:hover { background: var(--kbn-canvas-2, #f8f9fb); }
.kbn-autocomplete__avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--kbn-blue); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.kbn-autocomplete__name { font-size: 14px; color: var(--kbn-ink); }
.kbn-autocomplete__meta { font-size: 12px; color: var(--kbn-ink-3); }
.kbn-autocomplete__empty { padding: 14px; font-size: 13px; color: var(--kbn-ink-3); text-align: center; }
.kbn-autocomplete__pill { margin-left: auto; font-size: 10px; padding: 2px 6px; background: var(--kbn-gold); color: var(--kbn-ink); border-radius: 999px; font-weight: 600; letter-spacing: 0.04em; }

.kbn-selected-listing { display: none; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--kbn-blue); border-radius: 4px; background: rgba(0,56,168,0.04); }
.kbn-selected-listing[data-active="true"] { display: flex; }
.kbn-selected-listing__avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--kbn-blue); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.kbn-selected-listing__clear { margin-left: auto; background: transparent; border: none; color: var(--kbn-ink-3); cursor: pointer; padding: 4px; font-size: 18px; line-height: 1; }
.kbn-selected-listing__clear:hover { color: var(--kbn-ink); }

.kbn-publish-notice {
	display: flex; gap: 12px; align-items: flex-start;
	padding: 14px 16px; margin: 24px 0 0;
	background: rgba(0, 56, 168, 0.05);
	border: 1px solid rgba(0, 56, 168, 0.18);
	border-radius: 4px;
	font-size: 13px; color: var(--kbn-ink-2); line-height: 1.5;
}
.kbn-publish-notice svg { flex-shrink: 0; color: var(--kbn-blue); margin-top: 1px; }
.kbn-publish-notice strong { color: var(--kbn-ink); font-weight: 600; }

.kbn-char-count { font-size: 12px; color: var(--kbn-ink-3); }
.kbn-char-count[data-state="under"] { color: var(--kbn-red); }

.kbn-form-step { display: none; }
.kbn-form-step[data-active="true"] { display: block; }

.kbn-success { text-align: center; padding: 24px 8px 8px; }
.kbn-success__icon { width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%; background: rgba(0,56,168,0.08); color: var(--kbn-blue); display: grid; place-items: center; }
.kbn-success__title { font-family: var(--kbn-font-display); font-weight: 500; font-size: 1.5rem; color: var(--kbn-ink); margin: 0 0 12px; }
.kbn-success__lede { font-size: 14.5px; color: var(--kbn-ink-2); line-height: 1.55; margin: 0 0 28px; max-width: 44ch; margin-left: auto; margin-right: auto; }

/* ========== Cities — image cards ========== */
.kbn-cities { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .kbn-cities { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .kbn-cities { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .kbn-cities { grid-template-columns: 1fr; } }
.kbn-city-card {
	position: relative; overflow: hidden;
	aspect-ratio: 4 / 5;
	border-radius: 4px; text-decoration: none; color: inherit;
	display: block;
	background: var(--kbn-canvas-3, #eff1f5);
	transition: transform 240ms ease;
	border-bottom: none !important;
}
.kbn-city-card:hover { transform: translateY(-3px); }
.kbn-city-card img {
	position: absolute; inset: 0;
	width: 100%; height: 100%; object-fit: cover;
	transition: transform 600ms ease, filter 240ms ease;
	filter: contrast(1.06) saturate(0.95);
}
.kbn-city-card:hover img { transform: scale(1.05); filter: contrast(1.1) saturate(1); }
.kbn-city-card::after {
	content: ''; position: absolute; inset: 0;
	background: linear-gradient(to top, rgba(11,14,19,0.78) 0%, rgba(11,14,19,0.15) 50%, transparent 80%);
	pointer-events: none;
}
.kbn-city-card__body {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
	padding: 22px 20px;
	color: #fff;
}
.kbn-city-card__name { font-family: var(--kbn-font-display); font-weight: 500; font-size: 1.5rem; line-height: 1.1; letter-spacing: -0.018em; margin: 0 0 4px; }
.kbn-city-card__meta { font-size: 12.5px; color: rgba(255,255,255,0.85); font-variant-numeric: tabular-nums; display: flex; gap: 10px; flex-wrap: wrap; }
.kbn-city-card__meta span::after { content: '·'; margin-left: 10px; color: rgba(255,255,255,0.5); }
.kbn-city-card__meta span:last-child::after { content: ''; margin: 0; }

/* ========== Events ========== */
.kbn-events { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
@media (max-width: 1024px) { .kbn-events { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px)  { .kbn-events { grid-template-columns: 1fr; } }

.kbn-event-card {
	display: flex; flex-direction: column;
	border: 1px solid var(--kbn-rule); border-radius: 2px;
	background: var(--kbn-canvas, #fff);
	overflow: hidden; text-decoration: none; color: inherit;
	transition: border-color 200ms ease, transform 200ms ease;
}
.kbn-event-card:hover { border-color: var(--kbn-blue); transform: translateY(-2px); }
.kbn-event-card--featured { grid-row: span 2; }
@media (max-width: 1024px) { .kbn-event-card--featured { grid-row: auto; grid-column: span 2; } }
@media (max-width: 600px)  { .kbn-event-card--featured { grid-column: auto; } }

.kbn-event-card__media { aspect-ratio: 5 / 3; background: linear-gradient(135deg, var(--kbn-canvas-2, #f8f9fb) 0%, var(--kbn-canvas-3, #eff1f5) 100%); position: relative; overflow: hidden; }
.kbn-event-card--featured .kbn-event-card__media { aspect-ratio: 5 / 4; }
.kbn-event-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 600ms ease; filter: contrast(1.04) saturate(0.98); }
.kbn-event-card:hover .kbn-event-card__media img { transform: scale(1.04); }

.kbn-event-date {
	position: absolute; top: 16px; left: 16px;
	background: var(--kbn-canvas, #fff); color: var(--kbn-ink);
	padding: 8px 12px; border-radius: 2px;
	text-align: center; line-height: 1;
	font-variant-numeric: tabular-nums;
	box-shadow: 0 2px 8px rgba(11,14,19,0.12);
}
.kbn-event-date__day { font-family: var(--kbn-font-display); font-weight: 500; font-size: 1.5rem; display: block; }
.kbn-event-date__month { font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--kbn-ink-2); display: block; margin-top: 2px; }

.kbn-event-card__pill {
	position: absolute; top: 16px; right: 16px;
	padding: 4px 10px; background: rgba(11,14,19,0.85);
	color: #fff; font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
	border-radius: 999px; backdrop-filter: blur(4px);
}

.kbn-event-card__body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.kbn-event-card--featured .kbn-event-card__body { padding: 28px 28px 32px; }
.kbn-event-card__category { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--kbn-ink-3); }
.kbn-event-card__title { font-family: var(--kbn-font-display); font-weight: 500; font-size: 1.18rem; line-height: 1.2; letter-spacing: -0.012em; color: var(--kbn-ink); margin: 0; }
.kbn-event-card--featured .kbn-event-card__title { font-size: 1.875rem; line-height: 1.1; letter-spacing: -0.022em; }
.kbn-event-card__lede { font-size: 14px; color: var(--kbn-ink-2); line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kbn-event-card--featured .kbn-event-card__lede { font-size: 15px; line-height: 1.6; -webkit-line-clamp: 8; }
.kbn-event-card__meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--kbn-rule); font-size: 12.5px; color: var(--kbn-ink-3); display: flex; justify-content: space-between; gap: 12px; }
.kbn-event-card__org { color: var(--kbn-ink-2); }

.kbn-events-invite {
	margin-top: 32px; padding: 28px 32px;
	border: 1px solid var(--kbn-rule); border-radius: 4px;
	background: var(--kbn-canvas-2, #f8f9fb);
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	flex-wrap: wrap;
}
.kbn-events-invite__copy { max-width: 60ch; }
.kbn-events-invite__title { font-family: var(--kbn-font-display); font-weight: 500; font-size: 1.18rem; line-height: 1.2; color: var(--kbn-ink); margin: 0 0 6px; }
.kbn-events-invite__lede { font-size: 14px; color: var(--kbn-ink-2); line-height: 1.5; margin: 0; }

/* ========== Signup wizard ========== */
.kbn-signup-progress { display: flex; gap: 6px; margin-bottom: 28px; }
.kbn-signup-progress span { flex: 1; height: 3px; background: var(--kbn-canvas-3, #eff1f5); border-radius: 999px; transition: background 200ms ease; }
.kbn-signup-progress span[data-on="true"] { background: var(--kbn-blue); }

.kbn-path-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 640px) { .kbn-path-tiles { grid-template-columns: 1fr; } }
.kbn-path-tile {
	display: flex; flex-direction: column; gap: 12px;
	padding: 28px 24px;
	border: 1px solid var(--kbn-rule); border-radius: 4px;
	background: var(--kbn-canvas, #fff); cursor: pointer; text-align: left; font: inherit;
	transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.kbn-path-tile:hover { border-color: var(--kbn-blue); background: var(--kbn-canvas-2, #f8f9fb); transform: translateY(-2px); }
.kbn-path-tile__icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--kbn-blue); background: rgba(0,56,168,0.06); border-radius: 4px; }
.kbn-path-tile__title { font-family: var(--kbn-font-display); font-weight: 500; font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.012em; color: var(--kbn-ink); margin: 0; }
.kbn-path-tile__desc { font-size: 13.5px; color: var(--kbn-ink-2); line-height: 1.5; margin: 0; }
.kbn-path-tile__meta { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--kbn-rule); font-size: 11px; color: var(--kbn-ink-3); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }

.kbn-profession-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
@media (max-width: 640px) { .kbn-profession-grid { grid-template-columns: 1fr; } }
.kbn-profession-card {
	display: flex; flex-direction: column; gap: 4px;
	padding: 14px 16px;
	border: 1px solid var(--kbn-rule); border-radius: 4px;
	background: var(--kbn-canvas, #fff); cursor: pointer; text-align: left; font: inherit;
	transition: border-color 120ms ease, background 120ms ease;
}
.kbn-profession-card:hover { border-color: var(--kbn-ink); background: var(--kbn-canvas-2, #f8f9fb); }
.kbn-profession-card[data-active="true"] { border-color: var(--kbn-blue); background: rgba(0,56,168,0.04); }
.kbn-profession-card__name { font-size: 14.5px; font-weight: 500; color: var(--kbn-ink); }
.kbn-profession-card__register { font-size: 11.5px; color: var(--kbn-ink-3); }

.kbn-step-back {
	display: inline-flex; align-items: center; gap: 6px;
	background: transparent; border: none; cursor: pointer;
	color: var(--kbn-ink-2); font: inherit; font-size: 13px;
	padding: 4px 0; margin-bottom: 12px;
}
.kbn-step-back:hover { color: var(--kbn-ink); }

/* Logo upload zone */
.kbn-logo-drop {
	display: flex; align-items: center; gap: 14px;
	padding: 14px;
	border: 1.5px dashed var(--kbn-rule); border-radius: 4px;
	background: var(--kbn-canvas-2, #f8f9fb);
	cursor: pointer;
	transition: border-color 120ms ease, background 120ms ease;
}
.kbn-logo-drop:hover { border-color: var(--kbn-blue); background: rgba(0,56,168,0.04); }
.kbn-logo-drop input[type="file"] { display: none; }
.kbn-logo-drop__preview {
	width: 56px; height: 56px; border-radius: 4px;
	background: var(--kbn-canvas-3, #eff1f5); flex-shrink: 0;
	display: grid; place-items: center;
	color: var(--kbn-ink-3);
	overflow: hidden; position: relative;
}
.kbn-logo-drop__preview img { width: 100%; height: 100%; object-fit: cover; }
.kbn-logo-drop__copy { display: flex; flex-direction: column; gap: 2px; }
.kbn-logo-drop__title { font-size: 13.5px; font-weight: 500; color: var(--kbn-ink); }
.kbn-logo-drop__hint { font-size: 12px; color: var(--kbn-ink-3); }

/* Photo confirm strip (community profile) */
.kbn-photo-confirm {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 14px;
	background: var(--kbn-canvas-2, #f8f9fb); border: 1px solid var(--kbn-rule); border-radius: 4px;
}
.kbn-photo-confirm__avatar {
	width: 48px; height: 48px; border-radius: 50%;
	background: var(--kbn-blue); color: #fff;
	display: grid; place-items: center;
	font-family: var(--kbn-font-display); font-size: 18px; font-weight: 500;
	flex-shrink: 0;
}
.kbn-photo-confirm__name { font-size: 14px; font-weight: 500; color: var(--kbn-ink); }
.kbn-photo-confirm__source { font-size: 12px; color: var(--kbn-ink-3); }

/* ========== Wordmark logo ========== */
/* Sits inline with the existing Fraunces wordmark text. The image is square
 * with transparent background so it composes against any canvas tone. We
 * intentionally keep it small so the wordmark text remains the primary
 * visual identity — the logo is a supporting glyph, not the lockup. */
.kbn-wm {
	display: inline-flex;
	align-items: baseline;
	gap: 10px;
	font-family: var(--kbn-font-display);
	color: var(--kbn-ink);
	line-height: 1;
	text-decoration: none;
	border-bottom: none !important;
}
.kbn-wm__primary {
	font-weight: 600;
	font-size: 1.5rem;
	letter-spacing: -0.02em;
	font-variation-settings: "opsz" 144;
}
.kbn-wm__secondary {
	font-style: italic;
	font-weight: 400;
	font-size: 1.18rem;
	color: var(--kbn-ink-2);
	font-variation-settings: "opsz" 144;
}
.kbn-wm__logo {
	width: 32px; height: 32px;
	display: block; flex-shrink: 0;
	object-fit: contain;
	border-radius: 4px;
	align-self: center;
}
@media (max-width: 600px) {
	.kbn-wm__logo { width: 28px; height: 28px; }
	.kbn-wm__primary { font-size: 1.25rem; }
	.kbn-wm__secondary { font-size: 1rem; }
}

/* ========== Connect with an Expert — distinguished pill ========== */
/* This is the only nav item that's also a CTA — sitting among plain text
 * links risks invisibility. Pill style with blue tint + small "expert"
 * glyph (person with badge) gives it priority without competing with the
 * dark "Write a Review" or primary-blue "Join free" buttons in the right
 * cluster. Stays in the topnav so it's perceived as discovery, not auth. */
.kbn-expert-pill {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 12px;
	margin-left: 4px;
	border-radius: 999px;
	border: 1px solid rgba(0, 56, 168, 0.25) !important;
	background: rgba(0, 56, 168, 0.06);
	color: var(--kbn-blue) !important;
	font-weight: 500;
	font-size: 13px;
	line-height: 1.4;
	transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
	position: relative;
}
.kbn-expert-pill:hover {
	background: var(--kbn-blue);
	border-color: var(--kbn-blue) !important;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px -4px rgba(0,56,168,0.4);
}
.kbn-expert-pill svg { flex-shrink: 0; }

/* Subtle pulse to draw the eye in the first second of page load. The
 * keyframe runs once, then stays still — animation as signal, not noise. */
@keyframes kbn-expert-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(0, 56, 168, 0.35); }
	60%  { box-shadow: 0 0 0 8px rgba(0, 56, 168, 0); }
	100% { box-shadow: 0 0 0 0 rgba(0, 56, 168, 0); }
}
.kbn-expert-pill { animation: kbn-expert-pulse 2400ms ease-out 800ms 1; }
@media (prefers-reduced-motion: reduce) { .kbn-expert-pill { animation: none; } }

/* The drawer version is a full-width btn instead, so it doesn't need the pill.
 * Make sure pill styles don't bleed into the drawer button if anything cascades. */
.kbn-drawer__actions .kbn-expert-pill { display: none; }

/* ========== Chips (multi-select tag UI) ========== */
.kbn-chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.kbn-chip {
	padding: 8px 14px; border: 1px solid var(--kbn-rule); border-radius: 999px;
	background: var(--kbn-canvas, #fff); font: inherit; font-size: 13.5px; color: var(--kbn-ink);
	cursor: pointer;
	transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.kbn-chip:hover { border-color: var(--kbn-ink); }
.kbn-chip[data-active="true"] {
	border-color: var(--kbn-blue); background: var(--kbn-blue); color: #fff;
}

/* ========== Progress bar (Connect with an Expert) ========== */
.kbn-progress-bar {
	position: relative;
	height: 4px;
	background: var(--kbn-canvas-3, #eff1f5);
	border-radius: 999px;
	margin: 4px 0 32px;
	overflow: visible;
}
.kbn-progress-bar__fill {
	height: 100%;
	background: var(--kbn-ink);
	border-radius: 999px;
	transition: width 280ms ease;
}
.kbn-progress-bar__label {
	position: absolute; top: -22px; left: 0;
	font-size: 12.5px; font-weight: 600; color: var(--kbn-ink-2);
	font-variant-numeric: tabular-nums;
}

/* ========== Question blocks — show only the active profession ========== */
.kbn-q-block { display: none; }
.kbn-q-block[data-active="true"] { display: block; }

/* ========== Match cards (Step 5) ========== */
.kbn-match-list { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 8px 0 28px; }

.kbn-match {
	display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
	padding: 18px 20px;
	border: 1px solid var(--kbn-rule); border-radius: 4px;
	background: var(--kbn-canvas, #fff);
	transition: border-color 120ms ease, background 120ms ease;
	cursor: pointer;
}
.kbn-match:hover { border-color: var(--kbn-ink); }
.kbn-match[data-selected="true"] { border-color: var(--kbn-blue); background: rgba(0,56,168,0.04); }

.kbn-match__check {
	width: 22px; height: 22px;
	border: 2px solid var(--kbn-rule); border-radius: 4px;
	display: grid; place-items: center;
	color: transparent;
	transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
	flex-shrink: 0;
}
.kbn-match[data-selected="true"] .kbn-match__check { border-color: var(--kbn-blue); background: var(--kbn-blue); color: #fff; }

.kbn-match__avatar {
	width: 56px; height: 56px; border-radius: 50%;
	background: var(--kbn-blue); color: #fff;
	display: grid; place-items: center;
	font-family: var(--kbn-font-display); font-size: 20px; font-weight: 500;
	flex-shrink: 0;
	grid-column: 2;
	margin-right: -8px;
}
.kbn-match__body { grid-column: 2; }
.kbn-match__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kbn-match__name { font-family: var(--kbn-font-display); font-weight: 500; font-size: 1.18rem; line-height: 1.2; color: var(--kbn-ink); margin: 0; }
.kbn-match__verified {
	display: inline-flex; align-items: center; gap: 4px;
	font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
	color: var(--kbn-ink-2);
	padding: 2px 8px; background: rgba(252,209,22,0.18); border-radius: 999px;
	text-transform: uppercase;
}
.kbn-match__meta { font-size: 13px; color: var(--kbn-ink-3); margin-top: 4px; }
.kbn-match__why { font-size: 13.5px; color: var(--kbn-ink-2); margin-top: 8px; line-height: 1.45; }
.kbn-match__why strong { color: var(--kbn-ink); font-weight: 500; }
.kbn-match__score {
	font-family: var(--kbn-font-display); font-weight: 500;
	font-size: 1.625rem; color: var(--kbn-blue);
	font-variant-numeric: tabular-nums;
	line-height: 1;
	text-align: center;
}
.kbn-match__score-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--kbn-ink-3); margin-top: 4px; font-weight: 600; }

/* Adjust the grid so the avatar slot doesn't break the layout. */
.kbn-match { grid-template-columns: auto auto 1fr auto; }
.kbn-match__check { grid-column: 1; }
.kbn-match__avatar { grid-column: 2; margin-right: 0; }
.kbn-match__body { grid-column: 3; }

/* ========== Wizard subheadings (used inside dense Step 2 forms) ========== */
.kbn-subhead {
	font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
	color: var(--kbn-ink-3);
	margin: 28px 0 14px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--kbn-rule);
}
.kbn-subhead:first-child { margin-top: 8px; }

/* ========== Profile page upgrades ========== */
.kbn-listing-logo {
	width: 96px; height: 96px;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 24px;
	background: var(--kbn-canvas-2, #f8f9fb);
	border: 1px solid var(--kbn-rule);
}
.kbn-listing-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Formal verification pill — the trust claim. Gold-tinted because gold
 * is reserved for RegisterConfirmed per BRAND.md. The chevron hints at
 * the public-register link; users can click through to verify themselves. */
.kbn-verify-pill {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 10px 16px;
	margin: 8px 0 24px;
	border: 1px solid rgba(252,209,22,0.45);
	background: rgba(252,209,22,0.08);
	border-radius: 999px;
	color: var(--kbn-ink);
	text-decoration: none !important;
	font-size: 13.5px;
	transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
	border-bottom: 1px solid rgba(252,209,22,0.45) !important;
}
.kbn-verify-pill:hover {
	border-color: var(--kbn-gold) !important;
	background: rgba(252,209,22,0.16);
	transform: translateY(-1px);
}
.kbn-verify-pill svg { color: var(--kbn-gold); flex-shrink: 0; }
.kbn-verify-pill__text strong { color: var(--kbn-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.kbn-verify-pill__chev { color: var(--kbn-ink-3); font-size: 14px; }

/* CTA row immediately under verification pill — the moment of decision.
 * "Connect with X" reads as the primary action; "Write a review" is for
 * past clients who came back to leave feedback. */
.kbn-listing-cta-row {
	display: flex; gap: 12px; flex-wrap: wrap;
	margin: 4px 0 32px;
}
.kbn-listing-cta-row .kbn-btn { padding: 14px 24px; }

/* Per-listing Voices + Related sections */
.kbn-listing-voices-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-top: 8px; }
@media (max-width: 760px) { .kbn-listing-voices-grid { grid-template-columns: 1fr; gap: 20px; } }

.kbn-listing-related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
@media (max-width: 760px) { .kbn-listing-related { grid-template-columns: 1fr; } }
.kbn-listing-related-card {
	display: flex; gap: 14px; align-items: center;
	padding: 16px;
	border: 1px solid var(--kbn-rule); border-radius: 4px;
	background: var(--kbn-canvas, #fff);
	text-decoration: none; color: inherit;
	transition: border-color 120ms ease, transform 120ms ease;
}
.kbn-listing-related-card:hover { border-color: var(--kbn-blue); transform: translateY(-2px); }
.kbn-listing-related-card__logo,
.kbn-listing-related-card__monogram {
	width: 48px; height: 48px;
	border-radius: 4px; flex-shrink: 0;
	background: var(--kbn-canvas-2, #f8f9fb);
	border: 1px solid var(--kbn-rule);
	display: grid; place-items: center;
	font-family: var(--kbn-font-display); font-weight: 500; font-size: 18px; color: var(--kbn-ink-3);
}
.kbn-listing-related-card__logo { object-fit: cover; }
.kbn-listing-related-card__title { font-family: var(--kbn-font-display); font-weight: 500; font-size: 15px; line-height: 1.2; color: var(--kbn-ink); margin: 0 0 4px; }
.kbn-listing-related-card__verify { font-size: 11.5px; color: var(--kbn-ink-3); margin: 0; font-variant-numeric: tabular-nums; }

/* ── Event modal import strip ───────────────────────────────────────────────── */
.kbn-event-import {
  background: #f0f6fc;
  border: 1px solid #c3d3e8;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.kbn-event-import__row {
  display: flex; gap: 8px; align-items: center;
}
.kbn-event-import__row .kbn-text-input { flex: 1; }
.kbn-event-import__status {
  margin: 6px 0 0; font-size: 12.5px; min-height: 16px; color: var(--kbn-ink-3);
}
.kbn-event-import__status--ok  { color: #1a7f50; }
.kbn-event-import__status--err { color: var(--kbn-red); }
.kbn-event-import__label { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--kbn-ink-2); }
.kbn-event-import__hint  { margin: 6px 0 0; font-size: 12px; color: var(--kbn-ink-3); }

/* ── Event cover image upload ── */
.kbn-cover-upload {
	position: relative;
	border: 1.5px dashed var(--kbn-border);
	border-radius: 10px;
	overflow: hidden;
	background: var(--kbn-surface-2);
	transition: border-color 0.15s;
}
.kbn-cover-upload:hover { border-color: var(--kbn-blue); }
.kbn-cover-upload__input { display: none; }
.kbn-cover-upload__prompt {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 24px 16px;
	cursor: pointer;
	color: var(--kbn-ink-3);
	text-align: center;
}
.kbn-cover-upload__prompt svg { color: var(--kbn-blue); opacity: 0.7; }
.kbn-cover-upload__prompt span { font-size: 13.5px; font-weight: 500; color: var(--kbn-ink-2); }
.kbn-cover-upload__hint { font-size: 11.5px; font-weight: 400; color: var(--kbn-ink-3); }
.kbn-cover-upload__preview {
	position: relative;
	width: 100%;
	aspect-ratio: 1200 / 630;
}
.kbn-cover-upload__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kbn-cover-upload__clear {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: none;
	background: rgba(0,0,0,0.55);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.kbn-cover-upload__clear:hover { background: rgba(0,0,0,0.8); }

/* ── Unsplash photo credit overlay ───────────────────────────────────────── */
.kbc-news-figure {
	position: relative;
	display: block;
	margin: 0;
	line-height: 0;
}
.kbc-news-figure img { display: block; width: 100%; height: auto; }
.kbc-photo-credit {
	position: absolute;
	bottom: 8px;
	right: 8px;
	background: rgba(0, 0, 0, 0.52);
	color: #fff;
	font-size: 10px;
	font-family: var(--kbn-font-body, sans-serif);
	line-height: 1.3;
	padding: 3px 8px;
	border-radius: 3px;
	text-decoration: none;
	white-space: nowrap;
	pointer-events: auto;
	transition: background 120ms ease;
}
a.kbc-photo-credit:hover { background: rgba(0, 0, 0, 0.75); }

/* ========================================================================
 * FX widget — sticky floating PHP-rate chip on the right edge.
 * Collapsed: small pill showing flag + rate + currency code.
 * Expanded: panel slides out left with rate detail and currency switcher.
 * ====================================================================== */

.kbn-fx {
	position: fixed;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 90; /* below modals (100+), above page chrome */
	font-family: var(--kbn-font-body);
}
@media (max-width: 700px) {
	.kbn-fx { right: 10px; top: auto; bottom: 16px; transform: none; }
}

/* Collapsed chip */
.kbn-fx__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	color: var(--kbn-ink);
	border: 1px solid var(--kbn-rule);
	box-shadow: 0 6px 20px rgba(11, 14, 19, 0.10), 0 1px 3px rgba(11, 14, 19, 0.06);
	border-radius: 999px;
	padding: 8px 14px 8px 10px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.005em;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.kbn-fx__chip:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 28px rgba(11, 14, 19, 0.14), 0 2px 6px rgba(11, 14, 19, 0.08);
	border-color: var(--kbn-blue);
}
.kbn-fx__chip:focus-visible {
	outline: 2px solid var(--kbn-blue);
	outline-offset: 2px;
}
.kbn-fx__chip-flag { font-size: 18px; line-height: 1; }
.kbn-fx__chip-line {
	display: inline-flex;
	align-items: baseline;
	gap: 5px;
	font-variant-numeric: tabular-nums;
}
.kbn-fx__chip-base {
	color: var(--kbn-ink);
	font-weight: 600;
	font-size: 13px;
}
.kbn-fx__chip-base-code {
	color: var(--kbn-ink);
	font-weight: 700;
	font-size: 11px;
	letter-spacing: 0.06em;
}
.kbn-fx__chip-eq {
	color: var(--kbn-ink-4);
	font-weight: 400;
	font-size: 12px;
	padding: 0 1px;
}
.kbn-fx__chip-amt {
	font-family: var(--kbn-font-display);
	font-weight: 600;
	font-size: 15px;
	letter-spacing: -0.015em;
	color: var(--kbn-blue);
	font-variation-settings: "opsz" 72;
}
.kbn-fx__chip-tgt {
	color: var(--kbn-ink-3);
	font-weight: 700;
	font-size: 11px;
	letter-spacing: 0.06em;
}

/* Loading shimmer */
.kbn-fx[data-state="loading"] .kbn-fx__chip-amt { color: var(--kbn-ink-3); }
.kbn-fx[data-state="error"]   .kbn-fx__chip-amt { color: var(--kbn-ink-4); }
.kbn-fx[data-state="error"]   .kbn-fx__chip { border-color: var(--kbn-ink-4); }

/* Expanded panel */
.kbn-fx__panel {
	position: absolute;
	right: 0;
	top: calc(100% + 12px);
	width: 280px;
	background: #fff;
	border: 1px solid var(--kbn-rule);
	border-radius: 8px;
	box-shadow: 0 14px 40px rgba(11, 14, 19, 0.14), 0 4px 12px rgba(11, 14, 19, 0.06);
	padding: 18px 18px 16px;
}
@media (max-width: 700px) {
	.kbn-fx__panel { right: 0; top: auto; bottom: calc(100% + 10px); }
}

.kbn-fx__panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}
.kbn-fx__panel-eyebrow {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: var(--kbn-tracking-eyebrow);
	text-transform: uppercase;
	color: var(--kbn-blue);
	margin: 0;
}
.kbn-fx__close {
	background: none;
	border: none;
	color: var(--kbn-ink-3);
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	transition: background 0.12s ease, color 0.12s ease;
}
.kbn-fx__close:hover { background: var(--kbn-canvas-2); color: var(--kbn-ink); }

.kbn-fx__big {
	font-family: var(--kbn-font-display);
	font-weight: 500;
	font-size: 1.5rem;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--kbn-ink);
	margin: 0 0 6px;
	font-variation-settings: "opsz" 144;
	font-variant-numeric: tabular-nums;
	display: flex;
	align-items: baseline;
	gap: 6px;
	flex-wrap: wrap;
}
.kbn-fx__big-base-code, .kbn-fx__big-tgt {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--kbn-ink-3);
	font-family: var(--kbn-font-body);
}
.kbn-fx__big-eq { color: var(--kbn-ink-4); font-weight: 400; padding: 0 2px; }
.kbn-fx__big-amt { color: var(--kbn-blue); font-weight: 600; font-size: 1.625rem; }

.kbn-fx__updated {
	font-size: 11px;
	color: var(--kbn-ink-3);
	margin: 0 0 14px;
	letter-spacing: 0.01em;
}

.kbn-fx__divider {
	height: 1px;
	background: var(--kbn-rule);
	margin: 0 -2px 14px;
}

.kbn-fx__switcher-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: var(--kbn-tracking-eyebrow);
	text-transform: uppercase;
	color: var(--kbn-ink-3);
	margin: 0 0 10px;
}
.kbn-fx__switcher {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	margin-bottom: 14px;
}
.kbn-fx__switch {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	background: var(--kbn-canvas-2);
	border: 1px solid transparent;
	border-radius: 6px;
	padding: 6px 4px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--kbn-ink-2);
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.kbn-fx__switch span { font-size: 16px; line-height: 1; }
.kbn-fx__switch:hover { background: #fff; border-color: var(--kbn-blue); color: var(--kbn-ink); }
.kbn-fx__switch[aria-pressed="true"] {
	background: var(--kbn-blue);
	color: #fff;
	border-color: var(--kbn-blue);
}

.kbn-fx__source {
	font-size: 10.5px;
	color: var(--kbn-ink-3);
	margin: 0;
	letter-spacing: 0.01em;
	text-align: center;
}

/* Don't render the widget on admin screens (it would conflict with the WP toolbar). */
body.wp-admin .kbn-fx { display: none; }

/* ==========================================================================
 * Mobile, tablet, and cross-browser optimisations
 * ==========================================================================
 *
 * This section is intentionally grouped at the end so it doesn't scatter
 * mobile rules across the file. Every rule here is a cross-cutting concern
 * (touch handling, safe-area insets, minimum tap targets, scroll behaviour)
 * rather than component-level layout, which lives with its component above.
 */

/* ---- Global touch improvements ---- */
/* Remove the blue flash on tap for all interactive elements on iOS/Android. */
a, button, [role="button"], input, select, textarea, label {
	-webkit-tap-highlight-color: transparent;
}

/* Smooth momentum-based scrolling on iOS (already default on Android). */
html {
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

/* Prevent double-tap zoom on buttons and links — keeps single-tap instant. */
button, a { touch-action: manipulation; }

/* ---- Safe-area insets for notched devices (iPhone X+, Android cutouts) ---- */
/* The sticky topbar sits under the status bar on iOS standalone. Extend its
   padding horizontally so content doesn't clip behind a notch or island. */
.kbn-topbar__inner {
	padding-left: max(32px, env(safe-area-inset-left, 32px));
	padding-right: max(32px, env(safe-area-inset-right, 32px));
}
@media (max-width: 600px) {
	.kbn-topbar__inner {
		padding-left: max(20px, env(safe-area-inset-left, 20px));
		padding-right: max(20px, env(safe-area-inset-right, 20px));
	}
}

/* Footer safe-area: the last interactive area on screen. */
.kbn-footer {
	padding-bottom: max(32px, env(safe-area-inset-bottom, 32px));
}

/* ---- Minimum tap target sizes (WCAG 2.5.5 / Apple HIG: 44×44pt) ---- */
/* Small icon-only buttons must be visually small but hittable. */
.kbn-modal__close,
.kbn-menu-btn,
.kbn-fx__close {
	min-width: 44px;
	min-height: 44px;
}

/* Nav links in the drawer get generous tap padding. */
.kbn-drawer__nav a {
	min-height: 44px;
	display: flex;
	align-items: center;
}

/* ---- Footer — mobile padding ---- */
@media (max-width: 760px) {
	.kbn-footer {
		padding-left: 20px;
		padding-right: 20px;
		padding-top: 36px;
	}
	.kbn-footer__inner p { max-width: 100%; text-align: left; }
}

/* ---- Editor's picks — stack on small screens ---- */
@media (max-width: 600px) {
	.kbn-pick-row {
		grid-template-columns: 1fr;
		gap: 8px;
	}
	.kbn-pick-row__count { display: none; }
}

/* ---- Section head — wrap tighter on mobile ---- */
@media (max-width: 600px) {
	.kbn-section__head { padding-bottom: 16px; margin-bottom: 24px; }
	.kbn-section__title { font-size: 1.5rem; }
}

/* ---- Trust band — improve very small screens ---- */
@media (max-width: 400px) {
	.kbn-trust-band { padding: 48px 16px; }
	.kbn-trust-stat__num { font-size: clamp(3rem, 18vw, 5rem); }
}

/* ---- Topbar right — keep at most 2 buttons on tablet ---- */
@media (max-width: 820px) and (min-width: 601px) {
	.kbn-topbar__right .kbn-btn--ghost { display: none; }
}

/* ---- Search bar — full-width on mobile (already 1-col, but refine touch) ---- */
@media (max-width: 760px) {
	.kbn-search__input { font-size: 16px; } /* Prevent iOS auto-zoom on focus */
	.kbn-search__category { font-size: 16px; }
	.kbn-search__submit { min-height: 48px; font-size: 15px; }
}

/* ---- Forms — prevent iOS auto-zoom (font-size must be ≥ 16px on inputs) ---- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
select,
textarea {
	font-size: 16px;
}
/* Scale back down on larger screens where 16px is too big for dense forms. */
@media (min-width: 761px) {
	input[type="text"],
	input[type="email"],
	input[type="tel"],
	input[type="url"],
	input[type="number"],
	input[type="password"],
	select,
	textarea {
		font-size: inherit;
	}
}

/* ---- FX widget — extra bottom clearance for home indicator bar (iOS PWA) ---- */
@media (max-width: 700px) {
	.kbn-fx {
		bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 8px));
	}
}

/* ---- Tablet (768–1024px) grid tuning ---- */
@media (max-width: 1024px) and (min-width: 761px) {
	.kbn-listings     { grid-template-columns: repeat(2, 1fr); }
	.kbn-categories   { grid-template-columns: repeat(2, 1fr); }
	.kbn-paths        { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Print: strip decorative chrome ---- */
@media print {
	.kbn-topbar, .kbn-drawer, .kbn-drawer-backdrop,
	.kbn-fx, .kbn-menu-btn, .kbn-modal-backdrop { display: none !important; }
	body { background: #fff; color: #000; font-size: 12pt; }
	a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }
}
