/* Domótica Fácil v0.3 — dirección «El producto actúa» (taste-skill, semilla 827500377).
   Carbón y salvia, una sola familia (Bricolage Grotesque, OFL, alojada aquí), sin degradados, sin sombras en reposo
   y sin líneas fuera de formularios, tablas y fragmentos de interfaz (data-ui). */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #1c1c1c;
  --surface: #262626;
  --surface-2: #303030;
  --ink: #f1f1ef;
  --muted: #a7a8a3;
  --accent: #8fa68e;
  --accent-hover: #a3b8a2;
  --accent-ink: #1c1c1c;
  --field-1: #c8c5ba;
  --field-1-ink: #1c1c1c;
  --paper: #ecebe6;
  --paper-ink: #1f211f;
  --error: #f2a594;
  --warn: #e8c37a;
  --line: #4a4b47;            /* solo en formularios, tablas y data-ui */
  --code-bg: #141514;

  --font: "Bricolage Grotesque", system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace; /* taste-skill-ignore: solo código, nombres de archivo y entidades de Home Assistant */
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --margin: clamp(20px, 3.2vw, 48px);
  --gap-section: clamp(96px, 12vw, 200px);
  --radius: 4px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-press: 120ms;
  --t-hover: 200ms;

  --y-key: #9fd0c4; --y-str: #ecc98a; --y-num: #f2a98f; --y-tpl: #c4b5f0; --y-dash: #8a948f;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--step-body)/1.5 var(--font); font-optical-sizing: auto; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--ink); text-decoration-line: underline; text-decoration-color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .2em; transition: text-decoration-color var(--t-hover); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-head); }
h2 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.15; }
h3 { font-size: var(--step-body); letter-spacing: -0.01em; line-height: 1.3; }
p { text-wrap: pretty; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface); padding: .08em .35em; border-radius: var(--radius); overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; }

/* Botones: rectángulo plano de un color, sin sombras */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px;
  border: 0; border-radius: 0; font: 500 var(--step-body)/1.2 var(--font); cursor: pointer; text-decoration: none;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover), color var(--t-hover); }
button:active:not(:disabled), .button:active { transform: scale(.97); }
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--accent-ink); }
.secondary { background: var(--surface-2); color: var(--ink); }
.secondary:hover:not(:disabled) { background: #3a3a3a; }
.ghost { background: transparent; color: var(--muted); padding-inline: 8px; }
.ghost:hover { color: var(--ink); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.done { background: var(--ink); color: var(--bg); }
.text-link { font-weight: 500; }
.row, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 20px 0 0; }

/* Cabecera y pie */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 18px var(--margin); }
.wordmark { font-weight: 650; font-size: 1.15rem; letter-spacing: -0.02em; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; font-size: var(--step-small); }
.nav a { text-decoration-color: transparent; color: var(--muted); padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration-color: var(--accent); }
.nav a.nav-action { background: var(--accent); color: var(--accent-ink); padding: 8px 14px; text-decoration: none; font-weight: 500; }
.nav a.nav-action:hover { background: var(--accent-hover); }
.site-footer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px 32px; align-items: baseline; margin-top: 18svh; padding: 0 var(--margin) 30px;
  font-size: var(--step-small); color: var(--muted); }
.site-footer p { margin: 0; }
.f-links { display: flex; flex-wrap: wrap; gap: 4px 24px; justify-content: center; }
.f-links a { text-decoration-color: transparent; }
.f-links a:hover { text-decoration-color: var(--accent); }
.f-year { text-align: right; }

/* ===== Portada ===== */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100svh - 72px); }
.hero-text { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: clamp(32px, 6vh, 72px) var(--margin) clamp(32px, 6vh, 64px); }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 5.5rem); letter-spacing: -0.04em; line-height: .92; }
.lines .line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.lines [data-line] { display: block; white-space: nowrap; }
.hero-lead { font-size: var(--step-lead); line-height: 1.35; max-width: 30ch; margin: 0; }
.aside { color: var(--muted); font-size: var(--step-small); }
.hero-stage { background: var(--surface); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 48px var(--margin); }

.translator { width: min(100%, 600px); background: var(--bg); padding: 26px 26px 0; font-size: 15px; }
.t-label { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.t-sentence { font-size: clamp(1.25rem, 1rem + 1vw, 1.65rem); line-height: 1.55; letter-spacing: -0.01em; margin: 0 0 6px; }
.blank input { font: 500 .86em/1.3 var(--font); width: var(--w, 12ch); color: var(--ink); background: var(--surface-2); border: 0; border-bottom: 2px solid var(--accent);
  padding: 2px 6px; margin: 0 2px; max-width: 100%; border-radius: 2px; }
.blank input:focus { outline: none; background: #3b3d39; }
.blank input[aria-invalid] { border-bottom-color: var(--error); }
.t-error { min-height: 1.4em; margin: 0 0 8px; color: var(--error); font-size: 13px; }
.t-file { display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); margin: 0 -26px; padding: 6px 10px 6px 26px; font-size: 13px; color: var(--muted); }
.t-file button { min-height: 32px; padding: 4px 12px; font-size: 13px; background: var(--accent); color: var(--accent-ink); }
.translator .code { margin: 0 -26px; max-height: 340px; }
.code.stale { opacity: .45; }

.showcase { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 var(--margin); margin-top: var(--gap-section); padding-left: var(--margin); }
.show-index { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 72px; }
.show-index button { display: block; background: none; color: var(--muted); padding: 0; min-height: 0; font: 600 clamp(2.25rem, 1.2rem + 3vw, 4rem)/1.1 var(--font);
  letter-spacing: -0.035em; text-align: left; transition: color var(--t-hover); }
.show-index button:hover { color: var(--ink); }
.show-index button[aria-selected="true"] { color: var(--ink); }
.show-index button[aria-selected="true"]::after { content: ""; display: block; width: 1.2em; height: .12em; margin-top: .12em; background: var(--accent); }
.stage { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--surface); min-height: 88svh; padding-bottom: 64px; }
.stage-item { display: block; min-width: 0; padding: 64px 0 0 64px; }
.js .stage-item { grid-area: 1 / 1; transition: opacity 200ms ease; }
.js .stage-item[data-off] { opacity: 0; visibility: hidden; }
.art { margin: 0; width: 100%; }
.art img { display: block; width: 100%; height: clamp(380px, 60vh, 640px); object-fit: cover; object-position: 50% 35%; }
@media (prefers-reduced-motion: no-preference) {
  .art img { animation: drift 24s ease-in-out infinite alternate; transform-origin: 60% 40%; }
}
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.06); } }
.art { overflow: hidden; }
.sheet-credit { margin: 18px 0 0; font-size: 13px; color: #5a5c56; }
.sheet-credit a { color: #5a5c56; }
.sheet { width: min(560px, 82%); margin-top: -96px; position: relative; background: var(--paper); color: var(--paper-ink); padding: 26px 28px 28px; font-size: 15px; }
.sheet a { color: var(--paper-ink); text-decoration-color: #5f7a5e; }
.sheet-file { margin: 0 0 10px; font-size: 13px; color: #5a5c56; }
.sheet-says { font-size: 1.15rem; line-height: 1.4; margin: 0 0 16px; font-weight: 500; }
.code.paper { background: #dcdad3; color: #1f211f; scrollbar-color: #9d9b93 #dcdad3; max-height: 300px; margin: 0 0 16px; }
.code.paper .y-key { color: #2f6155; } .code.paper .y-str { color: #8a5310; } .code.paper .y-num { color: #a3401f; } .code.paper .y-tpl { color: #5a46a5; } .code.paper .y-dash { color: #6d746f; }

.how { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 var(--margin); margin-top: var(--gap-section); padding: 0 var(--margin); }
.how-text h2 { font-size: var(--step-lead); margin-bottom: 24px; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; }
.step:first-child { min-height: 60vh; justify-content: flex-start; }
.step-line { font-size: clamp(1.6rem, 1.1rem + 1.4vw, 2.25rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 12px; color: var(--muted); transition: color 300ms; max-width: 16ch; }
.step.active .step-line, .step:only-child .step-line { color: var(--ink); }
.step p:last-child { margin: 0; max-width: 40ch; }
.how-stage { position: sticky; top: 14vh; align-self: start; height: 72vh; background: var(--accent); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 32px; }
.mini { width: min(100%, 520px); min-width: 0; background: var(--bg); padding: 24px; font-size: 15px; min-height: 340px; }
.mini > div { display: none; }
.mini[data-state="0"] .mini-s0, .mini[data-state="1"] .mini-s1, .mini[data-state="2"] .mini-s2 { display: block; animation: fade-in 300ms ease; }
@keyframes fade-in { from { opacity: 0; } }
.mini-h { margin: 0 0 16px; font-weight: 600; font-size: 17px; }
.mini-choice { margin: 0 0 8px; padding: 12px 14px; background: var(--surface); color: var(--muted); border-radius: var(--radius); }
.mini-choice.on { background: var(--surface-2); color: var(--ink); outline: 2px solid var(--accent); }
.mini-field { display: grid; gap: 6px; margin: 0 0 14px; }
.mini-field span { font-size: 13px; color: var(--muted); }
.mini-field b { font: 400 15px var(--font); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); } /* taste-skill-ignore: campo dentro de data-ui */
.mini-field.focus b { border-color: var(--accent); }
.caret { display: inline-block; width: 1px; height: 1em; background: var(--ink); vertical-align: -.15em; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.mini .code { max-height: 230px; font-size: 13px; margin: 0; }
.mini-toast { margin: 12px 0 0; padding: 10px 12px; background: var(--accent); color: var(--accent-ink); font-weight: 500; }

.proof { margin-top: var(--gap-section); padding: 0 var(--margin); }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: var(--surface); padding: 24px; aspect-ratio: 3 / 2; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.tile strong { font-size: clamp(1.6rem, 1rem + 1.6vw, 2.25rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.tile span { color: var(--muted); max-width: 30ch; }
.tile.head { grid-column: span 2; aspect-ratio: auto; background: var(--accent); color: var(--accent-ink); }
.tile.head h2 { font-size: clamp(2rem, 1rem + 3vw, 3.4rem); letter-spacing: -0.035em; line-height: 1; max-width: 12ch; }

.reading { margin: var(--gap-section) 0 0 22vw; padding-right: var(--margin); max-width: calc(560px + 22vw); }
.reading h2 { margin-bottom: 32px; }
.group { margin: 40px 0 8px; color: var(--muted); font-size: var(--step-small); }
.reading .group:first-of-type { margin-top: 0; }
.rows { list-style: none; margin: 0; padding: 0; max-width: 560px; }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; min-height: 40px; padding: 6px 0; }
.rows a { text-decoration-color: transparent; display: inline-flex; align-items: baseline; gap: 10px; }
.rows a:hover { text-decoration-color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; transform: translateY(-1px); }
.dot.quiet { background: var(--surface-2); }
.val { color: var(--muted); font-size: var(--step-small); white-space: nowrap; font-variant-numeric: tabular-nums; }

.ask { margin-top: clamp(72px, 9vw, 140px); padding: 0 var(--margin); }
.ask-line { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.25rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.35; margin: 0; max-width: 34ch; }
.ask-line input { font: inherit; letter-spacing: inherit; color: var(--ink); background: var(--surface); border: 0; padding: 0 .3em; width: 8em; height: 1.35em; border-radius: var(--radius); vertical-align: baseline; }
.ask-line input::placeholder { color: var(--muted); }
.ask-line input:focus { outline: 2px solid var(--accent); }
.ask-line button { font: inherit; letter-spacing: inherit; min-height: 0; height: 1.35em; padding: 0 .35em; background: var(--accent); color: var(--accent-ink); vertical-align: baseline; }
.ask-note { color: var(--muted); max-width: 52ch; margin: 16px 0 0; }

.chapter-light { --muted: #4a4c47; --accent-dark: #4f6a4e; background: var(--field-1); color: var(--field-1-ink); margin-top: var(--gap-section); padding: clamp(80px, 9vw, 150px) 0 clamp(80px, 9vw, 140px); }
.chapter-light a { color: var(--field-1-ink); text-decoration-color: var(--accent-dark); }
.chapter-light .reading { margin-top: 0; }
.chapter-light .reading h2 { font-size: var(--step-head); letter-spacing: -0.035em; }
.chapter-light .rows a { text-decoration-color: transparent; font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; }
.chapter-light .rows li { padding: 10px 0; }
.chapter-light .rows, .chapter-light .reading { max-width: none; }
.chapter-light .reading { max-width: 860px; }
.chapter-light .dot { background: var(--accent-dark); }
.chapter-light .dot.quiet { background: #a9a69b; }
.chapter-light .ask-line input { background: #b7b4a8; color: var(--field-1-ink); }
.chapter-light .ask-line input::placeholder { color: #5d5f59; }
.chapter-light .ask-line input:focus { outline-color: var(--accent-dark); }
.chapter-light .ask-line button { background: var(--accent-dark); color: #f1f1ef; }
.chapter-light .ask-line button:hover { background: #3f573e; }
.chapter-light ::selection { background: var(--field-1-ink); color: var(--field-1); }
.chapter-light :focus-visible { outline-color: var(--field-1-ink); }

/* Movimiento: titular enmascarado y entradas una sola vez. Con movimiento reducido todo aparece ya en su sitio. */
@media (prefers-reduced-motion: no-preference) {
  .js .lines [data-line] { transform: translateY(105%); animation: line-up 900ms var(--ease-out) forwards; animation-delay: calc(var(--i) * 110ms + 150ms); }
  .js [data-after-lines] { opacity: 0; animation: rise 700ms var(--ease-out) 650ms forwards; }
  .js .hero-stage .translator { opacity: 0; transform: translateY(24px); animation: rise 900ms var(--ease-out) 350ms forwards; }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .tiles [data-reveal]:nth-child(2) { transition-delay: 70ms; } .js .tiles [data-reveal]:nth-child(3) { transition-delay: 140ms; }
  .js .tiles [data-reveal]:nth-child(4) { transition-delay: 210ms; } .js .tiles [data-reveal]:nth-child(5) { transition-delay: 90ms; }
  .js .tiles [data-reveal]:nth-child(6) { transition-delay: 160ms; } .js .tiles [data-reveal]:nth-child(7) { transition-delay: 230ms; }
}
@keyframes line-up { to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ===== Código ===== */
.code { scrollbar-color: #4a4b47 var(--code-bg); background: var(--code-bg); color: #e3e8e4; padding: 16px 18px; margin: 0; overflow: auto; font: 14px/1.6 var(--mono); tab-size: 2; max-height: 60vh; border-radius: 0; }
.code code { background: none; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
.y-key { color: var(--y-key); } .y-str { color: var(--y-str); } .y-num { color: var(--y-num); } .y-tpl { color: var(--y-tpl); } .y-dash { color: var(--y-dash); }

/* ===== Páginas interiores ===== */
.wrap { width: 100%; max-width: 1480px; margin: 0 auto; padding: 0 var(--margin); }
.intro { padding: clamp(32px, 6vh, 72px) 0 24px; }
.intro h1 { font-size: var(--step-head); letter-spacing: -0.04em; max-width: 24ch; }
.lead { color: var(--ink); font-size: var(--step-lead); line-height: 1.35; max-width: 40ch; margin: 18px 0 0; }

.tut-list { list-style: none; padding: 0; margin: 40px 0 0; max-width: 900px; }
.tut-list li { padding: 28px 0; }
.tut-list li + li { padding-top: 12px; }
.tut-list a { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; text-decoration-color: transparent; }
.tut-list a:hover { text-decoration-color: var(--accent); }
.tut-list p { color: var(--muted); margin: 8px 0 0; max-width: 60ch; }

.article { max-width: 720px; padding-top: clamp(32px, 6vh, 72px); }
.article .lead { margin-bottom: 8px; }
.article h1 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem); letter-spacing: -0.035em; line-height: 1.04; }
.article h2 { margin: 56px 0 14px; }
.article h3 { margin: 28px 0 8px; }
.article p, .article li { max-width: 68ch; }
.article li { margin-bottom: 8px; }
.article .code { margin: 16px 0; max-height: none; }
.crumbs { margin: 0 0 12px; font-size: var(--step-small); }
.crumbs a { color: var(--muted); }
.meta { color: var(--muted); font-size: var(--step-small); }
.note { max-width: 72ch; background: var(--surface); padding: 14px 18px; color: var(--ink); font-size: var(--step-small); line-height: 1.55; }
.note.verify { background: var(--surface-2); }
.steps-list { padding-left: 1.3em; }
.steps-list li { margin-bottom: 10px; padding-left: 4px; }
.params dt { font-weight: 600; margin-top: 18px; }
.params dd { margin: 4px 0 0; color: var(--muted); }
.cta { margin: 40px 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: var(--step-small); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--surface); font-weight: 600; }
.products { background: var(--surface); padding: 20px 24px; margin: 40px 0; }
.products h2 { margin-top: 0; }
.disclosure { background: var(--surface-2); padding: 10px 14px; font-size: var(--step-small); }
.tag { font-size: 13px; font-weight: 600; color: var(--accent-ink); background: var(--accent); padding: 1px 6px; }

/* ===== Generador ===== */
.generator { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; margin-top: 16px; }
.panel { background: var(--surface); padding: 24px; }
.gen-output { position: sticky; top: 16px; }
.step-title { font-size: var(--step-body); font-weight: 600; letter-spacing: -0.01em; margin: 28px 0 12px; }
.gen-output .step-title { margin-top: 0; }
.chooser { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.chooser legend { font-weight: 600; margin-bottom: 12px; padding: 0; }
.choice { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: var(--surface); cursor: pointer; transition: background-color var(--t-hover); }
.choice:hover { background: var(--surface-2); }
.choice:has(input:checked) { background: var(--surface-2); outline: 2px solid var(--accent); outline-offset: -2px; }
.choice input { margin-top: 6px; accent-color: var(--accent); }
.choice span { display: grid; gap: 2px; }
.choice small { color: var(--muted); font-size: 15px; }
.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 500; font-size: var(--step-small); margin-bottom: 6px; padding: 0; }
.req { color: var(--error); }
input[type="text"], input[type="time"], select { width: 100%; min-height: 46px; padding: 8px 12px; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); } /* taste-skill-ignore: campos de formulario */
input.mono { font-family: var(--mono); font-size: .95rem; } /* taste-skill-ignore: campo de formulario donde se escribe una entidad */
input:focus, select:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
[aria-invalid] { border-color: var(--error) !important; }
.help { display: block; color: var(--muted); font-size: 15px; margin-top: 6px; }
.error { display: block; color: var(--error); font-size: 14px; font-weight: 500; margin-top: 4px; }
.error:empty { display: none; }
.field.check { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: start; }
.field.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--accent); }
.field.check label { font-weight: 500; font-size: var(--step-small); margin: 0; }
.field.check .help, .field.check .error { grid-column: 2; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.day { position: relative; }
.day input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.day span[aria-hidden] { display: grid; place-items: center; width: 44px; height: 44px; background: var(--bg); border: 1px solid var(--line); border-radius: 50%; font-weight: 600; } /* taste-skill-ignore: casillas de formulario */
.day input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.day input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.req-note { max-width: 60ch; font-size: 14px; color: var(--muted); margin: 0; }
.format { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--step-small); }
.format legend { font-weight: 500; padding: 0; margin-bottom: 6px; }
.format input { accent-color: var(--accent); }
.pending { background: var(--bg); padding: 14px 18px; color: var(--muted); }
.pending p { margin: 0 0 4px; }
.pending ul { margin: 0; padding-left: 1.2em; }
.howto { max-width: 900px; margin-top: 48px; }
.howto p, .howto li { max-width: 68ch; }
#summary { color: var(--ink); font-size: var(--step-lead); line-height: 1.4; }
.howto h2 { margin: 40px 0 12px; }
.cols { display: grid; gap: 8px 40px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cols h3 { margin: 16px 0 8px; }
.warn li::marker { color: var(--warn); }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero h1 { font-size: clamp(2.1rem, 9vw, 4.5rem); }
  .hero-stage { order: -1; padding: 24px 16px; }
  .hero-text { gap: 28px; }
  .showcase, .how { grid-template-columns: minmax(0, 1fr); }
  .showcase { padding-left: 0; }
  .how { padding: 0; }
  .how-text { padding: 0 var(--margin); }
  .show-index { flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory; gap: 24px; padding: 0 var(--margin) 16px; }
  .show-index button { display: inline-block; font-size: 1.375rem; white-space: nowrap; scroll-snap-align: start; }
  .stage { min-height: 0; }
  .js .stage-item[data-off] { display: none; }
  .stage-item { padding: 24px 16px 0; }
  .art img { height: auto; aspect-ratio: 4 / 3; }
  .sheet { width: 100%; margin-top: 16px; }
  .how-stage { position: sticky; top: 0; height: auto; min-height: 46svh; padding: 20px 16px; z-index: 1; order: -1; }
  .mini { min-height: 0; }
  .step { min-height: 60svh; }
  .step-line { font-size: 1.375rem; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 6px; }
  .tile { aspect-ratio: auto; min-height: 150px; padding: 16px; }
  .tile.head { grid-column: 1 / -1; }
  .reading { margin-left: var(--margin); }
  .generator { grid-template-columns: minmax(0, 1fr); }
  .gen-output { position: static; }
  .site-footer { grid-template-columns: 1fr; margin-top: 20svh; }
  .f-links { justify-content: flex-start; }
  .f-year { text-align: left; }
}
@media (max-width: 520px) {
  .nav { gap: 2px 16px; }
  .rows li { flex-wrap: wrap; gap: 0 12px; min-height: 44px; }
  .val { white-space: normal; padding-left: 20px; }
  .row > button { flex: 1 1 auto; }
  .panel { padding: 18px; }
  .translator { padding: 18px 18px 0; }
  .t-file, .translator .code { margin-inline: -18px; }
  .t-file { padding-left: 18px; }
}
.chapter-light .rows a:hover { text-decoration-color: var(--accent-dark); }
