:root {
  --blue: #124b81;
  --blue-dark: #0d3a66;
  --red: #df2126;
  --gray: #f2f2f2;
  --black: #0d0d0d;
  --green: #16a34a;
  --amber: #d97706;
  --line: #e2e5ea;
  --muted: #6b7280;
  --shadow: 0 2px 10px rgba(13, 13, 13, 0.06), 0 1px 3px rgba(13, 13, 13, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--gray);
  color: var(--black);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

body { padding-bottom: 96px; }

/* ---------- header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--blue);
  color: #fff;
  border-bottom: 3px solid var(--red);
}
.app-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  max-width: 720px;
  margin: 0 auto;
}
.app-header .brand {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 13px;
  text-transform: uppercase;
  line-height: 1.2;
}
.app-header .brand small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  opacity: 0.8;
  letter-spacing: 0.02em;
  text-transform: none;
}
.who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.who .name { font-weight: 700; }
.who button {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}
.progress-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 12px;
}
.progress-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #fff;
  width: 0%;
  transition: width 0.35s ease;
}
.progress-label { font-size: 12px; opacity: 0.9; margin-top: 6px; }

main { max-width: 720px; margin: 0 auto; padding: 16px; }

/* ---------- pick view ---------- */
.pick { text-align: center; padding: 32px 16px; }
.pick h1 { font-size: 22px; margin: 0 0 8px; }
.pick p { color: var(--muted); margin: 0 0 24px; }
.pick-grid { display: grid; gap: 12px; max-width: 360px; margin: 0 auto; }
.pick-grid button {
  padding: 18px;
  font-size: 18px;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.05s;
}
.pick-grid button:hover { border-color: var(--blue); }
.pick-grid button:active { transform: scale(0.98); }

/* ---------- list view ---------- */
.list-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.list-head h2 { font-size: 17px; margin: 0; }
.list-head .hint { font-size: 12px; color: var(--muted); }
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
  position: relative;
  transition: transform 0.06s;
}
.card:active { transform: scale(0.98); }
.card .thumb {
  aspect-ratio: 16 / 11;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.card .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card .meta { padding: 8px 10px 12px; }
.card .meta .n { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.card .idx {
  position: absolute; top: 8px; left: 8px;
  background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 2px 8px;
}
.dot {
  position: absolute; top: 8px; right: 8px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line);
}
.dot.pendiente { background: #cbd1d9; }
.dot.parcial { background: var(--amber); }
.dot.completa { background: var(--green); }

/* ---------- detail view ---------- */
.detail .back {
  background: none; border: 0; color: var(--blue);
  font-weight: 700; font-size: 14px; cursor: pointer;
  padding: 4px 0; margin-bottom: 8px;
}
.render {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  aspect-ratio: 16 / 10;
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
  box-shadow: var(--shadow);
}
.render img { max-width: 100%; max-height: 100%; object-fit: contain; }
.detail h2 { font-size: 21px; margin: 16px 0 4px; }
.detail .short { font-size: 15px; color: #333; margin: 0 0 4px; }
.detail .long { font-size: 14px; color: #444; white-space: pre-line; margin: 8px 0 0; }
.specs { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.specs td { border-bottom: 1px solid var(--line); padding: 6px 4px; }
.specs td:first-child { color: var(--muted); width: 45%; }
.ficha {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; font-size: 13px; font-weight: 700;
  color: var(--blue); text-decoration: none;
  border: 1.5px solid var(--blue); border-radius: 999px; padding: 7px 14px;
}

.block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.block > .q {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--blue); margin-bottom: 12px;
}
.block .help { font-size: 12.5px; color: var(--muted); margin: -6px 0 12px; }

/* descripcion correcta */
.ok-toggle {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 14px; border-radius: 12px;
  border: 2px solid var(--line); background: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer; text-align: left;
}
.ok-toggle .check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #c3c9d2; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
}
.ok-toggle.on { border-color: var(--green); background: #f0fdf4; }
.ok-toggle.on .check { background: var(--green); border-color: var(--green); }
.correccion-label { font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
textarea, input.txt {
  width: 100%; font-family: inherit; font-size: 15px;
  border: 2px solid var(--line); border-radius: 12px; padding: 12px;
  resize: vertical;
}
textarea:focus, input.txt:focus, .chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
textarea { min-height: 84px; }

/* chips extrusoras */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 2px solid var(--line); background: #fff;
  border-radius: 999px; padding: 11px 18px;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.multi { width: 100%; text-align: center; margin-top: 10px; }
.chip.multi.on { background: var(--red); border-color: var(--red); }
.otra-row { margin-top: 12px; }
.otra-row label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }

/* sticky footer nav */
.footnav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 20;
}
.footnav .inner {
  max-width: 720px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
}
.footnav button {
  flex: 1; padding: 13px; border-radius: 12px; border: 0;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.footnav .prev { background: var(--gray); color: var(--black); }
.footnav .next { background: var(--blue); color: #fff; }
.footnav button:disabled { opacity: 0.4; cursor: default; }
.saved {
  text-align: center; font-size: 12px; padding: 4px;
  color: var(--muted); min-height: 20px;
}
.saved.ok { color: var(--green); font-weight: 700; }

.hidden { display: none !important; }
