/*
 * Pill Identifier theme styles.
 *
 * Design idea: the pharmacy counter. A two-tone capsule search bar, color and
 * shape pickers laid out like a blister card, a counting tray that draws the
 * pill you describe, and yellow auxiliary-label stickers for safety notes.
 * Typeface: Atkinson Hyperlegible Next, designed so look-alike characters
 * (0/O, 1/l/I, 5/S, 8/B) are easy to tell apart, which matters for imprints.
 */

@font-face {
	font-family: "Atkinson Hyperlegible Next";
	src: url("../fonts/atkinson-hyperlegible-next-latin.woff") format("woff");
	font-weight: 200 800;
	font-style: normal;
	font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
	--pi-font: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--pi-bg: #eef3f1;
	--pi-surface: #ffffff;
	--pi-surface-2: #f5f8f7;
	--pi-ink: #15304a;
	--pi-ink-2: #36506a;
	--pi-muted: #566c7e;
	--pi-line: #c9d6da;
	--pi-brand: #0b7a55;
	--pi-brand-ink: #ffffff;
	--pi-brand-soft: #d3ece2;
	--pi-sticker: #ffd23f;
	--pi-sticker-ink: #2b2200;
	--pi-warn: #a3401a;
	--pi-warn-soft: #fbe4d8;
	--pi-tray: #dbe6e3;
	--pi-tray-deep: #c6d6d2;
	--pi-focus: #2457d6;
	--pi-footer: #15304a;
	--pi-footer-ink: #dbe7ee;
	--pi-radius-s: 10px;
	--pi-radius: 14px;
	--pi-radius-l: 24px;
	--pi-shadow: 0 1px 0 rgba(21, 48, 74, .06), 0 12px 28px -18px rgba(21, 48, 74, .45);
	--pi-wrap: 1180px;
	--pi-gutter: clamp(16px, 4vw, 32px);
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--pi-bg: #0f1a20;
		--pi-surface: #16252e;
		--pi-surface-2: #1b2d37;
		--pi-ink: #e4eef2;
		--pi-ink-2: #c3d3dc;
		--pi-muted: #98adb9;
		--pi-line: #2b414d;
		--pi-brand: #3cc495;
		--pi-brand-ink: #062419;
		--pi-brand-soft: #173d33;
		--pi-sticker: #f2c537;
		--pi-sticker-ink: #231b00;
		--pi-warn: #ff9a70;
		--pi-warn-soft: #3a2219;
		--pi-tray: #1d313b;
		--pi-tray-deep: #152730;
		--pi-focus: #8fb4ff;
		--pi-footer: #0a1318;
		--pi-footer-ink: #b9cad4;
		--pi-shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 30px -18px rgba(0, 0, 0, .8);
		color-scheme: dark;
	}
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
	margin: 0;
	font-family: var(--pi-font);
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--pi-ink);
	background: var(--pi-bg);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--pi-brand); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.015em; font-weight: 800; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.35rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.85rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pi-focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--pi-sticker); color: var(--pi-sticker-ink); }

.pi-wrap { width: 100%; max-width: calc(var(--pi-wrap) + var(--pi-gutter) * 2); margin: 0 auto; padding: 0 var(--pi-gutter); }
.pi-main { min-height: 60vh; padding-bottom: 64px; }
.pi-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pi-skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--pi-ink); color: var(--pi-bg); padding: 10px 16px; border-radius: 10px; }
.pi-skip:focus { top: 12px; }
.pi-icon { flex: none; vertical-align: -0.2em; }

/* ---------- Header ---------- */
.pi-header { background: var(--pi-surface); border-bottom: 1px solid var(--pi-line); position: relative; z-index: 20; }
.pi-header__inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.pi-logo { display: flex; align-items: center; gap: 10px; color: var(--pi-ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; margin-right: auto; }
.pi-logo img { max-height: 44px; width: auto; }
.pi-logo__mark { width: 42px; height: 21px; }
.pi-logo__a { fill: var(--pi-surface); stroke: var(--pi-ink); stroke-width: 2; }
.pi-logo__b { fill: var(--pi-brand); stroke: var(--pi-ink); stroke-width: 2; }
.pi-nav { display: flex; align-items: center; gap: 20px; }
.pi-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.pi-nav li { position: relative; }
.pi-nav a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--pi-ink-2); text-decoration: none; font-weight: 600; }
.pi-nav a:hover, .pi-nav .current-menu-item > a { background: var(--pi-surface-2); color: var(--pi-ink); }
.pi-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; flex-direction: column; background: var(--pi-surface); border: 1px solid var(--pi-line); border-radius: var(--pi-radius); padding: 6px; box-shadow: var(--pi-shadow); }
.pi-nav li:hover > .sub-menu, .pi-nav li:focus-within > .sub-menu { display: flex; }
.pi-help { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 10px; background: var(--pi-sticker); color: var(--pi-sticker-ink) !important; text-decoration: none; font-size: .9rem; line-height: 1.2; font-weight: 700; }
.pi-help__label { font-weight: 600; }
.pi-menu-btn { display: none; align-items: center; gap: 6px; background: none; border: 1px solid var(--pi-line); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 700; }

@media (max-width: 900px) {
	.pi-menu-btn { display: inline-flex; }
	.pi-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 12px; background: var(--pi-surface); border-bottom: 1px solid var(--pi-line); padding: 12px var(--pi-gutter) 20px; box-shadow: var(--pi-shadow); }
	.pi-nav.is-open { display: flex; }
	.pi-nav ul { flex-direction: column; }
	.pi-nav a { padding: 12px; }
	.pi-nav .sub-menu { display: flex; position: static; box-shadow: none; border: 0; padding-left: 12px; }
	.pi-help { justify-content: center; padding: 12px; }
}

/* ---------- Hero + identifier ---------- */
.pi-hero { padding: clamp(28px, 5vw, 64px) 0 12px; }
.pi-tool { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .9fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.pi-tool__title { max-width: 14ch; margin-bottom: .3em; }
.pi-tool__intro { font-size: 1.15rem; color: var(--pi-ink-2); max-width: 46ch; margin-bottom: 1.6em; }
.pi-label { display: block; font-weight: 700; margin-bottom: 8px; }
.pi-label span, legend span { font-weight: 400; color: var(--pi-muted); }

/* The capsule: input half + button half. */
.pi-capsule { position: relative; display: flex; align-items: stretch; background: var(--pi-surface); border: 2px solid var(--pi-ink); border-radius: 999px; box-shadow: inset 0 3px 6px rgba(21, 48, 74, .08), 0 14px 30px -20px rgba(21, 48, 74, .7); }
.pi-capsule:focus-within { box-shadow: 0 0 0 4px var(--pi-brand-soft), inset 0 3px 6px rgba(21, 48, 74, .08); }
.pi-capsule__input { flex: 1; min-width: 0; border: 0; background: transparent; padding: .62em .4em .62em 1.05em; font-size: clamp(1.3rem, 1rem + 1.5vw, 1.85rem); font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--pi-ink); text-shadow: 0 1px 0 rgba(255, 255, 255, .7); border-radius: 999px 0 0 999px; }
.pi-capsule__input:focus { outline: none; }
.pi-capsule__input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--pi-muted); opacity: .9; text-shadow: none; }
.pi-capsule__btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-left: 2px solid var(--pi-ink); border-radius: 0 999px 999px 0; padding: 0 1.4em 0 1.15em; background: var(--pi-brand) linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 58%); color: var(--pi-brand-ink); font-weight: 800; font-size: 1.05rem; cursor: pointer; }
.pi-capsule__btn:hover { filter: brightness(1.06); }
.pi-capsule__btn:focus-visible { outline-offset: -5px; border-radius: 0 999px 999px 0; }
.pi-hint { font-size: .9rem; color: var(--pi-muted); margin: 8px 0 0 1.2em; }

.pi-suggest { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--pi-surface); border: 1px solid var(--pi-line); border-radius: var(--pi-radius); box-shadow: var(--pi-shadow); }
.pi-suggest li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.pi-suggest li[aria-selected="true"], .pi-suggest li:hover { background: var(--pi-brand-soft); }
.pi-suggest small { color: var(--pi-muted); }

.pi-popular { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 0; font-size: .92rem; color: var(--pi-muted); }
.pi-popular a { padding: 3px 11px; border-radius: 999px; background: var(--pi-surface); border: 1px solid var(--pi-line); color: var(--pi-ink); text-decoration: none; font-weight: 800; letter-spacing: .06em; }
.pi-popular a:hover { border-color: var(--pi-brand); }

/* Tabs: a segmented control. */
.pi-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 26px; padding: 4px; background: var(--pi-tray); border-radius: 999px; }
.pi-tabs [role="tab"] { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 9px 16px; border-radius: 999px; font-weight: 700; color: var(--pi-ink-2); cursor: pointer; }
.pi-tabs [role="tab"][aria-selected="true"] { background: var(--pi-surface); color: var(--pi-ink); box-shadow: 0 1px 2px rgba(21, 48, 74, .2); }
.pi-panel { margin-top: 18px; }
.pi-panel[hidden] { display: none; }
.pi-field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.pi-field legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.pi-tool__actions { display: flex; align-items: center; gap: 16px; margin-top: 4px; }

/* Blister card: each choice sits in a domed pocket. */
.pi-blister { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin: 0; padding: 10px; list-style: none; border-radius: 18px; background:
	repeating-linear-gradient(90deg, rgba(255, 255, 255, .0) 0 6px, rgba(255, 255, 255, .08) 6px 7px),
	linear-gradient(160deg, var(--pi-tray), var(--pi-tray-deep)); }
.pi-pocket { position: relative; display: grid; justify-items: center; align-content: start; gap: 6px; padding: 12px 6px 9px; min-height: 92px; border-radius: 16px; cursor: pointer; text-decoration: none; color: var(--pi-ink);
	background: radial-gradient(120% 95% at 30% 18%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .58) 46%, rgba(255, 255, 255, .3));
	border: 1px solid rgba(255, 255, 255, .75);
	box-shadow: inset 0 -8px 14px -10px rgba(21, 48, 74, .45), 0 1px 0 rgba(21, 48, 74, .14); }
@media (prefers-color-scheme: dark) {
	.pi-pocket { background: radial-gradient(120% 95% at 30% 18%, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06) 46%, rgba(255, 255, 255, .02)); border-color: rgba(255, 255, 255, .1); }
}
.pi-pocket__pill { width: 34px; height: 34px; border-radius: 50%; background: var(--pill); border: 1px solid rgba(21, 48, 74, .2); box-shadow: inset -3px -4px 6px rgba(0, 0, 0, .16), inset 3px 3px 5px rgba(255, 255, 255, .6), 0 3px 4px -1px rgba(21, 48, 74, .35); }
.pi-pocket__shape { width: 42px; height: 34px; fill: var(--pi-surface); stroke: var(--pi-ink-2); stroke-width: 4; stroke-linejoin: round; overflow: visible; }
.pi-pocket__any { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px dashed var(--pi-muted); color: var(--pi-muted); font-weight: 800; }
.pi-pocket__label { font-size: .8rem; font-weight: 700; text-align: center; line-height: 1.15; }
.pi-pocket__n { font-size: .75rem; color: var(--pi-muted); }
.pi-pocket:hover { border-color: var(--pi-brand); }
.pi-pocket:has(input:checked) { background: var(--pi-brand-soft); border-color: var(--pi-brand); box-shadow: 0 0 0 2px var(--pi-brand), inset 0 -8px 14px -10px rgba(21, 48, 74, .4); }
.pi-pocket:has(input:checked)::after { content: ""; position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--pi-brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat; }
.pi-pocket:has(input:focus-visible) { outline: 3px solid var(--pi-focus); outline-offset: 2px; }
.pi-blister--links { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }

/* Counting tray with the live pill drawing. */
.pi-tray { margin: 0; position: sticky; top: 20px; }
.pi-tray__bed { position: relative; display: grid; place-items: center; aspect-ratio: 5 / 4; padding: 8% 10% 22%; border-radius: 30px;
	background: radial-gradient(130% 100% at 50% 0%, var(--pi-surface-2), var(--pi-tray) 70%);
	box-shadow: inset 0 4px 10px rgba(21, 48, 74, .16), inset 0 -2px 0 rgba(255, 255, 255, .55), 0 1px 0 rgba(255, 255, 255, .5); }
.pi-tray__bed::after { content: ""; position: absolute; left: 9%; right: 9%; bottom: 8%; height: 11%; border-radius: 999px; background: var(--pi-tray-deep); box-shadow: inset 0 3px 6px rgba(21, 48, 74, .25), 0 1px 0 rgba(255, 255, 255, .55); }
.pi-preview { width: 78%; overflow: visible; filter: drop-shadow(0 12px 10px rgba(21, 48, 74, .28)); }
.pi-preview path { transition: fill .3s ease; }
.pi-preview__base { stroke: rgba(21, 48, 74, .3); stroke-width: 1.2; }
.pi-preview text { font-family: var(--pi-font); font-weight: 800; letter-spacing: .6px; }
.pi-preview__text { fill: rgba(21, 48, 74, .55); }
.pi-preview__hi { fill: rgba(255, 255, 255, .9); }
.pi-preview.is-dark .pi-preview__text { fill: rgba(0, 0, 0, .4); }
.pi-preview.is-dark .pi-preview__hi { fill: rgba(255, 255, 255, .4); }
.pi-preview.is-empty { opacity: .6; }
.pi-preview.is-changed { animation: pi-settle .4s cubic-bezier(.3, 1.4, .5, 1); transform-origin: center; transform-box: fill-box; }
@keyframes pi-settle { from { transform: translateY(-6px) scale(.96); } to { transform: none; } }
.pi-tray figcaption { margin-top: 14px; text-align: center; font-weight: 700; color: var(--pi-ink-2); min-height: 1.6em; }

@media (max-width: 860px) {
	.pi-tool { grid-template-columns: 1fr; }
	.pi-tray { position: static; order: -1; }
	.pi-tool__copy { display: contents; }
	.pi-tool__title { order: -2; margin-bottom: 0; }
	.pi-tool__intro { order: -2; margin-bottom: 0; }
	.pi-tool__form { order: 0; }
	.pi-tray__bed { aspect-ratio: auto; height: 156px; padding: 14px 20% 38px; }
	.pi-tray__bed::after { height: 16px; bottom: 12px; }
	.pi-preview { width: 104px; height: 104px; }
	.pi-tray figcaption { margin-top: 8px; font-size: .95rem; }
	.pi-tabs { display: flex; width: 100%; }
	.pi-tabs [role="tab"] { flex: 1; justify-content: center; padding: 9px 8px; font-size: .92rem; }
	.pi-hint { margin-left: .6em; }
}
@media (max-width: 420px) {
	.pi-capsule__btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.pi-capsule__btn { padding: 0 1.1em 0 .95em; }
	.pi-tabs [role="tab"] .pi-icon { display: none; }
}

/* Method pages: the chosen method comes first, the imprint box after it. */
.pi-tool--lead .pi-tool__form { display: flex; flex-direction: column; }
.pi-tool--lead .pi-tabs { order: -2; margin-top: 0; align-self: flex-start; }
.pi-tool--lead .pi-panel { order: -1; margin: 18px 0 26px; }
.pi-tool--lead .pi-popular { display: none; }
@media (max-width: 860px) { .pi-tool--lead .pi-tabs { align-self: stretch; } }

/* "Other ways to identify" links. */
.pi-ways { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.pi-ways a { display: grid; grid-template-columns: 40px 1fr; gap: 4px 12px; align-items: start; height: 100%; padding: 14px 16px; border-radius: var(--pi-radius); background: var(--pi-surface); border: 1px solid var(--pi-line); color: var(--pi-ink); text-decoration: none; }
.pi-ways a:hover { border-color: var(--pi-brand); }
.pi-ways a[aria-current] { background: var(--pi-brand-soft); border-color: var(--pi-brand); }
.pi-ways .pi-icon { grid-row: span 2; width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--pi-tray); color: var(--pi-brand); }
.pi-ways strong { font-weight: 800; }
.pi-ways span { color: var(--pi-muted); font-size: .92rem; line-height: 1.35; }

/* Compact identifier (archives, 404). */
.pi-tool--compact { grid-template-columns: 1fr; }
.pi-tool--compact .pi-tabs { display: none; }
.pi-tool--compact .pi-panel { margin-top: 14px; }
.pi-narrow { background: var(--pi-surface); border: 1px solid var(--pi-line); border-radius: var(--pi-radius-l); padding: clamp(16px, 3vw, 28px); margin: 8px 0 24px; }
.pi-narrow .pi-blister { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }

/* Photo helper. */
.pi-photo__drop { display: grid; justify-items: center; gap: 6px; padding: 28px 20px; text-align: center; border: 2px dashed var(--pi-line); border-radius: 18px; background: var(--pi-surface); cursor: pointer; }
.pi-photo__drop .pi-icon { width: 34px; height: 34px; color: var(--pi-brand); }
.pi-photo__drop span { color: var(--pi-muted); font-size: .95rem; max-width: 36ch; }
.pi-photo__drop:hover { border-color: var(--pi-brand); }
.pi-photo__drop:has(input:focus-visible) { outline: 3px solid var(--pi-focus); outline-offset: 2px; }
.pi-photo__result { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; margin-top: 14px; }
.pi-photo__result[hidden] { display: none; }
.pi-photo__result img { width: 112px; height: 112px; object-fit: cover; border-radius: 14px; border: 1px solid var(--pi-line); }
.pi-privacy { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--pi-muted); margin: 12px 0 0; }
.pi-privacy .pi-icon { color: var(--pi-brand); }

/* ---------- Buttons, inputs, chips, tags ---------- */
.pi-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: .72em 1.35em; background: var(--pi-brand); color: var(--pi-brand-ink); font-weight: 800; text-decoration: none; cursor: pointer; }
.pi-btn:hover { filter: brightness(1.06); }
.pi-btn--ghost { background: transparent; color: var(--pi-brand); box-shadow: inset 0 0 0 2px var(--pi-brand); }
.pi-btn--ghost:hover { background: var(--pi-brand-soft); filter: none; }
.pi-btn[disabled] { opacity: .6; cursor: progress; }
.pi-link-btn { background: none; border: 0; padding: 4px; color: var(--pi-muted); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; font-weight: 600; }
.pi-input { width: 100%; padding: .7em 1em; border: 2px solid var(--pi-line); border-radius: 12px; background: var(--pi-surface); }
.pi-input:focus { border-color: var(--pi-brand); outline: none; box-shadow: 0 0 0 4px var(--pi-brand-soft); }
.pi-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.pi-chips a, .pi-chips li { padding: .32em .85em; border-radius: 999px; background: var(--pi-surface); border: 1px solid var(--pi-line); color: var(--pi-ink); text-decoration: none; font-size: .92rem; font-weight: 600; }
.pi-chips a:hover { border-color: var(--pi-brand); }
.pi-chips--static { margin: 0; }
.pi-tag { display: inline-block; width: fit-content; padding: .15em .65em; border-radius: 6px; font-size: .82rem; font-weight: 700; }
.pi-tag--warn { background: var(--pi-warn-soft); color: var(--pi-warn); }

/* The embossed imprint chip: the theme's recurring motif. */
.pi-imprint { display: inline-block; width: fit-content; padding: .08em .6em; border-radius: 999px; background: var(--pi-surface-2); border: 1px solid var(--pi-line); box-shadow: inset 0 1px 3px rgba(21, 48, 74, .14); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pi-ink); }
.pi-imprint--xl { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem); padding: .06em .5em; letter-spacing: .07em; }

/* ---------- Results ---------- */
.pi-results { margin-top: 28px; scroll-margin-top: 16px; }
.pi-results:empty { margin: 0; }
.pi-results__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 4px; }
.pi-results__title { margin: 0; }
.pi-results__title:focus { outline: none; }
.pi-results__note { color: var(--pi-muted); margin: 8px 0 0; font-size: .95rem; }
.pi-results__more { margin-top: 16px; }
.pi-loading { color: var(--pi-muted); font-weight: 600; }
.pi-empty { padding: 18px 20px; border-radius: var(--pi-radius); background: var(--pi-surface); border: 1px dashed var(--pi-line); }
.pi-empty p:last-child { margin-bottom: 0; }

.pi-rows { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.pi-rows--tight { grid-template-columns: 1fr; }
.pi-row__link { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; height: 100%; padding: 10px 14px 10px 10px; background: var(--pi-surface); border: 1px solid var(--pi-line); border-radius: var(--pi-radius); color: inherit; text-decoration: none; }
.pi-row__link:hover { border-color: var(--pi-brand); box-shadow: 0 0 0 1px var(--pi-brand); }
.pi-row__media { display: grid; place-items: center; width: 92px; height: 70px; border-radius: 10px; background: var(--pi-tray); overflow: hidden; }
.pi-row__media img { width: 100%; height: 100%; object-fit: contain; }
.pi-row__media .pi-pill-svg { width: 58px; height: 58px; filter: drop-shadow(0 4px 3px rgba(21, 48, 74, .22)); }
.pi-row__body { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.pi-row__name { font-weight: 700; line-height: 1.3; }
.pi-row__looks { color: var(--pi-muted); font-size: .9rem; line-height: 1.3; }
.pi-pill-svg text { font-family: var(--pi-font); }

/* ---------- Safety sticker ---------- */
.pi-sticker { max-width: 780px; margin: 32px 0; padding: 20px 24px; border-radius: 12px; background: var(--pi-sticker); color: var(--pi-sticker-ink); outline: 2px dashed rgba(43, 34, 0, .28); outline-offset: -9px; box-shadow: 0 12px 24px -20px rgba(0, 0, 0, .7); }
.pi-sticker p { margin: 0 0 .5em; }
.pi-sticker p:last-child { margin: 0; }
.pi-sticker__head { font-weight: 800; font-size: 1.15rem; }
.pi-sticker__call a { display: inline-flex; align-items: center; gap: 6px; color: inherit; font-weight: 800; }
.pi-sticker__call { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.pi-calls { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.pi-calls a { color: inherit; font-weight: 600; text-decoration-thickness: .1em; }
.pi-calls strong { font-weight: 800; }
.pi-calls small { font-size: .85em; }
.pi-country { flex-basis: 100%; font-size: .88rem; opacity: .9; }
.pi-country label { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; font-weight: 700; }
.pi-country select { max-width: 13rem; padding: 3px 6px; border-radius: 8px; border: 1px solid rgba(43, 34, 0, .35); background: rgba(255, 255, 255, .55); color: inherit; font-size: .88rem; }
.pi-sticker--compact { padding: 16px 20px; font-size: .95rem; }
.pi-sticker--compact .pi-sticker__head { font-size: 1.02rem; }

/* ---------- Sections ---------- */
.pi-band { background: var(--pi-surface); border-block: 1px solid var(--pi-line); padding: clamp(40px, 6vw, 72px) 0; margin: 40px 0; }
.pi-band__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 18px; }
.pi-band__head h2 { margin: 0; }
.pi-band__head p { margin: 0; color: var(--pi-muted); }
.pi-band__sub { font-size: 1.25rem; margin: 36px 0 14px; }
.pi-section { margin: 48px 0; }
.pi-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.pi-section__head h2 { margin: 0; }
.pi-section__head a { font-weight: 700; }
.pi-section__title { font-size: 1.4rem; }
.pi-section__lede { color: var(--pi-muted); margin-top: -.3em; }
.pi-group__title { margin: 28px 0 0; font-size: 1.12rem; display: flex; align-items: baseline; gap: 10px; }
.pi-group__title span { font-size: .88rem; font-weight: 600; color: var(--pi-muted); }
.pi-linkgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.pi-linkgrid a { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--pi-line); color: var(--pi-ink); text-decoration: none; font-weight: 600; }
.pi-linkgrid a:hover { color: var(--pi-brand); }
.pi-linkgrid span { color: var(--pi-muted); font-weight: 400; }

/* A–Z */
.pi-az { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 24px; }
.pi-az a { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 8px; border-radius: 10px; background: var(--pi-surface); border: 1px solid var(--pi-line); color: var(--pi-ink); text-decoration: none; font-weight: 800; }
.pi-az a:hover { border-color: var(--pi-brand); }
.pi-az a[aria-current] { background: var(--pi-ink); color: var(--pi-bg); border-color: var(--pi-ink); }
.pi-druglist { list-style: none; margin: 0; padding: 0; columns: 16rem; column-gap: 32px; }
.pi-druglist li { break-inside: avoid; display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--pi-line); }
.pi-druglist a { color: var(--pi-ink); text-decoration: none; font-weight: 600; }
.pi-druglist a:hover { color: var(--pi-brand); }
.pi-druglist span { color: var(--pi-muted); font-size: .9rem; }

/* ---------- Breadcrumbs + archive headers ---------- */
.pi-crumbs { margin: 22px 0 14px; font-size: .9rem; color: var(--pi-muted); }
.pi-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.pi-crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--pi-line); }
.pi-crumbs a { color: var(--pi-muted); }
.pi-crumbs [aria-current] { color: var(--pi-ink-2); }
.pi-archive__head { margin: 8px 0 24px; max-width: 820px; }
.pi-archive__head--pills { display: flex; gap: 22px; align-items: flex-start; max-width: 900px; }
.pi-archive__badge { flex: none; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 20px; background: var(--pi-tray); }
.pi-archive__badge .pi-pill-svg { width: 54px; height: 54px; }
.pi-archive__intro { color: var(--pi-ink-2); font-size: 1.08rem; }
.pi-archive__sub { font-size: 1.15rem; color: var(--pi-muted); font-weight: 600; margin-top: -.2em; }

/* ---------- Pill page ---------- */
.pi-pill__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.pi-pill__media { display: grid; gap: 12px; position: sticky; top: 20px; }
.pi-tray__bed--photo { aspect-ratio: 4 / 3; padding: 7% 8% 20%; }
.pi-tray__bed--photo img { max-height: 100%; width: auto; object-fit: contain; border-radius: 10px; }
.pi-tray__bed--photo .pi-pill-svg { width: 62%; filter: drop-shadow(0 14px 10px rgba(21, 48, 74, .3)); }
.pi-tray__bed--small { aspect-ratio: 16 / 7; padding: 4% 8% 16%; }
.pi-pill__drawn { font-size: .88rem; color: var(--pi-muted); margin: 0; text-align: center; }
.pi-pill__title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.pi-pill__kind { font-weight: 500; color: var(--pi-muted); font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem); }
.pi-pill__lede { font-size: 1.15rem; color: var(--pi-ink-2); }

.pi-label-card { margin-top: 20px; background: var(--pi-surface); border: 2px solid var(--pi-ink); border-radius: 14px; overflow: hidden; box-shadow: var(--pi-shadow); }
.pi-label-card__head { margin: 0; padding: 11px 18px; background: var(--pi-ink); color: var(--pi-bg); font-weight: 800; font-size: 1.05rem; }
.pi-specs { margin: 0; }
.pi-specs div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 9px 18px; border-top: 1px dashed var(--pi-line); }
.pi-specs div:first-child { border-top: 0; }
.pi-specs dt { color: var(--pi-muted); }
.pi-specs dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.pi-label-card__more { margin: 0; padding: 12px 18px; border-top: 2px solid var(--pi-ink); background: var(--pi-surface-2); font-weight: 700; }

.pi-check { margin: 40px 0; padding: clamp(18px, 3vw, 28px); background: var(--pi-surface); border: 1px solid var(--pi-line); border-radius: var(--pi-radius-l); }
.pi-check ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pi-check li { display: flex; gap: 10px; align-items: flex-start; }
.pi-check li .pi-icon { color: var(--pi-brand); margin-top: .18em; }
.pi-check .pi-sticker { margin: 22px 0 0; }
.pi-pill__foot { margin-top: 40px; display: grid; gap: 20px; max-width: 820px; }
.pi-official { margin: 0; }

@media (max-width: 860px) {
	.pi-pill__head { grid-template-columns: 1fr; }
	.pi-pill__media { position: static; }
	.pi-specs div { grid-template-columns: 8em 1fr; }
}

/* ---------- Articles ---------- */
.pi-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 32px 26px; }
.pi-posts--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.pi-post { display: grid; gap: 12px; align-content: start; }
.pi-post__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--pi-radius); background: var(--pi-tray); }
.pi-post__body { display: grid; gap: 6px; }
.pi-post__cat { font-size: .88rem; font-weight: 800; color: var(--pi-brand); text-decoration: none; }
.pi-post__title { font-size: 1.18rem; margin: 0; line-height: 1.25; }
.pi-post__title a { color: var(--pi-ink); text-decoration: none; }
.pi-post__title a:hover { color: var(--pi-brand); text-decoration: underline; }
.pi-post__excerpt { color: var(--pi-muted); margin: 0; font-size: .98rem; }

.pi-article-grid { display: grid; gap: 48px; }
.pi-article-grid.has-sidebar { grid-template-columns: minmax(0, 1fr) 300px; }
.pi-article { max-width: 760px; min-width: 0; }
.pi-article__head { margin-bottom: 24px; }
.pi-article__title { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem); }
.pi-article__dek { font-size: 1.2rem; color: var(--pi-ink-2); }
.pi-article__image { margin: 0 0 28px; }
.pi-article__image img { width: 100%; border-radius: var(--pi-radius-l); }
.pi-article__image figcaption { font-size: .9rem; color: var(--pi-muted); margin-top: 8px; }
.pi-article__foot { display: grid; gap: 20px; margin-top: 40px; }
.pi-byline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .94rem; color: var(--pi-muted); }
.pi-byline a { color: var(--pi-ink-2); font-weight: 700; }
.pi-byline__review { display: inline-flex; align-items: center; gap: 5px; color: var(--pi-ink-2); }
.pi-byline__review .pi-icon { color: var(--pi-brand); }
.pi-sidebar { min-width: 0; }
.pi-sidebar .widget { margin-bottom: 28px; }
.pi-sidebar .widget-title { font-size: 1.05rem; }
.pi-sticky { position: sticky; top: 20px; }
.pi-identify-cta { margin: 40px 0; padding: clamp(18px, 3vw, 26px); border-radius: var(--pi-radius-l); background: var(--pi-tray); }
.pi-identify-cta h2 { font-size: 1.3rem; }
.pi-identify-cta .pi-rows { margin-bottom: 16px; }
.pi-tags a { display: inline-block; margin: 0 6px 6px 0; padding: .2em .7em; border-radius: 999px; border: 1px solid var(--pi-line); font-size: .88rem; color: var(--pi-ink-2); text-decoration: none; }
@media (max-width: 1000px) {
	.pi-article-grid.has-sidebar { grid-template-columns: 1fr; }
}

/* Long-form text. */
.pi-prose { max-width: 70ch; font-size: 1.08rem; line-height: 1.7; }
.pi-prose > * + * { margin-top: 0; }
.pi-prose h2 { margin: 1.8em 0 .55em; scroll-margin-top: 20px; }
.pi-prose h3 { margin: 1.5em 0 .5em; scroll-margin-top: 20px; }
.pi-prose ul, .pi-prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.pi-prose li { margin-bottom: .35em; }
.pi-prose blockquote { margin: 1.5em 0; padding: .4em 0 .4em 1.2em; border-left: 4px solid var(--pi-brand); color: var(--pi-ink-2); }
.pi-prose img { border-radius: 12px; }
.pi-prose figure { margin: 1.5em 0; }
.pi-prose figcaption { font-size: .9rem; color: var(--pi-muted); }
.pi-prose table { width: 100%; border-collapse: collapse; font-size: .98rem; margin: 1.5em 0; }
.pi-prose th, .pi-prose td { padding: 10px 12px; border-bottom: 1px solid var(--pi-line); text-align: left; vertical-align: top; }
.pi-prose th { background: var(--pi-surface-2); }
.pi-prose .wp-block-table { overflow-x: auto; }
.pi-prose details { border-top: 1px solid var(--pi-line); padding: 14px 0; margin: 0; }
.pi-prose details:last-of-type { border-bottom: 1px solid var(--pi-line); }
.pi-prose summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.pi-prose summary::-webkit-details-marker { display: none; }
.pi-prose summary::after { content: "+"; font-weight: 800; color: var(--pi-brand); }
.pi-prose details[open] summary::after { content: "−"; }
.pi-prose details > *:not(summary) { margin-top: .6em; }
.pi-prose .alignwide { max-width: 1000px; }
.pi-prose--home { max-width: 760px; }
.has-text-align-center { text-align: center; }
.wp-block-button__link { border-radius: 999px; }

.pi-toc { margin: 26px 0; padding: 14px 20px; background: var(--pi-surface); border: 1px solid var(--pi-line); border-radius: var(--pi-radius); font-size: 1rem; }
.pi-toc summary { cursor: pointer; font-weight: 800; }
.pi-toc ol { margin: 10px 0 4px; padding-left: 1.3em; }
.pi-toc a { color: var(--pi-ink-2); }

/* Author box, sources, cite, share. */
.pi-author { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 18px; background: var(--pi-surface); border: 1px solid var(--pi-line); border-radius: var(--pi-radius); }
.pi-author img { border-radius: 50%; }
.pi-author p { margin: 0 0 .4em; }
.pi-author__label { font-size: .85rem; color: var(--pi-muted); font-weight: 700; }
.pi-author__name { font-weight: 800; font-size: 1.1rem; }
.pi-author__name a { color: var(--pi-ink); }
.pi-author__job { color: var(--pi-ink-2); }
.pi-sources h2 { font-size: 1.15rem; }
.pi-sources ol { padding-left: 1.3em; font-size: .95rem; }
.pi-cite { padding: 14px 18px; background: var(--pi-surface); border: 1px solid var(--pi-line); border-radius: var(--pi-radius); }
.pi-cite summary { cursor: pointer; font-weight: 800; }
.pi-cite__label { margin: 14px 0 6px; font-size: .88rem; color: var(--pi-muted); font-weight: 700; }
.pi-copy { display: flex; gap: 8px; align-items: stretch; }
.pi-copy code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--pi-surface-2); border: 1px solid var(--pi-line); font-size: .84rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.pi-copy button { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--pi-line); background: var(--pi-surface); cursor: pointer; font-weight: 700; white-space: nowrap; }
.pi-copy button:hover { border-color: var(--pi-brand); }
.pi-copy--block { flex-direction: column; }
.pi-copy--block button { align-self: flex-start; padding: 8px 14px; }
.pi-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pi-share__label { font-weight: 800; margin-right: 4px; }
.pi-share a, .pi-share button { display: inline-flex; align-items: center; gap: 6px; padding: .35em .9em; border-radius: 999px; border: 1px solid var(--pi-line); background: var(--pi-surface); color: var(--pi-ink); text-decoration: none; font-size: .9rem; font-weight: 600; cursor: pointer; }
.pi-share a:hover, .pi-share button:hover { border-color: var(--pi-brand); }
.pi-embed-box iframe { display: block; margin-top: 8px; }
.pi-embed-box__preview-label { margin: 22px 0 0; font-weight: 800; }

/* Pagination, search form, comments. */
.pi-pages .nav-links, nav.pi-pages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 32px; }
.pi-pages .page-numbers { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--pi-line); background: var(--pi-surface); color: var(--pi-ink); text-decoration: none; font-weight: 700; }
.pi-pages .page-numbers.current { background: var(--pi-ink); color: var(--pi-bg); border-color: var(--pi-ink); }
.pi-pages .page-numbers.dots { border: 0; background: none; }
.pi-searchform { display: flex; gap: 8px; max-width: 560px; margin-top: 32px; }
.pi-comments { margin-top: 48px; }
.pi-comments__list { padding-left: 0; list-style: none; }
.pi-comments .comment-body { padding: 16px 0; border-bottom: 1px solid var(--pi-line); }
.pi-comments textarea, .pi-comments input[type="text"], .pi-comments input[type="email"], .pi-comments input[type="url"] { width: 100%; padding: .6em .8em; border: 2px solid var(--pi-line); border-radius: 10px; background: var(--pi-surface); }
.pi-comments .submit { border: 0; border-radius: 999px; padding: .7em 1.3em; background: var(--pi-brand); color: var(--pi-brand-ink); font-weight: 800; cursor: pointer; }

/* Ads: reserved space limits layout shift; always labeled. */
.pi-ad { margin: 28px auto; text-align: center; min-height: 100px; }
.pi-ad__label { display: block; font-size: .72rem; color: var(--pi-muted); margin-bottom: 4px; }
.pi-ad--sidebar { min-height: 250px; }

/* ---------- Footer ---------- */
.pi-footer { background: var(--pi-footer); color: var(--pi-footer-ink); padding: 56px 0 28px; font-size: .96rem; }
.pi-footer a { color: var(--pi-footer-ink); text-decoration: none; }
.pi-footer a:hover { color: #ffffff; text-decoration: underline; }
.pi-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 32px; }
.pi-footer__title { font-size: 1rem; color: #ffffff; margin-bottom: 12px; }
.pi-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pi-footer__colors { grid-template-columns: 1fr 1fr; }
.pi-footer__colors a { display: inline-flex; align-items: center; gap: 8px; }
.pi-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pill); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.pi-footer__note { margin: 40px 0 0; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .14); max-width: 80ch; font-size: .9rem; opacity: .85; }
.pi-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: .88rem; opacity: .85; }
.pi-footer__base p { margin: 0; }
.pi-legal { display: flex !important; flex-wrap: wrap; gap: 6px 16px !important; }

/* ---------- Dark mode refinements ---------- */
@media (prefers-color-scheme: dark) {
	.pi-tabs [role="tab"][aria-selected="true"] { background: #2b4553; box-shadow: none; }
	.pi-tray__bed { box-shadow: inset 0 4px 12px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .04); }
	.pi-tray__bed::after { box-shadow: inset 0 3px 6px rgba(0, 0, 0, .45); }
	.pi-capsule__input { text-shadow: none; }
}

/* ---------- Motion + print ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
	.pi-header, .pi-footer, .pi-ad, .pi-share, .pi-cite, .pi-tool, .pi-narrow, .pi-crumbs, .pi-comments, .pi-sidebar, .pi-identify-cta { display: none !important; }
	body { background: #fff; color: #000; font-size: 12pt; }
	.pi-pill__head { grid-template-columns: 1fr 1.4fr; }
	.pi-pill__media { position: static; }
	.pi-sticker { box-shadow: none; border: 2px solid #000; }
	a { color: #000; }
}
