
@font-face{font-family:"Instrument Serif";font-style:normal;font-weight:400;font-display:swap;src:url(/public/fonts/instrument-serif-400.woff2) format("woff2")}
@font-face{font-family:"Instrument Serif";font-style:italic;font-weight:400;font-display:swap;src:url(/public/fonts/instrument-serif-italic.woff2) format("woff2")}
/* GALATEA v1 — app.css | Diseño: Sonnet 5.5 | Construcción quirúrgica: Blanc (Gema) */
@layer tokens, base, layout, components, pages;
@layer tokens {
 :root { color-scheme: dark; --bg: #0E0D0C; --bg-sunken: #0A0908; --surface: #171513; --surface-2: #201D1A; --surface-3: #2A2622; --line: #34302B; --line-strong: #4A443D; --line-input: #766D60; --text: #F2EDE6; --text-2: #B8AFA3; --text-3: #8F867A; --brasa: #FF7A2F; --brasa-hover: #FF8F4F; --brasa-deep: #E65100; --luz: #FFB36B; --patina: #5FBF9A; --ocre: #E3B341; --cinabrio: #F2556B; --cinabrio-t: #FF7D8E; --lapis: #7FA8E0; --brasa-a: rgba(255, 122, 47, .14); --patina-a: rgba(95, 191, 154, .14); --ocre-a: rgba(227, 179, 65, .14); --cinabrio-a: rgba(242, 85, 107, .14); --lapis-a: rgba(127, 168, 224, .14); --veta: linear-gradient(90deg, transparent, var(--brasa-deep) 20%, var(--luz) 50%, var(--brasa-deep) 80%, transparent); --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--luz); --font-display: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif; --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif; --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; --fs-12: .75rem; --lh-12: 1.3; --fs-14: .875rem; --lh-14: 1.45; --fs-16: 1rem; --lh-16: 1.55; --fs-18: 1.125rem; --lh-18: 1.65; --fs-22: 1.375rem; --lh-22: 1.2; --fs-28: 1.75rem; --lh-28: 1.15; --fs-36: 2.25rem; --lh-36: 1.05; --fs-56: 3.5rem; --lh-56: 1; --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-14: 56px; --s-18: 72px; --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px; --sh-1: inset 0 1px 0 rgba(255, 255, 255, .045), 0 1px 2px rgba(0, 0, 0, .5); --sh-2: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 28px rgba(0, 0, 0, .5); --sh-glow: 0 0 0 1px rgba(255, 122, 47, .38), 0 0 28px rgba(255, 122, 47, .16); --ease: cubic-bezier(.2, .7, .2, 1); --d-1: 120ms; --d-2: 200ms; --d-3: 360ms; --tabbar-h: 60px; --topbar-h: 48px; --w-read: 720px; --w-wide: 1120px; --z-tab: 40; --z-sheet: 60; --z-toast: 80; --z-veta: 90; }
@media (min-width: 720px) {
 :root { --fs-36: 2.75rem; --fs-28: 2rem; }
}
}
@layer base {
 *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
 html { -webkit-text-size-adjust: 100%; color-scheme: dark; font-synthesis: none; scroll-behavior: smooth; }
 body { background: radial-gradient(120% 55% at 50% -12%, rgba(255, 122, 47, .07), transparent 62%), var(--bg) fixed; color: var(--text); font-family: var(--font-ui); font-size: var(--fs-16); line-height: var(--lh-16); min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
 h1, h2, h3, h4, .serif { font-family: var(--font-display); font-weight: 400; color: var(--text); letter-spacing: -0.01em; }
 h1 { font-size: var(--fs-36); line-height: var(--lh-36); }
 h2 { font-size: var(--fs-28); line-height: var(--lh-28); }
 h3 { font-size: var(--fs-22); line-height: var(--lh-22); }
 p { margin-bottom: var(--s-3); color: var(--text-2); }
 a { color: var(--brasa); text-decoration: none; transition: color var(--d-1) var(--ease); }
 a:hover { color: var(--brasa-hover); }
 code, kbd, samp, pre { font-family: var(--font-mono); font-size: .875em; }
 img, svg { display: block; max-width: 100%; }
 :focus-visible { outline: none; box-shadow: var(--focus); }
 .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
 @keyframes latido {
 0%, 100% { transform: scale(1); opacity: .4; } 8% { transform: scale(1.08); opacity: .85; }
 16% { transform: scale(1); opacity: .5; } 26% { transform: scale(1.04); opacity: .7; }
 40% { transform: scale(1); opacity: .4; }
}
 @keyframes viaja { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
 @keyframes spin { to { transform: rotate(360deg); } }
 @keyframes arrive { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
 @keyframes ping { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
 @keyframes toast {
 0% { opacity: 0; transform: translateY(8px); } 6% { opacity: 1; transform: translateY(0); }
 88% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); max-height: 0; margin: 0; padding: 0; border: 0; visibility: hidden; }
}
 @keyframes pulse-pip { 0%, 100% { opacity: .6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }
 @keyframes veta-flow { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
 @keyframes pulse-typing { 0%, 100% { opacity: .3; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); color: var(--brasa); } }
 @keyframes skeleton-shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
 @keyframes draw-ring { from { stroke-dashoffset: 340; } to { stroke-dashoffset: 0; } }
 .htmx-swapping { opacity: 0; transition: opacity var(--d-2) var(--ease); }
 .htmx-added { animation: arrive var(--d-3) var(--ease); }
 @view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
}
@layer layout {
 #veta { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: var(--z-veta); background: var(--veta); background-size: 200% 100%; pointer-events: none; animation: veta-flow 6s linear infinite; }
 #veta[data-state="atento"] { filter: hue-rotate(-20deg); animation-duration: 3s; }
 #veta[data-state="caido"] { background: var(--cinabrio); animation: none; }
 #veta[data-state="dormido"] { background: var(--line-strong); animation: none; opacity: .4; }
 body.htmx-request #veta { animation-duration: 1.2s; }
 .wrap { width: 100%; margin-inline: auto; padding-inline: var(--s-4); }
 .wrap--read { max-width: var(--w-read); }
 .wrap--wide { max-width: var(--w-wide); }
 .app-shell { display: flex; flex-direction: column; min-height: 100dvh; position: relative; }
 .topbar { position: sticky; top: 0; z-index: 30; height: calc(var(--topbar-h) + env(safe-area-inset-top, 0)); padding-top: env(safe-area-inset-top, 0); padding-inline: var(--s-4); display: flex; align-items: center; justify-content: space-between; background: rgba(14, 13, 12, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
 .topbar__brand { display: flex; align-items: center; gap: var(--s-2); color: var(--text); text-decoration: none; }
 .topbar__brand .logo-icon { width: 22px; height: 22px; }
 .topbar__title { font-family: var(--font-display); font-size: var(--fs-22); line-height: 1; color: var(--text); }
 .topbar__status { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-12); color: var(--text-2); text-decoration: none; padding: var(--s-1) var(--s-2); border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); }
 .tabbar { position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0)); padding-bottom: env(safe-area-inset-bottom, 0); z-index: var(--z-tab); background: rgba(14, 13, 12, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch; }
 .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); text-decoration: none; position: relative; min-height: 44px; min-width: 64px; transition: color var(--d-1) var(--ease); }
 .tab__icon { width: 22px; height: 22px; position: relative; }
 .tab__label { font-size: var(--fs-12); font-weight: 500; line-height: 1; }
 .tab--active { color: var(--text); }
 .tab--active .tab__icon { color: var(--brasa); }
 .tab--active::before { content: ""; position: absolute; top: -1px; width: 20px; height: 2px; background: var(--brasa); box-shadow: 0 0 8px var(--brasa); border-radius: var(--r-pill); }
 .tab__badge { position: absolute; top: 6px; right: calc(50% - 18px); min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--r-pill); background: var(--ocre); color: var(--bg); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 6px var(--ocre-a); animation: ping 1.2s var(--ease) 2; }
 body:has(.composer :focus-visible) .tabbar { display: none !important; }
 #main { flex: 1; padding-top: var(--s-4); padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0) + var(--s-6)); }
 .sheet { position: fixed; inset: 0; z-index: var(--z-sheet); display: none; align-items: flex-end; }
 .sheet:target { display: flex; }
 .sheet__scrim { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
 .sheet__panel { position: relative; width: 100%; max-width: 600px; margin-inline: auto; background: var(--surface); border-top: 1px solid var(--line-strong); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: var(--s-4) var(--s-4) calc(var(--s-6) + env(safe-area-inset-bottom, 0)); box-shadow: var(--sh-2); animation: arrive var(--d-2) var(--ease); }
 .sheet__drag { width: 36px; height: 4px; background: var(--line-strong); border-radius: var(--r-pill); margin: 0 auto var(--s-4); }
 .sheet__item { display: flex; align-items: center; gap: var(--s-3); padding: 12px 14px; min-height: 56px; color: var(--text); text-decoration: none; border-radius: var(--r-md); transition: background var(--d-1); }
 .sheet__item:hover { background: var(--surface-2); }
 .sheet__item-info { display: flex; flex-direction: column; gap: 2px; }
 .sheet__item-title { font-size: var(--fs-16); font-weight: 500; color: var(--text); }
 .sheet__item-desc { font-size: var(--fs-12); color: var(--text-3); }
 .sheet__sep { height: 1px; background: var(--line); margin: var(--s-3) 0; }
 .sheet__footer { padding-top: var(--s-3); text-align: center; font-family: var(--font-display); font-style: italic; font-size: var(--fs-14); color: var(--text-3); }
 .sidebar { display: none; flex-direction: column; flex-shrink: 0; height: 100dvh; position: sticky; top: 0; background: var(--surface); border-right: 1px solid var(--line); justify-content: space-between; z-index: 30; }
 .sidebar__top, .sidebar__nav, .sidebar__foot { display: flex; flex-direction: column; width: 100%; }
 .sidebar__nav { gap: var(--s-2); }
 .sidebar__brand { display: flex; align-items: center; gap: var(--s-3); color: var(--text); text-decoration: none; }
 .sidebar__link { display: flex; align-items: center; border-radius: var(--r-md); color: var(--text-3); text-decoration: none; position: relative; transition: all var(--d-1) var(--ease); }
 .sidebar__link:hover { background: var(--surface-2); color: var(--text); }
 .sidebar__link--active { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--brasa); }
 .sidebar__link--active .ic { color: var(--brasa); }
 .sidebar__badge { background: var(--ocre); color: var(--bg); font-size: 11px; font-weight: 700; padding: 0 4px; height: 16px; line-height: 16px; border-radius: var(--r-pill); }
 .sidebar__foot { padding-top: var(--s-3); border-top: 1px solid var(--line); }
@media (min-width: 720px) {
 .app-shell { flex-direction: row; }
 .topbar, .tabbar, .sheet { display: none !important; }
 .sidebar { display: flex; width: 76px; padding: var(--s-4) var(--s-2); align-items: center; }
 .sidebar__top { align-items: center; gap: var(--s-6); }
 .sidebar__brand { justify-content: center; padding: var(--s-2); }
 .sidebar__brand-text, .sidebar__tagline, .sidebar__pulse-info { display: none; }
 .sidebar__link { flex-direction: column; justify-content: center; gap: 4px; padding: var(--s-2) var(--s-1); }
 .sidebar__link span { font-size: var(--fs-12); font-weight: 500; }
 .sidebar__badge { position: absolute; top: 4px; right: 12px; }
 .sidebar__foot { align-items: center; gap: var(--s-3); }
 #main { padding: var(--s-6) var(--s-6) var(--s-10); min-width: 0; }
}
@media (min-width: 1100px) {
 .sidebar { width: 248px; align-items: stretch; padding: var(--s-6) var(--s-4); }
 .sidebar__top { align-items: stretch; }
 .sidebar__brand { justify-content: flex-start; padding: var(--s-2) var(--s-3); }
 .sidebar__brand-text { display: flex; flex-direction: column; }
 .sidebar__brand-text h1 { font-family: var(--font-display); font-size: var(--fs-28); line-height: 1; }
 .sidebar__tagline { display: block; font-family: var(--font-display); font-style: italic; font-size: var(--fs-12); color: var(--text-3); margin-top: 2px; }
 .sidebar__link { flex-direction: row; justify-content: flex-start; gap: var(--s-3); padding: 10px 14px; }
 .sidebar__link span { font-size: var(--fs-14); }
 .sidebar__badge { position: static; margin-left: auto; }
 .sidebar__foot { align-items: stretch; }
 .sidebar__pulse-info { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-12); color: var(--text-3); padding: var(--s-2); }
 #main { padding: var(--s-8) var(--s-8) var(--s-14); }
}
 #toasts { position: fixed; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0) + 12px); left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: 420px; z-index: var(--z-toast); pointer-events: none; display: flex; flex-direction: column; gap: var(--s-2); }
@media (min-width: 720px) { #toasts { bottom: var(--s-6); right: var(--s-6); left: auto; transform: none; } }
}
@layer components {
 .ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
 .ic--sm { width: 16px; height: 16px; }
 .ic--lg { width: 24px; height: 24px; }
 .ic--spin { animation: spin .9s linear infinite; }
 .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4); border-radius: var(--r-md); font-family: var(--font-ui); font-size: var(--fs-16); font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: all var(--d-1) var(--ease); white-space: nowrap; }
 .btn:active { transform: scale(.98); }
 .btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
 .btn--primary { background: var(--brasa); color: var(--bg); border-color: var(--brasa); }
 .btn--primary:hover { background: var(--brasa-hover); border-color: var(--brasa-hover); }
 .btn--primary:active { background: var(--brasa-deep); }
 .btn--secondary { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
 .btn--secondary:hover { background: var(--surface-3); border-color: var(--line-input); }
 .btn--ghost { background: transparent; color: var(--text-2); }
 .btn--ghost:hover { background: var(--surface-2); color: var(--text); }
 .btn--danger { background: transparent; color: var(--cinabrio-t); border-color: var(--cinabrio); }
 .btn--danger:hover { background: var(--cinabrio-a); }
 .btn--danger.btn--solid { background: var(--cinabrio); color: var(--bg); border-color: var(--cinabrio); }
 .btn--danger.btn--solid:hover { opacity: .9; }
 .btn--icon { width: 44px; height: 44px; padding: 0; border-radius: var(--r-pill); flex-shrink: 0; }
 .btn--sm { min-height: 36px; padding: 0 var(--s-3); font-size: var(--fs-14); }
 .btn--lg { min-height: 52px; padding: 0 var(--s-6); font-size: var(--fs-18); }
 .btn--block { width: 100%; }
 .spin { width: 18px; height: 18px; animation: spin .9s linear infinite; }
 .btn .spin { display: none; }
 .btn.htmx-request, .htmx-request .btn { pointer-events: none; position: relative; }
 .btn.htmx-request .btn__text, .htmx-request .btn .btn__text { opacity: 0; }
 .btn.htmx-request .spin, .htmx-request .btn .spin { display: inline-block; position: absolute; }
 .badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: var(--fs-12); font-weight: 600; line-height: 1; white-space: nowrap; }
 .badge .ic { width: 14px; height: 14px; }
 .badge--pendiente { background: var(--ocre-a); color: var(--ocre); }
 .badge--aprobada { background: var(--lapis-a); color: var(--lapis); }
 .badge--ejecutando, .badge--latiendo { background: var(--brasa-a); color: var(--brasa); }
 .badge--ejecutada, .badge--online { background: var(--patina-a); color: var(--patina); }
 .badge--rechazada { background: var(--cinabrio-a); color: var(--cinabrio-t); }
 .badge--expirada { background: var(--surface-3); color: var(--text-2); }
 .badge--neutral { background: var(--surface-3); color: var(--text-2); }
 .badge--brasa { background: var(--brasa-a); color: var(--brasa); }
 .badge-origen.origen-telegram, .origen-telegram .badge-origen { color: var(--lapis); background: var(--lapis-a); }
 .badge-origen.origen-web, .origen-web .badge-origen { color: var(--patina); background: var(--patina-a); }
 .badge-origen.origen-max, .origen-max .badge-origen { color: var(--brasa); background: var(--brasa-a); }
 .msg, .card, .prose { word-break: break-word; overflow-wrap: anywhere; }
 .pip { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-pill); background: currentColor; flex-shrink: 0; }
 .pip--pulse { animation: pulse-pip 1.6s var(--ease) infinite; }
 .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); box-shadow: var(--sh-1); position: relative; overflow: hidden; transition: transform var(--d-1) var(--ease), border-color var(--d-1) var(--ease); }
 .card--raised { background: var(--surface-2); box-shadow: var(--sh-2); }
 .card--vein { border-left: 2px solid var(--brasa); }
 .card--attn { border-left: 2px solid var(--ocre); }
 .card--danger { border-left: 2px solid var(--cinabrio); }
 .card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
 .card__overline { font-size: var(--fs-12); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: var(--s-1); }
 .card__title { font-family: var(--font-display); font-size: var(--fs-22); line-height: var(--lh-22); color: var(--text); margin: 0; }
 .card__foot { border-top: 1px solid var(--line); margin-top: var(--s-4); padding-top: var(--s-3); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
 a.card { text-decoration: none; cursor: pointer; min-height: 56px; color: inherit; }
 a.card:active { background: var(--surface-2); transform: scale(.995); }
 .heart { --c: var(--brasa); --t: 1.6s; position: relative; width: 96px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
 .heart::before { content: ""; position: absolute; inset: -14%; border-radius: 50%; background: radial-gradient(closest-side, var(--c), transparent 70%); opacity: .5; }
 .heart__ring { fill: none; stroke: var(--line-strong); stroke-width: 2; }
 .heart__trace { fill: none; stroke: var(--line-strong); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
 .heart__vein { fill: none; stroke: var(--c); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 28 72; }
@media (prefers-reduced-motion: no-preference) {
 .heart::before { animation: latido var(--t) var(--ease) infinite; }
 .heart__vein { animation: viaja var(--t) linear infinite; }
}
 .heart[data-state="atento"] { --c: var(--ocre); --t: 1s; }
 .heart[data-state="caido"] { --c: var(--cinabrio); }
 .heart[data-state="dormido"] { --c: var(--text-3); }
 .heart[data-state="caido"]::before, .heart[data-state="caido"] .heart__vein, .heart[data-state="dormido"]::before, .heart[data-state="dormido"] .heart__vein { animation: none; }
 .empty { padding: var(--s-10) var(--s-4); text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
 .empty__icon { width: 56px; height: 56px; color: var(--line-strong); margin-bottom: var(--s-4); }
 .empty__title { font-family: var(--font-display); font-size: var(--fs-22); color: var(--text); margin-bottom: var(--s-2); }
 .empty__text { font-size: .9375rem; color: var(--text-2); max-width: 36ch; margin-bottom: var(--s-6); line-height: 1.5; }
 .toast { pointer-events: auto; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); box-shadow: var(--sh-2); display: flex; align-items: center; gap: var(--s-3); border-left: 2px solid var(--line-strong); animation: toast 5s forwards; }
 .toast--patina { border-left-color: var(--patina); }
 .toast--ocre { border-left-color: var(--ocre); }
 .toast--cinabrio { border-left-color: var(--cinabrio); animation: arrive var(--d-2) var(--ease); }
 .toast--brasa { border-left-color: var(--brasa); }
 .toast__icon { width: 18px; height: 18px; flex-shrink: 0; }
 .toast__msg { font-size: var(--fs-14); color: var(--text); flex: 1; }
 .toast__close { background: transparent; border: none; color: var(--text-3); cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; }
 .toast__close:hover { color: var(--text); }
 .form-group { margin-bottom: var(--s-4); }
 label { display: block; font-size: var(--fs-14); font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
 input, textarea, select { width: 100%; height: 48px; background: var(--bg-sunken); border: 1px solid var(--line-input); border-radius: var(--r-md); padding: 12px 14px; font-family: var(--font-ui); font-size: var(--fs-16); color: var(--text); transition: border-color var(--d-1), box-shadow var(--d-1); appearance: none; }
 textarea { height: auto; min-height: 96px; resize: vertical; line-height: 1.5; }
 select { background: var(--bg-sunken) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%238F867A'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center / 16px; padding-right: 40px; }
 input:focus-visible, textarea:focus-visible, select:focus-visible { border-color: var(--brasa); box-shadow: 0 0 0 3px var(--brasa-a); }
 .form-hint { font-size: var(--fs-14); color: var(--text-3); margin-top: 4px; }
 .form-error { font-size: var(--fs-14); color: var(--cinabrio-t); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
 .cmd { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; font-family: var(--font-mono); font-size: var(--fs-14); color: var(--text); display: flex; align-items: center; gap: 8px; overflow-x: auto; white-space: nowrap; }
 .cmd::before { content: "$"; color: var(--text-3); user-select: none; }
 .list { list-style: none; border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
 .list__item { min-height: 56px; padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); text-decoration: none; color: inherit; }
 .list__item:last-child { border-bottom: none; }
 a.list__item:hover { background: var(--surface-2); }
 .list__main { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
 .list__title { font-size: var(--fs-16); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
 .list__meta { font-size: var(--fs-14); color: var(--text-2); }
 .time { font-variant-numeric: tabular-nums; font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; }
 .skel { background: var(--surface-2); border-radius: var(--r-sm); position: relative; overflow: hidden; min-height: 1rem; }
 .skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .04), transparent); animation: skeleton-shine 1.8s infinite; }
 .prose { max-width: 68ch; font-size: var(--fs-18); line-height: 1.7; color: var(--text); }
 .prose h1, .prose h2, .prose h3 { margin-top: var(--s-6); margin-bottom: var(--s-3); }
 .prose p { margin-bottom: var(--s-4); color: var(--text); }
 .prose a { color: var(--brasa); text-decoration: underline; text-underline-offset: 3px; }
 .prose a.wikilink { color: var(--luz); text-decoration: underline dotted; }
 .prose blockquote { border-left: 2px solid var(--brasa); padding-left: var(--s-4); color: var(--text-2); font-style: italic; margin-block: var(--s-4); }
 .prose pre { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4); overflow-x: auto; font-family: var(--font-mono); font-size: var(--fs-14); margin-block: var(--s-4); }
 .prose code:not(pre code) { background: var(--bg-sunken); padding: 2px 6px; border-radius: var(--r-xs); font-family: var(--font-mono); font-size: .9em; }
 .prose ul, .prose ol { margin-left: var(--s-5); margin-bottom: var(--s-4); }
 .prose li { margin-bottom: var(--s-1); color: var(--text-2); }
 .prose hr { border: none; height: 1px; background: var(--line); margin: var(--s-6) 0; position: relative; }
 .prose hr::after { content: "◆"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--bg); padding: 0 8px; color: var(--text-3); font-size: 10px; }
 .prose table { width: 100%; border-collapse: collapse; margin-block: var(--s-4); font-size: var(--fs-14); }
 .prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
 .prose th { color: var(--text-3); font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .06em; }
 #thread { display: flex; flex-direction: column; gap: var(--s-3); max-width: 760px; margin-inline: auto; padding-bottom: var(--s-8); }
 .msg { max-width: 88%; display: flex; flex-direction: column; animation: arrive var(--d-2) var(--ease); }
 .msg--user { align-self: flex-end; background: var(--surface-3); color: var(--text); border-radius: 18px 18px var(--r-xs) 18px; padding: 10px 14px; }
 .msg--max { align-self: flex-start; max-width: 92%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-xs) 18px 18px 18px; padding: 12px 14px; position: relative; }
 .msg--max[data-streaming="true"] { border-left: 2px solid var(--brasa); }
 .msg--max[data-streaming="true"] #live::after { content: "▍"; color: var(--brasa); animation: ping .8s infinite; }
 .msg__header { display: flex; align-items: center; gap: 6px; font-size: var(--fs-12); color: var(--text-3); margin-bottom: 6px; }
 .typing { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; }
 .typing span { font-size: 8px; animation: pulse-typing 1.2s infinite; }
 .typing span:nth-child(2) { animation-delay: .2s; }
 .typing span:nth-child(3) { animation-delay: .4s; }
 .trace { border-left: 2px solid var(--line); margin-left: 12px; padding-left: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); margin-block: var(--s-2); }
 .step--say { font-family: var(--font-display); font-style: italic; font-size: 1.0625rem; color: var(--text-2); }
 .step--tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; font-size: var(--fs-14); display: flex; flex-direction: column; gap: 6px; }
 .composer { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0)); background: var(--bg); border-top: 1px solid var(--line); padding: var(--s-3) var(--s-4); display: flex; align-items: flex-end; gap: var(--s-2); z-index: 25; }
@media (min-width: 720px) { .composer { bottom: 0; } }
 .approval { border-left: 2px solid var(--ocre); display: flex; flex-direction: column; gap: var(--s-3); animation: arrive var(--d-3) var(--ease); }
 .approval--danger { border-left-color: var(--cinabrio); }
 .approval__actions { display: grid; grid-template-columns: 2fr 3fr; gap: var(--s-2); margin-top: var(--s-2); }
 .tree details { margin-left: var(--s-3); border-left: 1px solid var(--line); }
 .tree summary { list-style: none; cursor: pointer; padding: 8px 12px; display: flex; align-items: center; gap: var(--s-2); border-radius: var(--r-md); color: var(--text-2); }
 .tree summary:hover { background: var(--surface); color: var(--text); }
 .tree summary::-webkit-details-marker { display: none; }
 .tree__leaf { padding: 8px 12px 8px 24px; display: flex; align-items: center; gap: var(--s-2); color: var(--text-2); text-decoration: none; border-radius: var(--r-md); }
 .tree__leaf:hover { background: var(--surface); color: var(--text); }
 .tree__leaf--active { background: var(--surface-2); border-left: 2px solid var(--brasa); color: var(--text); }
}
@layer pages {
 .pulse-hero { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 600px) { .pulse-hero { grid-template-columns: 120px 1fr; align-items: center; } }
 .stat-bars { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
 .stat-bar { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-12); color: var(--text-2); }
 .stat-bar__track { flex: 1; height: 4px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
 .stat-bar__fill { height: 100%; background: var(--patina); border-radius: var(--r-pill); }
 .stat-bar__fill--warn { background: var(--ocre); }
 .stat-bar__fill--danger { background: var(--cinabrio); }
 .day-timeline { border-left: 2px solid var(--line); margin-left: 14px; padding-left: var(--s-5); display: flex; flex-direction: column; gap: var(--s-6); position: relative; }
 .day-station { position: relative; }
 .day-station::before { content: "◆"; position: absolute; left: calc(-1 * var(--s-5) - 6px); top: 2px; font-size: 10px; color: var(--text-3); background: var(--bg); }
 .day-station[data-current="true"]::before { color: var(--brasa); }
 .filter-chips { display: flex; align-items: center; gap: var(--s-2); overflow-x: auto; padding-bottom: var(--s-2); margin-bottom: var(--s-4); scrollbar-width: none; }
 .filter-chips::-webkit-scrollbar { display: none; }
 .chip { padding: 6px 14px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: var(--fs-14); white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
 .chip--active { background: var(--brasa-a); border-color: var(--brasa); color: var(--brasa); }
 .auth-scene { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s-6); text-align: center; background: radial-gradient(100% 60% at 50% 20%, rgba(255, 122, 47, .12), transparent 70%), var(--bg); }
 .auth-card { width: 100%; max-width: 400px; margin-top: var(--s-6); }
 .auth-scene .heart { width: 128px; }
 .auth-scene .heart__ring { stroke-dasharray: 340; animation: draw-ring .9s var(--ease) forwards; }
 /* Social Hub Overlay Drawer & Planner Components */
 .social-panel-overlay { position: fixed; inset: 0; background: rgba(14, 13, 12, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 99; display: flex; justify-content: flex-end; }
 .social-panel-overlay[hidden] { display: none !important; }
 .social-panel { width: 100%; max-width: 520px; height: 100dvh; background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: var(--sh-2); overflow-y: auto; position: relative; animation: arrive var(--d-2) var(--ease); display: flex; flex-direction: column; }
 .meta-planner-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-2); transition: all var(--d-1) var(--ease); }
 .meta-planner-card:hover { border-color: var(--line-strong); background: var(--surface-3); transform: translateY(-1px); }
 .story-circle-item:hover { transform: scale(1.04); }
}/* ─── Consola de agentes (Herdr) ─── */
.consola {
  border: 1px solid var(--line-input);
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  overflow: hidden;
  margin-bottom: var(--s-3);
}
.consola__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line-input);
  background: var(--bg-sunken);
}
.consola__selector {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  flex-wrap: wrap;
}
.consola__selector select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-input);
  border-radius: var(--r-md);
  padding: 4px 8px;
  font-size: var(--fs-12);
  font-family: var(--font-ui);
  max-width: 60%;
}
.consola__stream {
  max-height: 40dvh;
  overflow: auto;
  border-top: 1px solid var(--line-input);
}
.consola__stream pre {
  margin: 0;
  padding: var(--s-2) var(--s-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}
.consola__empty {
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-13);
  color: var(--text-2);
}
