/*
Theme Name: yhstky Webtoon
Theme URI: https://yhstky.shop/
Author: yhstky
Author URI: https://yhstky.shop/
Description: Tema oscuro romantico para la biblioteca de webtoons en espanol de yhstky.shop. Incluye el subsistema de herramientas heredado (CPT tool + tool_category, permalinks /tools/<categoria>/<herramienta>/), lector vertical de capitulos, planes de suscripcion (arquitectura lista, pagos pendientes), espacios publicitarios como marcadores y pipeline de marca de agua documentado. Sin peticiones externas, sin frameworks: CSS y JS vanilla.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yhstky-webtoon
Tags: webtoon, manga, dark, responsive, custom-post-types, spanish
*/

/* ==========================================================================
   yhstky Webtoon 1.0.0 — hoja de estilos principal
   Diseno: romantico oscuro — indigo profundo / ciruela + acentos dorados.
   Mobile-first. Cero scroll horizontal: todo usa max-width:100% y
   box-sizing:border-box. Sin peticiones externas (tipografias del sistema).
   ========================================================================== */

:root {
	/* Paleta romantica oscura */
	--plum-950: #12081c;   /* fondo pagina */
	--plum-900: #1a0e27;   /* fondo superficie */
	--plum-800: #241236;   /* superficie elevada */
	--plum-700: #311a49;   /* bordes / tarjetas hover */
	--indigo: #4c2e83;     /* acento indigo */
	--indigo-bright: #7c5cd6;
	--gold: #d9a441;       /* acento dorado */
	--gold-soft: #f0d089;
	--rose: #c86b8a;       /* acento secundario tenue */
	--ink: #f6f1e7;        /* texto principal */
	--text: #efe7d8;
	--muted: #bfa9d4;      /* texto secundario */
	--faint: #8a749e;      /* texto tenue */
	--border: #3a2353;
	--border-strong: #54356f;
	--success: #5fc98a;
	--danger: #e06c7a;
	--gradient-brand: linear-gradient(135deg, #4c2e83 0%, #7c3f6e 55%, #a86a3c 130%);
	--gradient-gold: linear-gradient(135deg, #d9a441, #f0d089);
	--focus-ring: rgba(217, 164, 65, .55);
	--shadow-card: 0 10px 30px rgba(0, 0, 0, .45);
	--font-display: Georgia, 'Times New Roman', 'Noto Serif', serif;
	--font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
	--font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
	--radius: 18px;
}

/* ── Reset base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
	font-family: var(--font-body);
	background: var(--plum-950);
	color: var(--text);
	line-height: 1.65;
	font-size: 16px;
	overflow-x: hidden; /* cinturon de seguridad: nunca scroll horizontal de pagina */
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--gold-soft); }
a:hover { color: var(--gold); }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 1024px) { .wrap { padding: 0 32px; } }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.skip-link {
	position: absolute; left: 16px; top: -60px; z-index: 200;
	background: var(--gold); color: #241236; padding: 10px 18px;
	border-radius: 10px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #241236; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Cabecera ───────────────────────────────────────────────── */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: rgba(18, 8, 28, .92);
	backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .01em; }
.brand .wordmark { color: var(--ink); }
.logo-badge stop.lg-a { stop-color: #6b3fa8; }
.logo-badge stop.lg-b { stop-color: #d9a441; }
.nav-links { display: none; gap: 24px; list-style: none; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; padding: 6px 0; position: relative; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--gold-soft); }
.nav-links a.is-active::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: -4px; width: 16px; height: 2px; border-radius: 4px; background: var(--gold); }
@media (min-width: 860px) { .nav-links { display: flex; } }
.menu-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px;
	background: var(--plum-800); cursor: pointer; color: var(--text);
}
.menu-toggle svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
@media (min-width: 860px) { .menu-toggle { display: none; } }
.mobile-nav { display: none; border-top: 1px solid var(--border); }
.mobile-nav.open { display: block; }
.mobile-nav ul { list-style: none; margin: 12px 20px 16px; padding: 12px; background: var(--plum-900); border: 1px solid var(--border); border-radius: 16px; display: grid; gap: 2px; }
.mobile-nav a { display: block; padding: 12px; font-size: 17px; font-weight: 500; color: var(--text); text-decoration: none; border-radius: 10px; }
.mobile-nav a:hover { background: var(--plum-800); }

/* ── Espacios publicitarios (marcadores) ────────────────────── */
.yhwt-ad-slot { max-width: 1140px; margin: 0 auto; padding: 14px 20px 0; }
.yhwt-ad-slot:empty { display: none !important; }
.yhwt-ad-slot .yhwt-ad-placeholder {
	border: 2px dashed var(--border-strong); border-radius: 14px;
	color: var(--faint); font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
	text-align: center; padding: 18px 12px; background: rgba(76, 46, 131, .12);
}

/* ── Hero de la biblioteca ──────────────────────────────────── */
.hero {
	position: relative; overflow: hidden; border-radius: 22px;
	margin: 24px 0 0; padding: 44px 22px; text-align: center;
	background: radial-gradient(120% 140% at 50% 0%, #3a1f5e 0%, #1a0e27 55%, #12081c 100%);
	border: 1px solid var(--border);
}
.hero::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: radial-gradient(500px 260px at 80% 10%, rgba(217, 164, 65, .14), transparent 60%);
}
.hero > * { position: relative; }
.hero-badge {
	display: inline-flex; align-items: center; gap: 8px;
	border: 1px solid var(--border-strong); border-radius: 999px;
	padding: 8px 16px; font-size: 12px; font-weight: 700; letter-spacing: .1em;
	text-transform: uppercase; color: var(--gold-soft); background: rgba(217, 164, 65, .08);
	margin-bottom: 18px;
}
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.12; letter-spacing: -.01em; margin-bottom: 14px; color: var(--ink); }
.hero h1 .accent { color: var(--gold-soft); font-style: italic; }
.hero .lede { color: var(--muted); font-size: 17px; line-height: 1.6; max-width: 620px; margin: 0 auto 26px; }
@media (min-width: 768px) { .hero { padding: 64px 40px; } .hero h1 { font-size: 42px; } .hero .lede { font-size: 18px; } }
@media (min-width: 1100px) { .hero { padding: 80px 64px; } .hero h1 { font-size: 50px; } }

/* ── Botones ────────────────────────────────────────────────── */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 48px; padding: 0 28px; border: none; border-radius: 999px;
	font-family: var(--font-body); font-weight: 700; font-size: 16px;
	cursor: pointer; text-decoration: none;
	background: var(--gradient-gold); color: #241236;
	box-shadow: 0 6px 18px rgba(217, 164, 65, .25);
}
.btn:hover { color: #241236; filter: brightness(1.06); }
.btn--ghost { background: transparent; color: var(--gold-soft); border: 1px solid var(--border-strong); box-shadow: none; }
.btn--ghost:hover { color: var(--gold); border-color: var(--gold); }
.btn[disabled], .btn--disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Secciones ──────────────────────────────────────────────── */
.section { margin: 44px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink); }
.section-head .more { font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }

/* ── Fila "Últimos capítulos" (scroll horizontal interno) ───── */
.chapters-row {
	display: grid; grid-auto-flow: column; grid-auto-columns: 240px;
	gap: 16px; overflow-x: auto; padding: 4px 4px 14px;
	scroll-snap-type: x mandatory; max-width: 100%;
	-webkit-overflow-scrolling: touch;
}
.chapter-chip {
	scroll-snap-align: start; display: flex; gap: 12px; align-items: center;
	background: var(--plum-900); border: 1px solid var(--border); border-radius: 16px;
	padding: 12px; text-decoration: none; color: var(--text); min-width: 0;
}
.chapter-chip:hover { border-color: var(--border-strong); }
.chapter-chip img { width: 52px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; background: var(--plum-700); }
.chapter-chip .cc-series { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter-chip .cc-title { font-size: 15px; font-weight: 600; color: var(--ink); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter-chip .cc-date { font-size: 12px; color: var(--faint); }

/* ── Filtros por género ─────────────────────────────────────── */
.genre-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; list-style: none; padding: 0; }
.genre-chips button {
	border: 1px solid var(--border); background: var(--plum-900); color: var(--muted);
	border-radius: 999px; padding: 9px 18px; font-size: 14px; font-weight: 600;
	cursor: pointer; font-family: var(--font-body);
}
.genre-chips button:hover { border-color: var(--border-strong); color: var(--ink); }
.genre-chips button.is-active { background: var(--gradient-gold); color: #241236; border-color: transparent; }
.genre-chips button .n { opacity: .7; font-weight: 500; }

/* ── Rejilla de series ──────────────────────────────────────── */
.series-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .series-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .series-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.series-card {
	display: flex; flex-direction: column; background: var(--plum-900);
	border: 1px solid var(--border); border-radius: var(--radius);
	overflow: hidden; text-decoration: none; color: var(--text);
	transition: transform .18s ease-out, border-color .18s ease-out, box-shadow .18s ease-out;
	min-width: 0;
}
.series-card:hover, .series-card:focus-visible { transform: translateY(-4px); border-color: var(--gold); box-shadow: var(--shadow-card); outline: none; }
.series-card .cover { aspect-ratio: 3 / 4; overflow: hidden; background: var(--plum-700); position: relative; }
.series-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.series-card .body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.series-card h3 { font-family: var(--font-display); font-size: 19px; color: var(--ink); line-height: 1.3; }
.series-card .meta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-soft); background: rgba(217, 164, 65, .1); border: 1px solid rgba(217, 164, 65, .3); border-radius: 999px; padding: 4px 12px; }
.estado { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-radius: 999px; padding: 4px 12px; }
.estado--en-curso { color: #9fe6b8; background: rgba(95, 201, 138, .12); border: 1px solid rgba(95, 201, 138, .35); }
.estado--completada { color: var(--gold-soft); background: rgba(217, 164, 65, .12); border: 1px solid rgba(217, 164, 65, .35); }
.estado--pausada { color: var(--muted); background: rgba(185, 169, 212, .1); border: 1px solid var(--border-strong); }
.series-card .chapters-count { font-size: 13px; color: var(--faint); margin-top: auto; }

/* ── Banda promocional de herramientas ──────────────────────── */
.tools-band {
	background: var(--gradient-brand); border-radius: 22px; padding: 36px 24px;
	text-align: center; border: 1px solid var(--border-strong); margin: 52px 0;
}
.tools-band h2 { font-family: var(--font-display); font-size: 26px; color: #fff; margin-bottom: 10px; }
.tools-band p { color: rgba(255, 255, 255, .82); max-width: 560px; margin: 0 auto 22px; }
.tools-band .mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 720px; margin: 0 auto 24px; }
@media (min-width: 700px) { .tools-band .mini-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tools-band .mini-grid a {
	background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 14px; padding: 14px 10px; color: #fff; text-decoration: none;
	font-size: 14px; font-weight: 600; line-height: 1.35;
}
.tools-band .mini-grid a:hover { background: rgba(255, 255, 255, .18); }

/* ── Migas de pan ───────────────────────────────────────────── */
.crumbs { font-size: 13px; color: var(--faint); margin: 22px 0 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--gold-soft); }
.crumbs .sep { color: var(--faint); margin: 0 6px; }

/* ── Página de serie ────────────────────────────────────────── */
.series-hero { position: relative; border-radius: 22px; overflow: hidden; margin: 18px 0 28px; border: 1px solid var(--border); background: var(--plum-900); }
.series-hero .banner { height: 180px; background: var(--gradient-brand); overflow: hidden; }
@media (min-width: 768px) { .series-hero .banner { height: 260px; } }
.series-hero .banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.series-hero .series-info { display: grid; gap: 20px; padding: 0 22px 26px; margin-top: -64px; position: relative; }
@media (min-width: 768px) { .series-hero .series-info { grid-template-columns: 180px minmax(0, 1fr); margin-top: -90px; padding: 0 32px 32px; } }
.series-hero .cover { width: 128px; border-radius: 14px; overflow: hidden; border: 2px solid var(--border-strong); box-shadow: var(--shadow-card); background: var(--plum-700); }
@media (min-width: 768px) { .series-hero .cover { width: 180px; } }
.series-hero .cover img { display: block; width: 100%; height: auto; }
.series-hero h1 { font-family: var(--font-display); font-size: 30px; color: var(--ink); line-height: 1.15; margin: 8px 0 10px; }
@media (min-width: 768px) { .series-hero h1 { font-size: 40px; } }
.series-hero .synopsis { color: var(--muted); max-width: 720px; margin: 12px 0 18px; }
.license-note {
	border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px 16px;
	font-size: 13px; color: var(--faint); background: rgba(76, 46, 131, .1); margin-top: 22px;
}
.chapter-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.chapter-list a {
	display: flex; align-items: center; gap: 14px; padding: 14px 18px;
	background: var(--plum-900); border: 1px solid var(--border); border-radius: 14px;
	text-decoration: none; color: var(--text);
}
.chapter-list a:hover { border-color: var(--gold); }
.chapter-list .ch-num {
	flex: none; width: 44px; height: 44px; border-radius: 12px;
	display: flex; align-items: center; justify-content: center;
	background: var(--plum-800); color: var(--gold-soft); font-weight: 800; font-size: 16px;
}
.chapter-list .ch-title { font-weight: 600; color: var(--ink); }
.chapter-list .ch-date { margin-left: auto; font-size: 13px; color: var(--faint); white-space: nowrap; }

/* ── Lector de capítulos ────────────────────────────────────── */
.reader-progress { position: fixed; top: 0; left: 0; height: 4px; width: 0; background: var(--gradient-gold); z-index: 300; }
.reader-head { max-width: 800px; margin: 0 auto; padding: 22px 20px 8px; text-align: center; }
.reader-head .series-link { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-soft); text-decoration: none; }
.reader-head h1 { font-family: var(--font-display); font-size: 26px; color: var(--ink); margin: 8px 0 4px; line-height: 1.2; }
@media (min-width: 768px) { .reader-head h1 { font-size: 34px; } }
.reader-head .ch-date { font-size: 13px; color: var(--faint); }
.reader-nav { display: flex; justify-content: space-between; gap: 12px; max-width: 800px; margin: 18px auto; padding: 0 20px; }
.reader-nav .btn { flex: 1; min-height: 52px; font-size: 15px; padding: 0 16px; }
.reader-nav .btn--spacer { visibility: hidden; }
.reader { max-width: 800px; margin: 0 auto; padding: 0 0 8px; }
.reader figure { margin: 0; }
.reader img.yhwt-reader-img {
	display: block; width: 100%; height: auto; margin: 0 auto;
	background: var(--plum-900);
	-webkit-user-select: none; user-select: none;
}
.reader img.yhwt-reader-img.protected { -webkit-touch-callout: none; pointer-events: none; }
.reader-actions { text-align: center; margin: 26px 0; display: grid; gap: 12px; justify-items: center; }
.reader-foot { max-width: 800px; margin: 0 auto; padding: 0 20px 40px; }

/* ── Planes de suscripción ──────────────────────────────────── */
.plans-grid { display: grid; gap: 20px; grid-template-columns: 1fr; margin: 30px 0; }
@media (min-width: 820px) { .plans-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan-card {
	position: relative; background: var(--plum-900); border: 1px solid var(--border);
	border-radius: 20px; padding: 30px 26px; display: flex; flex-direction: column; gap: 14px;
}
.plan-card--highlight { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow-card); }
.plan-card .soon-badge {
	position: absolute; top: -14px; right: 18px;
	background: var(--gradient-gold); color: #241236;
	font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
	border-radius: 999px; padding: 6px 16px;
}
.plan-card h2 { font-family: var(--font-display); font-size: 22px; color: var(--ink); }
.plan-card .price { font-family: var(--font-display); font-size: 40px; color: var(--gold-soft); font-weight: 700; }
.plan-card .period { font-size: 14px; color: var(--faint); }
.plan-card ul { list-style: none; padding: 0; display: grid; gap: 10px; margin: 6px 0 10px; }
.plan-card li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--text); }
.plan-card li svg { width: 18px; height: 18px; flex: none; stroke: var(--gold); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin-top: 3px; }
.plan-card .btn { margin-top: auto; }

/* ── Shortcode de cuenta ────────────────────────────────────── */
.yhwt-account {
	background: var(--plum-900); border: 1px solid var(--border); border-radius: var(--radius);
	padding: 26px; max-width: 560px; margin: 24px auto;
}
.yhwt-account h2 { font-family: var(--font-display); font-size: 22px; color: var(--ink); margin-bottom: 14px; }
.yhwt-account .status-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.yhwt-account .pill { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 6px 14px; }
.yhwt-account .pill--active { color: #9fe6b8; background: rgba(95, 201, 138, .12); border: 1px solid rgba(95, 201, 138, .4); }
.yhwt-account .pill--inactive { color: var(--muted); background: rgba(185, 169, 212, .08); border: 1px solid var(--border-strong); }

/* ── Pie de página ──────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); margin-top: 56px; background: var(--plum-900); }
.foot-grid { display: grid; gap: 28px; padding: 40px 0 24px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.foot-brand .foot-tag { color: var(--faint); font-size: 14px; margin-top: 12px; max-width: 280px; }
.site-footer h2 { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.site-footer ul a { color: var(--muted); text-decoration: none; font-size: 14px; }
.site-footer ul a:hover { color: var(--ink); }
.foot-fine {
	border-top: 1px solid var(--border); padding: 18px 0 26px;
	display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
	font-size: 13px; color: var(--faint);
}

/* ══════════════════════════════════════════════════════════════
   SUBSISTEMA DE HERRAMIENTAS (portado de hexkit v2.0)
   Mismas clases que las plantillas portadas esperan; reestilizadas
   al lenguaje visual romantico oscuro. Los permalinks
   /tools/<categoria>/<herramienta>/ no cambian.
   ══════════════════════════════════════════════════════════════ */
.tool-layout { display: grid; gap: 28px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 980px) { .tool-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.title-block { padding: 20px 0 24px; max-width: 780px; }
.title-block h1 { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1.12; margin-bottom: 12px; color: var(--ink); }
@media (min-width: 768px) { .title-block h1 { font-size: 46px; } }
.title-block .lede { color: var(--muted); font-size: 17px; line-height: 1.6; }
.trust-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; list-style: none; padding: 0; }
.trust-chips li { display: inline-flex; align-items: center; gap: 8px; background: var(--plum-900); border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--text); }
.trust-chips svg { width: 16px; height: 16px; stroke: var(--gold); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tool-panel { background: var(--plum-900); border: 1px solid var(--border); border-radius: 20px; padding: 24px; margin: 8px 0; }
@media (min-width: 768px) { .tool-panel { padding: 40px; } }
.tool-loading { color: var(--faint); text-align: center; padding: 40px 0; }
.noscript-note { background: rgba(224, 108, 122, .1); border: 1px solid var(--danger); border-radius: 12px; padding: 16px; color: var(--text); margin-bottom: 16px; }
/* Controles genericos de herramientas (los modulos JS los usan) */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.field input, .field select, .field textarea {
	width: 100%; min-height: 48px; border: 1px solid var(--border-strong); border-radius: 12px;
	padding: 12px 14px; font-size: 16px; font-family: var(--font-body);
	background: var(--plum-950); color: var(--text);
}
.field textarea { font-family: var(--font-mono); font-size: 14px; line-height: 1.55; }
.results { background: var(--plum-950); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 24px; min-height: 200px; }
.results h2 { font-family: var(--font-body); font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-soft); margin-bottom: 16px; }
.content { margin-top: 28px; }
.content h2 { font-family: var(--font-display); font-size: 24px; color: var(--ink); margin: 34px 0 14px; }
.content p { margin-bottom: 14px; color: var(--text); }
.steps { margin: 0 0 14px 22px; display: grid; gap: 10px; }
.formula { background: var(--plum-950); border: 1px solid var(--border); border-radius: 14px; padding: 18px; font-family: var(--font-mono); font-size: 14px; white-space: pre-wrap; overflow-x: auto; max-width: 100%; }
details.faq { background: var(--plum-900); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 12px; }
details.faq[open] { border-color: var(--gold); }
details.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; padding: 18px 20px; cursor: pointer; color: var(--text); }
details.faq summary::-webkit-details-marker { display: none; }
details.faq .faq-a { margin: 0; padding: 0 20px 20px; font-size: 15px; color: var(--text); }
.related { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .related { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.related a { background: var(--plum-900); border: 1px solid var(--border); border-radius: 16px; padding: 18px; text-decoration: none; color: var(--text); display: block; }
.related a:hover { border-color: var(--gold); }
.related h3 { font-family: var(--font-display); font-size: 17px; color: var(--ink); margin-bottom: 6px; }
.related p { font-size: 14px; color: var(--muted); }
/* Rejilla de tarjetas de herramientas */
.bento { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
	position: relative; background: var(--plum-900); border: 1px solid var(--border);
	border-radius: 20px; padding: 22px; min-height: 190px;
	display: flex; flex-direction: column; text-decoration: none; color: var(--text);
	transition: transform .18s ease-out, box-shadow .18s ease-out, border-color .18s ease-out;
	min-width: 0;
}
.tile:hover, .tile:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--gold); outline: none; }
.tile .icon-chip { width: 44px; height: 44px; border-radius: 12px; background: var(--plum-800); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; flex: none; }
.tile .icon-chip svg { width: 22px; height: 22px; stroke: var(--gold); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.3; margin-bottom: 6px; color: var(--ink); }
.tile p { font-size: 14px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 14px; }
.tile .count { font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.tile .open { margin-top: auto; font-size: 15px; font-weight: 600; color: var(--gold-soft); }
.tile:hover .open { transform: translateX(3px); }
.term-head { padding: 8px 0 6px; max-width: 780px; }
.term-head h1 { font-family: var(--font-display); font-size: 32px; color: var(--ink); margin-bottom: 10px; }
@media (min-width: 768px) { .term-head h1 { font-size: 44px; } }
.term-desc { color: var(--muted); }
.term-meta { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.sidebar { display: grid; gap: 20px; align-content: start; }
.side-card { background: var(--plum-900); border: 1px solid var(--border); border-radius: 18px; padding: 22px; }
.side-card h2 { font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 14px; }
.side-card ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.side-card ul a { color: var(--text); text-decoration: none; font-size: 15px; }
.side-card ul a:hover { color: var(--gold-soft); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check-row svg { width: 18px; height: 18px; flex: none; stroke: var(--gold); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin-top: 3px; }
.section { margin: 36px 0; }

/* ── Paginacion / 404 / varios ───────────────────────────────── */
.pagination { margin: 28px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
.pagination .page-numbers.current { background: var(--gradient-gold); color: #241236; border-color: transparent; font-weight: 700; }
.error-404 { text-align: center; padding: 80px 0; }
.error-404 h1 { font-family: var(--font-display); font-size: 72px; color: var(--gold); }
.error-404 p { color: var(--muted); margin: 12px 0 24px; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
