/*!
 * HerramientasClave — sistema de diseño
 * Variables globales, modo claro/oscuro, componentes y utilidades.
 * Tipografía del sistema (sin fuentes externas: más rápido y sin transferencias a terceros).
 */

/* ---------- 1. Tokens ---------- */
:root {
	--ct-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--ct-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

	--ct-bg: #ffffff;
	--ct-bg-soft: #f7f7fb;
	--ct-surface: #ffffff;
	--ct-surface-2: #f3f3f8;
	--ct-surface-3: #ebebf3;
	--ct-border: #e5e5ee;
	--ct-border-strong: #cfcfdc;
	--ct-text: #15151d;
	--ct-text-2: #45455a;
	--ct-muted: #636376;
	--ct-primary: #5b3df5;
	--ct-primary-hover: #4b2ee3;
	--ct-primary-active: #3f24c9;
	--ct-primary-soft: #efebff;
	--ct-primary-soft-2: #e0d9ff;
	--ct-primary-text: #4b2ee3;
	--ct-on-primary: #ffffff;
	--ct-success: #0a7450;
	--ct-success-soft: #e6f5ee;
	--ct-warn: #995200;
	--ct-warn-soft: #fff3df;
	--ct-danger: #c22a37;
	--ct-danger-soft: #fdecee;
	--ct-info: #1f5fbf;
	--ct-info-soft: #e8f0fd;
	--ct-focus: #5b3df5;
	--ct-diff-add: #dcf5e6;
	--ct-diff-del: #fde3e5;
	--ct-checker: #e9e9f0;

	--ct-radius-sm: 8px;
	--ct-radius: 12px;
	--ct-radius-lg: 16px;
	--ct-radius-xl: 22px;
	--ct-radius-full: 999px;

	--ct-shadow-sm: 0 1px 2px rgba(20, 20, 40, .06);
	--ct-shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 4px 14px rgba(20, 20, 40, .06);
	--ct-shadow-lg: 0 10px 40px rgba(20, 20, 40, .14);

	--ct-s1: 4px;
	--ct-s2: 8px;
	--ct-s3: 12px;
	--ct-s4: 16px;
	--ct-s5: 24px;
	--ct-s6: 32px;
	--ct-s7: 48px;
	--ct-s8: 64px;

	--ct-fs-xs: .78rem;
	--ct-fs-sm: .875rem;
	--ct-fs: 1rem;
	--ct-fs-md: 1.125rem;
	--ct-fs-lg: 1.375rem;
	--ct-fs-xl: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
	--ct-fs-2xl: clamp(2rem, 1.3rem + 3vw, 3.4rem);

	--ct-container: 1200px;
	--ct-header-h: 64px;
	--ct-ease: cubic-bezier(.2, .7, .2, 1);
	--ct-dur: .18s;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--ct-bg: #0f1117;
		--ct-bg-soft: #131620;
		--ct-surface: #171a24;
		--ct-surface-2: #1d2130;
		--ct-surface-3: #252a3b;
		--ct-border: #2a2f40;
		--ct-border-strong: #3a4056;
		--ct-text: #eceef5;
		--ct-text-2: #c0c3d2;
		--ct-muted: #9ca0b3;
		--ct-primary: #8f80ff;
		--ct-primary-hover: #a092ff;
		--ct-primary-active: #b2a6ff;
		--ct-primary-soft: #221f3d;
		--ct-primary-soft-2: #2e2955;
		--ct-primary-text: #b3a8ff;
		--ct-on-primary: #0d0b1f;
		--ct-success: #43c995;
		--ct-success-soft: #12291f;
		--ct-warn: #f0b252;
		--ct-warn-soft: #2d2412;
		--ct-danger: #ff7a85;
		--ct-danger-soft: #331a1e;
		--ct-info: #7fb0ff;
		--ct-info-soft: #172338;
		--ct-focus: #a092ff;
		--ct-diff-add: #133325;
		--ct-diff-del: #3a1a1f;
		--ct-checker: #262a38;
		--ct-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
		--ct-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .3);
		--ct-shadow-lg: 0 12px 44px rgba(0, 0, 0, .55);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--ct-bg: #0f1117;
	--ct-bg-soft: #131620;
	--ct-surface: #171a24;
	--ct-surface-2: #1d2130;
	--ct-surface-3: #252a3b;
	--ct-border: #2a2f40;
	--ct-border-strong: #3a4056;
	--ct-text: #eceef5;
	--ct-text-2: #c0c3d2;
	--ct-muted: #9ca0b3;
	--ct-primary: #8f80ff;
	--ct-primary-hover: #a092ff;
	--ct-primary-active: #b2a6ff;
	--ct-primary-soft: #221f3d;
	--ct-primary-soft-2: #2e2955;
	--ct-primary-text: #b3a8ff;
	--ct-on-primary: #0d0b1f;
	--ct-success: #43c995;
	--ct-success-soft: #12291f;
	--ct-warn: #f0b252;
	--ct-warn-soft: #2d2412;
	--ct-danger: #ff7a85;
	--ct-danger-soft: #331a1e;
	--ct-info: #7fb0ff;
	--ct-info-soft: #172338;
	--ct-focus: #a092ff;
	--ct-diff-add: #133325;
	--ct-diff-del: #3a1a1f;
	--ct-checker: #262a38;
	--ct-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
	--ct-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .3);
	--ct-shadow-lg: 0 12px 44px rgba(0, 0, 0, .55);
	color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--ct-header-h) + 16px); }
body.ct-body {
	margin: 0;
	font-family: var(--ct-font);
	font-size: var(--ct-fs);
	line-height: 1.6;
	color: var(--ct-text);
	background: var(--ct-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
.ct-body img, .ct-body svg, .ct-body video, .ct-body canvas { max-width: 100%; }
.ct-body img { height: auto; }
.ct-body a { color: var(--ct-primary-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.ct-body a:hover { color: var(--ct-primary-hover); }
.ct-body h1, .ct-body h2, .ct-body h3, .ct-body h4 { line-height: 1.25; letter-spacing: -.015em; color: var(--ct-text); margin: 0 0 .5em; }
.ct-body p { margin: 0 0 1em; }
.ct-body button, .ct-body input, .ct-body select, .ct-body textarea { font: inherit; color: inherit; }
.ct-body code, .ct-body kbd, .ct-body pre { font-family: var(--ct-mono); font-size: .92em; }
.ct-body :focus { outline: none; }
.ct-body :focus-visible { outline: 3px solid var(--ct-focus); outline-offset: 2px; border-radius: 6px; }
.ct-body ::selection { background: var(--ct-primary-soft-2); }
.ct-icon { flex-shrink: 0; vertical-align: middle; }
[hidden] { display: none !important; }

.ct-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; }
.ct-skip { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ct-primary); color: var(--ct-on-primary) !important; padding: 10px 16px; border-radius: var(--ct-radius-sm); font-weight: 600; text-decoration: none; transition: top var(--ct-dur); }
.ct-skip:focus { top: 12px; }
.ct-muted { color: var(--ct-muted); }
.ct-center { text-align: center; }
.ct-mono { font-family: var(--ct-mono); }
.ct-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ct-container { width: 100%; max-width: var(--ct-container); margin: 0 auto; padding: 0 20px; }
.ct-container--narrow { max-width: 820px; }
.ct-main { min-height: 60vh; outline: none; }

/* ---------- 3. Cabecera ---------- */
.ct-header { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--ct-bg) 88%, transparent); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--ct-border); }
@supports not (background: color-mix(in srgb, red 50%, transparent)) { .ct-header { background: var(--ct-bg); } }
.admin-bar .ct-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ct-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .ct-header { top: 0; } }
.ct-header__inner { display: flex; align-items: center; gap: var(--ct-s4); height: var(--ct-header-h); }
.ct-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; color: var(--ct-text) !important; font-weight: 750; font-size: 1.15rem; letter-spacing: -.02em; margin: 0; }
.ct-logo__mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ct-primary); color: var(--ct-on-primary); box-shadow: 0 2px 8px color-mix(in srgb, var(--ct-primary) 35%, transparent); }
.ct-nav { flex: 1; }
.ct-nav__list { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.ct-nav__list > li > a, .ct-nav__toggle { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: var(--ct-radius-sm); color: var(--ct-text-2) !important; text-decoration: none; font-weight: 550; font-size: var(--ct-fs-sm); background: none; border: 0; cursor: pointer; transition: background var(--ct-dur), color var(--ct-dur); }
.ct-nav__list > li > a:hover, .ct-nav__toggle:hover, .ct-nav__toggle[aria-expanded="true"] { background: var(--ct-surface-2); color: var(--ct-text) !important; }
.ct-nav__toggle[aria-expanded="true"] .ct-icon { transform: rotate(180deg); }
.ct-nav__toggle .ct-icon { transition: transform var(--ct-dur); }
.ct-nav__dropdown { position: relative; }
.ct-mega { position: absolute; top: calc(100% + 8px); left: -120px; width: min(720px, 90vw); background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: var(--ct-radius-lg); box-shadow: var(--ct-shadow-lg); padding: var(--ct-s3); animation: ct-pop .16s var(--ct-ease); }
.ct-mega__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; list-style: none; margin: 0; padding: 0; }
.ct-mega__item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--ct-radius-sm); text-decoration: none; color: var(--ct-text) !important; }
.ct-mega__item:hover { background: var(--ct-surface-2); }
.ct-mega__item strong { display: block; font-size: var(--ct-fs-sm); font-weight: 600; }
.ct-mega__item small { display: block; color: var(--ct-muted); font-size: var(--ct-fs-xs); }
.ct-mega__icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ct-primary-soft); color: var(--ct-primary-text); }
.ct-header__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ct-search-trigger { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; border-radius: var(--ct-radius-sm); border: 1px solid var(--ct-border); background: var(--ct-surface-2); color: var(--ct-muted); cursor: pointer; font-size: var(--ct-fs-sm); min-width: 220px; transition: border-color var(--ct-dur), background var(--ct-dur); }
.ct-search-trigger:hover { border-color: var(--ct-border-strong); background: var(--ct-surface); }
.ct-search-trigger__label { flex: 1; text-align: left; }
.ct-kbd { display: inline-block; font-family: var(--ct-mono); font-size: .72rem; line-height: 1; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--ct-border); background: var(--ct-surface); color: var(--ct-muted); }
.ct-icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 38px; height: 38px; padding: 0 8px; border-radius: var(--ct-radius-sm); border: 1px solid transparent; background: none; color: var(--ct-text-2); cursor: pointer; transition: background var(--ct-dur), color var(--ct-dur); list-style: none; }
.ct-icon-btn:hover { background: var(--ct-surface-2); color: var(--ct-text); }
.ct-icon-btn::-webkit-details-marker { display: none; }
.ct-theme-icon--dark { display: none; }
:root[data-theme="dark"] .ct-theme-icon--dark { display: inline-flex; }
:root[data-theme="dark"] .ct-theme-icon--light { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .ct-theme-icon--dark { display: inline-flex; }
	:root:not([data-theme="light"]) .ct-theme-icon--light { display: none; }
}
.ct-lang { position: relative; }
.ct-lang__code { font-size: var(--ct-fs-xs); font-weight: 700; }
.ct-lang__menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; list-style: none; margin: 0; padding: 6px; background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: var(--ct-radius); box-shadow: var(--ct-shadow-lg); z-index: 10; }
.ct-lang__menu li > * { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; font-size: var(--ct-fs-sm); text-decoration: none; color: var(--ct-text); }
.ct-lang__menu a:hover { background: var(--ct-surface-2); }
.ct-menu-btn { display: none; }
.ct-drawer { border-top: 1px solid var(--ct-border); background: var(--ct-bg); max-height: calc(100vh - var(--ct-header-h)); overflow: auto; padding: var(--ct-s4) 0 var(--ct-s5); }
.ct-drawer ul { list-style: none; margin: 0; padding: 0; }
.ct-drawer a { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: var(--ct-radius-sm); color: var(--ct-text) !important; text-decoration: none; font-weight: 550; }
.ct-drawer a:hover { background: var(--ct-surface-2); }
.ct-drawer a .ct-icon { color: var(--ct-primary-text); }
.ct-drawer__title { margin: var(--ct-s4) 8px var(--ct-s2); font-size: var(--ct-fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ct-muted); }
.ct-drawer__cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

@media (max-width: 960px) {
	.ct-nav { display: none; }
	.ct-menu-btn { display: inline-flex; }
	.ct-search-trigger { min-width: 0; }
	.ct-search-trigger__label, .ct-search-trigger .ct-kbd { display: none; }
	.ct-search-trigger { width: 38px; padding: 0; justify-content: center; background: none; border-color: transparent; color: var(--ct-text-2); }
}

/* ---------- 4. Botones ---------- */
.ct-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: var(--ct-radius-sm); border: 1px solid transparent; font-weight: 600; font-size: var(--ct-fs-sm); line-height: 1.2; text-decoration: none !important; cursor: pointer; white-space: nowrap; transition: background var(--ct-dur), border-color var(--ct-dur), color var(--ct-dur), box-shadow var(--ct-dur), transform .08s; user-select: none; -webkit-tap-highlight-color: transparent; }
.ct-btn:active:not(:disabled) { transform: translateY(1px); }
.ct-btn:disabled, .ct-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.ct-btn--primary { background: var(--ct-primary); color: var(--ct-on-primary) !important; box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.12); }
.ct-btn--primary:hover:not(:disabled) { background: var(--ct-primary-hover); }
.ct-btn--primary:active:not(:disabled) { background: var(--ct-primary-active); }
.ct-btn--secondary { background: var(--ct-surface); color: var(--ct-text) !important; border-color: var(--ct-border-strong); box-shadow: var(--ct-shadow-sm); }
.ct-btn--secondary:hover:not(:disabled) { background: var(--ct-surface-2); }
.ct-btn--ghost { background: transparent; color: var(--ct-text-2) !important; border-color: var(--ct-border); }
.ct-btn--ghost:hover:not(:disabled) { background: var(--ct-surface-2); color: var(--ct-text) !important; }
.ct-btn--danger { background: var(--ct-danger-soft); color: var(--ct-danger) !important; border-color: transparent; }
.ct-btn--danger:hover:not(:disabled) { border-color: var(--ct-danger); }
.ct-btn--sm { min-height: 36px; padding: 6px 12px; font-size: var(--ct-fs-xs); }
.ct-btn--lg { min-height: 52px; padding: 14px 24px; font-size: var(--ct-fs); }
.ct-btn--block { width: 100%; }
.ct-btn--icon { padding: 0; width: 36px; min-height: 36px; }
.ct-btn[aria-pressed="true"] { background: var(--ct-primary-soft); color: var(--ct-primary-text) !important; border-color: var(--ct-primary-soft-2); }
.ct-btn[aria-pressed="true"] .ct-icon { fill: currentColor; }
.ct-btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.ct-btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--ct-on-primary) transparent var(--ct-on-primary) transparent; animation: ct-spin .7s linear infinite; }
.ct-btn--secondary.is-busy::after, .ct-btn--ghost.is-busy::after { border-color: var(--ct-text) transparent var(--ct-text) transparent; }
.ct-linklike { background: none; border: 0; padding: 0; color: var(--ct-text-2); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.ct-link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }

/* ---------- 5. Formularios ---------- */
.ct-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--ct-s4); min-width: 0; }
.ct-field > label, .ct-label { font-weight: 600; font-size: var(--ct-fs-sm); color: var(--ct-text); }
.ct-help { font-size: var(--ct-fs-xs); color: var(--ct-muted); margin: 0; }
.ct-req { color: var(--ct-danger); }
.ct-input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--ct-border-strong); border-radius: var(--ct-radius-sm); background: var(--ct-surface); color: var(--ct-text); font-size: 1rem; transition: border-color var(--ct-dur), box-shadow var(--ct-dur); appearance: none; -webkit-appearance: none; }
.ct-input::placeholder { color: var(--ct-muted); opacity: .85; }
.ct-input:hover { border-color: var(--ct-muted); }
.ct-input:focus, .ct-input:focus-visible { outline: none; border-color: var(--ct-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ct-primary) 25%, transparent); border-radius: var(--ct-radius-sm); }
.ct-input[aria-invalid="true"] { border-color: var(--ct-danger); }
.ct-input:disabled { background: var(--ct-surface-2); cursor: not-allowed; }
.ct-input--sm { min-height: 36px; padding: 6px 10px; font-size: var(--ct-fs-sm); width: auto; }
select.ct-input { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23636376' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
textarea.ct-input { min-height: 140px; resize: vertical; line-height: 1.5; }
textarea.ct-input.ct-mono, .ct-code { font-family: var(--ct-mono); font-size: .9rem; tab-size: 2; }
.ct-input-group { display: flex; align-items: stretch; }
.ct-input-group .ct-input { border-radius: var(--ct-radius-sm) 0 0 var(--ct-radius-sm); min-width: 0; }
.ct-input-group .ct-input:focus { position: relative; z-index: 1; }
.ct-unit { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--ct-border-strong); border-left: 0; border-radius: 0 var(--ct-radius-sm) var(--ct-radius-sm) 0; background: var(--ct-surface-2); color: var(--ct-text-2); font-size: var(--ct-fs-sm); white-space: nowrap; }
.ct-field__error { margin: 0; color: var(--ct-danger); font-size: var(--ct-fs-xs); font-weight: 550; min-height: 0; }
.ct-field__error:empty { display: none; }
.ct-check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--ct-fs-sm); cursor: pointer; line-height: 1.45; }
.ct-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--ct-primary); flex-shrink: 0; }
.ct-range { width: 100%; accent-color: var(--ct-primary); height: 28px; }
.ct-color { width: 52px; height: 44px; padding: 4px; border: 1px solid var(--ct-border-strong); border-radius: var(--ct-radius-sm); background: var(--ct-surface); cursor: pointer; }
.ct-switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 550; font-size: var(--ct-fs-sm); }
.ct-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ct-switch__track { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--ct-border-strong); transition: background var(--ct-dur); flex-shrink: 0; }
.ct-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform var(--ct-dur) var(--ct-ease); }
.ct-switch input:checked + .ct-switch__track { background: var(--ct-primary); }
.ct-switch input:checked + .ct-switch__track::after { transform: translateX(18px); }
.ct-switch input:focus-visible + .ct-switch__track { outline: 3px solid var(--ct-focus); outline-offset: 2px; }
.ct-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--ct-surface-2); border: 1px solid var(--ct-border); border-radius: var(--ct-radius); max-width: 100%; }
.ct-seg label { position: relative; }
.ct-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.ct-seg span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: var(--ct-radius-sm); font-weight: 600; font-size: var(--ct-fs-sm); color: var(--ct-text-2); transition: background var(--ct-dur), color var(--ct-dur); cursor: pointer; }
.ct-seg input:checked + span { background: var(--ct-surface); color: var(--ct-text); box-shadow: var(--ct-shadow-sm); }
.ct-seg input:focus-visible + span { outline: 3px solid var(--ct-focus); outline-offset: 1px; }
.ct-seg--block { display: flex; }
.ct-seg--block label { flex: 1; }
.ct-seg--block span { width: 100%; justify-content: center; }
fieldset.ct-fieldset { border: 0; padding: 0; margin: 0 0 var(--ct-s4); min-width: 0; }
fieldset.ct-fieldset legend { font-weight: 600; font-size: var(--ct-fs-sm); margin-bottom: 6px; padding: 0; }

/* ---------- 6. Tarjetas y rejillas ---------- */
.ct-grid { display: grid; gap: var(--ct-s4); }
.ct-grid--tools { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.ct-grid--cats { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); list-style: none; margin: 0; padding: 0; }
.ct-grid--posts { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ct-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: var(--ct-s5); background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: var(--ct-radius-lg); box-shadow: var(--ct-shadow-sm); transition: border-color var(--ct-dur), box-shadow var(--ct-dur), transform var(--ct-dur) var(--ct-ease); min-width: 0; }
.ct-card--tool:hover, .ct-card--cat:hover, .ct-card--post:hover { border-color: var(--ct-primary-soft-2); box-shadow: var(--ct-shadow); transform: translateY(-2px); }
.ct-card__icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--ct-primary-soft); color: var(--ct-primary-text); }
.ct-card__title { font-size: 1.02rem; font-weight: 650; margin: 4px 0 0 !important; }
.ct-card__link { color: var(--ct-text) !important; text-decoration: none; }
.ct-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.ct-card__link:focus-visible { outline: none; }
.ct-card__link:focus-visible::after { outline: 3px solid var(--ct-focus); outline-offset: 2px; }
.ct-card__desc { margin: 0 !important; color: var(--ct-text-2); font-size: var(--ct-fs-sm); line-height: 1.5; }
.ct-card__meta { margin: auto 0 0 !important; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
.ct-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--ct-radius-full); background: var(--ct-surface-2); color: var(--ct-text-2); font-size: var(--ct-fs-xs); font-weight: 600; line-height: 1.4; }
.ct-chip--ok { background: var(--ct-success-soft); color: var(--ct-success); }
.ct-chip--warn { background: var(--ct-warn-soft); color: var(--ct-warn); }
.ct-chip--beta { background: var(--ct-info-soft); color: var(--ct-info); }
.ct-chip--primary { background: var(--ct-primary-soft); color: var(--ct-primary-text); }

/* ---------- 7. Inicio ---------- */
.ct-hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); background:
	radial-gradient(ellipse 60% 50% at 50% 0%, color-mix(in srgb, var(--ct-primary) 9%, transparent), transparent 70%), var(--ct-bg); border-bottom: 1px solid var(--ct-border); }
.ct-hero__inner { text-align: center; max-width: 860px; }
.ct-eyebrow { display: inline-block; margin: 0 0 var(--ct-s4) !important; padding: 5px 12px; border-radius: var(--ct-radius-full); background: var(--ct-primary-soft); color: var(--ct-primary-text); font-size: var(--ct-fs-xs); font-weight: 700; letter-spacing: .02em; }
.ct-hero__title { font-size: var(--ct-fs-2xl); font-weight: 800; letter-spacing: -.035em; margin: 0 0 var(--ct-s4) !important; }
.ct-hero__subtitle { font-size: clamp(1.02rem, .9rem + .5vw, 1.25rem); color: var(--ct-text-2); max-width: 640px; margin: 0 auto var(--ct-s6) !important; }
.ct-shortcuts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: var(--ct-s5) 0 0; padding: 0; }
.ct-shortcuts--left { justify-content: flex-start; }
.ct-shortcut { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--ct-radius-full); border: 1px solid var(--ct-border); background: var(--ct-surface); color: var(--ct-text-2) !important; font-size: var(--ct-fs-sm); font-weight: 550; text-decoration: none; transition: border-color var(--ct-dur), color var(--ct-dur); }
.ct-shortcut:hover { border-color: var(--ct-primary); color: var(--ct-primary-text) !important; }
.ct-shortcut .ct-icon { color: var(--ct-primary-text); }
.ct-section { padding: clamp(40px, 6vw, 72px) 0; }
.ct-section--alt { background: var(--ct-bg-soft); border-top: 1px solid var(--ct-border); border-bottom: 1px solid var(--ct-border); }
.ct-section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--ct-s4); margin-bottom: var(--ct-s5); }
.ct-section__title { font-size: var(--ct-fs-xl); font-weight: 750; margin: 0 0 6px !important; }
.ct-section__lead { color: var(--ct-text-2); margin: 0 !important; }
.ct-sort { display: flex; align-items: center; gap: 8px; font-size: var(--ct-fs-sm); color: var(--ct-text-2); }
.ct-benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--ct-s5); list-style: none; padding: 0; margin: var(--ct-s6) 0 0; }
.ct-benefits li { padding: var(--ct-s5); border-radius: var(--ct-radius-lg); background: var(--ct-surface); border: 1px solid var(--ct-border); }
.ct-benefits h3 { font-size: 1.05rem; margin: var(--ct-s3) 0 6px !important; }
.ct-benefits p { margin: 0 !important; color: var(--ct-text-2); font-size: var(--ct-fs-sm); }
.ct-benefits__icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--ct-primary-soft); color: var(--ct-primary-text); }
.ct-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ct-s5); padding: clamp(24px, 4vw, 40px); border-radius: var(--ct-radius-xl); background: var(--ct-primary-soft); border: 1px solid var(--ct-primary-soft-2); }
.ct-cta__title { font-size: var(--ct-fs-lg); margin: 0 0 6px !important; }
.ct-cta p { margin: 0 !important; color: var(--ct-text-2); }

/* ---------- 8. Buscador ---------- */
.ct-search { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; background: var(--ct-surface); border: 1px solid var(--ct-border-strong); border-radius: var(--ct-radius-lg); padding: 6px 6px 6px 14px; box-shadow: var(--ct-shadow); transition: border-color var(--ct-dur), box-shadow var(--ct-dur); text-align: left; }
.ct-search:focus-within { border-color: var(--ct-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ct-primary) 18%, transparent), var(--ct-shadow); }
.ct-search__icon { color: var(--ct-muted); display: inline-flex; }
.ct-search__input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 1.05rem; padding: 10px 4px; color: var(--ct-text); }
.ct-search__input:focus, .ct-search__input:focus-visible { outline: none; }
.ct-search__input::-webkit-search-cancel-button { cursor: pointer; }
.ct-search--large .ct-search__input { font-size: 1.1rem; padding: 12px 4px; }
.ct-search__list { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 50; list-style: none; margin: 0; padding: 6px; max-height: min(420px, 60vh); overflow: auto; background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: var(--ct-radius-lg); box-shadow: var(--ct-shadow-lg); }
.ct-search__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--ct-radius-sm); cursor: pointer; color: var(--ct-text); text-decoration: none; }
.ct-search__item[aria-selected="true"], .ct-search__item:hover { background: var(--ct-primary-soft); }
.ct-search__item-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ct-surface-2); color: var(--ct-primary-text); flex-shrink: 0; }
.ct-search__item-text { min-width: 0; flex: 1; }
.ct-search__item-text strong { display: block; font-weight: 600; font-size: var(--ct-fs-sm); }
.ct-search__item-text small { display: block; color: var(--ct-muted); font-size: var(--ct-fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-search__item mark { background: none; color: var(--ct-primary-text); font-weight: 700; }
.ct-search__empty { padding: 14px 12px; color: var(--ct-text-2); font-size: var(--ct-fs-sm); }
.ct-search__group { padding: 8px 12px 4px; font-size: var(--ct-fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ct-muted); }
.ct-palette { width: min(680px, calc(100vw - 24px)); max-width: none; margin: 10vh auto auto; padding: 0; border: 0; background: transparent; overflow: visible; color: var(--ct-text); }
.ct-palette::backdrop { background: rgba(10, 10, 25, .45); backdrop-filter: blur(3px); }
.ct-palette__box { background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: var(--ct-radius-xl); box-shadow: var(--ct-shadow-lg); padding: 10px; animation: ct-pop .16s var(--ct-ease); }
.ct-palette .ct-search { box-shadow: none; border-color: var(--ct-border); }
.ct-palette .ct-search__list { position: static; box-shadow: none; border: 0; margin-top: 6px; padding: 0; max-height: 55vh; }
.ct-palette .ct-search__submit { display: none; }
.ct-palette__hint { margin: 8px 6px 2px !important; font-size: var(--ct-fs-xs); color: var(--ct-muted); }
@media (max-width: 600px) { .ct-search__submit { display: none; } .ct-palette { margin-top: 12px; } }

/* ---------- 9. Páginas ---------- */
.ct-crumbs { padding: var(--ct-s4) 0 0; font-size: var(--ct-fs-xs); }
.ct-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.ct-crumbs li { display: inline-flex; align-items: center; gap: 4px; color: var(--ct-muted); }
.ct-crumbs a { color: var(--ct-text-2) !important; text-decoration: none; }
.ct-crumbs a:hover { color: var(--ct-primary-text) !important; text-decoration: underline; }
.ct-page-head { padding: var(--ct-s5) 0 var(--ct-s5); }
.ct-page-head--icon { display: flex; gap: var(--ct-s4); align-items: flex-start; }
.ct-page-head__title { font-size: var(--ct-fs-xl); font-weight: 800; letter-spacing: -.03em; margin: 0 0 8px !important; }
.ct-page-head__lead { color: var(--ct-text-2); font-size: var(--ct-fs-md); margin: 0 !important; max-width: 760px; }
.ct-results-count { color: var(--ct-text-2); font-size: var(--ct-fs-sm); margin: 0 0 var(--ct-s3) !important; }
.ct-filters { display: grid; grid-template-columns: 2fr repeat(4, minmax(140px, 1fr)); gap: var(--ct-s3); align-items: end; padding: var(--ct-s4); margin-bottom: var(--ct-s4); background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: var(--ct-radius-lg); }
.ct-filters .ct-field { margin: 0; }
@media (max-width: 960px) { .ct-filters { grid-template-columns: 1fr 1fr; } .ct-filters__q { grid-column: 1 / -1; } }
@media (max-width: 480px) { .ct-filters { grid-template-columns: 1fr; } }
.ct-empty { text-align: center; padding: var(--ct-s7) var(--ct-s4); border: 1px dashed var(--ct-border-strong); border-radius: var(--ct-radius-lg); background: var(--ct-bg-soft); margin: var(--ct-s4) 0; }
.ct-empty h2 { font-size: var(--ct-fs-lg); }
.ct-empty p { color: var(--ct-text-2); }
.ct-empty__icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--ct-primary-soft); color: var(--ct-primary-text); margin-bottom: var(--ct-s3); }
.ct-404 { padding: var(--ct-s7) 20px; text-align: center; }
.ct-404 .ct-search { margin: var(--ct-s5) 0 var(--ct-s6); }
.ct-404 .ct-grid { text-align: left; margin-bottom: var(--ct-s5); }
.ct-article { padding-bottom: var(--ct-s6); }
.ct-article__meta { color: var(--ct-muted); font-size: var(--ct-fs-sm); }
.ct-article__image img { border-radius: var(--ct-radius-lg); }
.ct-post-nav { display: flex; justify-content: space-between; gap: var(--ct-s4); padding: var(--ct-s5) 0 var(--ct-s7); border-top: 1px solid var(--ct-border); }
.ct-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: var(--ct-s6) 0; }
.ct-pagination .page-numbers { display: inline-flex; min-width: 40px; height: 40px; align-items: center; justify-content: center; padding: 0 12px; border-radius: var(--ct-radius-sm); border: 1px solid var(--ct-border); text-decoration: none; color: var(--ct-text); }
.ct-pagination .page-numbers.current { background: var(--ct-primary); color: var(--ct-on-primary); border-color: var(--ct-primary); }
.ct-history-toggle { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: var(--ct-s4); padding: var(--ct-s4) var(--ct-s5); }
.ct-history { list-style: none; padding: 0; margin: 0 0 var(--ct-s6); display: grid; gap: 8px; }
.ct-history li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--ct-border); border-radius: var(--ct-radius); background: var(--ct-surface); }
.ct-history a { font-weight: 600; text-decoration: none; }
.ct-history time { margin-left: auto; color: var(--ct-muted); font-size: var(--ct-fs-xs); white-space: nowrap; }
.ct-status-block { margin-bottom: var(--ct-s4); }
.ct-status-block h2 { font-size: var(--ct-fs-lg); }
.ct-status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ct-status-list li { display: flex; align-items: flex-start; gap: 10px; font-size: var(--ct-fs-sm); }
.ct-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--ct-muted); }
.ct-dot--ok { background: var(--ct-success); }
.ct-dot--warn { background: var(--ct-warn); }
.ct-dot--off { background: var(--ct-border-strong); }
.ct-placeholder { background: var(--ct-warn-soft); color: var(--ct-warn); padding: 0 4px; border-radius: 4px; }

/* Contenido editorial */
.ct-prose { font-size: 1.02rem; line-height: 1.75; color: var(--ct-text); }
.ct-prose h2 { font-size: 1.4rem; margin: 1.8em 0 .6em; }
.ct-prose h3 { font-size: 1.15rem; margin: 1.5em 0 .5em; }
.ct-prose ul, .ct-prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.ct-prose li { margin-bottom: .35em; }
.ct-prose code { background: var(--ct-surface-2); padding: 2px 6px; border-radius: 6px; }
.ct-prose pre { background: var(--ct-surface-2); padding: var(--ct-s4); border-radius: var(--ct-radius); overflow: auto; }
.ct-prose blockquote { margin: 1.5em 0; padding: .5em 1.2em; border-left: 3px solid var(--ct-primary); background: var(--ct-bg-soft); border-radius: 0 var(--ct-radius-sm) var(--ct-radius-sm) 0; }
.ct-prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.ct-prose th, .ct-prose td { border: 1px solid var(--ct-border); padding: 8px 10px; text-align: left; }
.ct-prose > :first-child { margin-top: 0; }
.ct-prose .ct-grid { margin: 1.5em 0; }

/* ---------- 10. Página de herramienta ---------- */
.ct-tool-page { padding-bottom: var(--ct-s7); }
.ct-tool-hero { display: grid; grid-template-columns: auto 1fr auto; gap: var(--ct-s4); align-items: flex-start; padding: var(--ct-s5) 0; }
.ct-tool-hero__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--ct-primary-soft); color: var(--ct-primary-text); flex-shrink: 0; }
.ct-tool-hero__title { font-size: var(--ct-fs-xl); font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px !important; }
.ct-tool-hero__intro { color: var(--ct-text-2); font-size: var(--ct-fs-md); margin: 0 0 10px !important; max-width: 760px; }
.ct-tool-hero__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 !important; }
.ct-tool-hero__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 760px) {
	.ct-tool-hero { grid-template-columns: auto 1fr; }
	.ct-tool-hero__actions { grid-column: 1 / -1; justify-content: flex-start; }
	.ct-tool-hero__icon { width: 46px; height: 46px; }
}
.ct-workspace { background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: var(--ct-radius-xl); box-shadow: var(--ct-shadow); padding: clamp(16px, 3vw, 28px); margin-bottom: var(--ct-s4); animation: ct-rise .28s var(--ct-ease); }
.ct-workspace--embed { margin: 1.5em 0; }
.ct-app { min-height: 160px; }
.ct-app__loading { display: grid; gap: 14px; }
.ct-skeleton { display: block; border-radius: var(--ct-radius-sm); background: linear-gradient(90deg, var(--ct-surface-2), var(--ct-surface-3), var(--ct-surface-2)); background-size: 200% 100%; animation: ct-shimmer 1.2s ease-in-out infinite; }
.ct-skeleton--line { height: 18px; width: 40%; }
.ct-skeleton--block { height: 120px; }
.ct-skeleton--btn { height: 44px; width: 160px; }
.ct-note { display: flex; gap: 14px; align-items: flex-start; padding: var(--ct-s4) var(--ct-s5); border-radius: var(--ct-radius-lg); border: 1px solid var(--ct-border); background: var(--ct-bg-soft); margin-bottom: var(--ct-s5); font-size: var(--ct-fs-sm); }
.ct-note p { margin: 0 0 4px !important; color: var(--ct-text-2); }
.ct-note__title { font-weight: 700; color: var(--ct-text) !important; }
.ct-note__icon { display: inline-flex; margin-top: 2px; }
.ct-note--ok .ct-note__icon { color: var(--ct-success); }
.ct-note--warn { background: var(--ct-warn-soft); border-color: color-mix(in srgb, var(--ct-warn) 30%, transparent); }
.ct-note--warn .ct-note__icon { color: var(--ct-warn); }
.ct-tool-content { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--ct-s6); margin-top: var(--ct-s5); }
@media (max-width: 960px) { .ct-tool-content { grid-template-columns: 1fr; } }
.ct-tool-content__main h2 { font-size: 1.3rem; margin-top: 0; }
.ct-tool-content__main section + section { margin-top: var(--ct-s6); }
.ct-steps { counter-reset: ct-step; list-style: none; padding: 0 !important; }
.ct-steps li { counter-increment: ct-step; position: relative; padding-left: 44px; margin-bottom: 14px; min-height: 30px; }
.ct-steps li::before { content: counter(ct-step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ct-primary-soft); color: var(--ct-primary-text); font-weight: 700; font-size: var(--ct-fs-sm); }
.ct-faq { display: grid; gap: 8px; }
.ct-faq__item { border: 1px solid var(--ct-border); border-radius: var(--ct-radius); background: var(--ct-surface); }
.ct-faq__item summary { padding: 14px 44px 14px 16px; cursor: pointer; font-weight: 600; list-style: none; position: relative; }
.ct-faq__item summary::-webkit-details-marker { display: none; }
.ct-faq__item summary::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--ct-muted); border-bottom: 2px solid var(--ct-muted); transform: translateY(-70%) rotate(45deg); transition: transform var(--ct-dur); }
.ct-faq__item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.ct-faq__item p { padding: 0 16px 14px; margin: 0 !important; color: var(--ct-text-2); }
.ct-side-title { font-size: var(--ct-fs-sm) !important; text-transform: uppercase; letter-spacing: .06em; color: var(--ct-muted) !important; margin-bottom: var(--ct-s3) !important; }
.ct-related { list-style: none; margin: 0 0 var(--ct-s4); padding: 0; display: grid; gap: 6px; }
.ct-related a { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--ct-radius); border: 1px solid var(--ct-border); background: var(--ct-surface); text-decoration: none; color: var(--ct-text) !important; transition: border-color var(--ct-dur); }
.ct-related a:hover { border-color: var(--ct-primary-soft-2); }
.ct-related strong { display: block; font-size: var(--ct-fs-sm); }
.ct-related small { display: block; color: var(--ct-muted); font-size: var(--ct-fs-xs); line-height: 1.4; }
.ct-related__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--ct-primary-soft); color: var(--ct-primary-text); flex-shrink: 0; }
.ct-side-small { font-size: var(--ct-fs-sm); color: var(--ct-text-2); display: flex; align-items: center; gap: 6px; }

/* ---------- 11. Componentes de herramientas ---------- */
.ct-panel { padding: var(--ct-s4); border: 1px solid var(--ct-border); border-radius: var(--ct-radius-lg); background: var(--ct-bg-soft); margin-bottom: var(--ct-s4); min-width: 0; }
.ct-panel__title { font-size: var(--ct-fs-sm) !important; font-weight: 700; margin: 0 0 var(--ct-s3) !important; color: var(--ct-text); }
.ct-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 0 var(--ct-s4); }
.ct-cols--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--ct-s4); }
.ct-row { display: flex; flex-wrap: wrap; gap: var(--ct-s3); align-items: center; }
.ct-actions { display: flex; flex-wrap: wrap; gap: var(--ct-s2); align-items: center; margin: var(--ct-s4) 0; }
.ct-actions--end { justify-content: flex-end; }
.ct-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: clamp(24px, 5vw, 44px) 16px; border: 2px dashed var(--ct-border-strong); border-radius: var(--ct-radius-lg); background: var(--ct-bg-soft); cursor: pointer; transition: border-color var(--ct-dur), background var(--ct-dur); }
.ct-drop:hover, .ct-drop.is-over { border-color: var(--ct-primary); background: var(--ct-primary-soft); }
.ct-drop:focus-within { border-color: var(--ct-primary); }
.ct-drop__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--ct-surface); color: var(--ct-primary-text); box-shadow: var(--ct-shadow-sm); }
.ct-drop__title { font-weight: 700; margin: 0 !important; }
.ct-drop__hint { margin: 0 !important; color: var(--ct-muted); font-size: var(--ct-fs-sm); }
.ct-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ct-drop--compact { padding: 16px; flex-direction: row; }
.ct-files { list-style: none; margin: var(--ct-s4) 0 0; padding: 0; display: grid; gap: 8px; }
.ct-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ct-border); border-radius: var(--ct-radius); background: var(--ct-surface); min-width: 0; }
.ct-file.is-dragging { opacity: .5; }
.ct-file.is-drop-target { border-color: var(--ct-primary); box-shadow: 0 0 0 2px var(--ct-primary-soft-2); }
.ct-file__thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--ct-surface-2); display: grid; place-items: center; color: var(--ct-muted); flex-shrink: 0; overflow: hidden; }
.ct-file__thumb img, .ct-file__thumb canvas { width: 100%; height: 100%; object-fit: cover; }
.ct-file__body { flex: 1; min-width: 0; }
.ct-file__name { display: block; font-weight: 600; font-size: var(--ct-fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-file__meta { display: block; color: var(--ct-muted); font-size: var(--ct-fs-xs); }
.ct-file__actions { display: flex; gap: 4px; flex-shrink: 0; }
.ct-file__handle { cursor: grab; color: var(--ct-muted); display: inline-flex; }
.ct-result { margin-top: var(--ct-s4); padding: var(--ct-s5); border-radius: var(--ct-radius-lg); background: var(--ct-primary-soft); border: 1px solid var(--ct-primary-soft-2); animation: ct-rise .22s var(--ct-ease); }
.ct-result__label { font-size: var(--ct-fs-sm); color: var(--ct-text-2); margin: 0 0 4px !important; font-weight: 600; }
.ct-result__main { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 var(--ct-s3) !important; color: var(--ct-text); word-break: break-word; font-variant-numeric: tabular-nums; }
.ct-result__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: var(--ct-s3); }
.ct-stat { padding: 12px 14px; border-radius: var(--ct-radius); background: var(--ct-surface); border: 1px solid var(--ct-border); min-width: 0; }
.ct-stat__label { display: block; font-size: var(--ct-fs-xs); color: var(--ct-muted); font-weight: 600; }
.ct-stat__value { display: block; font-size: 1.15rem; font-weight: 700; word-break: break-word; font-variant-numeric: tabular-nums; }
.ct-stat--good .ct-stat__value { color: var(--ct-success); }
.ct-stat--bad .ct-stat__value { color: var(--ct-danger); }
.ct-formula { margin-top: var(--ct-s3); padding: 10px 14px; border-radius: var(--ct-radius-sm); background: var(--ct-surface); border: 1px dashed var(--ct-border-strong); font-family: var(--ct-mono); font-size: var(--ct-fs-xs); color: var(--ct-text-2); overflow-x: auto; white-space: pre-wrap; }
.ct-formula strong { font-family: var(--ct-font); color: var(--ct-text); }
.ct-table-wrap { overflow-x: auto; border: 1px solid var(--ct-border); border-radius: var(--ct-radius); background: var(--ct-surface); max-width: 100%; }
.ct-table { width: 100%; border-collapse: collapse; font-size: var(--ct-fs-sm); font-variant-numeric: tabular-nums; }
.ct-table th, .ct-table td { padding: 9px 12px; border-bottom: 1px solid var(--ct-border); text-align: left; white-space: nowrap; }
.ct-table th { background: var(--ct-surface-2); font-weight: 700; position: sticky; top: 0; }
.ct-table td.num, .ct-table th.num { text-align: right; }
.ct-table tr:last-child td { border-bottom: 0; }
.ct-table tbody tr:hover { background: var(--ct-bg-soft); }
.ct-table--wrap td { white-space: normal; }
.ct-table input.ct-input { min-height: 36px; padding: 6px 8px; font-size: var(--ct-fs-sm); }
.ct-table-wrap--tall { max-height: 460px; }
.ct-progress { position: relative; height: 8px; border-radius: 999px; background: var(--ct-surface-3); overflow: hidden; margin: var(--ct-s3) 0; }
.ct-progress__bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ct-primary); border-radius: inherit; transition: width .2s; }
.ct-progress--indeterminate .ct-progress__bar { width: 35%; animation: ct-indet 1.1s ease-in-out infinite; }
.ct-progress-text { font-size: var(--ct-fs-xs); color: var(--ct-text-2); margin: 0 !important; }
.ct-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--ct-radius); font-size: var(--ct-fs-sm); margin: var(--ct-s3) 0; border: 1px solid transparent; }
.ct-alert p { margin: 0 !important; }
.ct-alert--ok { background: var(--ct-success-soft); color: var(--ct-success); }
.ct-alert--warn { background: var(--ct-warn-soft); color: var(--ct-warn); }
.ct-alert--err { background: var(--ct-danger-soft); color: var(--ct-danger); }
.ct-alert--info { background: var(--ct-info-soft); color: var(--ct-info); }
.ct-alert strong { color: inherit; }
.ct-preview { position: relative; display: grid; place-items: center; min-height: 160px; padding: var(--ct-s3); border-radius: var(--ct-radius); border: 1px solid var(--ct-border); background-color: var(--ct-surface); background-image: linear-gradient(45deg, var(--ct-checker) 25%, transparent 25%), linear-gradient(-45deg, var(--ct-checker) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--ct-checker) 75%), linear-gradient(-45deg, transparent 75%, var(--ct-checker) 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; overflow: hidden; }
.ct-preview img, .ct-preview canvas { max-height: 480px; object-fit: contain; display: block; }
.ct-compare { position: relative; overflow: hidden; border-radius: var(--ct-radius); border: 1px solid var(--ct-border); user-select: none; touch-action: pan-y; background: var(--ct-surface); }
.ct-compare img { display: block; width: 100%; height: auto; pointer-events: none; }
.ct-compare__after { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.ct-compare__after img { width: 100%; height: 100%; object-fit: contain; }
.ct-compare__line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); pointer-events: none; }
.ct-compare__range { position: absolute; inset: auto 0 8px; width: calc(100% - 24px); margin: 0 12px; accent-color: var(--ct-primary); }
.ct-compare__tag { position: absolute; top: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: var(--ct-fs-xs); }
.ct-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ct-border); margin-bottom: var(--ct-s4); overflow-x: auto; }
.ct-tab { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; font-weight: 600; font-size: var(--ct-fs-sm); color: var(--ct-text-2); cursor: pointer; white-space: nowrap; }
.ct-tab[aria-selected="true"] { color: var(--ct-primary-text); border-bottom-color: var(--ct-primary); }
.ct-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--ct-s3); margin-top: var(--ct-s4); list-style: none; padding: 0; }
.ct-thumb { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 2px solid var(--ct-border); border-radius: var(--ct-radius); background: var(--ct-surface); text-align: center; font-size: var(--ct-fs-xs); cursor: pointer; transition: border-color var(--ct-dur), opacity var(--ct-dur); }
.ct-thumb canvas, .ct-thumb img { width: 100%; height: auto; border-radius: 4px; background: #fff; box-shadow: var(--ct-shadow-sm); }
.ct-thumb.is-selected { border-color: var(--ct-primary); background: var(--ct-primary-soft); }
.ct-thumb.is-removed { opacity: .4; }
.ct-thumb.is-removed canvas { filter: grayscale(1); }
.ct-thumb.is-dragging { opacity: .4; }
.ct-thumb.is-drop-target { border-color: var(--ct-primary); border-style: dashed; }
.ct-thumb__tools { display: flex; justify-content: center; gap: 2px; }
.ct-thumb__tools .ct-btn { min-height: 28px; width: 28px; padding: 0; }
.ct-thumb__badge { position: absolute; top: 4px; right: 4px; padding: 0 6px; border-radius: 6px; background: var(--ct-primary); color: var(--ct-on-primary); font-weight: 700; }
.ct-diff { font-family: var(--ct-mono); font-size: .86rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; padding: var(--ct-s3); border: 1px solid var(--ct-border); border-radius: var(--ct-radius); background: var(--ct-surface); max-height: 520px; overflow: auto; }
.ct-diff ins { background: var(--ct-diff-add); text-decoration: none; color: inherit; border-radius: 3px; }
.ct-diff del { background: var(--ct-diff-del); text-decoration: line-through; color: inherit; border-radius: 3px; }
.ct-diff__line { display: block; padding: 0 6px; border-radius: 4px; }
.ct-diff__line--add { background: var(--ct-diff-add); }
.ct-diff__line--del { background: var(--ct-diff-del); }
.ct-diff__line::before { content: attr(data-sign); display: inline-block; width: 1.4em; color: var(--ct-muted); }
.ct-kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 16px; margin: 0; font-size: var(--ct-fs-sm); }
.ct-kv dt { color: var(--ct-muted); font-weight: 600; }
.ct-kv dd { margin: 0; word-break: break-word; }
@media (max-width: 480px) { .ct-kv { grid-template-columns: 1fr; gap: 2px; } .ct-kv dd { margin-bottom: 8px; } }
.ct-big-display { font-family: var(--ct-mono); font-variant-numeric: tabular-nums; font-size: clamp(2.6rem, 1.5rem + 6vw, 5.5rem); font-weight: 700; text-align: center; letter-spacing: -.02em; line-height: 1.1; margin: var(--ct-s4) 0 !important; }
.ct-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--ct-s3); }
.ct-swatch { border-radius: var(--ct-radius); overflow: hidden; border: 1px solid var(--ct-border); background: var(--ct-surface); font-size: var(--ct-fs-xs); }
.ct-swatch__color { height: 72px; }
.ct-swatch__info { padding: 8px; font-family: var(--ct-mono); display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.ct-qr-out { display: grid; place-items: center; padding: var(--ct-s4); border-radius: var(--ct-radius); border: 1px solid var(--ct-border); background: var(--ct-surface); }
.ct-qr-out canvas, .ct-qr-out img { max-width: min(100%, 360px); height: auto; image-rendering: pixelated; }
.ct-list-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ct-list-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--ct-border); border-radius: var(--ct-radius-sm); background: var(--ct-surface); }
.ct-list-item.is-done .ct-list-item__text { text-decoration: line-through; color: var(--ct-muted); }
.ct-list-item__text { flex: 1; min-width: 0; word-break: break-word; }
.ct-list-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--ct-primary); flex-shrink: 0; }
.ct-matrix { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ct-s3); }
@media (max-width: 640px) { .ct-matrix { grid-template-columns: 1fr; } }
.ct-matrix__cell { padding: var(--ct-s3); border-radius: var(--ct-radius); border: 1px solid var(--ct-border); background: var(--ct-surface); min-height: 140px; }
.ct-matrix__cell h3 { font-size: var(--ct-fs-sm); margin-bottom: 8px !important; }
.ct-calendar { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ct-calendar th { font-size: var(--ct-fs-xs); color: var(--ct-muted); padding: 6px 2px; }
.ct-calendar td { text-align: center; padding: 8px 2px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.ct-calendar td.is-today { background: var(--ct-primary); color: var(--ct-on-primary); font-weight: 700; }
.ct-calendar td.is-weekend { color: var(--ct-muted); }
.ct-calendar td.is-holiday { background: var(--ct-warn-soft); color: var(--ct-warn); }
.ct-calendar td.is-week { color: var(--ct-muted); font-size: var(--ct-fs-xs); }
.ct-cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--ct-s4); }
.ct-cal-grid h3 { font-size: var(--ct-fs-sm); text-transform: capitalize; margin: 0 0 6px !important; }
.ct-calculator { display: grid; gap: 8px; max-width: 520px; margin: 0 auto; }
.ct-calculator__display { padding: 14px 16px; border-radius: var(--ct-radius); background: var(--ct-bg-soft); border: 1px solid var(--ct-border); text-align: right; min-height: 96px; }
.ct-calculator__expr { font-family: var(--ct-mono); color: var(--ct-muted); font-size: var(--ct-fs-sm); word-break: break-all; min-height: 1.4em; }
.ct-calculator__value { font-family: var(--ct-mono); font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); font-weight: 700; word-break: break-all; font-variant-numeric: tabular-nums; }
.ct-calculator__keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ct-calculator__keys--sci { grid-template-columns: repeat(5, 1fr); }
.ct-key { min-height: 52px; border-radius: var(--ct-radius); border: 1px solid var(--ct-border); background: var(--ct-surface); font-weight: 650; font-size: 1.05rem; cursor: pointer; transition: background var(--ct-dur); }
.ct-key:hover { background: var(--ct-surface-2); }
.ct-key:active { transform: translateY(1px); }
.ct-key--op { background: var(--ct-primary-soft); color: var(--ct-primary-text); }
.ct-key--eq { background: var(--ct-primary); color: var(--ct-on-primary); border-color: var(--ct-primary); }
.ct-key--eq:hover { background: var(--ct-primary-hover); }
.ct-key--fn { font-size: .9rem; background: var(--ct-bg-soft); }
.ct-crop { position: relative; display: inline-block; max-width: 100%; touch-action: none; user-select: none; }
.ct-crop canvas { display: block; max-width: 100%; height: auto; }
.ct-crop__box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.4) inset; cursor: move; }
.ct-crop__handle { position: absolute; width: 18px; height: 18px; background: #fff; border: 2px solid var(--ct-primary); border-radius: 4px; }
.ct-crop__handle--nw { left: -10px; top: -10px; cursor: nwse-resize; }
.ct-crop__handle--ne { right: -10px; top: -10px; cursor: nesw-resize; }
.ct-crop__handle--sw { left: -10px; bottom: -10px; cursor: nesw-resize; }
.ct-crop__handle--se { right: -10px; bottom: -10px; cursor: nwse-resize; }
.ct-placer { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; border: 1px solid var(--ct-border); }
.ct-placer canvas { display: block; max-width: 100%; height: auto; }
.ct-placer__mark { position: absolute; transform: translate(-50%, -50%); width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--ct-primary); background: rgba(255,255,255,.6); pointer-events: none; }
.ct-meter { height: 10px; border-radius: 999px; background: var(--ct-surface-3); overflow: hidden; margin: 6px 0; }
.ct-meter__bar { height: 100%; border-radius: inherit; transition: width .25s, background .25s; }
.ct-guide-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ct-guide-check li { padding: 12px 14px; border: 1px solid var(--ct-border); border-radius: var(--ct-radius); background: var(--ct-surface); }
.ct-guide-check small { display: block; color: var(--ct-muted); margin: 4px 0 0 28px; }
.ct-output-box { position: relative; }
.ct-counter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: var(--ct-s2); margin-bottom: var(--ct-s4); }

/* ---------- 12. Formularios públicos ---------- */
.ct-form { max-width: 640px; }
.ct-form__note { font-size: var(--ct-fs-xs); color: var(--ct-muted); }
.ct-form__status:empty { display: none; }

/* ---------- 13. Pie ---------- */
.ct-footer { margin-top: var(--ct-s7); background: var(--ct-bg-soft); border-top: 1px solid var(--ct-border); font-size: var(--ct-fs-sm); }
.ct-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--ct-s6); padding-top: var(--ct-s7); padding-bottom: var(--ct-s6); }
@media (max-width: 860px) { .ct-footer__grid { grid-template-columns: 1fr 1fr; } .ct-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .ct-footer__grid { grid-template-columns: 1fr; } }
.ct-footer ul { list-style: none; margin: 0 0 var(--ct-s4); padding: 0; display: grid; gap: 8px; }
.ct-footer a { color: var(--ct-text-2) !important; text-decoration: none; }
.ct-footer a:hover { color: var(--ct-primary-text) !important; text-decoration: underline; }
.ct-footer__title { font-weight: 700; color: var(--ct-text); margin: 0 0 var(--ct-s3) !important; font-size: var(--ct-fs-xs); text-transform: uppercase; letter-spacing: .06em; }
.ct-footer__brand p { color: var(--ct-text-2); margin: var(--ct-s3) 0 0 !important; max-width: 340px; }
.ct-footer__muted { color: var(--ct-muted) !important; font-size: var(--ct-fs-xs); }
.ct-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--ct-s3); padding-top: var(--ct-s4); padding-bottom: var(--ct-s5); border-top: 1px solid var(--ct-border); color: var(--ct-muted); font-size: var(--ct-fs-xs); }
.ct-footer__bottom p { margin: 0 !important; }
.ct-footer__menu ul, ul.ct-footer__menu { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* ---------- 14. Avisos flotantes, consentimiento, publicidad ---------- */
.ct-toast-region { position: fixed; z-index: 300; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.ct-toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--ct-radius); background: var(--ct-text); color: var(--ct-bg); box-shadow: var(--ct-shadow-lg); font-size: var(--ct-fs-sm); font-weight: 550; animation: ct-rise .2s var(--ct-ease); pointer-events: auto; }
.ct-toast--err { background: var(--ct-danger); color: #fff; }
.ct-consent { position: fixed; z-index: 250; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: center; pointer-events: none; }
.ct-consent__box { pointer-events: auto; width: min(720px, 100%); padding: var(--ct-s5); border-radius: var(--ct-radius-xl); background: var(--ct-surface); border: 1px solid var(--ct-border); box-shadow: var(--ct-shadow-lg); font-size: var(--ct-fs-sm); }
.ct-consent__title { font-size: 1.05rem !important; margin-bottom: 6px !important; }
.ct-consent__options { display: grid; gap: 10px; }
.ct-consent__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 6px; }
@media (max-width: 520px) { .ct-consent__actions .ct-btn { flex: 1 1 100%; } }
.ct-ad { margin: var(--ct-s5) 0; padding: var(--ct-s3); border-radius: var(--ct-radius); border: 1px solid var(--ct-border); background: var(--ct-bg-soft); min-height: 120px; }
.ct-ad__label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ct-muted); margin-bottom: 6px; }

/* ---------- 15. Animaciones ---------- */
@keyframes ct-spin { to { transform: rotate(360deg); } }
@keyframes ct-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ct-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ct-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes ct-indet { 0% { left: -35%; } 100% { left: 100%; } }
.ct-spinner { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ct-primary); border-right-color: transparent; animation: ct-spin .7s linear infinite; vertical-align: middle; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
	.ct-card--tool:hover, .ct-card--cat:hover, .ct-card--post:hover { transform: none; }
}
@media (forced-colors: active) {
	.ct-btn, .ct-input, .ct-card, .ct-search { border: 1px solid CanvasText; }
	.ct-switch__track { border: 1px solid CanvasText; }
}
@media (max-width: 600px) {
	.ct-container { padding: 0 16px; }
	.ct-card { padding: var(--ct-s4); }
	.ct-workspace { border-radius: var(--ct-radius-lg); padding: 14px; }
	.ct-actions .ct-btn--primary { flex: 1 1 auto; }
	.ct-result { padding: var(--ct-s4); }
}

/* ---------- Documentos (facturas, presupuestos, recibos) ---------- */
.ct-subtitle { font-size: var(--ct-fs-md); margin: 24px 0 10px; }
.ct-doc-form { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ct-doc-preview { background: var(--ct-bg-soft); border-radius: var(--ct-radius); padding: 16px; overflow-x: auto; }
.ct-doc { background: #fff; color: #15151d; border: 1px solid var(--ct-border); border-radius: var(--ct-radius-sm); padding: 28px; max-width: 820px; margin: 0 auto; font-size: var(--ct-fs-sm); line-height: 1.5; }
.ct-doc p { margin: 0 0 4px; }
.ct-doc__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.ct-doc .ct-doc__title { margin: 0; font-size: 1.6rem; color: #4b2ee3; }
.ct-doc__meta { display: grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 0; }
.ct-doc__meta dt { color: #636376; }
.ct-doc__meta dd { margin: 0; font-weight: 600; text-align: right; }
.ct-doc__parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 20px; }
.ct-doc__label { text-transform: uppercase; letter-spacing: .04em; font-size: var(--ct-fs-xs); color: #636376; font-weight: 600; }
.ct-doc__name { font-weight: 700; }
.ct-doc__pre { white-space: pre-line; }
.ct-doc .ct-table th, .ct-doc .ct-table td { color: #15151d; border-color: #e5e5ee; }
.ct-doc__lines th { background: #f3f1ff; }
.ct-doc__totals { margin: 16px 0 0 auto; border-collapse: collapse; min-width: 280px; font-variant-numeric: tabular-nums; }
.ct-doc__totals th { text-align: right; font-weight: 400; color: #636376; padding: 3px 12px; }
.ct-doc__totals td { text-align: right; padding: 3px 0; }
.ct-doc__total th, .ct-doc__total td { font-size: 1.15rem; font-weight: 700; color: #15151d; border-top: 2px solid #4b2ee3; padding-top: 8px; }
.ct-doc__notes { margin-top: 18px; }
.ct-doc__amount { font-size: 1.4rem; font-weight: 700; margin: 0; }
.ct-doc__sign { margin-top: 36px; width: min(260px, 100%); margin-left: auto; border-top: 1px solid #636376; padding-top: 6px; text-align: center; }
.ct-doc-stack { display: grid; gap: 16px; }
.ct-doc__totals .num { text-align: right; }
/* La vista previa del documento imita papel: siempre fondo blanco, también en modo oscuro. */
.ct-doc .ct-table, .ct-doc .ct-table td, .ct-doc .ct-table tr { background: #fff; }
.ct-doc .ct-table thead th { background: #f3f1ff; color: #15151d; }

/* Cabecera compacta en móviles estrechos: el nombre de la marca es largo. */
@media (max-width: 480px) {
	.ct-header__inner { gap: 8px; }
	.ct-header__actions { gap: 0; }
	.ct-logo { gap: 8px; font-size: 1rem; min-width: 0; }
	.ct-logo__mark { width: 30px; height: 30px; border-radius: 9px; flex: none; }
	.ct-logo__mark svg { width: 17px; height: 17px; }
	.ct-logo__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.ct-header .ct-icon-btn, .ct-search-trigger { width: 36px; min-width: 36px; }
	.ct-lang__code { display: none; }
}
@media (max-width: 350px) { .ct-logo__mark { display: none; } }
/* Con un solo idioma, el selector no aporta nada en pantallas estrechas. */
@media (max-width: 400px) { .ct-lang--single { display: none; } }
