/* MiVida - sistema de diseno. Variables CSS, claro/oscuro automatico. */
:root {
  color-scheme: light dark;
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --text: #14172b;
  --muted: #5b6080;
  --line: rgba(20, 23, 43, .08);
  --accent: #4338ca;
  --accent-2: #0f766e;
  --on-accent: #ffffff; /* texto sobre acento / degradado (contraste >= 4.5:1) */
  --accent-soft: rgba(67, 56, 202, .12);
  --ok: #15803d;
  --ok-text: #166534;
  --danger: #b91c1c;
  --warn: #d97706;
  --warn-text: #92400e;
  --tap: 44px; /* objetivo tactil minimo */
  --shadow: 0 1px 2px rgba(20, 23, 43, .06), 0 8px 24px rgba(20, 23, 43, .08);
  --radius: 20px;
  --radius-sm: 14px;
  --nav-h: 68px;
  --font: ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f1c;
    --surface: #171a2c;
    --surface-2: #20243a;
    --text: #eceefa;
    --muted: #9297b8;
    --line: rgba(255, 255, 255, .08);
    --accent: #8b85ff;
    --accent-2: #2dd4bf;
    --on-accent: #0d0f1c;
    --accent-soft: rgba(139, 133, 255, .16);
    --ok: #4ade80;
    --ok-text: #4ade80;
    --danger: #f87171;
    --warn: #fbbf24;
    --warn-text: #fbbf24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.45; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: 1.9rem; font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
/* Oculto a la vista pero disponible para lectores de pantalla (etiquetas de campos) */
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app { max-width: 640px; margin: 0 auto; min-height: 100%; padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
main { padding: calc(20px + env(safe-area-inset-top)) 18px 0; animation: rise .38s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.head .eyebrow { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }

.card { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.hero { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); }
.card.hero .muted { color: var(--on-accent); }

/* Navegacion inferior */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
nav.tabs .inner { display: flex; width: 100%; max-width: 640px; height: var(--nav-h); }
nav.tabs button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .75rem; font-weight: 600; position: relative; transition: color .2s;
}
nav.tabs svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
nav.tabs button[aria-current="page"] { color: var(--accent); }
nav.tabs button[aria-current="page"] svg { transform: translateY(-2px) scale(1.08); }
nav.tabs button[aria-current="page"]::after { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent); }

/* Boton flotante */
.fab {
  position: fixed; right: max(18px, calc(50% - 302px)); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 21;
  width: 62px; height: 62px; border-radius: 22px; color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 28px rgba(67, 56, 202, .45);
  display: grid; place-items: center; transition: transform .2s var(--ease);
}
.fab:active { transform: scale(.92); }
.fab svg { width: 28px; height: 28px; stroke: var(--on-accent); stroke-width: 2.4; fill: none; stroke-linecap: round; }

/* Segmentos */
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 2px; margin-bottom: 14px; }
.seg button { flex: 1; min-height: var(--tap); padding: 9px 0; border-radius: 11px; font-weight: 600; font-size: .92rem; color: var(--muted); transition: all .2s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.nav-row .title { font-weight: 700; display: block; min-height: var(--tap); padding: 0 10px; }
.nav-row .title::first-letter { text-transform: uppercase; }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Items de agenda */
.day-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); margin: 18px 4px 8px; }
.day-title.today { color: var(--accent); }
.item { position: relative; border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; background: var(--ok); touch-action: pan-y; animation: rise .3s var(--ease) backwards; }
.item .swipe-hint { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 20px; color: var(--on-accent); font-weight: 700; }
.item .inner {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius-sm);
  transition: transform .25s var(--ease), opacity .2s; will-change: transform;
}
.item.dragging .inner { transition: none; }
.item .time { min-width: 52px; font-weight: 700; font-size: .92rem; }
.item .time small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.item.done .t { text-decoration: line-through; color: var(--muted); }
.item.done .inner { background: var(--surface-2); }
.dot { width: 4px; align-self: stretch; border-radius: 4px; background: var(--accent); }
.item.task .dot { background: var(--accent-2); }
.check {
  position: relative; width: var(--tap); height: var(--tap); border-radius: 50%; flex: none; display: grid; place-items: center; background: transparent;
}
.check::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 2px solid var(--muted); transition: all .2s var(--ease); }
.check svg { position: relative; width: 16px; height: 16px; stroke: var(--on-accent); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.5); transition: all .2s var(--ease); }
.item.done .check::before { background: var(--ok); border-color: var(--ok); }
.item.done .check svg { opacity: 1; transform: none; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty .big { font-size: 2.2rem; margin-bottom: 6px; }

/* Mes */
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; }
.month .dow { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.month .cell { aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-weight: 600; font-size: .92rem; background: var(--surface); transition: transform .15s; }
.month .cell:active { transform: scale(.93); }
.month .cell.out { color: var(--muted); background: transparent; font-weight: 500; }
.month .cell.today { background: var(--accent); color: var(--on-accent); }
.month .cell.sel { outline: 2px solid var(--accent); }
.month .cell .pips { display: flex; gap: 2px; height: 5px; }
.month .cell .pips i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); }
.month .cell.today .pips i { background: var(--on-accent); }

/* Hoja (formulario) */
.scrim { position: fixed; inset: 0; background: rgba(8, 10, 24, .5); z-index: 40; opacity: 0; transition: opacity .25s; }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; margin: 0 auto; max-width: 640px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: 28px 28px 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .35s var(--ease); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
}
.sheet.on { transform: none; }
.sheet .grab { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 14px; background: var(--muted); opacity: .4; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1.5px solid transparent; background: var(--surface-2); outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nl { display: flex; gap: 8px; margin-bottom: 14px; }
.nl input { flex: 1; padding: 13px 14px; border-radius: 14px; background: var(--accent-soft); border: 1.5px solid transparent; outline: none; }
.nl input:focus { border-color: var(--accent); }
.btn { min-height: var(--tap); padding: 13px 18px; border-radius: 14px; font-weight: 700; background: var(--accent); color: var(--on-accent); transition: transform .15s var(--ease), opacity .2s; }
.btn:active { transform: scale(.96); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.danger { background: transparent; color: var(--danger); }
.btn[disabled] { opacity: .5; }
.btn.block { width: 100%; padding: 15px; font-size: 1.02rem; }
.actions { display: flex; gap: 10px; margin-top: 6px; }
.actions .btn { flex: 1; }
.chips { display: flex; gap: 8px; margin-bottom: 12px; }
.chip { min-height: var(--tap); padding: 9px 14px; border-radius: 99px; background: var(--surface-2); font-weight: 600; font-size: .9rem; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.hint { font-size: .8rem; color: var(--muted); margin: -4px 0 12px; }

/* Anillo de progreso */
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--on-accent) calc(var(--p) * 1%), color-mix(in srgb, var(--on-accent) 28%, transparent) 0); }
.ring b { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 1.1rem; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

/* Login y "proximamente" */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login form { width: 100%; max-width: 360px; text-align: center; }
.login img { width: 84px; height: 84px; border-radius: 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.login .err { color: var(--danger); min-height: 1.4em; font-size: .9rem; margin: 6px 0; }
.soon { text-align: center; padding: 56px 10px; }
.soon .em { font-size: 3rem; margin-bottom: 8px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.more { margin: 0 0 12px; }
.more > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 650; color: var(--accent); }
.err-card { text-align: center; padding: 32px 16px; }
.err-card p { margin: 8px 0 14px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 96px); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: .9rem; opacity: 0; transition: all .3s var(--ease); z-index: 60; max-width: 90%; text-align: center; display: flex; gap: 12px; align-items: center; justify-content: center; }
.toast button { color: var(--bg); font-weight: 800; text-decoration: underline; min-height: var(--tap); padding: 0 6px; }
.toast:not(.on) { pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ===== Comida (nutricion) ===== */
.btn.light { background: var(--on-accent); color: var(--accent); }
.btn.sm { min-height: var(--tap); padding: 8px 14px; font-size: .88rem; }
.icon-btn.sm { width: var(--tap); height: var(--tap); border-radius: 12px; box-shadow: none; background: var(--surface-2); }
.icon-btn.sm svg { width: 18px; height: 18px; }
.err { color: var(--danger); font-size: .9rem; margin: 6px 0; }
.rg { position: relative; flex: none; }
.rg svg { width: 100%; height: 100%; display: block; }
.rg-t { fill: none; stroke: var(--surface-2); }
.rg-v { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .9s var(--ease), stroke .3s; }
.rg-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; text-align: center; }
.rg-in .big { font-size: 1.9rem; font-weight: 750; letter-spacing: -.03em; }
.rg-in small { font-size: .75rem; max-width: 84px; }
.card.kc .rg-t { stroke: color-mix(in srgb, var(--on-accent) 28%, transparent); }
.card.kc .rg-v { stroke: var(--on-accent); }
.card.kc .rg.over .rg-v { stroke: var(--on-accent); }
.kc-side { flex: 1; display: grid; gap: 10px; }
.kc-side small { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.kc-side b { font-size: 1.35rem; }
.kc-r { font-size: .8rem; }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.mac { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mac .ml { font-weight: 650; font-size: .85rem; }
.mac small { color: var(--muted); font-size: .75rem; }
.rg.m-p .rg-v { stroke: var(--accent); } .rg.m-c .rg-v { stroke: var(--warn); } .rg.m-g .rg-v { stroke: var(--accent-2); }
.rg.over .rg-v { stroke: var(--accent-2); } /* neutro: pasarse no es un error moral */
.addrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.addrow .btn { min-height: 52px; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 8px; }
.addrow .btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.cam { grid-column: 1 / -1; min-height: 58px; font-size: 1.05rem; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 20px rgba(67, 56, 202, .3); }
.consent-note { grid-column: 1 / -1; margin: -2px 2px 2px; font-size: .8rem; color: var(--muted); }
.meal { padding: 14px 16px; }
.meal-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.meal-h h2 { flex: 1; font-size: 1.05rem; }
.erow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 0; border-top: 1px solid var(--line); animation: rise .3s var(--ease) backwards; }
.eth { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; font-size: 1.15rem; }
.eb { flex: 1; min-width: 0; display: block; }
.en { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eb small { color: var(--muted); font-size: .78rem; }
.ek { font-weight: 700; font-size: .9rem; text-align: right; flex: none; }
.ek small, .ikcal small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
.bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-bottom: 12px; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .6s var(--ease); }
.wnow { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; } .wnow b { font-size: 1.6rem; } .wnow span { font-size: .82rem; }
.wchart { width: 100%; height: auto; margin-top: 8px; } .wt { font-size: 10px; fill: var(--muted); }
.disc { font-size: .8rem; color: var(--muted); line-height: 1.4; margin: 16px 2px; }
.chips.scroll { overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; flex-wrap: nowrap; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; flex: none; min-height: 40px; transition: background .2s, color .2s; }
.chip.s { min-height: var(--tap); padding: 6px 12px; font-size: .85rem; }
.rcard { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); animation: rise .3s var(--ease) backwards; transition: transform .15s var(--ease); }
.rcard:active { transform: scale(.98); }
.card .rcard { box-shadow: none; background: var(--surface-2); }
.rcard.dis { opacity: .55; }
.rb { flex: 1; min-width: 0; display: block; }
.rb b { display: block; font-weight: 650; }
.rb small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
small.warn, .warn { color: var(--warn-text); }
.rk { font-weight: 750; font-size: 1.1rem; text-align: center; flex: none; min-width: 48px; }
.rk small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); }
.mgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0; }
.mgrid > div, .tot > div { background: var(--surface-2); border-radius: 12px; padding: 8px 2px; text-align: center; }
.mgrid b, .tot b { display: block; font-size: 1.05rem; } .mgrid small, .tot small { font-size: .75rem; color: var(--muted); }
.tot { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 6px; margin: 8px 0; }
.alert { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .88rem; margin: 8px 0; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert.warnbox { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.alert.aitext { white-space: pre-wrap; margin-top: 10px; }
.sh { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 6px; }
.ing { list-style: none; margin: 0; padding: 0; } .ing li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.steps { margin: 0 0 12px; padding-left: 20px; } .steps li { margin-bottom: 6px; }
.stepper { display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); border-radius: 14px; padding: 4px; min-height: 52px; }
.stepper button { width: var(--tap); height: var(--tap); border-radius: 11px; background: var(--surface); font-size: 1.2rem; font-weight: 700; }
.irow { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.irow.nodata { background: color-mix(in srgb, var(--danger) 8%, transparent); border-radius: 10px; padding: 10px 6px; }
.ibody { flex: 1; min-width: 0; } .iname { font-weight: 650; } .imeta { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.gin { display: flex; align-items: center; gap: 3px; flex: none; }
.gin input { width: 72px; min-height: var(--tap); padding: 10px 6px; border-radius: 12px; border: 1.5px solid transparent; background: var(--surface-2); text-align: center; outline: none; }
.gin input:focus { border-color: var(--accent); }
.ikcal { width: 70px; font-weight: 700; font-size: .85rem; text-align: right; flex: none; }
.xbtn { width: var(--tap); height: var(--tap); border-radius: 10px; color: var(--muted); flex: none; }
.bdg { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.bdg.ok, .bdg.c-alta { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok-text); }
.bdg.warn, .bdg.c-media { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn-text); }
.bdg.bad, .bdg.c-baja { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.linkbtn { color: var(--accent); font-weight: 650; font-size: .88rem; min-height: var(--tap); padding: 4px 0; text-align: left; }
.phead { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pthumb { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; }
.pprev { width: 100%; max-height: 38vh; object-fit: cover; border-radius: var(--radius-sm); margin: 10px 0; }
.analyzing { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0; text-align: center; }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check-row { display: flex; gap: 12px; align-items: center; font-size: .88rem; margin: 8px 0; min-height: var(--tap); }
.check-row input { width: 24px; height: 24px; flex: none; accent-color: var(--accent); }
.menu { display: grid; gap: 8px; margin-top: 12px; }
.mi { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); text-align: left; }
.mi svg { width: 26px; height: 26px; stroke: var(--accent); fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mi b { display: block; } .mi small { color: var(--muted); }
.ppre { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin: 4px 0 12px; }
.pk { display: flex; align-items: baseline; gap: 8px; } .pk b { font-size: 2rem; letter-spacing: -.03em; }
.sheet h2 { font-size: 1.25rem; }
.sheet code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ===== Empleo ===== */
.ocard { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 64px; text-align: left; padding: 14px; margin-bottom: 8px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); animation: rise .35s var(--ease) both; }
.ocard:active { transform: scale(.985); }
.ocard.flat { box-shadow: none; background: var(--surface); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sc { flex: none; width: 52px; height: 52px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; background: var(--surface-2); color: var(--muted); }
.sc b { font-size: 1.2rem; font-weight: 800; }
.sc small { font-size: .62rem; font-weight: 600; margin-top: 2px; }
.sc.hi { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok-text); }
.sc.mid { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn-text); }
.ob { flex: 1; min-width: 0; display: block; }
.ot { display: block; font-weight: 650; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.om { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.or { display: block; margin-top: 6px; } .or i { display: block; font-style: normal; font-size: .8rem; color: var(--muted); }
.or i::before { content: "• "; }
.ot2 { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.bdg.st-postulada, .bdg.st-entrevista { background: var(--accent-soft); color: var(--accent); }
.bdg.st-rechazada, .bdg.st-descartada { background: var(--surface-2); color: var(--muted); }
.oscore { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.bl { margin: 4px 0 0; padding-left: 20px; } .bl li { margin-bottom: 4px; }
.bl.warnl li::marker { color: var(--warn); }
.contact { display: grid; gap: 4px; word-break: break-word; }
.ch { font-size: 1.1rem; margin-bottom: 10px; }
.filebtn { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.filebtn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn.spinning svg { animation: spin .8s linear infinite; }
.cvtext { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: .88rem; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; max-height: 45vh; overflow: auto; margin: 6px 0 12px; }
.cvdoc { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 16px; font-size: .9rem; margin-top: 10px; }
.cvdoc .cvn { font-weight: 800; font-size: 1.1rem; text-align: center; } .cvdoc .cvc { text-align: center; color: var(--muted); font-size: .8rem; word-break: break-word; }
.cvdoc .cvh { text-align: center; font-style: italic; margin-top: 6px; } .cvdoc .cvs { margin-top: 8px; }
.cvdoc .cvt { font-weight: 800; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border-bottom: 2px solid var(--accent-soft); margin: 14px 0 6px; padding-bottom: 2px; }
.cvdoc ul { margin: 0; padding-left: 18px; } .cvdoc li { margin-bottom: 3px; }
.esec { border-top: 1px solid var(--line); padding-top: 8px; }
.kv { display: flex; gap: 10px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.kv span { color: var(--muted); flex: none; } .kv b { text-align: right; word-break: break-word; min-width: 0; }
.card.flatc { box-shadow: none; background: var(--surface-2); margin-bottom: 12px; } .card.flatc h3 { font-size: 1.02rem; margin-bottom: 8px; }
.card.flatc .btn { margin-top: 10px; } a.btn { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.steps li { margin-bottom: 10px; }
.field textarea { resize: vertical; }
@media (prefers-reduced-motion: reduce) { .ocard { animation: none; } .icon-btn.spinning svg { animation: none; } }

/* Empleo: datos de oferta y controles para pulgar */
.offer-chips { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.offer-chips .bdg { white-space:normal; overflow-wrap:anywhere; }
.offer-fit { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.85rem; color:var(--muted); }
.ocard .ob { min-width:0; }
.sc.na { width:90px; height:auto; min-height:52px; padding:8px; font-size:.75rem; line-height:1.35; overflow-wrap:anywhere; }
.offer-tools { flex-wrap:wrap; margin:12px 0; }
.offer-score-note { display:block; color:var(--muted); font-size:.75rem; margin-top:4px; }
.offer-tools button, .offer-filters select, .ocard { min-height:44px; min-width:44px; }
.maint-status { min-height: 1.2em; margin: 0 0 8px; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.maint-status:empty { display: none; }
.offer-tools .btn[aria-busy="true"] { opacity: .85; }
.contact a.linkbtn { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
/* Comida: ¿Que cocino con lo que tengo? y Mis recetas (IA) */
.bdg.ia { background: var(--accent-soft); color: var(--accent); vertical-align: middle; margin-left: 4px; }
.mgrid.mg4 { grid-template-columns: repeat(4, 1fr); }
.mgrid.mg4 > div { padding: 8px 2px; min-width: 0; }
.mgrid.mg4 b { font-size: .95rem; overflow-wrap: anywhere; }
.cookcard { margin-bottom: 14px; }
.cookcard h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.cookcard .actions { flex-wrap: wrap; }
.cookcard .actions .btn { min-height: 44px; flex: 1 1 140px; }
.alert.aitext { white-space: normal; overflow-wrap: anywhere; }
.alert.aitext p { margin: 0 0 6px; } .alert.aitext p:last-child { margin-bottom: 0; }
.alert.aitext ul { margin: 4px 0 6px; padding-left: 20px; }
#ckprev .pprev { max-width: 100%; max-height: 180px; border-radius: 12px; margin-top: 8px; }
#ckprev .linkbtn, #cdone, #rdel { min-height: 44px; }
/* Progreso de trabajos largos (Empleo) */
.maint-status progress { display: block; width: 100%; height: 10px; margin-top: 6px; accent-color: var(--accent); }
.maint-status #jobtxt { font-weight: 600; color: var(--text); }
[data-maint="cancel"] { min-height: 44px; }
