html { color-scheme: light; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Layout: una sola columna de banco de trabajo. Arriba lo que escribiste, el termómetro en el medio, abajo las dos versiones para mandar. */
  :root {
    --bg: #E9EDF1;
    --surface: #F7F9FB;
    --fg: #121C26;
    --muted: #55656F;
    --line: #C5CED6;
    --calm: #17766A;
    --warn: #A86B0C;
    --heat: #D93B1E;
    --font-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
    --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0F161D;
      --surface: #17212B;
      --fg: #E8EEF3;
      --muted: #93A3B2;
      --line: #2B3948;
      --calm: #4FC3B0;
      --warn: #E0A93B;
      --heat: #FF6A4A;
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #0F161D;
    --surface: #17212B;
    --fg: #E8EEF3;
    --muted: #93A3B2;
    --line: #2B3948;
    --calm: #4FC3B0;
    --warn: #E0A93B;
    --heat: #FF6A4A;
    color-scheme: dark;
  }

  * { box-sizing: border-box; }
  body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    padding-block: 40px 56px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .wrap { max-width: 760px; margin: 0 auto; display: grid; gap: 28px; }
  .wrap > * { min-width: 0; }

  .kicker {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 10px;
  }
  h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.8rem, 11vw, 5.2rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
    margin: 0 0 16px;
    text-wrap: balance;
  }
  h1 .dot { color: var(--heat); }
  .lede { font-size: 18px; max-width: 54ch; margin: 0; color: var(--fg); }

  .bench { display: grid; gap: 20px; }
  fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
  legend, .label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip { position: relative; }
  .chip input {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
  }
  .chip span {
    display: inline-flex;
    flex-direction: column;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    font-weight: 600;
    line-height: 1.2;
  }
  .chip small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
  .chip input:checked + span { background: var(--fg); color: var(--bg); border-color: var(--fg); }
  .chip input:checked + span small { color: var(--bg); opacity: 0.75; }
  .chip input:focus-visible + span { outline: 3px solid var(--calm); outline-offset: 2px; }

  .tag {
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    background: var(--surface);
  }

  textarea {
    width: 100%;
    min-height: 168px;
    resize: vertical;
    font: inherit;
    font-size: 17px;
    line-height: 1.5;
    color: var(--fg);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px 16px;
  }
  textarea:focus-visible { outline: 3px solid var(--calm); outline-offset: 1px; }

  .meter { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
  .meter .label { margin: 0; }
  .track { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
  .fill { height: 100%; width: 0; background: var(--calm); transition: width 0.25s ease, background-color 0.25s ease; }
  .fill[data-level="mid"] { background: var(--warn); }
  .fill[data-level="high"] { background: var(--heat); }
  .num { font-family: var(--font-mono); font-size: 14px; font-variant-numeric: tabular-nums; min-width: 9ch; text-align: right; }

  .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  button {
    font: inherit;
    font-weight: 600;
    border-radius: 6px;
    padding: 12px 20px;
    border: 1px solid var(--fg);
    background: var(--fg);
    color: var(--bg);
    cursor: pointer;
  }
  button:hover:not(:disabled) { filter: brightness(1.15); }
  button:disabled { opacity: 0.55; cursor: default; }
  button:focus-visible { outline: 3px solid var(--calm); outline-offset: 2px; }
  button.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
  button.small { padding: 7px 12px; font-size: 14px; }
  .status { color: var(--muted); font-size: 15px; }
  .status.err { color: var(--heat); }

  .result { display: grid; gap: 16px; }
  .fondo {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.25rem, 4.2vw, 1.6rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }
  .versions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
  .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 16px;
    display: grid;
    gap: 14px;
    align-content: start;
    min-width: 0;
  }
  .card h2 {
    margin: 0;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .card p { margin: 0; font-size: 17px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
  .card footer { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
  .mini { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
  .mini .track { height: 6px; }
  .mini .num { min-width: 0; font-size: 12px; color: var(--muted); }
  .ojo {
    border: 1px solid var(--heat);
    border-radius: 6px;
    padding: 12px 14px;
    background: var(--surface);
  }
  .ojo b { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; color: var(--heat); margin-right: 8px; }

  .nota { font-size: 14px; color: var(--muted); max-width: 62ch; display: grid; gap: 8px; }
  .nota p { margin: 0; }

  @media (prefers-reduced-motion: reduce) { .fill { transition: none; } }
  @media (max-width: 480px) {
    .meter { grid-template-columns: 1fr auto; }
    .meter .label { grid-column: 1 / -1; }
  }

.firma { font-size: 14px; color: var(--muted); }
.firma a { color: var(--fg); font-weight: 600; text-underline-offset: 3px; }
.firma a:focus-visible { outline: 3px solid var(--calm); outline-offset: 2px; }
