/* Kit visual de las herramientas sencillas de h2oai.es */
@font-face { font-family: "Geist"; src: url("/assets/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #f6f7f5; --surface: #fff; --ink: #0d2236; --ink-2: #33475b; --muted: #627384;
  --line: #e1e6ea; --line-2: #cfd8df; --accent: #0b74b8; --accent-soft: #e5f2fa; --brand: #04568a;
  --ok: #127a5a; --ok-soft: #e3f4ee; --warn: #9a5b00; --warn-soft: #fff4dc; --err: #b42318; --err-soft: #fde9e7;
  --c: var(--accent);
  --s1: #0b74b8; --s2: #d9731a; --s3: #11946f; --s4: #6a55d0; --s5: #c03a74;
  --shadow: 0 1px 2px rgba(13,34,54,.04), 0 8px 24px rgba(13,34,54,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a1520; --surface: #0f1d2a; --ink: #e7eef4; --ink-2: #c3d0db; --muted: #8fa2b3;
    --line: #1f3244; --line-2: #2b4258; --accent: #5bb6ec; --accent-soft: #10304a;
    --ok: #4cc79b; --ok-soft: #0f3326; --warn: #f0b955; --warn-soft: #3a2c0b; --err: #ff8a7a; --err-soft: #3d1512;
    --s1: #5bb6ec; --s2: #f0a050; --s3: #4cc79b; --s4: #a493f0; --s5: #f07aa8;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.kit {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15.5px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  padding: 28px 16px 80px;
}
.kit .k-wrap { max-width: 1120px; margin: 0 auto; }
.kit .k-head { margin: 8px 0 24px; max-width: 760px; }
.kit .k-cat { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--c); }
.kit .k-cat::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--c); }
.kit h1 { font-size: clamp(28px, 4.4vw, 42px); line-height: 1.08; letter-spacing: -.035em; margin: 10px 0 12px; font-weight: 720; }
.kit .k-lead { color: var(--ink-2); font-size: 17px; margin: 0; }
.kit .k-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .kit .k-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } .kit .k-grid.even { grid-template-columns: 1fr 1fr; } }
.kit .k-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; min-width: 0; }
@media (min-width: 640px) { .kit .k-card { padding: 26px; } }
.kit .k-card + .k-card { margin-top: 0; }
.kit .k-stack { display: grid; gap: 16px; min-width: 0; }
.kit h2 { font-size: 17px; letter-spacing: -.01em; margin: 0 0 14px; font-weight: 650; }
.kit h3 { font-size: 15px; margin: 18px 0 8px; font-weight: 650; }
.kit .k-sub { font-size: 12.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 20px 0 10px; }
.kit .k-sub:first-child { margin-top: 0; }

/* Campos */
.kit .k-fields { display: grid; gap: 12px 14px; grid-template-columns: 1fr 1fr; }
.kit .k-fields.one { grid-template-columns: 1fr; }
.kit .k-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kit .k-field.full { grid-column: 1 / -1; }
.kit .k-field > label, .kit .k-label { font-size: 13.5px; font-weight: 550; color: var(--ink-2); display: block; }
.kit .k-field > label output { float: right; font-family: "Geist Mono", ui-monospace, monospace; font-size: 13px; color: var(--ink); font-weight: 600; }
.kit .k-input { position: relative; display: flex; align-items: center; }
.kit input[type="number"], .kit input[type="text"], .kit select {
  width: 100%; height: 42px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); padding: 0 12px; font: inherit; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
  font-variant-numeric: tabular-nums;
}
.kit .k-input input { padding-right: 58px; }
.kit .k-input .u { position: absolute; right: 12px; font-size: 13px; color: var(--muted); pointer-events: none; }
.kit select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23627384' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.kit input:focus, .kit select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.kit input.bad { border-color: var(--err); }
.kit input[type="range"] { width: 100%; accent-color: var(--accent); height: 22px; }
.kit .k-hint { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.kit .k-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.kit .k-seg button { flex: 1 1 auto; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; }
.kit .k-seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.kit .k-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.kit .k-btn:hover { border-color: var(--ink-2); }
.kit .k-btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.kit .k-btn.block { width: 100%; }
.kit .k-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Resultados */
.kit .k-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kit .k-tile { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: color-mix(in srgb, var(--paper) 55%, var(--surface)); min-width: 0; }
.kit .k-tile .l { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.kit .k-tile .v { font-size: 22px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; overflow-wrap: anywhere; }
.kit .k-tile .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kit .k-tile .h { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kit .k-tile.main { grid-column: 1 / -1; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.kit .k-tile.main .v { font-size: 34px; color: var(--accent); }
.kit .k-tile.ok { background: var(--ok-soft); border-color: transparent; } .kit .k-tile.ok .v { color: var(--ok); }
.kit .k-tile.warn { background: var(--warn-soft); border-color: transparent; } .kit .k-tile.warn .v { color: var(--warn); }
.kit .k-tile.bad { background: var(--err-soft); border-color: transparent; } .kit .k-tile.bad .v { color: var(--err); }
.kit .k-alert { border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-top: 12px; line-height: 1.45; }
.kit .k-alert.ok { background: var(--ok-soft); color: var(--ok); }
.kit .k-alert.warn { background: var(--warn-soft); color: var(--warn); }
.kit .k-alert.bad { background: var(--err-soft); color: var(--err); }
.kit .k-alert.info { background: var(--accent-soft); color: var(--ink-2); }
.kit .k-alerts:empty { display: none; }
.kit .k-chart { margin-top: 18px; }
.kit .k-chart svg { width: 100%; height: auto; display: block; overflow: visible; font-family: inherit; }
.kit .k-chart .ax { stroke: var(--line-2); stroke-width: 1; }
.kit .k-chart .gr { stroke: var(--line); stroke-width: 1; }
.kit .k-chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.kit .k-chart .tt { fill: var(--ink-2); font-size: 12px; font-weight: 550; }
.kit .k-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.kit .k-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kit .k-legend i { width: 14px; height: 3px; border-radius: 3px; background: currentColor; }
.kit table.k-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.kit .k-table th, .kit .k-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; }
.kit .k-table th:first-child, .kit .k-table td:first-child { text-align: left; }
.kit .k-table th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kit .k-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Notas de método */
.kit .k-notes { margin-top: 16px; }
.kit details.k-card { padding: 0; }
.kit details.k-card > summary { cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 650; display: flex; justify-content: space-between; align-items: center; }
.kit details.k-card > summary::-webkit-details-marker { display: none; }
.kit details.k-card > summary::after { content: "+"; font-size: 20px; color: var(--muted); font-weight: 400; }
.kit details.k-card[open] > summary::after { content: "−"; }
.kit details.k-card > div { padding: 0 22px 20px; color: var(--ink-2); font-size: 14.5px; }
.kit details.k-card p { margin: 0 0 10px; }
.kit details.k-card ul { margin: 0 0 10px; padding-left: 18px; }
.kit code, .kit .mono, .kit .f, .kit textarea, .kit .code { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.kit code, .kit .mono { font-family: "Geist Mono", ui-monospace, monospace; font-size: .92em; }
.kit .f { font-family: "Geist Mono", ui-monospace, monospace; font-size: 13.5px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 6px 0 10px; overflow-x: auto; white-space: nowrap; }
.kit .k-foot { max-width: 1120px; margin: 28px auto 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }
.kit .k-foot a { color: var(--muted); }

/* Juegos / preguntas */
.kit .k-quiz { max-width: 720px; margin: 0 auto; }
.kit .k-progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 18px; }
.kit .k-progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.kit .k-options { display: grid; gap: 10px; }
.kit .k-option { text-align: left; padding: 14px 16px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 15.5px; cursor: pointer; transition: border-color .15s, background .15s; }
.kit .k-option:hover:not([disabled]) { border-color: var(--accent); }
.kit .k-option.right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); font-weight: 600; }
.kit .k-option.wrong { background: var(--err-soft); border-color: var(--err); color: var(--err); }
.kit .k-option[disabled] { cursor: default; }

@media print {
  body.kit { background: #fff; padding: 0; }
  .kit .k-card { box-shadow: none; break-inside: avoid; }
  .kit .k-actions, .kit .k-seg { display: none; }
}
