/* Día y noche: la misma identidad JHG en blanco, carbón y plata. */
html { color-scheme: light; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 87px;
  height: 42px;
  padding: 0 12px;
  flex-shrink: 0;
  border: 1px solid #58616a;
  background: #20252a;
  color: #e3e7ea;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.theme-toggle:hover { background: #31383e; border-color: #b9c0c6; }
.theme-toggle svg { width: 17px; height: 17px; flex-shrink: 0; }
.theme-toggle .theme-moon { display: none; }
.header-actions { gap: 16px; }

@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e9ecef;
    --muted: #aeb4ba;
    --line: #3d444b;
    --paper: #171b20;
  }
  html[data-theme="dark"] .theme-sun { display: none; }
  html[data-theme="dark"] .theme-moon { display: block; }
  html[data-theme="dark"] body { background: #12161a; }
  html[data-theme="dark"] :is(a, button, summary, input, select, textarea):focus-visible { outline-color: #c4d4cc; }
  html[data-theme="dark"] .button-light { color: #17191d; }
  html[data-theme="dark"] .button-dark { background: #e1e4e7; color: #17191d; }
  html[data-theme="dark"] .button-dark:hover { background: #fff; }
  html[data-theme="dark"] .button-outline:hover { background: #252c32; }
  html[data-theme="dark"] .service-card:hover { background: #22282e; }
  html[data-theme="dark"] :is(.process, .client-section, .resource-footer-cta) { background: #1d2329; }
  html[data-theme="dark"] .client-illustration { background: repeating-linear-gradient(135deg, transparent, transparent 39px, #343c43 40px, transparent 41px); }
  html[data-theme="dark"] :is(.card-number, .service-icon, .principle-symbol, .mission-grid .mini-label, .values-grid article > span, .process-grid li > span, .team-role, .team-area) { color: #aeb8c0; }
  html[data-theme="dark"] .team-email { color: #cad8d2; }
  html[data-theme="dark"] dialog { background: #1b2127; }
  html[data-theme="dark"] :is(.dialog-copy .eyebrow, .dialog-copy ul, .dialog-copy .scope-note, .simple-dialog .feedback, .privacy-list) { color: #b4bec7; }
  html[data-theme="dark"] .message-preview { background: #12171c; }
  html[data-theme="dark"] .whatsapp-contacts .floating-contact { background: #21282e; color: #f0f2f3; border-color: #69757d; box-shadow: 0 5px 24px #0005; }
  html[data-theme="dark"] .whatsapp-contacts .floating-contact:hover { background: #303940; }
  html[data-theme="dark"] .whatsapp-contacts small { color: #b4c0c8; }
  html[data-theme="dark"] .floating-whatsapp svg { color: #9dc9b5; }

  /* Publicaciones, fuentes legales, tablas y las doce calculadoras. */
  html[data-theme="dark"] .resource-content { background: #14191e; }
  html[data-theme="dark"] :is(.publication, .reference-block, .law-card, .calc-form, .calculator-nav) { background: #1d242b; border-color: #414b54; }
  html[data-theme="dark"] :is(.article-toolbar, .editor-note, .publication .publication-authors, .calc-method) { border-color: #414b54; }
  html[data-theme="dark"] :is(.small-note, .source-links a, .publication-meta, .publication .publication-authors, .publication-actions button, .metric-strip span, .metric-strip small, .law-card .law-kind, .calculator-heading .eyebrow, .calc-field small, .calc-actions button[type="reset"], .example-button, .calc-method p, .calc-method li, .calc-footnote) { color: #b0bdc7; }
  html[data-theme="dark"] .publication:nth-child(2) .publication-cover { background: #35414b; color: #e7ebee; }
  html[data-theme="dark"] :is(.resource-search, .reference-controls select, .calc-field input, .calc-field select, .mobile-calc-picker select) { background: #13191f; color: #edf1f4; border-color: #63717c; color-scheme: dark; }
  html[data-theme="dark"] :is(.resource-search, .calc-field input)::placeholder { color: #9dabb6; }
  html[data-theme="dark"] .calc-field { color: #d1d8de; }
  html[data-theme="dark"] .form-error { color: #efaaaa; }
  html[data-theme="dark"] .fiscal-table th { background: #2a343d; color: #d0dbe3; }
  html[data-theme="dark"] :is(.fiscal-table th, .fiscal-table td) { border-color: #414b54; }
  html[data-theme="dark"] .fiscal-table tbody tr:hover { background: #28323b; }
  html[data-theme="dark"] .fiscal-table caption { color: #bbc8d2; }
  html[data-theme="dark"] .law-card:hover { border-color: #a1afbb; }
  html[data-theme="dark"] .calculator-nav button { background: #1d242b; color: #cbd3da; border-color: #414b54; }
  html[data-theme="dark"] .calculator-nav button > span { color: #9caebc; }
  html[data-theme="dark"] .calculator-nav button.active { background: #dce2e6; color: #172027; box-shadow: inset 3px 0 0 #fff; }
  html[data-theme="dark"] .calculator-nav button.active > span { color: #4c5a65; }
  html[data-theme="dark"] .calculator-nav button:hover:not(.active) { background: #303c46; }
}

@media (max-width: 1250px) and (min-width: 901px) {
  .header-contact { display: none; }
}
@media (max-width: 650px) {
  .theme-toggle { min-width: 40px; width: 40px; padding: 0; }
  .theme-toggle [data-theme-label] { display: none; }
  .header-actions { gap: 8px; }
  .header-inner { gap: 12px; }
}
@media (max-width: 370px) {
  .header-actions .client-button { display: none; }
}
@media print {
  .theme-toggle { display: none !important; }
}
