/* ─────────────────────────────────────────────
   Search Palette — iGamingCompliance.io
   A cross-jurisdiction content discovery overlay.
   Sandboxed under .igc-pal.
───────────────────────────────────────────── */

.igc-pal-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	height: 40px;
	padding: 0 0.85rem 0 0.9rem;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	color: rgba(255, 255, 255, 0.8);
	font: 500 0.9rem/1 "DM Sans", system-ui, sans-serif;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	min-width: 220px;
	max-width: 340px;
}
.igc-pal-trigger:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(245, 200, 66, 0.4);
	color: #fff;
}
.igc-pal-trigger__label {
	flex: 1;
	text-align: left;
	color: rgba(255, 255, 255, 0.65);
}
.igc-pal-trigger kbd {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 5px;
	font: 600 0.72rem/1 "DM Sans", system-ui, sans-serif;
	color: rgba(255, 255, 255, 0.8);
}
.igc-pal-trigger svg { flex-shrink: 0; color: rgba(255, 255, 255, 0.6); }

.igc-light .igc-pal-trigger {
	background: rgba(15, 23, 42, 0.04);
	border-color: rgba(15, 23, 42, 0.12);
	color: #1e293b;
}
.igc-light .igc-pal-trigger__label { color: #64748b; }
.igc-light .igc-pal-trigger kbd {
	background: rgba(15, 23, 42, 0.06);
	border-color: rgba(15, 23, 42, 0.12);
	color: #1e293b;
}

@media (max-width: 820px) {
	.igc-pal-trigger { min-width: 0; padding: 0 0.7rem; }
	.igc-pal-trigger__label, .igc-pal-trigger kbd { display: none; }
}

/* ── Overlay ── */
.igc-pal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding: 6vh 1rem 1rem;
	background: rgba(5, 11, 26, 0.74);
	backdrop-filter: blur(14px) saturate(1.2);
	-webkit-backdrop-filter: blur(14px) saturate(1.2);
	animation: igc-pal-fade 0.18s ease-out;
}
.igc-pal[data-open="true"] { display: flex; }

@keyframes igc-pal-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@keyframes igc-pal-rise {
	from { transform: translateY(14px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

.igc-pal__panel {
	width: min(820px, 100%);
	max-height: 86vh;
	background: linear-gradient(180deg, #0d1528 0%, #0a1122 100%);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 18px;
	box-shadow: 0 32px 80px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 200, 66, 0.05) inset;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	color: #e2e8f0;
	animation: igc-pal-rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
	font-family: "DM Sans", system-ui, sans-serif;
}

.igc-light .igc-pal { background: rgba(15, 23, 42, 0.34); }
.igc-light .igc-pal__panel {
	background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
	border-color: rgba(15, 23, 42, 0.08);
	color: #1e293b;
	box-shadow: 0 32px 80px -20px rgba(15, 23, 42, 0.25);
}

/* ── Search bar ── */
.igc-pal__bar {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.igc-light .igc-pal__bar { border-bottom-color: rgba(15, 23, 42, 0.06); }

.igc-pal__bar svg { color: rgba(255, 255, 255, 0.55); flex-shrink: 0; }
.igc-light .igc-pal__bar svg { color: #64748b; }

.igc-pal__input {
	flex: 1;
	min-width: 0;
	background: transparent;
	border: 0;
	outline: 0;
	color: inherit;
	font: 500 1.05rem/1.3 "DM Sans", system-ui, sans-serif;
	padding: 0.25rem 0;
}
.igc-pal__input::placeholder { color: rgba(255, 255, 255, 0.42); }
.igc-light .igc-pal__input::placeholder { color: #94a3b8; }

.igc-pal__close {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	height: 28px;
	padding: 0 0.55rem;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 6px;
	color: rgba(255, 255, 255, 0.65);
	font: 600 0.72rem/1 "DM Sans", system-ui, sans-serif;
	cursor: pointer;
}
.igc-pal__close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.igc-light .igc-pal__close {
	background: rgba(15, 23, 42, 0.05);
	border-color: rgba(15, 23, 42, 0.1);
	color: #475569;
}

/* ── Filter row ── */
.igc-pal__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	padding: 0.6rem 1.25rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	background: rgba(255, 255, 255, 0.02);
}
.igc-light .igc-pal__filters { background: rgba(15, 23, 42, 0.02); border-bottom-color: rgba(15, 23, 42, 0.05); }

.igc-pal__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	height: 26px;
	padding: 0 0.6rem;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 999px;
	color: rgba(255, 255, 255, 0.75);
	font: 500 0.75rem/1 "DM Sans", system-ui, sans-serif;
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.igc-pal__chip:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}
.igc-pal__chip[aria-pressed="true"] {
	background: rgba(245, 200, 66, 0.16);
	border-color: rgba(245, 200, 66, 0.55);
	color: #fde68a;
}
.igc-pal__chip .igc-pal__dot {
	width: 8px; height: 8px; border-radius: 50%; background: currentColor;
	opacity: 0.85;
}
.igc-pal__chip__count {
	color: rgba(255, 255, 255, 0.45);
	font-size: 0.68rem;
	font-variant-numeric: tabular-nums;
}

.igc-light .igc-pal__chip {
	background: rgba(15, 23, 42, 0.04);
	border-color: rgba(15, 23, 42, 0.1);
	color: #334155;
}
.igc-light .igc-pal__chip:hover { background: rgba(15, 23, 42, 0.08); color: #0f172a; }
.igc-light .igc-pal__chip[aria-pressed="true"] {
	background: rgba(245, 200, 66, 0.22);
	border-color: rgba(234, 179, 8, 0.7);
	color: #92400e;
}
.igc-light .igc-pal__chip__count { color: #94a3b8; }

/* ── Body / scroller ── */
.igc-pal__body {
	flex: 1;
	overflow-y: auto;
	padding: 0.25rem 0 0.75rem;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.igc-pal__body::-webkit-scrollbar { width: 8px; }
.igc-pal__body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }

.igc-pal__section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 0.9rem 1.25rem 0.4rem;
	font: 700 0.68rem/1.2 "DM Sans", system-ui, sans-serif;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.48);
}
.igc-light .igc-pal__section-head { color: #64748b; }

.igc-pal__section-head__count {
	color: rgba(255, 255, 255, 0.4);
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	font-size: 0.72rem;
}
.igc-light .igc-pal__section-head__count { color: #94a3b8; }

/* ── Topic synthesis card ── */
.igc-pal__topic {
	margin: 0.25rem 1rem 0.5rem;
	padding: 1rem 1.1rem;
	background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(245, 200, 66, 0.08));
	border: 1px solid rgba(245, 200, 66, 0.28);
	border-radius: 12px;
	position: relative;
	overflow: hidden;
}
.igc-pal__topic::before {
	content: "";
	position: absolute; inset: 0;
	background: radial-gradient(ellipse at top right, rgba(245, 200, 66, 0.14), transparent 60%);
	pointer-events: none;
}
.igc-pal__topic__head {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin-bottom: 0.4rem;
}
.igc-pal__topic__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 2px 8px;
	background: rgba(245, 200, 66, 0.18);
	border: 1px solid rgba(245, 200, 66, 0.4);
	border-radius: 999px;
	color: #fde68a;
	font: 700 0.65rem/1.4 "DM Sans", system-ui, sans-serif;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.igc-light .igc-pal__topic__badge { color: #92400e; background: rgba(245, 200, 66, 0.28); }
.igc-pal__topic__title {
	font: 700 1.05rem/1.3 "DM Sans", system-ui, sans-serif;
	color: #fff;
}
.igc-light .igc-pal__topic__title { color: #0f172a; }

.igc-pal__topic__lede {
	margin: 0.15rem 0 0.7rem;
	color: rgba(255, 255, 255, 0.78);
	font: 400 0.88rem/1.55 "DM Sans", system-ui, sans-serif;
}
.igc-light .igc-pal__topic__lede { color: #475569; }

.igc-pal__topic__matrix {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.igc-pal__topic__juris {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.35rem 0.55rem 0.35rem 0.45rem;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
	font: 500 0.78rem/1 "DM Sans", system-ui, sans-serif;
	transition: background 0.12s, transform 0.12s;
}
.igc-pal__topic__juris:hover {
	background: rgba(255, 255, 255, 0.1);
	transform: translateY(-1px);
}
.igc-pal__topic__juris__flag { font-size: 1rem; line-height: 1; }
.igc-pal__topic__juris__short { color: rgba(255, 255, 255, 0.95); font-weight: 600; }
.igc-pal__topic__juris__n {
	padding: 1px 6px;
	background: rgba(245, 200, 66, 0.18);
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 700;
	color: #fde68a;
	font-variant-numeric: tabular-nums;
}
.igc-light .igc-pal__topic__juris {
	background: #fff;
	border-color: rgba(15, 23, 42, 0.1);
}
.igc-light .igc-pal__topic__juris__short { color: #0f172a; }
.igc-light .igc-pal__topic__juris__n { color: #92400e; background: rgba(245, 200, 66, 0.28); }

/* ── Result rows ── */
.igc-pal__group { margin: 0.25rem 0.75rem; }

.igc-pal__result {
	display: grid;
	grid-template-columns: 44px 1fr auto;
	grid-template-rows: auto auto;
	gap: 0.35rem 0.8rem;
	padding: 0.75rem 0.85rem;
	border-radius: 10px;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background 0.1s, border-color 0.1s;
}
.igc-pal__result:hover,
.igc-pal__result[data-focused="true"] {
	background: rgba(255, 255, 255, 0.05);
	border-color: rgba(255, 255, 255, 0.08);
}
.igc-light .igc-pal__result:hover,
.igc-light .igc-pal__result[data-focused="true"] {
	background: rgba(15, 23, 42, 0.04);
	border-color: rgba(15, 23, 42, 0.08);
}

.igc-pal__result__badge {
	grid-row: 1 / 3;
	width: 44px;
	height: 44px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-left: 3px solid var(--igc-pal-accent, #f5c842);
	border-radius: 8px;
	font: 700 0.65rem/1.1 "DM Sans", system-ui, sans-serif;
	color: rgba(255, 255, 255, 0.9);
	text-align: center;
}
.igc-pal__result__flag { font-size: 1rem; line-height: 1; }
.igc-pal__result__short {
	font-size: 0.58rem;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.6);
	margin-top: 2px;
	text-transform: uppercase;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.igc-light .igc-pal__result__badge {
	background: #fff;
	border-color: rgba(15, 23, 42, 0.08);
	color: #0f172a;
}
.igc-light .igc-pal__result__short { color: #64748b; }

.igc-pal__result__head {
	grid-column: 2 / 3;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.45rem;
	min-width: 0;
}
.igc-pal__result__id {
	font: 700 0.7rem/1.2 "DM Sans", system-ui, sans-serif;
	color: rgba(245, 200, 66, 0.95);
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.03em;
	white-space: nowrap;
}
.igc-light .igc-pal__result__id { color: #b45309; }

.igc-pal__result__title {
	font: 600 0.93rem/1.35 "DM Sans", system-ui, sans-serif;
	color: #f1f5f9;
	flex: 1;
	min-width: 0;
}
.igc-light .igc-pal__result__title { color: #0f172a; }

.igc-pal__result__snippet {
	grid-column: 2 / 4;
	font: 400 0.82rem/1.5 "DM Sans", system-ui, sans-serif;
	color: rgba(255, 255, 255, 0.62);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.igc-light .igc-pal__result__snippet { color: #64748b; }

.igc-pal__result__snippet mark {
	background: rgba(245, 200, 66, 0.3);
	color: #fde68a;
	padding: 0 2px;
	border-radius: 3px;
}
.igc-light .igc-pal__result__snippet mark { color: #78350f; background: rgba(245, 200, 66, 0.4); }

.igc-pal__result__meta {
	grid-column: 3 / 4;
	grid-row: 1 / 2;
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-shrink: 0;
}

.igc-pal__tag {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 1px 7px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	font: 600 0.64rem/1.5 "DM Sans", system-ui, sans-serif;
	color: rgba(255, 255, 255, 0.8);
	white-space: nowrap;
}
.igc-pal__tag__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.igc-light .igc-pal__tag { background: #fff; border-color: rgba(15, 23, 42, 0.08); color: #475569; }

/* ── Empty state (no query) ── */
.igc-pal__empty {
	padding: 0.75rem 1.25rem 1.25rem;
}
.igc-pal__empty__lede {
	margin: 0.35rem 0 0.75rem;
	color: rgba(255, 255, 255, 0.6);
	font: 400 0.88rem/1.55 "DM Sans", system-ui, sans-serif;
}
.igc-light .igc-pal__empty__lede { color: #64748b; }

.igc-pal__topics {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 0.5rem;
}
.igc-pal__topic-chip {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0.65rem 0.85rem;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	cursor: pointer;
	text-align: left;
	font: 500 0.82rem/1.3 "DM Sans", system-ui, sans-serif;
	color: #e2e8f0;
	transition: background 0.12s, transform 0.12s;
}
.igc-pal__topic-chip:hover {
	background: rgba(245, 200, 66, 0.08);
	border-color: rgba(245, 200, 66, 0.3);
	transform: translateY(-1px);
}
.igc-pal__topic-chip__title { font-weight: 600; color: #f1f5f9; display: flex; align-items: center; gap: 0.4rem; }
.igc-pal__topic-chip__icon { font-size: 0.95rem; }
.igc-pal__topic-chip__sub { font-size: 0.72rem; color: rgba(255, 255, 255, 0.5); }
.igc-light .igc-pal__topic-chip {
	background: #fff;
	border-color: rgba(15, 23, 42, 0.08);
	color: #0f172a;
}
.igc-light .igc-pal__topic-chip__title { color: #0f172a; }
.igc-light .igc-pal__topic-chip__sub { color: #64748b; }

.igc-pal__recent {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.5rem;
}

/* ── No results ── */
.igc-pal__noresults {
	padding: 2rem 1.5rem;
	text-align: center;
	color: rgba(255, 255, 255, 0.55);
	font-size: 0.9rem;
}
.igc-pal__noresults strong { display: block; color: #f1f5f9; font-size: 1rem; margin-bottom: 0.3rem; }
.igc-light .igc-pal__noresults { color: #64748b; }
.igc-light .igc-pal__noresults strong { color: #0f172a; }

/* ── Footer rail ── */
.igc-pal__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.6rem 1.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	background: rgba(255, 255, 255, 0.02);
	font: 500 0.72rem/1 "DM Sans", system-ui, sans-serif;
	color: rgba(255, 255, 255, 0.55);
}
.igc-light .igc-pal__foot {
	border-top-color: rgba(15, 23, 42, 0.06);
	background: rgba(15, 23, 42, 0.02);
	color: #64748b;
}
.igc-pal__foot__group { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.igc-pal__foot__item { display: inline-flex; align-items: center; gap: 0.35rem; }
.igc-pal__foot kbd {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 4px;
	font: 600 0.68rem/1 "DM Sans", system-ui, sans-serif;
	color: rgba(255, 255, 255, 0.75);
}
.igc-light .igc-pal__foot kbd {
	background: rgba(15, 23, 42, 0.05);
	border-color: rgba(15, 23, 42, 0.12);
	color: #475569;
}

/* ── Responsive ── */
@media (max-width: 640px) {
	.igc-pal { padding: 2vh 0.5rem 0.5rem; }
	.igc-pal__panel { max-height: 95vh; border-radius: 12px; }
	.igc-pal__topics { grid-template-columns: 1fr; }
	.igc-pal__result { grid-template-columns: 38px 1fr; }
	.igc-pal__result__meta { grid-column: 2 / 3; grid-row: 2 / 3; }
	.igc-pal__result__snippet { grid-column: 2 / 3; }
	.igc-pal__result__badge { width: 38px; height: 38px; }
	.igc-pal__foot__group:last-child { display: none; }
}

/* ── Prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
	.igc-pal, .igc-pal__panel, .igc-pal__result, .igc-pal__topic-chip { animation: none !important; transition: none !important; }
}
