/* Balanceador · paleta "balanza índigo" (acento índigo, apoyo ámbar). Contrastes verificados (AA) en claro y oscuro. */
:root {
  --bg: #F8F9FD;
  --surface: #FFFFFF;
  --text: #1B2140;
  --muted: #565E80;
  --border: #DADEEF;
  --accent: #4F5FD0;        /* detalles y bordes de foco */
  --accent-fill: #4453C4;   /* relleno de botones: con texto blanco da 6,4:1 */
  --accent-ink: #FFFFFF;
  --accent-text: #3A47B0;   /* acento como texto */
  --warm: #E8A33D;
  --warm-ink: #3A2504;
  --error: #C8453B;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12152A;
    --surface: #1B1F3A;
    --text: #E7EAFB;
    --muted: #A3AAD0;
    --border: #2F3560;
    --accent: #8F9BFF;
    --accent-fill: #8F9BFF;
    --accent-ink: #12152A;
    --accent-text: #A5AEFF;
    --warm: #F2B960;
    --warm-ink: #2A1B04;
    --error: #F07A6F;
    color-scheme: dark;
  }
}

.muted { color: var(--muted); font-size: 0.9rem; }
.top { display: flex; align-items: center; gap: 12px; padding: 8px 0 12px; }
.logo { border-radius: 10px; }
h1 { font-size: 1.5rem; line-height: 1.2; color: var(--accent-text); }
.tagline { color: var(--muted); font-size: 0.95rem; }
.intro { color: var(--muted); margin-bottom: 14px; }

h2 { font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* Campo de entrada */
.field { position: relative; }
#q {
  width: 100%; min-height: 52px; padding: 0 48px 0 16px; font-size: 1.125rem;
  background: var(--surface); color: var(--text); border: 2px solid var(--border); border-radius: 14px;
}
#q:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1;
}
.clear[hidden] { display: none; }
.insert { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.insert .chip { min-width: 44px; min-height: 44px; justify-content: center; font-size: 1.125rem; }

.examples { margin: 12px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Resultado */
.results { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.results:empty { display: none; }
.result { display: flex; flex-direction: column; gap: 14px; }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 0.875rem; white-space: nowrap; }
.note { color: var(--muted); font-size: 0.9rem; }

.ecuacion { font-size: 1.5rem; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.coef { color: var(--accent-text); font-weight: 800; }
.st { color: var(--muted); font-size: 0.7em; font-weight: 500; margin-left: 1px; }
.flecha { color: var(--muted); padding: 0 2px; }
.no-cuadra { list-style: disc; padding-left: 1.25rem; color: var(--error); }

details > summary { cursor: pointer; font-weight: 600; color: var(--accent-text); min-height: 32px; display: flex; align-items: center; }
.steps { padding-left: 1.25rem; list-style: decimal; display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.steps > li { padding-left: 4px; }
.eq { font-size: 1.0625rem; margin-top: 4px; overflow-wrap: anywhere; }
.ecuaciones { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.ecuaciones .el { display: inline-block; min-width: 3.5rem; font-weight: 700; }

.tabla-wrap { overflow-x: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: 12px; }
.tabla { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.tabla th, .tabla td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.tabla th { white-space: nowrap; }
.tabla td { min-width: 6.5rem; }
.tabla .t { white-space: nowrap; }
.tabla thead th { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.tabla tbody tr:last-child th, .tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody th { font-weight: 700; }

.unknown h2 { color: var(--error); }

.help { margin-top: 24px; }
.rules { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; list-style: disc; padding-left: 1.25rem; color: var(--muted); }

.foot { margin: 32px 0 16px; display: flex; flex-direction: column; gap: 6px; }
