/*
 * Plantas Medicinales — hoja de estilos principal.
 *
 * Sistema de diseño propio con la misma paleta de la app de Unity:
 *   verde #4E8B63 · verde oscuro #141A13 · dorado #D9A441
 *   papel #F8FBF7 · oliva #A09B88 · rojo #A94442 · apagado #E4E4DC
 *
 * Escrito a mano, sin dependencias ni CDN: funciona sin conexión.
 *
 * @package Plantas_Medicinales
 */

/* ═══════════════════════════════════════════════════════════════════
   1. TOKENS
   ═══════════════════════════════════════════════════════════════════ */

:root {
	--paper: #f8fbf7;
	--bg: #f3f1e8;
	--surface: #ffffff;
	--ink: #141a13;
	--ink-2: #2e352c;
	--muted: #6f7568;
	--line: #e4e1d3;
	--line-2: #efece0;
	--green: #3f7d4e;
	--green-2: #4e8b63;
	--green-dark: #1b3024;
	--green-deep: #141a13;
	--gold: #d9a441;
	--gold-dark: #a97b1e;
	--gold-soft: #fbf3dd;
	--red: #a94442;
	--red-soft: #fbedec;
	--olive: #a09b88;
	--off: #e4e4dc;

	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;

	--radius-sm: 10px;
	--radius: 16px;
	--radius-lg: 22px;
	--radius-xl: 28px;

	--shadow-sm: 0 1px 2px rgba(20, 26, 19, .06), 0 2px 8px rgba(20, 26, 19, .04);
	--shadow: 0 10px 30px rgba(20, 26, 19, .09), 0 2px 8px rgba(20, 26, 19, .05);
	--shadow-lg: 0 24px 60px rgba(20, 26, 19, .18);

	--container: 1180px;
	--topbar: 68px;
}

/* ═══════════════════════════════════════════════════════════════════
   2. BASE
   ═══════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink-2);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body.pm-lock { overflow: hidden; }

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; }

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }

h1, h2, h3, h4 {
	margin: 0 0 .4em;
	color: var(--ink);
	font-weight: 700;
	line-height: 1.15;
}

p { margin: 0 0 1em; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
	border-radius: 4px;
}

::selection { background: #cfe4d3; color: var(--ink); }

.pm-sprite { display: none; }

.icon {
	width: 1.25em;
	height: 1.25em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	vertical-align: -.16em;
	flex: none;
}

.container {
	width: min(var(--container), calc(100% - 2.5rem));
	margin-inline: auto;
}

@media (max-width: 640px) {
	.container { width: calc(100% - 1.75rem); }
}

.pm-main { min-height: 60vh; }

.skip-link {
	position: fixed;
	top: -60px;
	left: 16px;
	z-index: 200;
	padding: 10px 16px;
	border-radius: 0 0 10px 10px;
	background: var(--gold);
	color: var(--ink);
	font-weight: 700;
	transition: top .15s;
}
.skip-link:focus { top: 0; color: var(--ink); }

/* ═══════════════════════════════════════════════════════════════════
   3. PIEZAS COMUNES
   ═══════════════════════════════════════════════════════════════════ */

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
	color: var(--green);
	font-size: .76rem;
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.eyebrow .icon { width: 16px; height: 16px; }
.eyebrow--gold { color: var(--gold); }

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--green);
	color: #fff;
	font-size: .92rem;
	font-weight: 700;
	line-height: 1.1;
	text-align: center;
	transition: transform .15s, background .15s, border-color .15s, color .15s, box-shadow .15s;
}

.btn:hover { background: var(--green-dark); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 18px; height: 18px; }

.btn--gold { background: var(--gold); color: #231a06; }
.btn--gold:hover { background: #e8b757; color: #231a06; }

.btn--green { background: var(--green); color: #fff; }
.btn--green:hover { background: #2f633d; }

.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: #2a3527; color: #fff; }

.btn--ghost {
	background: transparent;
	border-color: var(--line);
	color: var(--ink);
}
.btn--ghost:hover { background: #fff; border-color: var(--olive); color: var(--ink); transform: translateY(-1px); }

.btn--outline {
	background: transparent;
	border-color: rgba(248, 251, 247, .35);
	color: var(--paper);
}
.btn--outline:hover { background: rgba(248, 251, 247, .12); border-color: rgba(248, 251, 247, .6); color: #fff; }

.btn.is-off,
.btn:disabled {
	opacity: .45;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.btn-icon {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: transparent;
	color: var(--ink-2);
	transition: background .15s, border-color .15s, color .15s;
}
.btn-icon:hover { background: #fff; border-color: var(--olive); }
.btn-icon .icon { width: 18px; height: 18px; }

.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--green);
	font-weight: 700;
	font-size: .9rem;
}
.link-arrow .icon { width: 17px; height: 17px; transition: transform .15s; }
.link-arrow:hover .icon { transform: translateX(3px); }

.pill {
	display: inline-grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--line-2);
	color: var(--ink-2);
	font-size: .74rem;
	font-weight: 800;
	line-height: 1;
}

.badge {
	display: inline-grid;
	place-items: center;
	min-width: 19px;
	height: 19px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--gold);
	color: #1d1505;
	font-size: .68rem;
	font-weight: 900;
	line-height: 1;
}

.badge--mini {
	position: absolute;
	top: -7px;
	right: -11px;
	min-width: 16px;
	height: 16px;
	font-size: .6rem;
}

.btn-fav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 38px;
	padding: 7px 14px;
	border: 1px solid rgba(217, 164, 65, .55);
	border-radius: 999px;
	background: transparent;
	color: var(--gold-dark);
	font-size: .86rem;
	font-weight: 700;
	transition: background .15s, border-color .15s, color .15s;
}
.btn-fav .icon { width: 18px; height: 18px; }
.btn-fav:hover { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-dark); }
.btn-fav.is-fav { background: #eaf5ec; border-color: #a9cdb1; color: var(--green); }
.btn-fav.is-fav .icon { fill: currentColor; }
.btn-fav--solid { background: var(--gold-soft); border-color: var(--gold); }
.btn-fav--lg { min-height: 46px; padding: 11px 20px; font-size: .95rem; }

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.chip {
	padding: 4px 10px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: #eff3ec;
	color: var(--green);
	font-size: .78rem;
	font-weight: 600;
	line-height: 1.35;
}

.chips__more { display: inline-flex; list-style: none; }

.chip--more {
	border-style: dashed;
	border-color: var(--olive);
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	font-weight: 700;
}
.chip--more:hover { border-color: var(--green); background: #fff; color: var(--green); }

.ficha-hero .chip--more { border-color: rgba(248, 251, 247, .45); color: rgba(248, 251, 247, .85); }
.ficha-hero .chip--more:hover { border-color: var(--paper); background: rgba(248, 251, 247, .12); color: #fff; }

.spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(248, 251, 247, .25);
	border-top-color: var(--gold);
	border-radius: 50%;
	animation: pm-spin .8s linear infinite;
	flex: none;
}

@keyframes pm-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
	html { scroll-behavior: auto; }
}

/* ═══════════════════════════════════════════════════════════════════
   4. BARRA SUPERIOR
   ═══════════════════════════════════════════════════════════════════ */

.topbar {
	position: sticky;
	top: 0;
	z-index: 60;
	background: var(--green-deep);
	color: var(--paper);
	box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}

.topbar__inner {
	display: flex;
	align-items: center;
	gap: 18px;
	min-height: var(--topbar);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	color: var(--paper);
	flex: none;
}
.brand:hover { color: #fff; }

.brand__mark {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: rgba(255, 255, 255, .07);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
	overflow: hidden;
}
.brand__mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name {
	font-family: var(--font-display);
	font-size: 1.06rem;
	font-weight: 700;
	letter-spacing: .01em;
}
.brand__sub {
	color: var(--gold);
	font-size: .63rem;
	font-weight: 800;
	letter-spacing: .2em;
	text-transform: uppercase;
}

.tabs {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-inline: auto;
	padding: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .05);
}

.tab {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 16px;
	border-radius: 999px;
	color: rgba(248, 251, 247, .68);
	font-size: .87rem;
	font-weight: 600;
	transition: background .15s, color .15s;
}
.tab .icon { width: 17px; height: 17px; }
.tab:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.tab.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }

.topbar__actions { display: flex; align-items: center; gap: 10px; flex: none; }

.topbar .btn-fav {
	min-height: 40px;
	border-color: rgba(248, 251, 247, .18);
	background: rgba(255, 255, 255, .04);
	color: #efd79a;
}
.topbar .btn-fav:hover { background: rgba(255, 255, 255, .1); border-color: rgba(248, 251, 247, .35); color: #fff; }
.topbar .btn-fav .icon { color: var(--gold); }

@media (max-width: 900px) {
	.tab { padding: 8px 12px; }
	.tab span { display: none; }
	.tab .icon { width: 20px; height: 20px; }
	.tabs { gap: 2px; }
	.topbar__actions .btn-fav__label { display: none; }
	.topbar .btn-fav { padding: 7px 10px; }
}

@media (max-width: 560px) {
	.brand__text { display: none; }
	.topbar__inner { gap: 10px; }
}

/* ═══════════════════════════════════════════════════════════════════
   5. HERO DEL HERBARIO
   ═══════════════════════════════════════════════════════════════════ */

.hero {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(1100px 420px at 82% -10%, rgba(78, 139, 99, .55), transparent 62%),
		linear-gradient(135deg, #16271c 0%, #1d3525 46%, #24422d 100%);
	color: var(--paper);
	padding: 54px 0 84px;
}

.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(circle at 1px 1px, rgba(248, 251, 247, .12) 1px, transparent 0);
	background-size: 26px 26px;
	opacity: .35;
	pointer-events: none;
}

.hero__inner {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
	gap: 40px;
	align-items: center;
}

.hero__title {
	margin: 0 0 14px;
	color: var(--paper);
	font-family: var(--font-display);
	font-size: clamp(2.5rem, 5.6vw, 4.1rem);
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.02;
}
.hero__title em { color: var(--gold); font-style: italic; }

.hero__lead {
	max-width: 62ch;
	margin: 0 0 24px;
	color: rgba(248, 251, 247, .78);
	font-size: 1.02rem;
	line-height: 1.65;
}
.hero__lead strong { color: var(--paper); }

.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; }

.hero__panel {
	position: relative;
	display: grid;
	gap: 10px;
	padding: 22px;
	border: 1px solid rgba(248, 251, 247, .14);
	border-radius: var(--radius-lg);
	background: rgba(248, 251, 247, .06);
	backdrop-filter: blur(6px);
	overflow: hidden;
}

.hero__watermark {
	position: absolute;
	right: -26px;
	top: -34px;
	color: rgba(248, 251, 247, .07);
	transform: rotate(-12deg);
	pointer-events: none;
}
.hero__watermark .icon { width: 170px; height: 170px; stroke-width: 1; }

.hero__stat {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	padding: 10px 0;
	border-bottom: 1px solid rgba(248, 251, 247, .1);
}
.hero__stat:last-child { border-bottom: 0; }
.hero__stat b {
	color: var(--paper);
	font-family: var(--font-display);
	font-size: 1.75rem;
	line-height: 1;
}
.hero__stat span {
	color: rgba(248, 251, 247, .62);
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-align: right;
	text-transform: uppercase;
}

@media (max-width: 860px) {
	.hero { padding: 40px 0 70px; }
	.hero__inner { grid-template-columns: 1fr; gap: 26px; }
	.hero__panel { grid-template-columns: repeat(3, 1fr); gap: 0; padding: 16px; }
	.hero__stat { flex-direction: column; align-items: flex-start; gap: 4px; border-bottom: 0; border-right: 1px solid rgba(248, 251, 247, .1); padding: 4px 12px; }
	.hero__stat:first-child { padding-left: 0; }
	.hero__stat:last-child { border-right: 0; }
	.hero__stat b { font-size: 1.35rem; }
	.hero__stat span { font-size: .66rem; text-align: left; }
	.hero__watermark .icon { width: 120px; height: 120px; }
}

@media (max-width: 520px) {
	.hero__panel { grid-template-columns: 1fr; }
	.hero__stat { flex-direction: row; align-items: baseline; border-right: 0; border-bottom: 1px solid rgba(248, 251, 247, .1); padding: 8px 0; }
	.hero__stat:last-child { border-bottom: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   6. HERBARIO: BUSCADOR, LETRAS Y LISTA
   ═══════════════════════════════════════════════════════════════════ */

.browser-wrap {
	position: relative;
	z-index: 2;
	margin-top: -42px;
	padding-bottom: 56px;
}

.browser {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.browser__search { padding: 18px 18px 6px; }

.searchbox {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 52px;
	padding: 0 14px;
	border: 1.5px solid var(--line);
	border-radius: 14px;
	background: #fff;
	color: var(--muted);
	transition: border-color .15s, box-shadow .15s;
}
.searchbox:focus-within { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(78, 139, 99, .12); }
.searchbox > .icon { width: 20px; height: 20px; color: var(--green); }

.searchbox input {
	flex: 1;
	min-width: 0;
	height: 100%;
	border: 0;
	background: transparent;
	color: var(--ink);
	font-size: .98rem;
	outline: none;
}
.searchbox input::placeholder { color: #9a9d92; }
.searchbox input::-webkit-search-cancel-button { display: none; }

.searchbox__clear {
	display: inline-grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 999px;
	background: var(--line-2);
	color: var(--ink-2);
}
.searchbox__clear:hover { background: var(--off); }
.searchbox__clear .icon { width: 16px; height: 16px; }

.letras {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 14px;
	padding-bottom: 12px;
}

.letra {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	width: 37px;
	height: 44px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 10px;
	background: #f2f0e6;
	color: #46503f;
	font-size: .84rem;
	font-weight: 800;
	line-height: 1;
	transition: background .12s, color .12s, transform .12s, border-color .12s;
}
.letra__n { font-size: .58rem; font-weight: 600; color: #8b8f82; line-height: 1; }
.letra:hover:not(:disabled) { background: #e8ecdF; border-color: #cfd8c6; transform: translateY(-1px); }
.letra.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.letra.is-active .letra__n { color: rgba(255, 255, 255, .72); }
.letra:disabled { opacity: .32; cursor: not-allowed; }

.browser__bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 12px 18px;
	border-top: 1px solid var(--line-2);
	border-bottom: 1px solid var(--line-2);
	background: #fbfaf5;
}

.browser__count {
	margin: 0;
	color: var(--ink);
	font-size: .86rem;
	font-weight: 800;
	letter-spacing: .02em;
}

.browser__filtro {
	margin: 0;
	color: var(--muted);
	font-size: .82rem;
}

.browser__limpiar {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
	padding: 4px 8px;
	border: 0;
	background: transparent;
	color: var(--green);
	font-size: .8rem;
	font-weight: 700;
}
.browser__limpiar:hover { color: var(--green-dark); text-decoration: underline; }
.browser__limpiar .icon { width: 14px; height: 14px; }

.plist {
	margin: 0;
	padding: 8px;
	list-style: none;
}

.row {
	display: flex;
	align-items: center;
	gap: 4px;
	border-radius: 12px;
	transition: background .12s;
}
.row:hover { background: #f7f5ec; }
.row[hidden] { display: none !important; }

.row__link {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 1;
	min-width: 0;
	padding: 9px 8px;
	color: var(--ink);
	border-radius: 12px;
}
.row__link:hover { color: var(--ink); }

.row__badge {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: #eef3ea;
	color: var(--green);
	font-family: var(--font-display);
	font-size: 1rem;
	font-weight: 700;
	flex: none;
}

.row__text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }

.row__name {
	color: var(--ink);
	font-family: var(--font-display);
	font-size: 1.04rem;
	font-weight: 700;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.row__sub {
	color: var(--muted);
	font-size: .8rem;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.row__chev { margin-left: auto; color: #b9b6a6; transition: transform .15s, color .15s; }
.row__chev .icon { width: 18px; height: 18px; }
.row:hover .row__chev { transform: translateX(3px); color: var(--green); }

.row__fav {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin-right: 6px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #c8a64a;
	flex: none;
	transition: background .12s, color .12s, transform .12s;
}
.row__fav .icon { width: 19px; height: 19px; }
.row__fav:hover { background: var(--gold-soft); transform: scale(1.06); }
.row__fav.is-fav { color: var(--green); background: #eaf5ec; }
.row__fav.is-fav .icon { fill: currentColor; }

/* Vacío / sin resultados */

.empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 54px 24px 58px;
	text-align: center;
	color: var(--muted);
}
.empty > .icon { width: 42px; height: 42px; color: var(--olive); stroke-width: 1.5; }
.empty__title { margin: 4px 0 0; color: var(--ink); font-family: var(--font-display); font-size: 1.4rem; }
.empty__text { margin: 0; max-width: 44ch; font-size: .92rem; }
.empty .btn { margin-top: 10px; }
.empty--page {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	padding: 64px 24px;
}
.empty--page .empty__code {
	font-family: var(--font-display);
	font-size: 3.6rem;
	font-weight: 700;
	color: var(--off);
	line-height: 1;
}
.empty__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.empty--sheet { padding: 36px 20px; }

/* ═══════════════════════════════════════════════════════════════════
   7. CABECERAS DE PÁGINA
   ═══════════════════════════════════════════════════════════════════ */

.pagehead {
	position: relative;
	padding: 46px 0 22px;
	background:
		radial-gradient(700px 260px at 90% 0%, rgba(78, 139, 99, .12), transparent 65%),
		linear-gradient(180deg, #f7f6ee 0%, var(--bg) 100%);
}

.pagehead__title {
	margin: 0 0 12px;
	font-family: var(--font-display);
	font-size: clamp(2.1rem, 4.6vw, 3.2rem);
	letter-spacing: -.02em;
}

.pagehead__lead {
	max-width: 68ch;
	margin: 0;
	color: var(--muted);
	font-size: 1rem;
	line-height: 1.65;
}

.pagehead--simple { padding-top: 0; background: none; }

/* ═══════════════════════════════════════════════════════════════════
   8. LIBRO / PDF
   ═══════════════════════════════════════════════════════════════════ */

.book { padding-bottom: 56px; }

.bookbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 10px;
	padding: 12px 14px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

.pagejump {
	display: flex;
	align-items: center;
	gap: 9px;
	flex-wrap: wrap;
}
.pagejump label {
	color: var(--muted);
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.pagejump input {
	width: 88px;
	height: 40px;
	padding: 0 10px;
	border: 1.5px solid var(--line);
	border-radius: 10px;
	background: #fff;
	color: var(--ink);
	font-weight: 700;
	text-align: center;
	outline: none;
}
.pagejump input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(78, 139, 99, .12); }
.pagejump .btn { min-height: 40px; padding: 8px 14px; }
.pagejump__total { color: var(--muted); font-size: .82rem; }

.bookbar__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bookbar__actions .btn { min-height: 40px; padding: 8px 13px; font-size: .84rem; }

.pdfwrap {
	position: relative;
	height: min(78vh, 880px);
	min-height: 520px;
	margin-top: 16px;
	border: 1px solid #263027;
	border-radius: var(--radius);
	background: #3a3f3a;
	overflow: hidden;
	box-shadow: var(--shadow);
}

.pdfwrap iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	background: #525659;
}

.pdfwrap__loading {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: #1a2019;
	color: rgba(248, 251, 247, .82);
	font-size: .9rem;
	font-weight: 600;
	pointer-events: none;
}

.pdfwrap:fullscreen { height: 100vh; border-radius: 0; border: 0; }
.pdfwrap:fullscreen iframe { height: 100vh; }

.note {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin: 14px 0 0;
	color: var(--muted);
	font-size: .84rem;
	line-height: 1.55;
}
.note .icon { width: 17px; height: 17px; margin-top: 2px; color: var(--gold-dark); }

.bookinfo {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-top: 22px;
}
.bookinfo__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 15px 16px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}
.bookinfo__item > .icon { width: 24px; height: 24px; color: var(--green); flex: none; }
.bookinfo__item b { display: block; color: var(--ink); font-family: var(--font-display); font-size: 1.15rem; line-height: 1.2; }
.bookinfo__item span { color: var(--muted); font-size: .78rem; }

@media (max-width: 760px) {
	.bookbar { align-items: stretch; }
	.pagejump { width: 100%; }
	.bookbar__actions { width: 100%; }
	.bookbar__actions .btn { flex: 1 1 auto; }
	.pdfwrap { height: 70vh; min-height: 420px; }
	.bookinfo { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
	.browser__search { padding: 14px 12px 4px; }
	.letra { width: 34px; height: 38px; font-size: .78rem; }
	.letra__n { display: none; }
	.row__link { gap: 10px; padding: 8px 4px; }
	.row__badge { width: 34px; height: 34px; font-size: .9rem; }
	.row__name { font-size: .98rem; }
	.row__sub { font-size: .76rem; }
	.row__fav { width: 36px; height: 36px; margin-right: 2px; }
	.browser__bar { padding: 10px 12px; }
	.plist { padding: 6px; }
}

/* ═══════════════════════════════════════════════════════════════════
   9. QUIZ — PORTADA
   ═══════════════════════════════════════════════════════════════════ */

.quiz { padding-bottom: 64px; }
.quiz-portada { padding-top: 42px; }

.quizhead {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
	gap: 32px;
	align-items: start;
}

.quizhead__copy .pagehead__title { margin-bottom: 12px; }

.records {
	padding: 18px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

.records__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
	color: var(--ink);
	font-size: .82rem;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.records__title .icon { width: 17px; height: 17px; color: var(--gold-dark); }

.records__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.record {
	padding: 10px 12px;
	background: #f7f5ec;
	border-radius: 10px;
}
.record b {
	display: block;
	color: var(--ink);
	font-family: var(--font-display);
	font-size: 1.35rem;
	line-height: 1.15;
}
.record span { color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .02em; }

.records__empty {
	margin: 10px 0 0;
	color: var(--muted);
	font-size: .78rem;
	font-style: italic;
}

.quiz__subtitle {
	margin: 38px 0 14px;
	font-family: var(--font-display);
	font-size: 1.4rem;
}

.modos {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.modo {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 18px;
	border: 1.5px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--ink);
	text-align: left;
	box-shadow: var(--shadow-sm);
	transition: transform .16s, border-color .16s, box-shadow .16s;
}
.modo:hover {
	transform: translateY(-3px);
	border-color: var(--green-2);
	box-shadow: var(--shadow);
}
.modo:disabled { opacity: .6; cursor: wait; transform: none; }

.modo__icon {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 13px;
	background: #eaf3ec;
	color: var(--green);
	flex: none;
}
.modo__icon .icon { width: 23px; height: 23px; }

.modo--aprendiz .modo__icon { background: #eef4e6; color: #5b8a3c; }
.modo--herbolario .modo__icon { background: #e6f1e9; color: var(--green); }
.modo--maestro .modo__icon { background: #fbeceb; color: var(--red); }
.modo--personalizado .modo__icon { background: var(--gold-soft); color: var(--gold-dark); }

.modo__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.modo__name { font-family: var(--font-display); font-size: 1.16rem; font-weight: 700; line-height: 1.2; }
.modo__desc { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.modo__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.modo__tags span {
	padding: 3px 8px;
	border-radius: 999px;
	background: #f2f0e6;
	color: #5b6354;
	font-size: .68rem;
	font-weight: 700;
	line-height: 1.3;
}
.modo__go { color: #b9b6a6; align-self: center; }
.modo__go .icon { width: 19px; height: 19px; }
.modo:hover .modo__go { color: var(--green); }

.quiz__nota {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 18px 0 0;
	color: var(--muted);
	font-size: .82rem;
}
.quiz__nota .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--gold-dark); }

@media (max-width: 900px) {
	.quizhead { grid-template-columns: 1fr; gap: 20px; }
	.records__grid { grid-template-columns: repeat(4, 1fr); }
	.modos { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
	.records__grid { grid-template-columns: 1fr 1fr; }
	.record b { font-size: 1.2rem; }
	.quiz-portada { padding-top: 28px; }
}

/* ═══════════════════════════════════════════════════════════════════
   10. QUIZ — PARTIDA
   ═══════════════════════════════════════════════════════════════════ */

.quiz-juego { padding: 26px 0 64px; }

.gamebar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	padding: 12px 16px;
	background: var(--green-deep);
	color: var(--paper);
	border-radius: var(--radius) var(--radius) 0 0;
}

.gamebar__stats { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.gamebar__actions { display: flex; align-items: center; gap: 8px; }

.gstat {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: rgba(248, 251, 247, .72);
	font-size: .82rem;
	font-weight: 600;
	white-space: nowrap;
}
.gstat b { color: var(--paper); font-size: .92rem; }
.gstat--puntos b { font-family: var(--font-display); font-size: 1.1rem; }
.gstat--contador b { font-variant-numeric: tabular-nums; }

.gstat--vidas { gap: 2px; }
.gstat--vidas .heart { display: inline-flex; color: var(--gold); }
.gstat--vidas .heart .icon { width: 17px; height: 17px; fill: currentColor; stroke-width: 1.5; }
.gstat--vidas .heart.is-lost { color: #545c50; }

.gstat--racha { color: var(--gold); }
.gstat--racha .icon { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.gstat--racha b { color: var(--gold); }

.gstat--modo {
	padding: 4px 10px;
	border: 1px solid rgba(248, 251, 247, .2);
	border-radius: 999px;
	color: rgba(248, 251, 247, .8);
	font-size: .7rem;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.gamebar .btn-icon {
	border-color: rgba(248, 251, 247, .2);
	color: var(--paper);
	width: 34px;
	height: 34px;
}
.gamebar .btn-icon:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .4); }

.timebar {
	height: 6px;
	margin-bottom: 26px;
	background: #2a3229;
	border-radius: 0 0 4px 4px;
	overflow: hidden;
}
.timebar__fill {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, #5aa06f, var(--green-2));
	transition: width .12s linear, background .2s;
}
.timebar__fill.is-warn { background: linear-gradient(90deg, #e0b45c, var(--gold)); }
.timebar__fill.is-danger { background: linear-gradient(90deg, #c65a56, var(--red)); }

.question { max-width: 860px; margin-inline: auto; }

.question__meta {
	margin: 0 0 6px;
	color: var(--muted);
	font-size: .76rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.question__meta b { color: var(--green); }

.question__text {
	margin: 0 0 22px;
	font-family: var(--font-display);
	font-size: clamp(1.32rem, 2.6vw, 1.8rem);
	font-weight: 700;
	line-height: 1.3;
}

.opciones { display: grid; gap: 9px; }

.opcion {
	display: flex;
	align-items: center;
	gap: 13px;
	width: 100%;
	padding: 13px 15px;
	border: 1.5px solid var(--line);
	border-radius: 14px;
	background: var(--surface);
	color: var(--ink-2);
	font-size: .97rem;
	line-height: 1.45;
	text-align: left;
	box-shadow: 0 1px 0 rgba(20, 26, 19, .02);
	transition: border-color .13s, background .13s, transform .13s;
}
.opcion:hover:not(:disabled) { border-color: var(--green-2); background: #fbfdf9; transform: translateX(2px); }
.opcion:disabled { cursor: default; }

.opcion__key {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 9px;
	background: #f2f0e6;
	color: #55604e;
	font-size: .78rem;
	font-weight: 900;
	flex: none;
}

.opcion__text { flex: 1; min-width: 0; }
.opcion__mark { display: inline-flex; color: inherit; }
.opcion__mark .icon { width: 19px; height: 19px; }

.opcion.is-correct { background: #eaf5ec; border-color: #7fb98c; color: #1f4a2a; }
.opcion.is-correct .opcion__key { background: var(--green); color: #fff; }
.opcion.is-correct .opcion__mark { color: var(--green); }

.opcion.is-wrong { background: var(--red-soft); border-color: #d29b99; color: #6d2624; }
.opcion.is-wrong .opcion__key { background: var(--red); color: #fff; }
.opcion.is-wrong .opcion__mark { color: var(--red); }

.opcion.is-dim { opacity: .5; }
.opcion.is-discarded { opacity: .34; background: #f4f3ec; border-style: dashed; }
.opcion.is-discarded .opcion__text { text-decoration: line-through; }
.opcion.is-correct.is-discarded { opacity: 1; background: #eaf5ec; border-style: solid; }

.feedback {
	margin-top: 16px;
	padding: 16px 18px;
	border: 1px solid var(--line);
	border-left: 4px solid var(--green);
	border-radius: 12px;
	background: var(--surface);
	box-shadow: var(--shadow-sm);
}
.feedback__head { display: flex; align-items: flex-start; gap: 9px; }
.feedback__icon { display: inline-flex; flex: none; margin-top: 1px; }
.feedback__icon .icon { width: 21px; height: 21px; }
.feedback__icon.is-ok { color: var(--green); }
.feedback__icon.is-bad { color: var(--red); }

.feedback__result { margin: 0; font-weight: 700; line-height: 1.45; }
.feedback__result.is-ok { color: #235c31; }
.feedback__result.is-bad { color: #7a2d2b; }

.feedback__exp {
	margin: 9px 0 0;
	padding-top: 9px;
	border-top: 1px dashed var(--line);
	color: var(--muted);
	font-size: .88rem;
	line-height: 1.55;
}

.feedback .btn { margin-top: 12px; }

.question__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 20px;
	padding-top: 14px;
	border-top: 1px solid var(--line);
}
.question__foot .btn { min-height: 40px; padding: 8px 14px; font-size: .84rem; }
.question__foot .pill { margin-left: 2px; }

.question__timer {
	color: var(--muted);
	font-size: .9rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

@media (max-width: 620px) {
	.quiz-juego { padding-top: 16px; }
	.gamebar { padding: 10px 12px; gap: 8px; }
	.gamebar__stats { gap: 10px; }
	.gstat--modo { display: none; }
	.opcion { padding: 12px; gap: 10px; font-size: .92rem; }
	.opcion__key { width: 27px; height: 27px; }
	.question__text { margin-bottom: 16px; }
	.timebar { margin-bottom: 18px; }
	.feedback { padding: 14px; }
}

/* ═══════════════════════════════════════════════════════════════════
   11. QUIZ — RESUMEN
   ═══════════════════════════════════════════════════════════════════ */

.quiz-resumen { padding: 36px 0 72px; }

.resumen {
	max-width: 900px;
	margin-inline: auto;
	padding: clamp(20px, 4vw, 38px);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
}

.resumen__top { display: flex; align-items: center; gap: 26px; }

.rankring {
	--p: 0;
	--ring: var(--green);
	position: relative;
	display: grid;
	place-items: center;
	width: 132px;
	height: 132px;
	border-radius: 50%;
	background: conic-gradient(var(--ring) calc(var(--p) * 1%), var(--line-2) 0);
	flex: none;
}
.rankring::before {
	content: "";
	position: absolute;
	inset: 11px;
	border-radius: 50%;
	background: var(--surface);
}
.rankring span {
	position: relative;
	z-index: 1;
	color: var(--ink);
	font-family: var(--font-display);
	font-size: 1.55rem;
	font-weight: 700;
}
.rankring.is-mid { --ring: var(--gold); }
.rankring.is-low { --ring: var(--red); }

.resumen__rank h2 {
	margin: 0 0 6px;
	font-family: var(--font-display);
	font-size: clamp(1.9rem, 4vw, 2.7rem);
	letter-spacing: -.01em;
}
.resumen__rank p { margin: 0; color: var(--muted); font-size: .95rem; }

.resumen__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 9px;
	margin-top: 26px;
}
.rstat { padding: 12px 14px; background: #f7f5ec; border-radius: 12px; }
.rstat b {
	display: block;
	color: var(--ink);
	font-family: var(--font-display);
	font-size: 1.4rem;
	line-height: 1.2;
}
.rstat span { color: var(--muted); font-size: .72rem; font-weight: 600; }

.resumen__aviso {
	margin: 16px 0 0;
	padding: 10px 14px;
	border: 1px solid #ead9a8;
	border-radius: 10px;
	background: var(--gold-soft);
	color: #745711;
	font-size: .86rem;
	font-weight: 600;
}

.resumen__fallos { margin-top: 30px; }
.resumen__fallos h3 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 4px;
	font-family: var(--font-display);
	font-size: 1.2rem;
}

.fallos { display: flex; flex-direction: column; }

.fallo { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.fallo:last-child { border-bottom: 0; }
.fallo__q { margin: 0 0 5px; color: var(--ink); font-size: .92rem; font-weight: 600; line-height: 1.5; }
.fallo__line { margin: 0; font-size: .84rem; line-height: 1.5; }
.fallo__line.is-bad { color: var(--red); }
.fallo__line.is-ok { color: var(--green); }

.fallos__vacio {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 12px 0 0;
	color: var(--green);
	font-size: .9rem;
	font-weight: 600;
}
.fallos__vacio .icon { width: 18px; height: 18px; }

.resumen__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin-top: 28px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
	.resumen__top { flex-direction: column; align-items: flex-start; gap: 16px; }
	.rankring { width: 104px; height: 104px; }
	.rankring span { font-size: 1.25rem; }
	.resumen__grid { grid-template-columns: 1fr 1fr; }
	.resumen__actions .btn { flex: 1 1 auto; }
}

/* ═══════════════════════════════════════════════════════════════════
   12. PANEL DE FAVORITOS
   ═══════════════════════════════════════════════════════════════════ */

.drawer { position: fixed; inset: 0; z-index: 90; }

.drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 14, 9, .55);
	opacity: 0;
	transition: opacity .2s;
	backdrop-filter: blur(2px);
}
.drawer.is-open .drawer__overlay { opacity: 1; }

.drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(420px, 94vw);
	display: flex;
	flex-direction: column;
	background: var(--paper);
	box-shadow: var(--shadow-lg);
	transform: translateX(102%);
	transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.drawer.is-open .drawer__panel { transform: translateX(0); }

.drawer__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 20px;
	border-bottom: 1px solid var(--line);
}
.drawer__head .eyebrow { margin-bottom: 6px; }
.drawer__head h2 { margin: 0; font-family: var(--font-display); font-size: 1.45rem; }

.drawer__body { flex: 1; overflow: auto; padding: 10px 12px 24px; }

.fav-list { margin: 0; padding: 0; list-style: none; }

.favrow { display: flex; align-items: center; gap: 2px; border-radius: 12px; }
.favrow:hover { background: #f1efe4; }

.favrow__link {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
	min-width: 0;
	padding: 9px 8px;
	color: var(--ink);
	border-radius: 12px;
}
.favrow__link:hover { color: var(--ink); }

.favrow__del {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--muted);
	flex: none;
}
.favrow__del:hover { background: var(--red-soft); color: var(--red); }
.favrow__del .icon { width: 16px; height: 16px; }

.fav-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 48px 24px;
	color: var(--muted);
	font-size: .9rem;
	line-height: 1.55;
	text-align: center;
}
.fav-empty .icon { width: 34px; height: 34px; color: var(--gold); }

/* ═══════════════════════════════════════════════════════════════════
   13. FICHA LATERAL
   ═══════════════════════════════════════════════════════════════════ */

.sheet { position: fixed; inset: 0; z-index: 95; }

.sheet__overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 14, 9, .5);
	opacity: 0;
	transition: opacity .2s;
	backdrop-filter: blur(2px);
}
.sheet.is-open .sheet__overlay { opacity: 1; }

.sheet__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(720px, 96vw);
	display: flex;
	flex-direction: column;
	background: var(--paper);
	box-shadow: var(--shadow-lg);
	transform: translateX(102%);
	transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.sheet.is-open .sheet__panel { transform: translateX(0); }

.sheet__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 22px 14px;
	border-bottom: 1px solid var(--line);
	background: var(--paper);
}
.sheet__headtext { min-width: 0; }
.sheet__head .eyebrow { margin-bottom: 6px; }
.sheet__head h2 {
	margin: 0 0 2px;
	font-family: var(--font-display);
	font-size: clamp(1.45rem, 3vw, 2rem);
	line-height: 1.15;
}
.sheet__sci { margin: 0; color: var(--muted); font-size: .9rem; font-style: italic; }

.sheet__tools { display: flex; align-items: center; gap: 8px; flex: none; }

.sheet__body { flex: 1; overflow: auto; padding: 16px 22px 24px; }
.sheet__body .chips { margin-top: 0; margin-bottom: 14px; }
.sheet__body .ficha-sec { margin-bottom: 10px; }

.sheet__foot { padding: 12px 22px; border-top: 1px solid var(--line); background: var(--paper); }

.sheet__loading {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 30px 4px;
	color: var(--muted);
	font-size: .9rem;
}
.sheet__loading .spinner { border-color: rgba(20, 26, 19, .15); border-top-color: var(--green); }
.sheet__vacio { color: var(--muted); font-size: .9rem; }

@media (max-width: 560px) {
	.drawer__panel { width: 100%; }
	.sheet__head { padding: 16px 16px 12px; }
	.sheet__body { padding: 12px 16px 20px; }
	.sheet__foot { padding: 10px 16px; }
	.sheet__tools { gap: 6px; }
}

/* ═══════════════════════════════════════════════════════════════════
   14. FICHA DE PLANTA (PÁGINA COMPLETA)
   ═══════════════════════════════════════════════════════════════════ */

.ficha { padding-top: 22px; padding-bottom: 60px; }

.crumbs {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 7px;
	margin-bottom: 14px;
	color: var(--muted);
	font-size: .82rem;
}
.crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; }
.crumbs .icon { width: 14px; height: 14px; }
.crumbs > .icon { color: #b3b0a1; }

.ficha-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 26px;
	overflow: hidden;
	padding: clamp(24px, 4vw, 44px);
	border-radius: var(--radius-lg);
	background:
		radial-gradient(900px 360px at 88% -20%, rgba(78, 139, 99, .5), transparent 60%),
		linear-gradient(135deg, #16271c, #24422d);
	color: var(--paper);
	box-shadow: var(--shadow);
}

.ficha-hero__letter {
	position: absolute;
	right: 10px;
	top: -46px;
	color: rgba(248, 251, 247, .05);
	font-family: var(--font-display);
	font-size: 240px;
	line-height: 1;
	pointer-events: none;
	user-select: none;
}

.ficha-hero__main { position: relative; z-index: 1; min-width: 0; max-width: 72ch; }

.ficha-hero__title {
	margin: 0 0 4px;
	color: var(--paper);
	font-family: var(--font-display);
	font-size: clamp(2rem, 5vw, 3.4rem);
	letter-spacing: -.015em;
}

.ficha-hero__sci { margin: 0 0 4px; color: rgba(248, 251, 247, .72); font-size: 1.05rem; }
.ficha-hero .chip {
	background: rgba(248, 251, 247, .1);
	border-color: rgba(248, 251, 247, .22);
	color: rgba(248, 251, 247, .92);
}

.ficha-hero__side {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	flex: none;
}

.ficha-hero__side .btn--ghost { border-color: rgba(248, 251, 247, .25); color: var(--paper); }
.ficha-hero__side .btn--ghost:hover { background: rgba(248, 251, 247, .12); border-color: rgba(248, 251, 247, .5); color: #fff; }
.ficha-hero__side .btn-fav { background: rgba(217, 164, 65, .16); border-color: rgba(217, 164, 65, .55); color: #f0d79a; }
.ficha-hero__side .btn-fav:hover { background: rgba(217, 164, 65, .26); color: #fff3d2; }
.ficha-hero__side .btn-fav.is-fav { background: rgba(78, 139, 99, .28); border-color: #8fc39d; color: #dcf3e1; }

.ficha-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 22px;
	align-items: start;
	margin-top: 22px;
}

.ficha-body { min-width: 0; }

.ficha-sec {
	padding: 20px;
	margin-bottom: 12px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

.ficha-sec__title {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 10px;
	color: var(--green);
	font-family: var(--font-body);
	font-size: .76rem;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
}
.ficha-sec__title .icon { width: 18px; height: 18px; }

.ficha-sec__text { color: var(--ink-2); font-size: .95rem; line-height: 1.68; }
.ficha-sec__text p { margin: 0 0 .8em; }
.ficha-sec__text p:last-child { margin-bottom: 0; }

.ficha-aside {
	position: sticky;
	top: calc(var(--topbar) + 16px);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.asidecard {
	position: relative;
	overflow: hidden;
	padding: 17px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

.asidecard__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px;
	color: var(--ink);
	font-size: .76rem;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.asidecard__title .icon { width: 16px; height: 16px; color: var(--green); }

.asidecard__text { margin: 0 0 12px; color: var(--muted); font-size: .86rem; line-height: 1.55; }

.asidecard--cta { background: linear-gradient(160deg, #f1f7ee, #e7f0e3); border-color: #d5e3cf; }
.asidecard__watermark { position: absolute; right: -14px; bottom: -18px; color: rgba(63, 125, 78, .1); }
.asidecard__watermark .icon { width: 100px; height: 100px; stroke-width: 1; }

.datos { margin: 0; }
.datos dt {
	margin-top: 10px;
	color: var(--muted);
	font-size: .67rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.datos dt:first-child { margin-top: 0; }
.datos dd { margin: 2px 0 0; color: var(--ink-2); font-size: .88rem; line-height: 1.5; }

.ficha-nav { padding: 4px; }
.ficha-nav__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--line-2);
	color: var(--ink);
}
.ficha-nav__item:last-child { border-bottom: 0; }
.ficha-nav__item:hover { color: var(--green); }
.ficha-nav__item .icon { width: 17px; height: 17px; color: var(--green); flex: none; }
.ficha-nav__item span { display: flex; flex-direction: column; font-size: .85rem; font-weight: 600; line-height: 1.3; }
.ficha-nav__item small {
	color: var(--muted);
	font-size: .63rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.ficha-nav__item--next { justify-content: flex-end; text-align: right; }

@media (max-width: 980px) {
	.ficha-layout { grid-template-columns: 1fr; }
	.ficha-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
	.ficha-hero { flex-direction: column; align-items: flex-start; }
	.ficha-hero__side { flex-direction: row; flex-wrap: wrap; }
	.ficha-hero__letter { top: -30px; font-size: 180px; }
	.ficha-aside { grid-template-columns: 1fr; }
	.ficha-sec { padding: 16px; }
}

/* ═══════════════════════════════════════════════════════════════════
   15. PIE Y NAVEGACIÓN MÓVIL
   ═══════════════════════════════════════════════════════════════════ */

.footer {
	margin-top: 48px;
	padding: 36px 0;
	background: var(--green-deep);
	color: rgba(248, 251, 247, .7);
}

.footer__inner {
	display: grid;
	grid-template-columns: 1.2fr .9fr auto;
	gap: 24px;
	align-items: center;
}

.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand img { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.footer__title { margin: 0; color: var(--paper); font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.footer__text { margin: 0; max-width: 46ch; font-size: .78rem; line-height: 1.5; }

.footer__nav { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; }
.footer__nav a,
.footer__link {
	padding: 0;
	border: 0;
	background: none;
	color: rgba(248, 251, 247, .72);
	font-size: .85rem;
}
.footer__nav a:hover,
.footer__link:hover { color: var(--gold); }

.footer__credit { margin: 0; color: rgba(248, 251, 247, .55); font-size: .78rem; text-align: right; }
.footer__credit strong { color: var(--gold); font-weight: 700; }

.mobilenav { display: none; }

@media (max-width: 900px) {
	.footer__inner { grid-template-columns: 1fr; gap: 18px; }
	.footer__credit { text-align: left; }
}

@media (max-width: 860px) {
	.mobilenav {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 70;
		display: flex;
		padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
		border-top: 1px solid rgba(255, 255, 255, .08);
		background: rgba(20, 26, 19, .98);
		backdrop-filter: blur(8px);
	}
	.mobilenav__item {
		display: flex;
		flex: 1;
		flex-direction: column;
		align-items: center;
		gap: 2px;
		padding: 4px;
		border: 0;
		background: none;
		color: rgba(248, 251, 247, .55);
		font-size: .63rem;
		font-weight: 600;
	}
	.mobilenav__item .icon { width: 21px; height: 21px; }
	.mobilenav__item.is-active { color: var(--gold); }
	.mobilenav__iconwrap { position: relative; display: inline-flex; }
	.footer { padding-bottom: 104px; }
}

/* ═══════════════════════════════════════════════════════════════════
   16. AVISOS
   ═══════════════════════════════════════════════════════════════════ */

.toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 120;
	max-width: calc(100% - 32px);
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--ink);
	color: var(--paper);
	font-size: .86rem;
	font-weight: 600;
	text-align: center;
	box-shadow: var(--shadow-lg);
	opacity: 0;
	transform: translate(-50%, 10px);
	transition: opacity .18s, transform .18s;
	pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
	.toast { bottom: 86px; }
}

/* ═══════════════════════════════════════════════════════════════════
   17. BLOG, PÁGINAS Y CONTENIDO DE WORDPRESS
   ═══════════════════════════════════════════════════════════════════ */

.page { padding: 40px 0 64px; }

.posts { display: grid; gap: 16px; margin-top: 20px; }

.postcard {
	display: grid;
	grid-template-columns: 280px 1fr;
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}
.postcard__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.postcard__body { padding: 18px 20px; }
.postcard__meta {
	margin: 0 0 4px;
	color: var(--muted);
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.postcard__title { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.3rem; }
.postcard__title a { color: var(--ink); }
.postcard__title a:hover { color: var(--green); }
.postcard__excerpt { color: var(--muted); font-size: .9rem; }

.prose {
	max-width: 780px;
	margin: 0 auto;
	padding: clamp(18px, 3vw, 32px);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}
.prose h2,
.prose h3 { margin-top: 1.4em; font-family: var(--font-display); }
.prose p,
.prose li { line-height: 1.72; }
.prose img { border-radius: 12px; }
.prose a { text-decoration: underline; }
.prose blockquote {
	margin: 1.4em 0;
	padding: 10px 18px;
	border-left: 4px solid var(--gold);
	background: var(--gold-soft);
	color: #5d4a1c;
}
.prose code {
	padding: 2px 6px;
	border-radius: 6px;
	background: #f1efe4;
	font-size: .9em;
}
.prose pre { overflow: auto; padding: 16px; border-radius: 12px; background: #f1efe4; }

.pagebody__media img { margin-bottom: 18px; border-radius: var(--radius); }

.navigation.pagination { margin-top: 24px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.nav-links .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface);
	color: var(--ink-2);
	font-size: .86rem;
	font-weight: 600;
}
.nav-links .page-numbers.current { background: var(--green); border-color: var(--green); color: #fff; }
.nav-links .page-numbers:hover { border-color: var(--green-2); }

@media (max-width: 700px) {
	.postcard { grid-template-columns: 1fr; }
	.postcard__media img { max-height: 220px; }
}

/* ═══════════════════════════════════════════════════════════════════
   18. DETALLES FINALES
   ═══════════════════════════════════════════════════════════════════ */

.view.pm-enter { animation: pm-fade .22s ease; }

@keyframes pm-fade {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: none; }
}

/* En pantallas táctiles el hover no aporta y molesta */
@media (hover: none) {
	.modo:hover,
	.row:hover,
	.btn:hover { transform: none; }
	.row:hover { background: transparent; }
}

/* Scrollbar discreta (solo navegadores que la soportan) */
@supports (scrollbar-width: thin) {
	.drawer__body,
	.sheet__body { scrollbar-width: thin; scrollbar-color: var(--olive) transparent; }
}


/* ═══════════════════════════════════════════════════════════════════
   ESTUDIOS CIENTÍFICOS (IA)
   ═══════════════════════════════════════════════════════════════════ */

.ficha-sec__intro {
	margin: 0 0 12px;
	color: var(--muted);
	font-size: .86rem;
	line-height: 1.55;
}

.estudios-lista { display: flex; flex-direction: column; gap: 12px; }

.estudio {
	padding: 14px 16px;
	background: var(--surface-2, var(--surface));
	border: 1px solid var(--line-2, var(--line));
	border-radius: var(--radius-sm, var(--radius));
}

.estudio__title {
	margin: 0 0 4px;
	color: var(--ink);
	font-family: var(--font-display);
	font-size: 1.05rem;
	line-height: 1.3;
}

.estudio__meta {
	margin: 0 0 6px;
	color: var(--green);
	font-size: .74rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.estudio__autores {
	margin: 0 0 6px;
	color: var(--ink-2);
	font-size: .88rem;
	font-weight: 600;
}

.estudio__bio {
	margin: 0 0 6px;
	color: var(--muted);
	font-size: .84rem;
	line-height: 1.5;
	font-style: italic;
}

.estudio__resumen {
	margin: 0 0 8px;
	color: var(--ink-2);
	font-size: .9rem;
	line-height: 1.6;
}

.estudio__link {
	display: inline-block;
	color: var(--green);
	font-size: .85rem;
	font-weight: 700;
	text-decoration: none;
}

.estudio__link:hover { text-decoration: underline; }

.estudios-cargando {
	color: var(--muted);
	font-style: italic;
	margin: 0;
}
