@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Raleway:wght@400;500;600;700&display=swap');

/* SANHE Phase 7 — shared visual language for authenticated and support interfaces. */
:root {
  --sanhe-ink: #1E4D44;
  --sanhe-ink-deep: #163b35;
  --sanhe-teal: #4A9E8E;
  --sanhe-paper: #f6f3ec;
  --sanhe-paper-alt: #ece8de;
  --sanhe-white: #fffdf8;
  --sanhe-line: #cfc8ba;
  --sanhe-muted: #5b625e;
  --sanhe-display: 'Cinzel', Georgia, serif;
  --sanhe-body: 'Raleway', ui-sans-serif, system-ui, sans-serif;
  --sanhe-space-1: .35rem;
  --sanhe-space-2: .65rem;
  --sanhe-space-3: 1rem;
  --sanhe-space-4: 1.5rem;
  --sanhe-space-5: 2.25rem;
  --sanhe-radius-sm: 3px;
  --sanhe-radius-md: 7px;
  --sanhe-radius-lg: 12px;
  --sanhe-shadow: 0 2px 10px rgba(30, 77, 68, .09);
  --sanhe-shadow-deep: 0 12px 32px rgba(30, 77, 68, .16);
  --sanhe-duration: 180ms;
}

html, body { font-family: var(--sanhe-body) !important; }
h1, h2, h3, h4, .page-title, .view-page-title, .empty-title,
.settings-h1, .settings-h2, .sec-title, .modal-title, .nav-logo,
.stat-val { font-family: var(--sanhe-display) !important; font-weight: 500; }

/* Mundo 1: quiet paper, reflective personal record. */
[data-mundo="1"], .mundo-1 { --mundo-accent: var(--sanhe-teal); }
/* Mundo 2: ink-led supervision, denser and more structured. */
[data-mundo="2"], .mundo-2 { --mundo-accent: var(--sanhe-ink); }

html:not([data-theme="dark"]) body {
  background: var(--sanhe-paper);
  color: var(--sanhe-ink-deep);
}

:where(button, input, select, textarea, a):focus-visible {
  outline: 3px solid var(--sanhe-teal) !important;
  outline-offset: 3px;
}

html:not([data-theme="dark"]) :where(.sidebar, .main, .topbar, .settings-dialog, .view-page, .composer,
.digest-card, .sesion-card, .session-note, .plan-card, .pay-box, .modal) {
  background-color: var(--sanhe-paper) !important;
}

html:not([data-theme="dark"]) :where(.sidebar, .topbar) { border-color: var(--sanhe-line) !important; }
html:not([data-theme="dark"]) :where(.sb-item-active, .settings-nav-item.active) {
  background: rgba(74, 158, 142, .12) !important;
  color: var(--sanhe-ink) !important;
  border-left-color: var(--mundo-accent, var(--sanhe-teal)) !important;
}
html:not([data-theme="dark"]) :where(.sb-item, .context-btn, .topbar-title, .view-page-title, .empty-title,
.settings-h1, .settings-h2, .card-name, .card-price) { color: var(--sanhe-ink) !important; }
html:not([data-theme="dark"]) :where(.sb-section-label, .sb-section-toggle, .text-muted, .empty-sub,
.view-page-sub, .settings-field-desc, .card-price-sub) { color: var(--sanhe-muted); }

html:not([data-theme="dark"]) :where(.btn-primary, .btn-current, .btn-mp, .li-action-primary, .voice-opt.active) {
  background: var(--sanhe-ink) !important;
  border-color: var(--sanhe-ink) !important;
}
html:not([data-theme="dark"]) :where(.btn-primary, .btn-current, .btn-mp, .li-action-primary, .voice-opt.active):hover {
  background: var(--sanhe-ink-deep) !important;
}
html:not([data-theme="dark"]) :where(.composer, .settings-inp, .settings-sel, .settings-textarea,
.search-inp, .filter-sel, input, select, textarea) {
  border-radius: var(--sanhe-radius-md) !important;
  border-color: var(--sanhe-line) !important;
}
html:not([data-theme="dark"]) :where(.composer, .plan-card, .digest-card, .sesion-card, .stat-card, .table-wrap) {
  box-shadow: var(--sanhe-shadow);
}
html:not([data-theme="dark"]) :where(.bubble-user, .sesion-msg-user .sesion-msg-bubble) {
  border-radius: var(--sanhe-radius-md) !important;
  background: var(--sanhe-paper-alt) !important;
  border: 1px solid var(--sanhe-line);
}
html:not([data-theme="dark"]) .bubble-ai,
html:not([data-theme="dark"]) .bubble-terapeuta { border-radius: 0 !important; }

/* Record-like distinction rather than conversational bubbles. */
html:not([data-theme="dark"]) .bubble-ai { border-left: 2px solid var(--mundo-accent, var(--sanhe-teal)); padding-left: 1rem !important; }
html:not([data-theme="dark"]) .bubble-terapeuta { border-left-color: var(--sanhe-ink) !important; }
.msg { margin-bottom: 2rem; }

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

@media (max-width: 768px) {
  .view-page { padding: var(--sanhe-space-4) var(--sanhe-space-3); }
  .main { min-width: 0; }
}

/* (widget "Ayuda urgente" retirado — ver emergency-access.js eliminado) */