/* QUÍMICA V18 · refinamientos de contraste para el tema oscuro.
   Estas reglas corrigen superficies claras que antes heredaban texto claro. */

/* Laboratorio 3D: el encabezado ya no queda sobre un fondo casi blanco. */
html[data-theme="dark"] .lab3d-page {
  border-color: #263b55;
  background: linear-gradient(180deg, #101f32 0%, #0b1727 100%);
}
html[data-theme="dark"] .lab3d-page .section-heading h2 { color: #f0f6ff; }
html[data-theme="dark"] .lab3d-page .section-heading p { color: #bfd0e3; }
html[data-theme="dark"] .lab3d-page .section-kicker { color: #8fe0d8; }
html[data-theme="dark"] .lab3d-benefit-card {
  border-color: #2b425d;
  background: linear-gradient(145deg, #14243a, #101d2f);
  box-shadow: 0 9px 26px rgba(0, 0, 0, .16);
}
html[data-theme="dark"] .lab3d-benefit-card h3 { color: #edf4ff; }
html[data-theme="dark"] .lab3d-benefit-card p { color: #bac9db; }

/* Biblioteca: fuerza una superficie oscura coherente con los textos del tema. */
html[data-theme="dark"] .library-grid .library-card {
  border-color: #2d4562;
  background: linear-gradient(145deg, #14243a, #101d2f);
  box-shadow: 0 9px 26px rgba(0, 0, 0, .16);
}
html[data-theme="dark"] .library-grid .library-card h3 { color: #edf4ff; }
html[data-theme="dark"] .library-grid .library-card p { color: #bac9db; }
html[data-theme="dark"] .library-grid .library-card .library-card-tag { color: #9fc4f0; }
html[data-theme="dark"] .library-grid .library-card details { border-color: #344d6a; }
html[data-theme="dark"] .library-grid .library-card details summary { color: #8fe0d8; }
html[data-theme="dark"] .library-grid .library-card details p { color: #c2d0e1; }

/* Ficha de elemento: todos los paneles y etiquetas usan colores legibles. */
html[data-theme="dark"] .periodic-workbench {
  --v11-ink: #e7effa;
  --v11-muted: #a9bad0;
  --v11-line: #2d435d;
  --v11-soft: #14243a;
  --v11-card: #13243a;
  border-color: #30465f;
  background: #101e30;
  color: #e7effa;
}
html[data-theme="dark"] .periodic-workbench .v11-element-detail {
  border-color: #2c435e;
  background: #0f1d2f;
}
html[data-theme="dark"] .periodic-workbench .v11-detail-top,
html[data-theme="dark"] .periodic-workbench .v11-tool-heading {
  border-color: #2b415a;
}
html[data-theme="dark"] .periodic-workbench .v11-detail-number,
html[data-theme="dark"] .periodic-workbench .v11-detail-hint,
html[data-theme="dark"] .periodic-workbench .v11-symbol-line span,
html[data-theme="dark"] .periodic-workbench .v11-model-disclaimer,
html[data-theme="dark"] .periodic-workbench .v11-fact-box span,
html[data-theme="dark"] .periodic-workbench .v11-config-short > span,
html[data-theme="dark"] .periodic-workbench .v11-mini-facts span,
html[data-theme="dark"] .periodic-workbench .v11-science-note,
html[data-theme="dark"] .periodic-workbench .v11-config-block p,
html[data-theme="dark"] .periodic-workbench .v11-data-label,
html[data-theme="dark"] .periodic-workbench .v11-source-panel p,
html[data-theme="dark"] .periodic-workbench .v11-data-note,
html[data-theme="dark"] .periodic-workbench .v11-tool-heading p {
  color: #aebed1;
}
html[data-theme="dark"] .periodic-workbench .v11-symbol-line > strong { color: #58d2cc; }
html[data-theme="dark"] .periodic-workbench .v11-symbol-line h4,
html[data-theme="dark"] .periodic-workbench .v11-atom-card-head h5,
html[data-theme="dark"] .periodic-workbench .v11-fact-box b,
html[data-theme="dark"] .periodic-workbench .v11-mini-facts b,
html[data-theme="dark"] .periodic-workbench .v11-source-panel h6,
html[data-theme="dark"] .periodic-workbench .v11-tool-heading h3,
html[data-theme="dark"] .periodic-workbench .v11-question-card h4,
html[data-theme="dark"] .periodic-workbench .v11-quiz-start h4,
html[data-theme="dark"] .periodic-workbench .v11-quiz-end h4 {
  color: #e8f1fc;
}
html[data-theme="dark"] .periodic-workbench .v11-family-chip,
html[data-theme="dark"] .periodic-workbench .v11-neutral-chip {
  border-color: #35516a;
  background: #1b354d;
  color: #d0e0ef;
}
html[data-theme="dark"] .periodic-workbench .v11-predicted-chip {
  border-color: #6a527b;
  background: #30253d;
  color: #e2c9f2;
}
html[data-theme="dark"] .periodic-workbench .v11-atom-card,
html[data-theme="dark"] .periodic-workbench .v11-property-card,
html[data-theme="dark"] .periodic-workbench .v11-ion-card,
html[data-theme="dark"] .periodic-workbench .v11-question-card {
  border-color: #2e4661;
  background: #13243a;
  color: #dce8f5;
}
html[data-theme="dark"] .periodic-workbench .v11-element-photo {
  border-color: #d7e0e9;
  background: #f8fafc;
}
html[data-theme="dark"] .periodic-workbench .v11-element-photo small { color: #536579; }
html[data-theme="dark"] .periodic-workbench .v11-photo-placeholder { color: #a9bacf; }
html[data-theme="dark"] .periodic-workbench .v11-model-tag,
html[data-theme="dark"] .periodic-workbench .v11-tool-count,
html[data-theme="dark"] .periodic-workbench .v11-ion-type {
  border-color: #35516a;
  background: #1b354d;
  color: #b9d4e8;
}
html[data-theme="dark"] .periodic-workbench .v11-canvas-wrap {
  background: radial-gradient(circle at 50% 45%, #1a3542, #0e202c 84%);
}
html[data-theme="dark"] .periodic-workbench .v11-canvas-overlay {
  border-color: #496477;
  background: rgba(8, 25, 37, .9);
  color: #c0d4e1;
}
html[data-theme="dark"] .periodic-workbench .v11-small-button,
html[data-theme="dark"] .periodic-workbench .v11-clear,
html[data-theme="dark"] .periodic-workbench .v11-answer-option {
  border-color: #3a5470;
  background: #172b43;
  color: #d0deee;
}
html[data-theme="dark"] .periodic-workbench .v11-atom-controls label,
html[data-theme="dark"] .periodic-workbench .v11-ion-card p,
html[data-theme="dark"] .periodic-workbench .v11-ion-meta,
html[data-theme="dark"] .periodic-workbench .v11-quiz-progress,
html[data-theme="dark"] .periodic-workbench .v11-quiz-feedback,
html[data-theme="dark"] .periodic-workbench .v11-quiz-start p,
html[data-theme="dark"] .periodic-workbench .v11-quiz-end p {
  color: #aebed1;
}
html[data-theme="dark"] .periodic-workbench .v11-shell-chip,
html[data-theme="dark"] .periodic-workbench .v11-config-short,
html[data-theme="dark"] .periodic-workbench .v11-config-value,
html[data-theme="dark"] .periodic-workbench .v11-mini-facts > div,
html[data-theme="dark"] .periodic-workbench .v11-series-wrap {
  border-color: #2f4964;
  background: #14263d;
  color: #c6d7e8;
}
html[data-theme="dark"] .periodic-workbench .v11-shell-chip b,
html[data-theme="dark"] .periodic-workbench .v11-config-short code,
html[data-theme="dark"] .periodic-workbench .v11-config-value,
html[data-theme="dark"] .periodic-workbench .v11-inline-link,
html[data-theme="dark"] .periodic-workbench .v11-source-panel a,
html[data-theme="dark"] .periodic-workbench .v11-ion-card-head > strong,
html[data-theme="dark"] .periodic-workbench .v11-ion-card > button,
html[data-theme="dark"] .periodic-workbench .v11-compare-symbol {
  color: #70ded5;
}
html[data-theme="dark"] .periodic-workbench .v11-warning-note {
  border-color: #614b6b;
  background: #2b2035;
  color: #e5cce9;
}
html[data-theme="dark"] .periodic-workbench .v11-detail-tabs {
  border-color: #2b415a;
  background: #122238;
}
html[data-theme="dark"] .periodic-workbench .v11-detail-tabs button { color: #b6c7da; }
html[data-theme="dark"] .periodic-workbench .v11-detail-tabs button.is-active {
  background: #1b4055;
  color: #a7eee6;
}
html[data-theme="dark"] .periodic-workbench .v11-fact-box,
html[data-theme="dark"] .periodic-workbench .v11-compare-table,
html[data-theme="dark"] .periodic-workbench .v11-quiz-shell {
  border-color: #2e4661;
  background: #13243a;
}
html[data-theme="dark"] .periodic-workbench .v11-compare-table th,
html[data-theme="dark"] .periodic-workbench .v11-compare-table td {
  border-color: #2c435c;
  color: #c7d7e8;
}
html[data-theme="dark"] .periodic-workbench .v11-compare-table thead th { background: #1a304a; color: #e0ebf7; }
html[data-theme="dark"] .periodic-workbench .v11-compare-table tbody th { color: #aebed1; }
html[data-theme="dark"] .periodic-workbench .v11-quiz-icon { background: #1b4055; color: #9be8df; }
html[data-theme="dark"] .periodic-workbench .v11-progress-track { background: #2b4057; }
html[data-theme="dark"] .periodic-workbench .v11-quiz-score { color: #70ded5; }
html[data-theme="dark"] .periodic-workbench .v11-quiz-score small,
html[data-theme="dark"] .periodic-workbench .v11-quiz-score small { color: #b1c2d5; }
html[data-theme="dark"] .periodic-workbench .v11-series-label b { color: #d4e1ef; }
html[data-theme="dark"] .periodic-workbench .v11-series-label small { color: #aebed1; }
html[data-theme="dark"] .periodic-workbench .v11-empty-state { border-color: #3b536d; color: #bacadb; }

/* QUÍMICA V18 · Parte 07 — superficies del visor atómico en modo oscuro.
   Se mantienen intactos los fondos claros de fotografías y recursos externos. */
html[data-theme="dark"] .periodic-workbench .v13-modebar,
html[data-theme="dark"] .periodic-workbench .v12-modebar {
  border-color: #304861;
  background: #14263d;
}
html[data-theme="dark"] .periodic-workbench .v13-modebar button,
html[data-theme="dark"] .periodic-workbench .v12-modebar button {
  color: #b6c8dc;
}
html[data-theme="dark"] .periodic-workbench .v13-modebar button span,
html[data-theme="dark"] .periodic-workbench .v12-modebar button span {
  color: #829bb5;
}
html[data-theme="dark"] .periodic-workbench .v13-modebar button:hover,
html[data-theme="dark"] .periodic-workbench .v12-modebar button:hover {
  border-color: #355a70;
  background: #1a354d;
  color: #e1f4f4;
}
html[data-theme="dark"] .periodic-workbench .v13-modebar button.is-active,
html[data-theme="dark"] .periodic-workbench .v12-modebar button.is-active {
  border-color: #347c80;
  background: #1b4655;
  color: #a8eee6;
  box-shadow: inset 0 0 0 1px rgba(91, 210, 199, .08), 0 2px 8px rgba(0, 0, 0, .18);
}
html[data-theme="dark"] .periodic-workbench .v13-nucleus-stats > div,
html[data-theme="dark"] .periodic-workbench .v12-nucleus-stats > div {
  border-color: #304861;
  background: #14263d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}
html[data-theme="dark"] .periodic-workbench .v13-nucleus-stats span,
html[data-theme="dark"] .periodic-workbench .v12-nucleus-stats span {
  color: #a3b7cc;
}
html[data-theme="dark"] .periodic-workbench .v13-nucleus-stats b,
html[data-theme="dark"] .periodic-workbench .v12-nucleus-stats b {
  color: #e5f0fc;
}
html[data-theme="dark"] .periodic-workbench .v13-nucleus-stats small,
html[data-theme="dark"] .periodic-workbench .v12-nucleus-stats small {
  color: #93a9c1;
}
html[data-theme="dark"] .periodic-workbench .v13-science-note,
html[data-theme="dark"] .periodic-workbench .v12-science-note {
  border-color: #304b64;
  background: #14263d;
  color: #b8c9dc !important;
}
html[data-theme="dark"] .periodic-workbench .v13-science-note strong,
html[data-theme="dark"] .periodic-workbench .v12-science-note strong {
  color: #8cddd5;
}
html[data-theme="dark"] .periodic-workbench .v13-model-readout,
html[data-theme="dark"] .periodic-workbench .v12-model-readout {
  border-color: #2c435d;
  color: #9eb2c9;
}
html[data-theme="dark"] .periodic-workbench .v13-model-readout span:first-child,
html[data-theme="dark"] .periodic-workbench .v12-model-readout span:first-child {
  color: #83dcd3;
}
html[data-theme="dark"] .periodic-workbench .v13-orbital-select,
html[data-theme="dark"] .periodic-workbench .v12-orbital-select {
  color: #b5c7da;
}
html[data-theme="dark"] .periodic-workbench .v13-orbital-select select,
html[data-theme="dark"] .periodic-workbench .v12-orbital-select select {
  border-color: #3a5572;
  background: #0f1d30;
  color: #e1edf9;
}
html[data-theme="dark"] .periodic-workbench .v13-control-sliders label,
html[data-theme="dark"] .periodic-workbench .v12-control-sliders label,
html[data-theme="dark"] .periodic-workbench .v13-node-controls label,
html[data-theme="dark"] .periodic-workbench .v12-node-controls label {
  color: #b4c6d9;
}
html[data-theme="dark"] .periodic-workbench .v13-fallback-note,
html[data-theme="dark"] .periodic-workbench .v12-fallback-note {
  border-color: #526b83;
  background: #1b3047;
  color: #f2d7bd;
}
