:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --text: #1c2521;
  --muted: #5d6b64;
  --border: #d9dfd9;
  --brand: #2f6b58;
  --brand-strong: #1f4f40;
  --brand-soft: #e3efe9;
  --accent: #c7803a;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warn-soft: #fff4e0;
  --focus: #6aa88f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 6px 20px rgba(20, 30, 25, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111614; --surface: #19201d; --surface-2: #212a26; --text: #e7ece9; --muted: #9aa8a1;
    --border: #2e3833; --brand: #6fb89c; --brand-strong: #8fcdb4; --brand-soft: #1f3129;
    --danger: #ff8a80; --danger-soft: #3a1f1d; --warn-soft: #3a2f1c; --focus: #8fcdb4;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; font-size: 16px; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ===== Layout ===== */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; color: var(--text); }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; font-weight: 800; }
.container { max-width: 760px; margin: 0 auto; padding: 24px 16px 120px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.stack > * + * { margin-top: 16px; }

/* ===== Botones ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ===== Inicio ===== */
.hero h1 { font-size: clamp(1.75rem, 5vw, 2.4rem); line-height: 1.15; margin: 8px 0 12px; letter-spacing: -.02em; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.steps { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.step-n { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-weight: 700; }
.steps strong { display: block; }
.notice { border-radius: 12px; padding: 12px 14px; background: var(--surface-2); font-size: .92rem; }
.notice.warn { background: var(--warn-soft); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }

/* ===== Formularios ===== */
label.field { display: block; }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.fields-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

/* ===== Wizard ===== */
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .3s; }
.progress-meta { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-top: 6px; }
.section-head h2 { margin: 4px 0 6px; font-size: 1.5rem; letter-spacing: -.01em; }
.q { padding: 12px 0; border-top: 1px solid var(--border); }
.q:first-child { border-top: 0; }
.q-title { font-weight: 600; margin: 0 0 4px; }
.q-hint { color: var(--muted); font-size: .88rem; margin: 0 0 10px; }
.q.invalid .q-title::after { content: " · requerido"; color: var(--danger); font-weight: 500; font-size: .85rem; }
.req { color: var(--danger); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; user-select: none; }
.chip input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.choices.column { flex-direction: column; align-items: stretch; }
.choices.column .chip span { border-radius: 10px; width: 100%; }

.items { display: grid; gap: 8px; }
.item { background: var(--surface-2); border-radius: 12px; padding: 10px; }
.item-text { margin: 0 0 8px; }
.scale { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (min-width: 560px) { .scale { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); } }
.scale .chip span { border-radius: 10px; width: 100%; justify-content: center; text-align: center; font-size: .85rem; line-height: 1.2; }

.matrix { width: 100%; border-collapse: collapse; font-size: .9rem; }
.matrix-wrap { overflow-x: auto; }
.matrix th, .matrix td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix input { width: 20px; height: 20px; accent-color: var(--brand); }

.list-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 8px; }
.detail { margin-top: 10px; }

.savebar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); }
.savebar-inner { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.save-status { font-size: .85rem; color: var(--muted); }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal .card { max-width: 480px; width: 100%; }
.modal h3 { margin-top: 0; color: var(--danger); }
.phone { font-size: 1.4rem; font-weight: 800; letter-spacing: .02em; }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--brand); animation: spin 1s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-banner { background: var(--accent); color: #fff; text-align: center; font-size: .85rem; padding: 6px 16px; }

/* ===== Bloques dentro de un paso ===== */
.block + .block { margin-top: 22px; padding-top: 18px; border-top: 2px solid var(--surface-2); }
.block-title { margin: 0 0 4px; font-size: 1.05rem; color: var(--brand-strong); }
.q.gate { border-top: 0; padding-top: 4px; }
.q.gate.invalid .q-title::after { content: " · elige una opción"; color: var(--danger); font-weight: 500; font-size: .85rem; }
tr.invalid td:first-child { color: var(--danger); }
.matrix.family { font-size: .8rem; table-layout: fixed; }
.matrix.family th, .matrix.family td { padding: 6px 1px; }
.matrix.family th:first-child, .matrix.family td:first-child { width: 34%; padding-right: 6px; }
.matrix.family th { font-size: .7rem; color: var(--muted); font-weight: 600; }
.matrix.family thead th:not(:first-child) { writing-mode: vertical-rl; transform: rotate(180deg); height: 72px; text-align: left; vertical-align: bottom; padding: 4px 0; }
.matrix.family td:first-child { overflow-wrap: anywhere; hyphens: auto; }
.matrix.family input { width: 18px; height: 18px; }
.chip-none span { border-style: dashed; }

/* ===== Controles visuales (celular) ===== */
.cards { display: grid; gap: 8px; }
.card-opt { position: relative; display: block; }
.card-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.card-opt .card-body { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font-weight: 500; cursor: pointer; }
.card-opt .ico { font-size: 1.35rem; line-height: 1; width: 28px; text-align: center; font-weight: 400; }
.card-opt input:checked + .card-body { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); font-weight: 700; box-shadow: inset 0 0 0 1px var(--brand); }
.card-opt input:disabled + .card-body { opacity: .45; }
.card-opt input:focus-visible + .card-body { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }

.slider-wrap { text-align: center; padding: 4px 0 0; }
.slider-val { display: block; font-size: 2.6rem; font-weight: 800; color: var(--brand-strong); line-height: 1; }
.slider { width: 100%; margin: 12px 0 2px; accent-color: var(--brand); height: 32px; }
.slider-legend { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }

.stepper { background: var(--surface-2); border-radius: 14px; padding: 14px; }
.stepper-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); display: block; }
.dots i.done { background: var(--brand); }
.dots i.on { background: var(--accent); transform: scale(1.35); }
.stepper-q { font-size: 1.12rem; font-weight: 600; margin: 0 0 12px; line-height: 1.35; }
.stepper-opts { display: grid; gap: 8px; }
.stepper-opts .opt, .sym-opts .opt { min-height: 48px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 500; padding: 6px 12px; }
.stepper-opts .opt.on, .sym-opts .opt.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); font-weight: 700; }
.sym-opts .opt.danger.on { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.stepper-done { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--brand-strong); }

.sym-list { display: grid; gap: 8px; }
.sym-row { display: grid; gap: 6px; }
.sym-name { font-weight: 500; }
.sym-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sym-opts.two { grid-template-columns: 1fr 1fr; }
.sym-list.alarm .sym-row { background: var(--warn-soft); border-radius: 12px; padding: 10px; }
.btn-wide { width: 100%; margin-top: 10px; min-height: 42px; }

.freq-list { display: grid; gap: 6px; }
.freq-row, .freq-head { display: grid; grid-template-columns: minmax(84px, 1fr) repeat(5, minmax(40px, 46px)); gap: 4px; align-items: center; }
.freq-head { font-size: .68rem; color: var(--muted); text-align: center; }
.freq-head .freq-name { text-align: left; }
.freq-name { font-size: .9rem; overflow-wrap: anywhere; }
.freq-row .dot { height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: .6rem; color: var(--muted); cursor: pointer; padding: 0; }
.freq-row .dot.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
@media (min-width: 560px) { .freq-row, .freq-head { grid-template-columns: 1fr repeat(5, 64px); } .freq-row .dot { font-size: .75rem; } }

.btn-link.skip { display: block; margin: 10px 0 0; padding: 8px 0; font-weight: 600; }
.q.is-skipped { background: var(--surface-2); border-radius: 12px; padding: 12px; margin: 8px 0; border-top: 0; }
.q.is-skipped .q-title { color: var(--muted); }
.skip-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .88rem; color: var(--muted); }
.block-actions { margin-top: 14px; }
.modal-btns { display: grid; gap: 8px; margin-top: 14px; }
.sym-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sym-chip { display: inline-flex; align-items: center; min-height: 42px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 500; }
.sym-chip.lvl1 { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.sym-chip.lvl3 { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.sym-lvl { font-style: normal; font-size: .78rem; opacity: .85; }
@media (prefers-color-scheme: dark) { .sym-chip.lvl3 { color: #10201a; } .freq-row .dot.on { color: #10201a; } }
@media (max-width: 559px) { .freq-head { display: none; } }
.modal h3.neutral { color: var(--text); }
.card-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.card-btn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); font-weight: 700; box-shadow: inset 0 0 0 1px var(--brand); }
.card-btn .ico { font-size: 1.35rem; line-height: 1; width: 28px; text-align: center; font-weight: 400; }
.fam-acts { display: grid; gap: 8px; margin-top: 12px; }
.fam-acts .btn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); font-weight: 700; }
/* Preguntas filtro: botones grandes, no chips chiquitos */
.q.gate .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q.gate .chip span { width: 100%; justify-content: center; min-height: 52px; border-radius: 12px; font-weight: 600; }

/* ===== Portada para quien llega por primera vez ===== */
.promo-hero { display: grid; gap: 22px; align-items: center; margin-bottom: 8px; }
.promo-txt h1 { font-size: 1.75rem; line-height: 1.18; margin: 6px 0 10px; }
.promo-txt .muted { margin: 0 0 16px; }
.promo-tel { display: flex; justify-content: center; }
.tel-svg { width: 100%; max-width: 215px; height: auto; filter: drop-shadow(0 8px 26px rgba(28,37,33,.17)); }

.promo-h2 { font-size: 1.2rem; margin: 28px 0 10px; }
.promo-grid { display: grid; gap: 10px; }
.promo-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 15px; background: var(--surface); }
.promo-card .mini { width: 72px; height: auto; display: block; margin-bottom: 9px; }
.promo-card strong { display: block; margin-bottom: 4px; font-size: .98rem; }
.promo-card p { margin: 0; }

.promo-no { border-left: 4px solid var(--accent); background: var(--warn-soft, #fdf2e6);
            border-radius: 0 var(--radius) var(--radius) 0; padding: 13px 16px; margin-top: 22px; }
.promo-no strong { display: block; margin-bottom: 6px; }
.promo-no ul { margin: 0; padding-left: 18px; font-size: .9rem; color: var(--muted); }
.promo-no li { margin-bottom: 4px; }

.promo-datos { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border);
               border-radius: var(--radius); padding: 13px 15px; margin-top: 12px; background: var(--surface); }
.promo-datos svg { flex: none; width: 26px; height: 26px; fill: none; stroke: var(--brand);
                   stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 720px) {
  .promo-hero { grid-template-columns: 1.15fr .85fr; gap: 30px; }
  .promo-txt h1 { font-size: 2.1rem; }
  .promo-grid { grid-template-columns: 1fr 1fr; }
}
.promo-claim { font-size: 1.12rem; font-weight: 600; color: var(--brand); margin: 0 0 12px; line-height: 1.35; }
@media (min-width: 720px) { .promo-claim { font-size: 1.28rem; } }

/* ===== Modulo de paciente: dos pestanas ===== */
.pg { display: none; }
.pg.on { display: block; }
body.con-tabs { padding-bottom: 86px; }

/* La barra de abajo del PACIENTE. Va atada a <nav> a proposito: el panel
   medico y la pagina de instalacion usan .tabs como tira de pestanas normal, y
   esta regla se las pegaba al fondo de la pantalla tapando el contenido. */
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); }

/* Cualquier otra tira de pestanas: en el flujo, donde esta escrita. */
.tabs:not(nav) { display: flex; flex-wrap: wrap; gap: 4px;
  border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tb { border: none; background: transparent; color: var(--muted); padding: 10px 6px;
  border-radius: 14px; font: inherit; font-size: 15px; font-weight: 700; letter-spacing: -.01em;
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.tb.on { background: var(--brand-soft); color: var(--brand-strong); }
.tb svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; }

/* anillo de adherencia */
.anillo-caja { display: flex; gap: 16px; align-items: center; }
.anillo { position: relative; width: 100px; height: 100px; flex: 0 0 100px; }
.anillo svg { transform: rotate(-90deg); display: block; }
.anillo .ctr { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
.anillo .n { font-size: 25px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.anillo .n small { font-size: 15px; color: var(--muted); font-weight: 700; }
.anillo .u { font-size: 10px; color: var(--muted); margin-top: 2px; letter-spacing: .08em; }

/* renglones del dia */
.fr { margin-bottom: 14px; }
.fr > h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin: 0 0 7px; font-weight: 700; }
.fr > h3 em { font-style: normal; color: var(--brand); margin-left: 6px; }
.lista { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; }
.it { display: flex; align-items: center; gap: 13px; padding: 13px 14px; width: 100%;
  border: none; border-bottom: 1px solid var(--border); background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer; }
.it:last-child { border-bottom: none; }
.it .cb { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 9px;
  border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; }
.it .cb svg { width: 15px; height: 15px; fill: none; stroke: var(--surface);
  stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.it.on .cb { background: var(--brand); border-color: var(--brand); }
.it.on .cb svg { opacity: 1; }
.it .nm { flex: 1; min-width: 0; }
.it .nm b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.it.on .nm b { color: var(--muted); text-decoration: line-through; }
.it .nm > span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.it .ds { font-size: 13.5px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.it.on .ds { opacity: .45; }
.et { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 5px; margin-left: 5px; vertical-align: 1.5px;
  background: var(--warn-soft); color: var(--accent); }
.et.ciclo { background: var(--brand-soft); color: var(--brand); }

/* entrenamiento */
.entreno { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; }
.entreno img { width: 100%; display: block; background: var(--surface-2); }
.entreno .bd { padding: 13px 14px; display: flex; align-items: center; gap: 12px; }
.entreno .bd .nm { flex: 1; }
.entreno .bd b { display: block; font-size: 15.5px; letter-spacing: -.015em; }
.entreno .bd .sub { font-size: 12.5px; color: var(--muted); }
.ejs { border-top: 1px solid var(--border); }
.ejs > div { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.ejs > div:last-child { border-bottom: none; }
.ejs b { font-weight: 600; }
.ejs span { float: right; color: var(--brand); font-weight: 700; font-size: 13px; }

/* semaforo por sistema */
.sem { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.sy { border-radius: var(--radius); padding: 12px 13px; border: 1px solid; text-align: left;
  font: inherit; color: inherit; cursor: pointer; }
.sy b { font-size: 14.5px; letter-spacing: -.015em; display: block; margin-bottom: 3px; }
.sy > span { font-size: 12px; display: block; opacity: .85; }
.sy .pt { width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  margin-right: 7px; vertical-align: 1px; }
.sy.rojo { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.sy.rojo .pt { background: var(--danger); }
.sy.amarillo { background: var(--warn-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.sy.amarillo .pt { background: var(--accent); }
.sy.verde { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.sy.verde .pt { background: var(--brand); }

/* accesos de Mi salud */
/* Los accesos de "Mi salud" van en la misma retícula que el semáforo de arriba:
   dos columnas, mismo alto, alineados. Antes cada uno era un <button> suelto y
   el navegador los ajustaba al texto, así que cada tarjeta medía distinto y la
   pantalla se veía como una lista de recortes. grid-auto-rows: 1fr es lo que
   iguala el alto de TODOS, no solo el de los de la misma fila. */
.accesos { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; grid-auto-rows: 1fr; }
.acceso { display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  width: 100%; height: 100%; position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 13px;
  text-align: left; text-decoration: none; color: inherit; font: inherit; cursor: pointer; }
.acceso:active { transform: scale(.99); }
.acceso .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft);
  display: flex; align-items: center; justify-content: center; flex: 0 0 34px; }
.acceso .ic svg { width: 18px; height: 18px; fill: none; stroke: var(--brand);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acceso .nm { min-width: 0; width: 100%; }
.acceso .nm b { display: block; font-size: 14.5px; letter-spacing: -.015em; line-height: 1.25; }
.acceso .nm span { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.35;
  color: var(--muted); }
/* El chevron no cabe en una tarjeta de dos columnas y tampoco hace falta:
   la tarjeta entera ya es el botón. */
.acceso .ch { display: none; }
.acceso .cuenta { position: absolute; top: 10px; right: 10px; }
.cuenta { background: var(--danger); color: #fff; font-size: 12px; font-weight: 800;
  min-width: 24px; height: 24px; line-height: 24px; text-align: center;
  padding: 0 7px; border-radius: 999px; flex: 0 0 auto; }

/* ===== Secciones de detalle de Mi salud ===== */
.det-nav { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 13px;
  padding: 13px 16px; background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); margin: 0 -16px; }
.det-bk { width: 34px; height: 34px; border-radius: 11px; background: var(--surface-2);
  border: none; color: var(--brand); font-size: 20px; line-height: 1; cursor: pointer; flex: 0 0 34px; }
.det-nav b { font-size: 18px; letter-spacing: -.02em; display: block; }
.det-nav span { font-size: 11.5px; color: var(--muted); display: block; }
#detalle .w { padding: 16px 0 0; }
.nota-chica { font-size: 11.5px; color: var(--muted); margin-top: 14px; }

.kcalbox { background: linear-gradient(145deg, var(--brand-strong), var(--brand));
  border-radius: 20px; padding: 18px; margin-bottom: 12px; position: relative; }
.kcalbox .lb { font-size: 11px; letter-spacing: .12em; color: #cfe6dc; font-weight: 700; }
.kcalbox .bg { font-size: 42px; font-weight: 800; letter-spacing: -.04em; line-height: 1;
  margin: 4px 0 2px; color: #fff; }
.kcalbox .un { font-size: 13px; color: #d8ece4; }
.kcalbox .tg { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.18);
  color: #fff; font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 999px; }
.mg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 12px; }
.mg3 .mc { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 12px; }
.mg3 .n { font-size: 12px; font-weight: 700; letter-spacing: .03em; margin-bottom: 7px; }
.mg3 .v { font-size: 25px; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.mg3 .v small { font-size: 13px; font-weight: 700; opacity: .6; }
.mg3 .p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.mg3 .bar { height: 5px; border-radius: 99px; background: var(--surface-2); margin-top: 9px; overflow: hidden; }
.mg3 .bar i { display: block; height: 5px; border-radius: 99px; }
.cP { color: var(--brand); } .bP { background: var(--brand); }
.cC { color: var(--accent); } .bC { background: var(--accent); }
.cG { color: #8fb9d4; } .bG { background: #8fb9d4; }

.dato { display: flex; gap: 11px; align-items: flex-start; background: var(--brand-soft);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; font-size: 13.5px; }
.dato.alerta { background: var(--danger-soft); }
.dato.alerta b { color: var(--danger); }
.dato .dic { font-size: 19px; line-height: 1.2; }
.dato b { color: var(--brand-strong); }

.vacio { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 24px 18px; text-align: center; color: var(--muted); font-size: 13.5px; }
.vacio .vic { font-size: 28px; display: block; margin-bottom: 9px; opacity: .55; }

.pend { background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 13px 14px; margin-bottom: 10px; }
.pend.urg { border-left-color: var(--danger); }
.pend .u { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--accent); margin-bottom: 4px; }
.pend.urg .u { color: var(--danger); }
.pend b { font-size: 15px; display: block; letter-spacing: -.01em; }
.pend p { font-size: 13px; color: var(--muted); margin: 5px 0 0; }
.pend p.falta { color: var(--accent); font-weight: 600; }
.pend .act { margin-top: 11px; }

.ficha { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 14px; margin-bottom: 9px; }
.ficha.off { opacity: .6; }
.ficha .t { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ficha .t b { font-size: 15px; }
.ficha .t .d { color: var(--brand); font-weight: 800; font-size: 14px; white-space: nowrap; }
.ficha .m { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ficha .aviso { margin-top: 9px; padding: 9px 11px; border-radius: 11px; font-size: 12.5px;
  line-height: 1.4; background: var(--warn-soft); color: var(--text); }

.sysg { margin-bottom: 16px; }
.sysh { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.sysh .pt { width: 10px; height: 10px; border-radius: 50%; }
.sysh .pt.rojo { background: var(--danger); } .sysh .pt.amarillo { background: var(--accent); }
.sysh .pt.verde { background: var(--brand); }
.sysh b { font-size: 15px; letter-spacing: -.015em; }
.sysh .cta { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.sysh .cta.rojo { background: var(--danger-soft); color: var(--danger); }
.sysh .cta.amarillo { background: var(--warn-soft); color: var(--accent); }
.sysh .cta.verde { background: var(--brand-soft); color: var(--brand); }
.lv { padding: 13px 14px; border-bottom: 1px solid var(--border); }
.lv:last-child { border-bottom: 0; }
.lv .t { display: flex; align-items: baseline; gap: 10px; }
.lv .t b { font-size: 15px; letter-spacing: -.01em; }
.lv .t .ds { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.lv .exp { font-size: 13px; color: var(--muted); margin-top: 6px; }
.lv .m { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.msg { max-width: 82%; padding: 11px 13px; border-radius: 17px; margin-bottom: 9px;
  font-size: 14px; line-height: 1.4; }
.msg.yo { background: var(--brand); color: #0f1a16; margin-left: auto; border-bottom-right-radius: 5px; }
.msg.dr { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg .q { display: block; font-size: 10.5px; opacity: .65; margin-top: 4px; }
.caja { display: flex; gap: 9px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 99px; padding: 6px 6px 6px 16px; margin-top: 14px; }
.caja input { flex: 1; background: transparent; border: none; outline: none; font-size: 14px; }
.caja button { width: 38px; height: 38px; border-radius: 50%; background: var(--brand);
  border: none; color: #0f1a16; font-size: 17px; cursor: pointer; flex: 0 0 38px; }

.met { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; }
.met > div { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px; }
.met .n { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.met .v { font-size: 26px; font-weight: 800; letter-spacing: -.035em; margin-top: 3px; }
.met .v small { font-size: 13px; color: var(--muted); }
.met .c { font-size: 11.5px; margin-top: 2px; color: var(--muted); }

.row { display: flex; justify-content: space-between; align-items: center; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 9px; }
.row .l b { display: block; font-size: 14.5px; }
.row .l span { font-size: 12.5px; color: var(--muted); }
.row .r { font-size: 13.5px; color: var(--brand); font-weight: 700; }

/* Tira de la semana en Mi entrenamiento. Sin esto los siete recuadros salian
   como texto corrido: "LUNjalon MARpierna". */
.wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 14px; }
.wk > div { background: var(--surface-2); border-radius: 10px; padding: 7px 2px 7px;
            text-align: center; font-size: 11px; line-height: 1.3; color: var(--muted);
            overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; }
.wk > div b { display: block; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
              color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.wk > div.on { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.wk > div.on b { color: var(--brand-strong); }

.day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 12px; }
.day img { width: 100%; display: block; background: var(--surface-2); }
.day .hd { padding: 13px 14px; border-bottom: 1px solid var(--border); }
.day .hd b { font-size: 16px; letter-spacing: -.02em; display: block; }
.day .hd span { font-size: 12.5px; color: var(--muted); }
.ex { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ex:last-child { border: none; }
.ex .t { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ex .t b { font-size: 14.5px; font-weight: 600; }
.ex .t span { color: var(--brand); font-weight: 700; font-size: 13px; white-space: nowrap; }
.ex .m { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ex summary { font-size: 12.5px; color: var(--brand); cursor: pointer; list-style: none; margin-top: 8px; }
.ex summary::-webkit-details-marker { display: none; }
.ex details p { font-size: 13px; color: var(--muted); margin: 7px 0 0; }
.ex details .err { color: var(--accent); font-size: 12.5px; margin-top: 5px; }
.meal { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.meal .mh { padding: 12px 14px; display: flex; justify-content: space-between;
  align-items: center; background: var(--surface-2); }
.meal .mh b { font-size: 15px; letter-spacing: -.01em; }
.meal .mh span { font-size: 13px; font-weight: 700; color: var(--brand); }
.meal ul { list-style: none; margin: 0; padding: 6px 14px 10px; }
.meal li { display: flex; justify-content: space-between; padding: 7px 0;
  border-bottom: 1px solid var(--border); font-size: 14.5px; }
.meal li:last-child { border: none; }
.meal li span { color: var(--brand); font-weight: 700; font-size: 13.5px;
  white-space: nowrap; margin-left: 12px; }
.chips { display: flex; gap: 6px; padding: 0 14px 12px; flex-wrap: wrap; }
.chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand); }
.chip.c { background: var(--warn-soft); color: var(--accent); }

/* Mi presión */
.pfoto { margin: 14px 0 4px; }
.confirma { border: 2px solid var(--brand); border-radius: 14px; padding: 14px; margin-top: 14px; background: var(--surface); }
.confirma > b { font-size: 15px; color: var(--brand-strong); }
.confirma > p { font-size: 13px; color: var(--muted); margin: 5px 0 12px; }
.tres { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.tres label { display: block; }
.tres span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .5px; color: var(--muted); margin-bottom: 4px; }
.tres input { width: 100%; box-sizing: border-box; padding: 12px 6px; font-size: 22px; font-weight: 800;
  text-align: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.tres input:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.lv .t .ds.pa-verde { color: #16a34a; }
.lv .t .ds.pa-amarillo { color: #b45309; }
.lv .t .ds.pa-rojo { color: var(--danger); }

/* Recordatorios */
.rec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.rec-top { display: flex; align-items: flex-start; gap: 12px; }
.rec-top > div { flex: 1; }
.rec-top b { display: block; font-size: 15px; }
.rec-top span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 10px; }
.horas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.horas label { display: block; }
.horas span { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.horas input { width: 100%; box-sizing: border-box; padding: 9px 8px; font-size: 15px; font-weight: 700;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); }

/* Mis estudios: foco, fijos y mapa */
.foco { display: flex; gap: 11px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 13px; margin-top: 11px; }
.fn { width: 27px; height: 27px; flex: none; border-radius: 50%; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.fc { flex: 1; min-width: 0; }
.fh { display: flex; align-items: baseline; gap: 9px; }
.fh b { font-size: 15px; flex: 1; }
.fv { font-size: 17px; font-weight: 800; }
.fv.rojo { color: var(--danger); } .fv.amarillo { color: #b45309; }
.fq { margin: 7px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.fa { margin-top: 9px; font-size: 12.5px; background: var(--brand-soft); border-radius: 9px; padding: 9px 11px; }
.fa > b { color: var(--brand-strong); display: block; margin-bottom: 5px; }
.fa ul { margin: 0; padding-left: 16px; }
.fa li { margin: 3px 0; line-height: 1.4; }
.fa li span { font-size: 10.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .4px; font-weight: 700; margin-left: 5px; }

.bar { position: relative; display: flex; height: 9px; border-radius: 99px;
  overflow: hidden; margin: 9px 0 5px; background: var(--surface-2); }
.bar .z { display: block; height: 100%; }
.bar .z1 { background: #f0b4ae; } .bar .z2 { background: #f5d08a; } .bar .z3 { background: #8ccfa8; }
.bar .mk { position: absolute; top: -4px; width: 4px; height: 17px; border-radius: 3px;
  background: var(--text); transform: translateX(-2px); box-shadow: 0 0 0 2px var(--surface); }
.rf { font-size: 11.5px; color: var(--muted); }
/* El numero tal como lo escribio el laboratorio, para que el paciente lo reconozca
   en su PDF cuando el sistema convirtio la unidad. */
.rf-conv { font-size: 11px; color: var(--muted); opacity: .85; margin-top: 2px;
  padding-left: 8px; border-left: 2px solid var(--line, #e5e7eb); }

.fijo { background: var(--surface-2); border-radius: 12px; padding: 13px; margin-top: 14px; }
.fijo > b { font-size: 14px; }
.fijo .fj { margin-top: 7px; border-top: 1px solid var(--border); padding-top: 7px; }
.fijo .fj summary, .fijo .fj-sola { display: flex; align-items: baseline; gap: 10px;
  list-style: none; cursor: pointer; }
.fijo .fj summary::-webkit-details-marker { display: none; }
.fijo .fj span { flex: 1; font-size: 13.5px; }
.fijo .fj b { font-size: 14.5px; color: var(--danger); white-space: nowrap; }
.fijo .fj i { font-style: normal; color: var(--muted); transition: transform .15s; }
.fijo .fj[open] i { transform: rotate(90deg); }
.fijo p { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.mapa { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.cu { aspect-ratio: 1; border-radius: 3px; }
.cu.rojo { background: var(--danger); } .cu.amarillo { background: #d99a4e; } .cu.verde { background: #5fae83; }
.leg { display: flex; gap: 13px; justify-content: center; flex-wrap: wrap;
  margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.leg span { display: flex; align-items: center; gap: 5px; }
.leg i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lgr { background: var(--danger); } .lga { background: #d99a4e; } .lgv { background: #5fae83; }

/* Subir un estudio */
.subir { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.subir .nota-chica { margin-top: 9px; }
.subir .sb-estado:not(:empty) { margin-top: 12px; }
.subir .sb-estado ul { margin: 6px 0 0; padding-left: 17px; }
.subir .sb-estado li { font-size: 12px; line-height: 1.4; margin: 3px 0; }

/* Renglon que sí hace algo al tocarlo */
.row-btn { display: flex; align-items: center; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 14px; cursor: pointer; gap: 12px; }
.row-btn:hover { background: var(--surface-2); }
.row-btn .l { flex: 1; }
.row-btn .l b { display: block; font-size: 15px; }
.row-btn .l span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row-btn .r { color: var(--muted); font-size: 19px; }

/* Registro de comidas */
.hoybox { display: flex; gap: 14px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.hoyl { flex: none; }
.hoyr { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.anp { width: 116px; height: 116px; display: block; }
.anp .apb { fill: none; stroke: var(--surface-2); stroke-width: 11; }
.anp .apf { fill: none; stroke: var(--brand); stroke-width: 11; stroke-linecap: round; }
.anp .apf.sobra { stroke: var(--accent); }
.anp .apn { font-size: 27px; font-weight: 800; text-anchor: middle; fill: var(--text); }
.anp .apu { font-size: 12px; text-anchor: middle; fill: var(--muted); }
.anp .apl { font-size: 9px; font-weight: 800; letter-spacing: .7px; text-anchor: middle; fill: var(--brand); }
.mn2 span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted); }
.mn2 b { font-size: 15px; } .mn2 b small { font-weight: 600; color: var(--muted); font-size: 12px; }
.bm { display: block; height: 6px; border-radius: 99px; background: var(--surface-2);
  overflow: hidden; margin-top: 4px; }
.bm u { display: block; height: 100%; }
.bm .bK { background: var(--accent); } .bm .bC { background: #c7803a; } .bm .bG { background: #8a7bb8; }

.comer-bot { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 13px; }
.cm-b { min-height: 48px; padding: 0 6px; font-size: 13px; border-radius: 12px; }
#cm-estado:not(:empty) { margin-top: 12px; }

.cm-row .m { display: flex; align-items: center; gap: 6px; }
.cm-del { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.cm-del:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }

.cmf { display: block; margin-top: 10px; }
.cmf span { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .5px;
  color: var(--muted); margin-bottom: 4px; }
.cmf input, .cmf select { width: 100%; box-sizing: border-box; padding: 11px 10px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.cmf.ancho { grid-column: 1 / -1; }
.cmg { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 4px; }
.cmg .cmf input { font-weight: 700; text-align: center; }
.sup { margin-top: 12px; background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.sup ul { margin: 5px 0; padding-left: 16px; } .sup li { margin: 3px 0; line-height: 1.4; }

.tabla-et { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 10px 0; }
.tabla-et > div { background: var(--surface-2); border-radius: 9px; padding: 8px 10px; }
.tabla-et span { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; }
.tabla-et b { font-size: 17px; }
.sellos { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0; }
.sellos i { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .4px;
  background: #1c2521; color: #fff; padding: 4px 8px; border-radius: 6px; }
.cm-tot { margin-top: 9px; font-size: 13px; background: var(--brand-soft); border-radius: 9px; padding: 9px 11px; }
.cm-tot b { color: var(--brand-strong); }
.ingr { margin-top: 10px; font-size: 12.5px; }
.ingr summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.ingr p { margin: 6px 0 0; color: var(--muted); line-height: 1.45; }

.sem7 { display: flex; gap: 6px; align-items: flex-end; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 10px; }
.d7 { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
/* El riel da la altura fija contra la que se mide el porcentaje de la barra.
   Sin el, todas las barras salen iguales. */
.riel7 { width: 100%; max-width: 30px; height: 68px; display: flex; align-items: flex-end; }
.riel7 i { display: block; width: 100%; border-radius: 5px 5px 2px 2px; min-height: 4px; }
.riel7 .ok { background: var(--brand); } .riel7 .med { background: #d99a4e; } .riel7 .bajo { background: #d8a3a0; }
.d7 span { font-size: 11px; font-weight: 700; color: var(--muted); }
.d7 u { font-size: 10px; text-decoration: none; color: var(--muted); }

/* Buscador de alimentos */
.busca { margin-top: 13px; }
.bu-in { width: 100%; box-sizing: border-box; padding: 13px 14px; font-size: 16px;
  border: 2px solid var(--brand); border-radius: 12px; background: var(--surface); color: var(--text); }
.bu-res { margin-top: 8px; }
.bu-res:not(:empty) { background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; max-height: 340px; overflow-y: auto; }
.bu-it { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 11px 13px; border: 0; border-bottom: 1px solid var(--border);
  background: transparent; cursor: pointer; }
.bu-it:last-child { border-bottom: 0; }
.bu-it:hover { background: var(--surface-2); }
.bu-it .bi { font-size: 19px; flex: none; }
.bu-it .bn { flex: 1; min-width: 0; }
.bu-it .bn b { display: block; font-size: 14.5px; }
.bu-it .bn > span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.bu-est { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--warn-soft);
  color: var(--accent); font-weight: 800; display: grid; place-items: center; font-size: 13px; }
.bu-nada { font-size: 13px; color: var(--muted); padding: 12px 4px; margin: 0; }
.bu-mano { display: block; width: 100%; margin-top: 10px; font-size: 13px; }

.cuanto { display: flex; gap: 8px; margin-top: 10px; }
.cuanto input { width: 92px; flex: none; padding: 12px 10px; font-size: 18px; font-weight: 700;
  text-align: center; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text); }
.cuanto select { flex: 1; min-width: 0; padding: 12px 10px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.cm-tot span { color: var(--muted); }

.ingr-lista { margin-top: 11px; display: flex; flex-direction: column; gap: 6px; }
.ing { display: flex; align-items: center; gap: 9px; }
.ing span { flex: 1; min-width: 0; font-size: 13.5px; }
.ing input { width: 74px; flex: none; padding: 8px 6px; font-size: 15px; font-weight: 700;
  text-align: center; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); color: var(--text); }
.ing u { flex: none; width: 16px; font-size: 12px; color: var(--muted); text-decoration: none; }

/* Platillo: cuántas porciones */
.porciones { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2); border-radius: 11px; padding: 10px 12px; margin-top: 11px; }
.porciones > span { font-size: 13.5px; font-weight: 600; flex: 1; }
.pmas { display: flex; align-items: center; gap: 2px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pmas button { width: 38px; height: 38px; border: 0; background: transparent; color: var(--brand);
  font-size: 21px; font-weight: 700; cursor: pointer; line-height: 1; }
.pmas button:hover { background: var(--brand-soft); }
.pmas b { min-width: 34px; text-align: center; font-size: 17px; font-weight: 800; }
.porciones u { font-size: 12.5px; color: var(--muted); text-decoration: none; width: 100%; }
.afinar { margin-top: 11px; }
.afinar summary { cursor: pointer; font-size: 13px; color: var(--brand); font-weight: 600; }

/* Tomas que no son diarias */
.it .tarde { color: var(--danger); font-weight: 700; }
.it.listo { cursor: default; opacity: .78; }
.it.listo:hover { background: transparent; }
.it .prox { flex: none; text-align: right; font-size: 10.5px; font-weight: 700;
  letter-spacing: .3px; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.it .prox b { display: block; font-size: 13px; letter-spacing: 0; text-transform: none;
  color: var(--brand); font-weight: 700; }

/* Valores sin rango: ni verdes ni rojos */
.cu.sin_rango { background: repeating-linear-gradient(45deg, #b9c2bd, #b9c2bd 2px, var(--surface) 2px, var(--surface) 4px); }
.lgs { background: repeating-linear-gradient(45deg, #b9c2bd, #b9c2bd 2px, #fff 2px, #fff 4px); }
.lv .t .ds.pa-sin_rango { color: var(--muted); }
.fijo .fj b.gris { color: var(--muted); }


/* ===== Resumen del día (tablero del paciente) =====
   Rejilla de 2 columnas. La tarjeta que no tiene dato no se dibuja, asi que la
   rejilla nunca sale con huecos: sale con una, con dos o con cuatro. */
.rs { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 10px 0; }
.rs-c { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
        padding: 11px 12px; }
/* Con una o tres tarjetas, la ultima ocupa el ancho completo. Si no, queda un hueco
   al lado que se lee como "aqui falta algo" en vez de "aqui no hay nada que decir". */
.rs-c:last-child:nth-child(odd) { grid-column: 1 / -1; }
.rs-c h4 { margin: 0 0 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
           text-transform: uppercase; color: var(--muted); }
.rs-n { font-size: 27px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.rs-n small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.rs-p { display: inline-block; margin-top: 7px; font-size: 10.5px; font-weight: 700;
        padding: 2px 8px; border-radius: 20px; }
.rs-p.v { background: var(--sem-verde-bg, #e3efe9); color: var(--sem-verde, #2f6b58); }
.rs-p.a { background: var(--sem-amar-bg, #fbf0e3); color: #9a5f22; }
.rs-p.r { background: var(--sem-rojo-bg, #f8e7e5); color: #9b3a31; }
.rs-s { margin: 6px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }

/* ===== La semana ===== */
.sm { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
      padding: 12px 13px; margin: 12px 0 4px; }
.sm h3 { margin: 0 0 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
         text-transform: uppercase; color: var(--muted); }
.sm-f { display: flex; align-items: center; justify-content: space-between; gap: 10px;
        padding: 9px 0; border-bottom: 1px dashed var(--border); }
.sm-f:last-child { border-bottom: none; padding-bottom: 0; }
.sm-f b { display: block; font-size: 14px; font-weight: 600; }
.sm-f em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.sm-f .rs-p { margin-top: 0; flex: none; }


/* ===== Botón de Google =====
   Blanco con borde, como pide la guía de marca de Google. Nunca verde RenovitIA:
   un botón de "continuar con Google" que no parece de Google se siente a trampa. */
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; }
.btn-google:hover { background: #f8f9fa; }
.btn-google:disabled { opacity: .6; }
.g-ico { width: 18px; height: 18px; flex: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-google { background: #fff; color: #1f1f1f; }
}


/* ===== Accesos del encabezado ===== */
.topbar-acc { display: flex; align-items: center; gap: 6px; }
.ico-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: grid; place-items: center;
  cursor: pointer; padding: 0; }
.ico-btn:hover { background: var(--surface-2); }
.ico-btn:active { transform: scale(.94); }
.ico-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Péptidos: días fijos y la jeringa ===== */
/* Los días viven DEBAJO del renglón, no dentro: el renglón es un <button> y
   meterle otro botón adentro deja el HTML inválido y el toque impredecible. */
.pep-dias { display: flex; gap: 4px; padding: 0 14px 10px 53px; }
.pep-dias span { flex: 1; text-align: center; font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; padding: 5px 0; border-radius: 7px;
  background: var(--chip, #eef2ef); color: var(--muted); }
.pep-dias span.on { background: var(--brand); color: #fff; }
.pep-dias span.hoy { outline: 2px solid var(--accent, #d9823c); outline-offset: 2px; }

.pep-ver { display: flex; align-items: center; justify-content: center; gap: 8px;
  width: calc(100% - 28px); margin: 0 14px 12px; padding: 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--chip, #eef2ef);
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--brand); cursor: pointer; }
.pep-ver:active { transform: scale(.99); }

.jer-fondo { position: fixed; inset: 0; z-index: 90; background: rgba(12,26,21,.55);
  display: flex; flex-direction: column; justify-content: flex-end; }
.jer-hoja { background: var(--surface, #fff); border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,.25); }
.jer-asa { width: 44px; height: 4px; border-radius: 999px; background: var(--line);
  margin: 0 auto 12px; }
.jer-fila { display: flex; gap: 16px; align-items: stretch; }
.jer-num { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1;
  color: var(--brand); }
.jer-eq { padding: 11px 13px; border-radius: 11px; background: var(--chip, #eef2ef);
  font-size: 13px; line-height: 1.5; }
.jer-ojo { padding: 13px 15px; border-radius: 12px; background: #fdf3ea;
  border: 1px solid #f0d6bd; color: #6b3d14; font-size: 13px; line-height: 1.5; margin-top: 14px; }

/* La hora de la franja, junto a su nombre. Es la que el paciente configuro
   para sus recordatorios: si no tiene, no se inventa ninguna. */
.fr h3 .hr { font-weight: 700; color: var(--brand); letter-spacing: 0; margin-left: 4px; }

/* ---------- El botón "+" de la pantalla Hoy ---------- */
/* Flota sobre el contenido, encima de la barra de pestañas (86px) y respetando
   el borde inferior del iPhone. Solo existe en "Hoy": en "Mi salud" el paciente
   está leyendo, no capturando. */
.mas { position: fixed; right: 16px; z-index: 45;
  bottom: calc(96px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 30px; line-height: 1; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(12,26,21,.28); transition: transform .12s ease; }
.mas:active { transform: scale(.94); }
.mas:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (min-width: 760px) { .mas { right: calc(50vw - 380px + 16px); } }

/* La hoja de abajo, compartida con el dibujo de la jeringa. */
.hoja-fondo { position: fixed; inset: 0; z-index: 90; background: rgba(12,26,21,.55);
  display: flex; flex-direction: column; justify-content: flex-end; }
.hoja { background: var(--surface, #fff); border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,.25); margin: 0 auto; width: 100%; max-width: 760px; }
.hoja-asa { display: block; width: 44px; height: 4px; border-radius: 999px;
  background: var(--border); margin: 0 auto 12px; }
.hoja h2 { margin: 0 0 12px; font-size: 17px; letter-spacing: -.02em; }

/* Las seis acciones rápidas: misma retícula de dos columnas, mismo alto. */
.rapidas { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; grid-auto-rows: 1fr; }
.rapida { display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  width: 100%; height: 100%; padding: 13px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: inherit;
  font: inherit; text-align: left; cursor: pointer; }
.rapida:active { transform: scale(.99); }
.rapida .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft);
  display: flex; align-items: center; justify-content: center; flex: 0 0 34px; }
.rapida .ic svg { width: 18px; height: 18px; fill: none; stroke: var(--brand);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rapida b { display: block; font-size: 14.5px; letter-spacing: -.015em; line-height: 1.25; }
.rapida span { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.35; color: var(--muted); }

/* ---------- Escalas de 1 a 5 del check-in ---------- */
.esc-fila { margin-bottom: 14px; }
.esc-fila > b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.esc-fila > .ayuda { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.esc-ops { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.esc-op { padding: 11px 0; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); font: inherit; font-size: 15px; font-weight: 700;
  color: var(--muted); cursor: pointer; }
.esc-op[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.esc-pies { display: flex; justify-content: space-between; margin-top: 5px;
  font-size: 11px; color: var(--muted); }

/* Campo de formulario con etiqueta encima. Lo usan "Mi peso" y el check-in. */
.campo { display: block; }
.campo > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted);
  margin-bottom: 5px; }
.campo > span i { font-style: normal; font-weight: 400; opacity: .8; }

/* ---------- Mensajes con el paciente (panel médico) ---------- */
.hilo { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.msj { max-width: min(560px, 86%); padding: 11px 13px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); }
/* Lo del paciente a la izquierda, lo de la médica a la derecha y en verde: de un
   vistazo se ve si la última palabra fue de ella o quedó sin contestar. */
.msj-pac { align-self: flex-start; }
.msj-yo { align-self: flex-end; background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.msj-cab { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.msj-txt { font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.responder { display: flex; flex-direction: column; gap: 9px; align-items: flex-start;
  border-top: 1px solid var(--border); padding-top: 14px; }
.responder .input { width: 100%; }
/* Punto rojo en la lista de pacientes: el único lugar donde la médica se entera
   sin abrir expediente por expediente. */
.punto-msj { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); margin-left: 7px; vertical-align: 1px; }
