/* Fórmula Propia · app de una columna pensada para el celular en el taller: una pantalla por paso, botones grandes abajo. */
:root {
  --bg: #F3F6F4; --surface: #FFFFFF; --ink: #14302F; --text: #14302F; --muted: #5A6C6A; --line: #D5DEDA;
  --amber: #E3A21A; --amber-soft: #FBF1D6; --amber-text: #7A5300; --good: #1F7A5A; --good-soft: #E1F2EA;
  --bad: #B23A2E; --bad-soft: #FBE7E4; --head-bg: #14302F; --head-text: #FFFFFF;
  --f-head: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0E1716; --surface: #16211F; --text: #E6EEEB; --muted: #9BB0AB; --line: #283634; --amber-soft: #2F2714; --amber-text: #F0C46B;
    --good-soft: #15302A; --good: #6BCBA3; --bad-soft: #3A1F1C; --bad: #EE8A7E; --head-bg: #0A1211; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--f-body); font-size: 17px; line-height: 1.5; }
h1, h2, h3 { font-family: var(--f-head); margin: 0; line-height: 1.05; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.top { position: sticky; top: 0; z-index: 5; background: var(--head-bg); color: var(--head-text); padding-top: env(safe-area-inset-top, 0px); }
.top-in { max-width: 720px; margin: 0 auto; padding: 10px 8px 10px 16px; display: flex; align-items: center; gap: 10px; }
.brand { background: none; border: 0; padding: 0; cursor: pointer; color: #fff; font-family: var(--f-head); font-weight: 700; font-size: 22px; letter-spacing: .02em; white-space: nowrap; }
.brand span { color: var(--amber); }
.crumb { margin-left: auto; min-width: 0; font-size: 14px; line-height: 1.3; color: #BFD2CD; text-align: right; }
.hbtn { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: #fff; border-radius: 10px; cursor: pointer; }
.hbtn:hover { background: rgba(255,255,255,.08); }
.prog { height: 4px; background: rgba(255,255,255,.12); }
.prog i { display: block; height: 100%; background: var(--amber); width: 0; transition: width .3s; }
.menu { position: absolute; right: 8px; top: calc(100% + 6px); width: min(280px, calc(100vw - 16px)); background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 6px; display: grid; }
.menu[hidden] { display: none; }
.menu button { text-align: left; background: none; border: 0; padding: 12px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 17px; }
.menu button:hover { background: var(--bg); }
.menu .pro-item { color: var(--amber-text); }

main { max-width: 720px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 130px; display: grid; gap: 18px; }
.h1 { font-size: 34px; font-weight: 700; }
.h2 { font-size: 24px; font-weight: 700; }
.lead { color: var(--muted); font-size: 17px; }
.small { font-size: 15px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 12px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pick { position: relative; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer;
  display: grid; align-content: start; gap: 8px; min-height: 92px; }
.pick:hover { border-color: var(--amber); }
.pick b { font-family: var(--f-head); font-size: clamp(16px, 4.4vw, 20px); line-height: 1.1; hyphens: auto; overflow-wrap: break-word; min-width: 0; }
.pick.locked b { color: var(--muted); }
.chip .lock { vertical-align: -1px; margin-right: 4px; }
.linea { font-family: var(--f-head); font-weight: 600; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { justify-self: start; font-family: var(--f-head); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; }
.chip.Fácil { background: var(--good-soft); color: var(--good); }
.chip.Media { background: var(--amber-soft); color: var(--amber-text); }
.chip.Avanzada { background: var(--bad-soft); color: var(--bad); }
.chip.pro { background: var(--ink); color: var(--amber); }
@media (prefers-color-scheme: dark) { .chip.pro { background: var(--amber); color: #14302F; } }
.q { font-family: var(--f-head); font-size: 22px; font-weight: 700; line-height: 1.15; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { border: 1.5px solid var(--line); background: var(--surface); border-radius: 99px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 16px; }
.opt[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (prefers-color-scheme: dark) { .opt[aria-pressed="true"] { background: var(--amber); color: #14302F; border-color: var(--amber); } }
.num-in { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.num-in input, .field input, .field select, .field textarea { padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); }
.num-in input { width: 120px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; font-size: 17px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 380px) { .grid, .two { grid-template-columns: 1fr; } }

.btnbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 6; }
.btnbar-in { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; }
.btn { flex: 1; border: 0; border-radius: 12px; padding: 14px 16px; font-family: var(--f-head); font-weight: 700; font-size: 21px; line-height: 1.1; cursor: pointer; background: var(--amber); color: #14302F; text-decoration: none; text-align: center; }
.btn.sec { flex: 0 0 auto; background: transparent; border: 1.5px solid var(--line); color: var(--text); }
.btn.inline { flex: 0 0 auto; justify-self: start; font-size: 19px; padding: 12px 18px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .opt:focus-visible, .pick:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .link:focus-visible, .hbtn:focus-visible, .menu button:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.link { background: none; border: 0; color: var(--text); text-decoration: underline; cursor: pointer; padding: 4px 0; font-weight: 600; justify-self: start; text-align: left; }

.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--good); }
.row .nm { font-weight: 600; }
.row .nt { font-size: 14px; color: var(--muted); }
.row .qt { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 19px; text-align: right; white-space: nowrap; }
.row.done .nm, .row.done .qt { color: var(--muted); text-decoration: line-through; }
.note { border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.note.warn { background: var(--amber-soft); color: var(--text); border-left: 4px solid var(--amber); }
.note.bad { background: var(--bad-soft); border-left: 4px solid var(--bad); }
.note.good { background: var(--good-soft); border-left: 4px solid var(--good); }
.note b { display: block; margin-bottom: 2px; }
.step-n { font-family: var(--f-head); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-size: 15px; }
.step-t { font-size: 21px; line-height: 1.4; font-weight: 500; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--amber); }
.dots i.done { background: var(--good); }
.prob { border-top: 1px solid var(--line); padding-top: 10px; }
.prob b { display: block; }
.prob p { color: var(--muted); }
pre.sum { white-space: pre-wrap; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 14px; background: var(--bg); border-radius: 10px; padding: 12px; margin: 0; overflow-wrap: anywhere; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list button { width: 100%; text-align: left; background: none; border: 0; padding: 12px 0; cursor: pointer; display: grid; gap: 2px; }
.list b { font-weight: 700; }
.banner { background: var(--ink); color: #fff; border-radius: 16px; padding: 16px 18px; display: grid; gap: 10px; }
.banner b { font-family: var(--f-head); font-size: 22px; color: var(--amber); }
.banner .btn { justify-self: start; flex: 0 0 auto; font-size: 18px; padding: 10px 16px; }
@media (prefers-color-scheme: dark) { .banner { background: #1D2F2C; } }
.feat { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feat li { padding-left: 30px; position: relative; }
.feat li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 14px; height: 8px; border-left: 3px solid var(--good); border-bottom: 3px solid var(--good); transform: rotate(-45deg); }
.price { font-family: var(--f-head); font-size: 40px; font-weight: 700; line-height: 1; }
.price small { font-size: 20px; color: var(--muted); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.kpi span { display: block; font-size: 14px; color: var(--muted); }
.kpi b { font-size: 22px; font-variant-numeric: tabular-nums; }
table.t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.t th, table.t td { text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t th { font-size: 14px; color: var(--muted); font-weight: 600; }
.plist .pr { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plist .pr:last-child { border-bottom: 0; }
.plist .pr input { width: 100%; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); text-align: right; font-variant-numeric: tabular-nums; }
.plist .pr span { font-size: 14px; color: var(--muted); display: block; }
.user { display: flex; align-items: center; gap: 12px; }
.user img { width: 44px; height: 44px; border-radius: 50%; }
.ask textarea { width: 100%; min-height: 70px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); resize: vertical; }
.ask .ans { white-space: pre-wrap; }
.gbtn { min-height: 44px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px; z-index: 9; max-width: calc(100vw - 32px); }
@media (prefers-color-scheme: dark) { .toast { background: #2A3B38; } }

/* Etiquetas: vista previa en pantalla y hoja A4 para imprimir */
.lbl { border: 1.5px dashed var(--line); border-radius: 8px; padding: 12px; background: #fff; color: #111; display: grid; gap: 4px; font-size: 12px; line-height: 1.3; }
.lbl .mk { font-family: var(--f-head); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; color: #444; }
.lbl .pn { font-family: var(--f-head); font-weight: 700; font-size: 22px; line-height: 1.05; }
.lbl .cn { font-weight: 700; }
.lbl .lt { font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
#print { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  body > *:not(#print) { display: none !important; }
  #print { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4mm; }
  #print .lbl { height: 64mm; overflow: hidden; break-inside: avoid; border-color: #999; border-radius: 0; font-size: 8.5pt; }
  #print .lbl .pn { font-size: 16pt; }
}
