/* CLAVE web tools — shared style (from webflasher-web.svg, 2026-09-17).
   Mockup artboard 834 units wide → 1 unit ≈ 1.6 px at desktop width. */
/* Fonts: CF Arche Grotesk (text) and CF Crónica Mono (console), self-hosted. */
@font-face { font-family: "CF Arche Grotesk"; src: url("./fonts/CFArcheGrotesk-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "CF Arche Grotesk"; src: url("./fonts/CFArcheGrotesk-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "CF Cronica Mono"; src: url("./fonts/CFCronica-Mono.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg: #1D1D1B;
  --yellow: #E1BA4E;
  --beige: #CABA9F;
  --panel: #3C3C3B;
  --white: #FFFFFF;
  --ink: #1D1D1B;
  --soft: #D9D9D9;
  --error: #FF8A80;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: "CF Arche Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.3;
}

.page { max-width: 1334px; margin: 0 auto; padding: 43px 58px 80px 65px; }

/* ── Header: logo · nav · badges + intro ─────────────────────── */
.site-header {
  display: grid;
  grid-template-columns: 330px 1fr 328px;
  column-gap: 74px;
  align-items: start;
}
.logo { display: block; width: 330px; }
.logo img { display: block; width: 100%; height: auto; }

.site-nav ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; row-gap: 24px; }
.site-nav a {
  color: var(--white);
  font-size: 19px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.site-nav a[aria-current="page"] { color: var(--yellow); }

.header-aside .badges { display: block; width: 130px; max-width: 100%; height: auto; }
/* La url va como texto de la página, estirada al ancho exacto del logotipo (130 px). */
.badges-url { display: block; width: 130px; margin-top: 7px; }
.badges-url svg { display: block; width: 100%; height: auto; }
.badges-url text { fill: var(--soft); font-family: "CF Arche Grotesk", system-ui, sans-serif; font-size: 8px; letter-spacing: 0; }
.badges-url:hover text { fill: var(--yellow); }
.intro {
  margin: 28px 0 0;
  color: var(--yellow);
  font-size: 15px;
  line-height: 1.45;
}

/* ── Main: title · steps (left) · console panel (right) ──────── */
main {
  display: grid;
  grid-template-columns: minmax(0, 650px) minmax(0, 525px);
  column-gap: 80px;
  margin-top: 36px;
  align-items: start;
}
h1 {
  grid-column: 1 / -1;
  margin: 0 0 70px;
  font-size: 45px;
  font-weight: 700;
  line-height: 1.1;
}

.step { margin: 0 0 50px; }
.step-title { margin: 0; font-size: inherit; font-weight: 700; }
.step-title .num { display: block; color: var(--yellow); font-size: 40px; line-height: 1; }
.step-title .txt { display: block; margin-top: 6px; font-size: 19px; line-height: 1.3; }
.step p, .step li { font-size: 17px; line-height: 1.45; }
.step p { margin: 12px 0 0; }
.note { color: var(--soft); }
.step p.small { font-size: 15px; margin-top: 18px; }
.step ul { margin: 16px 0 0; padding-left: 22px; }
.step li { margin: 4px 0; }
.step li::marker { color: var(--yellow); }

.actions { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 38px;
  border: 0;
  border-radius: 16px;
  background: var(--yellow);
  color: var(--ink);
  font: inherit;
  font-size: 35px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.btn.sec { background: var(--beige); }
.btn.small { min-height: 52px; padding: 0 26px; font-size: 26px; }
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:disabled { background: #4A4A48; color: #BDBDBD; cursor: not-allowed; }
.btn svg { width: .9em; height: .9em; flex: none; }

a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
}

.status { margin: 14px 0 0; font-size: 17px; color: var(--soft); min-height: 1.45em; }
.status.ok, .ok { color: var(--yellow); font-weight: 700; }
.status.err, .err { color: var(--error); font-weight: 700; }

/* Console panel */
.panel {
  position: sticky;
  top: 24px;
  min-height: 434px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  margin: 0;
  padding: 32px 34px;
  border: 1.5px solid var(--white);
  border-radius: 22px;
  background: var(--panel);
  color: var(--white);
  font-family: "CF Cronica Mono", ui-monospace, Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}
.panel.console { white-space: pre-wrap; }
.panel h2 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--yellow); }
.panel p { margin: 0 0 18px; white-space: normal; }
.panel code { color: var(--yellow); }

/* Channel list (Upload Sound Kits) */
.step .channels { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 14px; }
.step .channels li { display: grid; grid-template-columns: 40px auto minmax(0, 1fr) auto; align-items: center; column-gap: 16px; row-gap: 2px; margin: 0; }
.channels .file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: var(--soft); }
.channels .status { min-height: 0; }
.budget { margin-top: 24px; }
.budget-text { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.budget-text.err { color: var(--error); }
.budget-bar { position: relative; height: 12px; border-radius: 6px; background: var(--panel); overflow: hidden; }
.budget-fill, .budget-sent { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 6px; }
.budget-fill { background: var(--beige); }
.budget-fill.over { background: var(--error); }
.budget-sent { background: var(--yellow); transition: width .15s linear; }
.channels .ch { font-size: 24px; font-weight: 700; }
.channels .ch .n { color: var(--yellow); }
.channels .status { margin: 0; font-size: 15px; }
.btn.choose { min-height: 40px; padding: 0 16px; border-radius: 10px; font-size: 17px; }

.field { display: grid; gap: 8px; margin-top: 22px; max-width: 360px; }
.field label { font-size: 17px; font-weight: 700; }
input[type="text"] {
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 19px;
}

.site-footer { margin-top: 70px; color: #BDBDBD; font-size: 14px; line-height: 1.6; }
.site-footer a { color: var(--white); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; top: 12px; }
.skip:focus { left: 16px; z-index: 10; padding: 8px 14px; border-radius: 8px; background: var(--yellow); color: var(--ink); }

/* esp-web-tools install button: the activate button is ours (light DOM) */
esp-web-install-button { display: inline-block; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .site-header { grid-template-columns: 330px 1fr; row-gap: 32px; }
  .header-aside { grid-column: 1 / -1; max-width: 650px; }
  main { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; min-height: 240px; max-height: 480px; }
}
@media (max-width: 640px) {
  .page { padding: 24px 16px 60px; }
  .site-header { grid-template-columns: 1fr; }
  .logo { width: 240px; }
  .site-nav ul { margin-top: 0; row-gap: 14px; }
  h1 { font-size: 34px; margin-bottom: 40px; }
  .step-title .num { font-size: 34px; }
  .btn { min-height: 56px; padding: 0 24px; font-size: 26px; }
  .btn.small { min-height: 48px; font-size: 22px; }
  .step .channels li { grid-template-columns: 32px auto minmax(0, 1fr); }
  .step .channels li { grid-template-columns: 32px auto minmax(0, 1fr); }
  .channels .status { grid-column: 2 / -1; }
  .panel { padding: 20px; font-size: 12px; }
}

.step a { color: var(--white); }

/* ── Manual ──────────────────────────────────────────────────── */
/* Índice lateral fijo mientras se hace scroll; cada tema se despliega (jko 2026-10-01). */
main.manual {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); column-gap: 64px;
  align-items: start;
}
.manual-head {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px;
  margin-bottom: 40px;
}
.manual-head h1 { margin: 0; }

.manual-toc {
  position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto;
  padding-right: 8px; scrollbar-width: thin;
}
.manual-toc summary {
  list-style: none; cursor: pointer; margin-bottom: 12px;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--beige);
}
.manual-toc summary::-webkit-details-marker { display: none; }
.manual-toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid #4a4a48; }
.manual-toc a {
  display: block; margin-left: -1px; padding: 6px 0 6px 16px; border-left: 2px solid transparent;
  color: var(--soft); font-size: 16px; line-height: 1.3; text-decoration: none;
}
.manual-toc a:hover { color: var(--white); }
.manual-toc a[aria-current] { color: var(--yellow); border-left-color: var(--yellow); }
.manual-toc a:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.manual-toc__all {
  padding: 4px 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--beige);
}
.manual-toc__all { margin: 18px 0 0 18px; }
.manual-toc__all:hover { color: var(--yellow); }

.manual-body { max-width: 780px; border-bottom: 1px solid #4a4a48; }
.manual-chapter { border-top: 1px solid #4a4a48; scroll-margin-top: 24px; }
.manual-chapter > summary {
  display: flex; align-items: center; gap: 18px; padding: 20px 0;
  list-style: none; cursor: pointer; color: var(--soft);
}
.manual-chapter > summary::-webkit-details-marker { display: none; }
.manual-chapter > summary::before {
  content: ""; flex: none; width: 10px; height: 10px; margin-left: 2px;
  border-right: 2px solid var(--yellow); border-bottom: 2px solid var(--yellow);
  transform: rotate(-45deg); transition: transform .2s ease;
}
.manual-chapter[open] > summary::before { transform: rotate(45deg); }
.manual-chapter > summary h2 { margin: 0; font-size: 28px; font-weight: 700; color: inherit; }
.manual-chapter > summary:hover, .manual-chapter[open] > summary { color: var(--white); }
.manual-chapter > summary:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.manual-chapter__body { position: relative; padding: 0 0 36px 32px; }
.manual-chapter__anchor {
  position: absolute; right: 0; top: -54px; padding: 4px;
  font-family: "CF Cronica Mono", ui-monospace, monospace; font-size: 16px;
  color: #77776f; text-decoration: none;
}
.manual-chapter__anchor:hover, .manual-chapter__anchor:focus-visible { color: var(--yellow); }
.manual-chapter__body > p:first-of-type { color: var(--soft); }
.manual-body h3 { margin: 30px 0 10px; font-size: 19px; font-weight: 700; scroll-margin-top: 24px; }
.manual-body h3 a { color: var(--white); text-decoration: none; }
.manual-body h3 a:hover { color: var(--yellow); }

.manual-body p, .manual-body li { font-size: 17px; line-height: 1.55; }
.manual-body p { margin: 0 0 14px; }
.manual-body ul, .manual-body ol { margin: 0 0 16px; padding-left: 22px; }
.manual-body li { margin: 6px 0; }
.manual-body li::marker { color: var(--yellow); }
.manual-body a { color: var(--yellow); }
.manual-body code { font-family: "CF Cronica Mono", ui-monospace, monospace; font-size: .92em; color: var(--yellow); }
.manual-body blockquote {
  margin: 14px 0 22px; padding: 14px 18px; border-left: 3px solid var(--yellow);
  background: var(--panel); border-radius: 0 10px 10px 0;
}
.manual-body blockquote p:last-child { margin: 0; }
.manual-body .table-wrap { overflow-x: auto; margin: 0 0 20px; }
.manual-body table { width: 100%; border-collapse: collapse; }
.manual-body td, .manual-body th {
  padding: 9px 14px 9px 0; border-bottom: 1px solid #4a4a48; vertical-align: top;
  font-size: 16px; line-height: 1.45; text-align: left;
}
.manual-body tr td:first-child { font-weight: 700; color: var(--yellow); white-space: nowrap; padding-right: 24px; }
.manual-body table.wide tr td:first-child { white-space: normal; padding-right: 20px; }
.manual-body table.wide tr:first-child td { font-weight: 700; color: var(--beige); }
/* 3 columnas o mas: el tipo de 16px amontona el texto y cada celda se parte en
   varias lineas. 14px con mas aire horizontal lo descomprime (jko 2026-10-01). */
.manual-body table.wide td { font-size: 14px; line-height: 1.5; padding: 8px 16px 8px 0; }

@media (prefers-reduced-motion: reduce) { .manual-chapter > summary::before { transition: none; } }
@media (max-width: 900px) {
  main.manual { grid-template-columns: minmax(0, 1fr); }
  .manual-toc {
    position: static; max-height: none; overflow: visible; margin-bottom: 40px; padding: 16px 18px;
    background: var(--panel); border-radius: 10px;
  }
  .manual-toc summary { margin: 0; }
  .manual-toc__fold[open] summary { margin-bottom: 12px; }
  .manual-toc summary::after { content: " +"; }
  .manual-toc__fold[open] summary::after { content: " −"; }
}
@media (max-width: 640px) {
  .manual-chapter > summary h2 { font-size: 23px; }
  .manual-chapter__body { padding-left: 0; }
  .manual-body tr td:first-child { white-space: normal; }
}
@media print {
  .site-header, .manual-toc, .manual-head .btn, .manual-chapter__anchor, .skip { display: none; }
  main.manual { display: block; }
}
