/* ============ tokens ============ */
:root{
  --brand:#22c55e; --brand-d:#16a34a; --brand-ink:#052e16;
  --train:#f97316; --prog:#38bdf8; --warn:#f59e0b; --bad:#ef4444;
  --bg:#0b0f0d;
  --surface:#ffffff; --surface-2:#f4f6f5; --surface-3:#eaeeec;
  --text:#0f1a15; --muted:#6b7c74; --line:#e2e8e5;
  --radius:16px; --radius-lg:22px;
  --shadow:0 1px 2px rgba(16,32,24,.06), 0 8px 24px -12px rgba(16,32,24,.18);
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Inter,system-ui,sans-serif;
  /* iOS da env(safe-area-inset-*); en Android, Capacitor inyecta --safe-area-inset-*. */
  --safe-t:max(env(safe-area-inset-top,0px),var(--safe-area-inset-top,0px));
  --safe-b:max(env(safe-area-inset-bottom,0px),var(--safe-area-inset-bottom,0px));
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  margin:0;font-family:var(--font);color:var(--text);background:var(--surface-2);
  -webkit-font-smoothing:antialiased;overscroll-behavior:none;
  -webkit-text-size-adjust:100%;-webkit-touch-callout:none;
}
button,.item--tap,.chip,.tabbar,.appbar{-webkit-user-select:none;user-select:none}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none}
a{color:inherit}



/* ============ app ============ */
/* La app ocupa la pantalla del teléfono entera: cabecera, contenido y pestañas. */
.app{position:relative;height:100vh;height:100dvh;background:var(--surface-2);overflow:hidden;
  display:grid;grid-template-rows:auto 1fr auto}
.app.is-login{grid-template-rows:1fr}

/* ============ appbar ============ */
.appbar{background:var(--surface);padding:calc(12px + var(--safe-t)) 18px 12px;display:flex;align-items:center;gap:12px;
  border-bottom:1px solid var(--line);min-height:calc(62px + var(--safe-t));z-index:20}
.appbar--flat{border-bottom:0}
.appbar__back{width:34px;height:34px;border-radius:11px;background:var(--surface-2);display:grid;place-items:center;flex:0 0 auto}
.appbar__t{flex:1;min-width:0}
.appbar__t h1{margin:0;font-size:20px;letter-spacing:-.02em;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.appbar__t p{margin:2px 0 0;font-size:12.5px;color:var(--muted)}
.appbar__actions{display:flex;gap:8px;align-items:center}
.iconbtn{width:34px;height:34px;border-radius:11px;background:var(--surface-2);display:grid;place-items:center;
  font-size:15px;position:relative}
.iconbtn svg,.appbar__back svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round}
.iconbtn .dot{position:absolute;top:5px;right:5px;width:8px;height:8px;border-radius:50%;background:var(--bad);
  box-shadow:0 0 0 2px var(--surface-2)}

/* ============ screen ============ */
.screen{overflow-y:auto;overflow-x:hidden;padding:16px 16px 28px;scroll-behavior:smooth;
  -webkit-overflow-scrolling:touch;background:var(--surface-2)}
.screen::-webkit-scrollbar{width:0}
.stack{display:grid;gap:14px}
.section{display:grid;gap:10px}
.section__h{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:0 2px}
.section__h h2{margin:0;font-size:14px;letter-spacing:.02em;text-transform:uppercase;color:var(--muted);font-weight:700}
.section__h button{font-size:13px;color:var(--brand-d);font-weight:600}

/* ============ tabbar ============ */
.tabbar{display:flex;background:rgba(255,255,255,.92);backdrop-filter:blur(14px);border-top:1px solid var(--line);
  padding:8px 6px calc(10px + var(--safe-b));z-index:20}
.tabbar button{flex:1;display:grid;justify-items:center;gap:3px;padding:4px 2px;border-radius:12px;
  font-size:10.5px;font-weight:600;color:var(--muted);letter-spacing:-.01em}
.tabbar button svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.tabbar button.is-active{color:var(--brand-d)}
.tabbar button.is-active svg{stroke-width:2.1}

/* ============ cards ============ */
.card{background:var(--surface);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow)}
.card--pad0{padding:0;overflow:hidden}
.card__h{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.card__h h3{margin:0;font-size:15.5px;letter-spacing:-.01em}
.card__h .sub{font-size:12px;color:var(--muted)}
.hero{background:linear-gradient(150deg,#1f8f4d,#0f6b3c 70%);color:#eafff2;border-radius:var(--radius-lg);padding:18px}
.hero h2{margin:0 0 2px;font-size:22px;letter-spacing:-.025em}
.hero p{margin:0;font-size:13px;color:#a9e6c4}

.row{display:flex;align-items:center;gap:12px}
.row--between{justify-content:space-between}
.row--wrap{flex-wrap:wrap}
.grow{flex:1;min-width:0}
.muted{color:var(--muted)}
.tiny{font-size:11.5px}
.small{font-size:13px}
.b{font-weight:650}
.center{text-align:center}
.num{font-variant-numeric:tabular-nums}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}

.stat{background:var(--surface);border-radius:14px;padding:12px;box-shadow:var(--shadow)}
.stat b{display:block;font-size:21px;letter-spacing:-.03em;line-height:1.1}
.stat span{font-size:11.5px;color:var(--muted)}
.stat .delta{font-size:11.5px;font-weight:650}
.up{color:var(--bad)} .down{color:var(--brand-d)} .flat{color:var(--muted)}

/* list items */
.item{display:flex;align-items:center;gap:12px;padding:12px 14px;background:var(--surface);
  border-bottom:1px solid var(--line)}
.item:last-child{border-bottom:0}
.item__body{flex:1;min-width:0}
.item__body strong{display:block;font-size:14.5px;font-weight:600;letter-spacing:-.01em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item__body span{font-size:12.5px;color:var(--muted)}
.item__end{text-align:right;font-size:12.5px;color:var(--muted);flex:0 0 auto}
.item--tap:active{background:var(--surface-2)}

.avatar{width:40px;height:40px;border-radius:13px;display:grid;place-items:center;font-weight:700;font-size:15px;
  color:#fff;flex:0 0 auto;letter-spacing:-.02em}
.avatar--sm{width:30px;height:30px;border-radius:10px;font-size:12px}
.avatar--lg{width:58px;height:58px;border-radius:19px;font-size:22px}

.thumb{width:44px;height:44px;border-radius:13px;background:var(--surface-2);display:grid;place-items:center;
  font-size:21px;flex:0 0 auto;overflow:hidden}
.thumb img{width:100%;height:100%;object-fit:cover}

/* chips / pills */
.chip{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border-radius:999px;font-size:11.5px;
  font-weight:650;background:var(--surface-2);color:var(--muted);white-space:nowrap}
.chip--ok{background:#e7f8ee;color:#15803d}
.chip--warn{background:#fef3c7;color:#a16207}
.chip--bad{background:#fee2e2;color:#b91c1c}
.chip--info{background:#e0f2fe;color:#0369a1}
.chip--train{background:#ffedd5;color:#c2410c}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:11px 16px;border-radius:13px;
  font-size:14.5px;font-weight:650;background:var(--brand);color:var(--brand-ink);transition:.15s;letter-spacing:-.01em}
.btn:active{transform:scale(.975)}
.btn--block{width:100%}
.btn--sm{padding:8px 12px;font-size:13px;border-radius:11px}
.btn--soft{background:var(--surface-2);color:var(--text)}
.btn--outline{background:transparent;box-shadow:inset 0 0 0 1.5px var(--line);color:var(--text)}
.btn--dark{background:#132118;color:#eafff2}
.btn--ghost{background:rgba(255,255,255,.08);color:#dff3e6;box-shadow:inset 0 0 0 1px rgba(255,255,255,.14)}
.btn--danger{background:#fee2e2;color:#b91c1c}
.btn[disabled]{opacity:.45;pointer-events:none}

/* segmented */
.seg{display:flex;background:var(--surface-3);border-radius:12px;padding:3px;gap:2px;overflow-x:auto;scrollbar-width:none}
.seg::-webkit-scrollbar{display:none}
.seg button{flex:1;padding:8px 10px;border-radius:9px;font-size:13px;font-weight:620;color:var(--muted);
  white-space:nowrap;transition:.15s}
.seg button.is-active{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.08)}

/* progress */
.bar{height:7px;border-radius:999px;background:var(--surface-3);overflow:hidden}
.bar>i{display:block;height:100%;border-radius:999px;background:var(--brand);transition:width .4s}
.bar--thin{height:5px}

/* date strip */
.dates{display:flex;gap:7px;overflow-x:auto;padding:2px;scrollbar-width:none;margin:0 -2px}
.dates::-webkit-scrollbar{display:none}
.dates button{flex:0 0 auto;width:46px;padding:8px 0;border-radius:14px;background:var(--surface);
  display:grid;gap:2px;justify-items:center;box-shadow:var(--shadow)}
.dates button span{font-size:10.5px;color:var(--muted);text-transform:uppercase;font-weight:650}
.dates button b{font-size:16px;letter-spacing:-.02em}
.dates button.is-active{background:#132118;color:#fff}
.dates button.is-active span{color:#8fd7ab}
.dates button i{width:5px;height:5px;border-radius:50%;background:var(--brand);display:block}
.dates button.is-active i{background:#8fd7ab}

/* rings & charts */
.ring{display:block}
.chart{display:block;width:100%;overflow:visible}

/* meal slot */
.slot{display:flex;gap:12px;align-items:center;padding:11px 0;border-bottom:1px dashed var(--line)}
.slot:last-child{border-bottom:0}
.slot__check{width:26px;height:26px;border-radius:9px;box-shadow:inset 0 0 0 1.7px var(--line);display:grid;
  place-items:center;flex:0 0 auto;background:var(--surface);color:transparent;font-size:14px;transition:.18s}
.slot--done .slot__check{background:var(--brand);box-shadow:none;color:var(--brand-ink)}
.slot--done .slot__name{color:var(--muted);text-decoration:line-through}
.slot__name{font-size:14.5px;font-weight:600;letter-spacing:-.01em}

/* photos */
.photos{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.photos .ph{aspect-ratio:3/4;border-radius:12px;overflow:hidden;background:var(--surface-3);position:relative}
.photos .ph img{width:100%;height:100%;object-fit:cover;display:block}
.photos .ph b{position:absolute;left:5px;bottom:5px;font-size:10px;background:rgba(0,0,0,.55);color:#fff;
  padding:2px 6px;border-radius:6px;font-weight:600}
.ph--add{display:grid;place-items:center;color:var(--muted);font-size:22px;box-shadow:inset 0 0 0 1.5px var(--line)}

/* chat */
.chat{display:grid;gap:8px;padding-bottom:6px}
.msg{max-width:78%;padding:9px 12px;border-radius:16px;font-size:14px;line-height:1.42;position:relative;
  box-shadow:var(--shadow)}
.msg time{display:block;font-size:10px;opacity:.6;margin-top:3px;text-align:right}
.msg--in{background:var(--surface);border-bottom-left-radius:5px;justify-self:start}
.msg--out{background:#132118;color:#eafff2;border-bottom-right-radius:5px;justify-self:end}
.msg img{border-radius:10px;margin:-2px 0 4px;display:block;width:100%}
.chat-day{justify-self:center;font-size:11px;color:var(--muted);background:var(--surface-3);padding:3px 10px;border-radius:999px;margin:6px 0}
.composer{position:sticky;bottom:0;display:flex;gap:8px;align-items:flex-end;padding:10px 0 0;background:linear-gradient(transparent,var(--surface-2) 22%)}
.composer textarea{flex:1;resize:none;border:0;background:var(--surface);border-radius:18px;padding:11px 14px;
  font-size:14px;max-height:96px;box-shadow:var(--shadow);outline:none}
.composer .btn{border-radius:50%;width:42px;height:42px;padding:0;flex:0 0 auto}

/* forms */
.field{display:grid;gap:6px;margin-bottom:12px}
.field>label{font-size:12.5px;font-weight:650;color:var(--muted)}
.input,select.input,textarea.input{width:100%;padding:12px 13px;border-radius:12px;background:var(--surface-2);
  border:1.5px solid transparent;outline:none;font-size:15px;transition:.15s}
.input:focus{border-color:var(--brand);background:var(--surface)}
textarea.input{min-height:78px;resize:vertical}
select.input{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7c74' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 13px center}
.inline{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.inline3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.help{font-size:11.5px;color:var(--muted)}

/* set logger */
.sets{display:grid;gap:6px}
.sets__head,.setrow{display:grid;grid-template-columns:30px 1fr 1fr 58px 32px;gap:6px;align-items:center}
.sets__head span{font-size:10.5px;color:var(--muted);text-transform:uppercase;font-weight:700;text-align:center}
.setrow .n{width:26px;height:26px;border-radius:9px;background:var(--surface-2);display:grid;place-items:center;
  font-size:12px;font-weight:700;color:var(--muted)}
.setrow input{padding:9px 8px;border-radius:10px;background:var(--surface-2);border:1.5px solid transparent;
  text-align:center;font-size:14.5px;outline:none;width:100%;font-variant-numeric:tabular-nums}
.setrow input:focus{border-color:var(--brand);background:var(--surface)}
.setrow .del{color:var(--muted);font-size:16px;text-align:center}

/* sheet */
.sheet-bd{position:fixed;inset:0;background:rgba(6,14,10,.5);z-index:90;opacity:0;transition:.22s;backdrop-filter:blur(2px)}
.sheet-bd.is-open{opacity:1}
.sheet{position:absolute;left:0;right:0;bottom:0;background:var(--surface);border-radius:22px 22px 0 0;
  max-height:88%;display:grid;grid-template-rows:auto 1fr;transform:translateY(100%);transition:transform .26s cubic-bezier(.32,.72,0,1)}
.sheet.is-open{transform:translateY(0)}
.sheet__h{padding:14px 18px 10px;border-bottom:1px solid var(--line);position:relative}
.sheet__h::before{content:"";position:absolute;top:6px;left:50%;transform:translateX(-50%);width:36px;height:4px;
  border-radius:99px;background:var(--surface-3)}
.sheet__h h3{margin:6px 0 0;font-size:17px;letter-spacing:-.02em}
.sheet__h p{margin:2px 0 0;font-size:12.5px;color:var(--muted)}
.sheet__h .x{position:absolute;right:12px;top:14px;width:30px;height:30px;border-radius:10px;background:var(--surface-2);
  display:grid;place-items:center;color:var(--muted)}
.sheet__b{padding:16px 18px calc(20px + var(--safe-b));overflow-y:auto}


/* toast */
.toast-root{position:fixed;left:0;right:0;bottom:calc(84px + var(--safe-b));display:grid;justify-items:center;gap:8px;z-index:120;pointer-events:none}
.toast{background:#132118;color:#eafff2;padding:10px 16px;border-radius:999px;font-size:13.5px;font-weight:600;
  box-shadow:0 10px 30px -8px rgba(0,0,0,.6);animation:tin .25s cubic-bezier(.32,.72,0,1)}
@keyframes tin{from{opacity:0;transform:translateY(10px)}}

/* misc */
.empty{display:grid;gap:8px;justify-items:center;text-align:center;padding:34px 20px;color:var(--muted)}
.empty .em{font-size:34px}
.empty b{color:var(--text);font-size:15px}
.divider{height:1px;background:var(--line);margin:2px 0}
.badge-n{min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--bad);color:#fff;font-size:11px;
  font-weight:700;display:grid;place-items:center}

/* login */
.login{height:100%;display:grid;align-content:center;gap:14px;padding:calc(32px + var(--safe-t)) 26px calc(32px + var(--safe-b));
  background:linear-gradient(160deg,#123122,#0a1410 65%);color:#eafff2;text-align:center}
.login__logo{width:64px;height:64px;border-radius:20px;background:var(--brand);color:var(--brand-ink);
  display:grid;place-items:center;font-weight:800;font-size:31px;margin:0 auto 6px}
.login h1{margin:0;font-size:27px;letter-spacing:-.03em}
.login p{margin:0 0 14px;font-size:14px;color:#9dc4ae;line-height:1.5}
.login .btn{width:100%}




/* ---------- acceso ---------- */
.login__form { width: 100%; max-width: 320px; margin: 18px auto 0; text-align: left; }
.login__form label { display: block; font-size: 12px; font-weight: 600; opacity: .72; margin: 12px 0 5px; }
.login__form input {
  width: 100%; padding: 13px 14px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08);
  color: inherit; font: inherit; font-size: 16px;  /* 16px o iOS hace zoom al enfocar */
}
.login__form input:focus { outline: none; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.14); }
.login__form .btn--block { width: 100%; margin-top: 20px; }
.login__error {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13px;
  background: rgba(220,70,70,.18); color: #ffd9d9; text-align: center;
}
.login__avanzado { margin-top: 18px; }
.login__avanzado summary { font-size: 12px; opacity: .6; cursor: pointer; list-style: none; }
.login__avanzado summary::-webkit-details-marker { display: none; }
.login__avanzado summary::before { content: '⚙ '; }
.login__avanzado input { margin-top: 8px; font-size: 14px; }
.login__avanzado .help { display: block; margin-top: 6px; font-size: 11px; opacity: .55; }

/* ---------- estado de sincronización ---------- */
.sync {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-radius: 12px; font-size: 12.5px; margin-bottom: 12px;
}
.sync--pendiente { background: rgba(210,150,40,.14); color: #a97516; }
.sync--error { background: rgba(200,60,60,.13); color: #b03636; }
.sync__punto { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- plan por opciones ---------- */
.chip--m{background:var(--surface-2);color:var(--text)}
.chip--m-desayuno{background:#fff7e0;color:#92600a}
.chip--m-comida{background:#e7f8ee;color:#15803d}
.chip--m-merienda{background:#fde8ef;color:#a3244f}
.chip--m-cena{background:#e8eafd;color:#3d46a8}
.momentos{display:inline-flex;flex-wrap:wrap;gap:5px}
button.chip{border:0;cursor:pointer}
.chip.is-on{background:#132118;color:#fff}

.receta{display:grid;gap:12px}
.receta__macros{margin:0}
.receta__meta{display:flex;flex-wrap:wrap;gap:6px}
.receta__bloque b{display:block;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:6px}
.receta__bloque ul,.receta__bloque ol{margin:0;padding-left:19px;font-size:14px;line-height:1.5}
.receta__bloque li{margin:3px 0}
.receta__titulo{font-weight:700;font-size:15.5px;margin:4px 0 10px}
.divider{height:1px;background:var(--line);margin:16px 0}

.opcion{padding:0;overflow:hidden}
.opcion__h{display:flex;align-items:center;gap:10px;padding:13px 14px 10px}
.opcion__h h3{margin:0;font-size:15.5px;flex:1;min-width:0}
.opcion__tot{padding:0 14px 10px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.momento{padding:9px 14px 4px;border-top:1px solid var(--line)}
.momento__h{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}
.momento__h span{font-size:11.5px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.momento__add{font-size:12.5px;font-weight:650;color:var(--brand-d)}
.plato{display:flex;align-items:center;gap:10px;padding:7px 0}
.plato .thumb{width:36px;height:36px;border-radius:10px;font-size:18px}
.plato__n{flex:1;min-width:0;font-size:14px;font-weight:600}
.plato__n small{display:block;font-weight:500;font-size:12px;color:var(--muted)}
.plato__vacio{font-size:12.5px;color:var(--muted);padding:4px 0 8px}

details.plato-det{border-radius:12px}
details.plato-det > summary{list-style:none;cursor:pointer}
details.plato-det > summary::-webkit-details-marker{display:none}
details.plato-det[open] > summary .plato__chev{transform:rotate(90deg)}
.plato__chev{color:var(--muted);transition:transform .15s}
details.plato-det .receta{padding:4px 2px 12px}

.semana{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}
.semana button{background:var(--surface);border-radius:12px;padding:8px 0 7px;box-shadow:var(--shadow);
  display:grid;gap:2px;justify-items:center;min-width:0}
.semana button span{font-size:10px;text-transform:uppercase;color:var(--muted);font-weight:700}
.semana button b{font-size:15px}
.semana button.is-hoy{background:#132118;color:#fff}
.semana button.is-hoy span{color:#8fd7ab}

.hoy-opcion{display:flex;align-items:center;gap:10px}
.hoy-opcion__t{flex:1;min-width:0}
.hoy-opcion__t b{display:block;font-size:15px}
.hoy-opcion__t span{font-size:12.5px;color:var(--muted)}

.compra{padding:0;overflow:hidden}
.compra label{display:flex;gap:12px;align-items:flex-start;padding:11px 14px;border-bottom:1px solid var(--line);cursor:pointer}
.compra label:last-child{border-bottom:0}
.compra input{width:20px;height:20px;margin-top:1px;accent-color:var(--brand-d);flex:none}
.compra .c-n{flex:1;min-width:0;font-size:14.5px}
.compra .c-n small{display:block;color:var(--muted);font-size:11.5px;margin-top:1px}
.compra .c-q{font-weight:650;font-size:14px;white-space:nowrap}
.compra label.is-hecho .c-n,.compra label.is-hecho .c-q{text-decoration:line-through;color:var(--muted)}

.ing-row{display:grid;grid-template-columns:64px 88px 1fr 34px;gap:6px;margin-bottom:6px}
.ing-row .input{padding:9px 8px}
.ej-row{display:grid;grid-template-columns:1fr 48px 64px 58px 30px;gap:5px;margin-bottom:6px}
.ej-row .input{padding:9px 7px;font-size:14px}
.x-row{width:34px;height:38px;border-radius:10px;background:var(--surface-2);color:var(--bad);font-weight:700}
.dia-ed{background:var(--surface-2);border-radius:14px;padding:10px;margin-bottom:10px}

/* Sin esto una columna de grid no encoge por debajo del contenido mínimo de sus
   hijos: un nombre de receta largo (que se recorta con puntos suspensivos y no
   salta de línea) ensanchaba la pantalla entera por encima de los 375 px. */
.stack,.section{grid-template-columns:minmax(0,1fr)}

/* ---------- revisión 1.1 ---------- */
[hidden]{display:none!important}

/* Aviso de conexión: flota sobre la barra inferior para no mover el contenido. */
.app{position:relative}
.syncbar{position:absolute;left:10px;right:10px;bottom:calc(70px + var(--safe-b));z-index:30;display:flex;align-items:center;gap:8px;
  padding:8px 10px 8px 12px;border-radius:14px;background:#3b1d1d;color:#ffe1e1;font-size:12.5px;font-weight:600;
  box-shadow:0 10px 30px -10px rgba(0,0,0,.5)}
.syncbar span:nth-child(2){flex:1;min-width:0}
.syncbar button{background:rgba(255,255,255,.14);color:#fff;border-radius:9px;padding:5px 9px;font-size:12px;font-weight:650}
.syncbar__punto{width:8px;height:8px;border-radius:50%;background:#f87171;flex:none;animation:pulso 1.6s infinite}
@keyframes pulso{50%{opacity:.35}}



/* Avisos de Hoy */
.avisos{display:grid;gap:8px;grid-template-columns:minmax(0,1fr)}
.aviso{display:flex;align-items:center;gap:11px;background:var(--surface);border-radius:14px;padding:10px 10px 10px 12px;
  box-shadow:var(--shadow);border-left:3px solid var(--brand)}
.aviso__em{font-size:20px;flex:none}
.aviso b{display:block;font-size:13.5px;letter-spacing:-.01em}
.aviso span{display:block;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.dates button.is-futuro{background:transparent;box-shadow:inset 0 0 0 1.5px var(--line)}
.dates button.is-futuro.is-active{background:#132118;box-shadow:none}
.dates button.is-hoy:not(.is-active) b{color:var(--brand-d)}
.slot__hora{width:26px;height:26px;display:grid;place-items:center;flex:0 0 auto;font-size:16px}
.hoy-opcion__nota{display:block;font-size:12px;color:var(--brand-d);margin-top:2px}

.foto-grande{width:100%;border-radius:14px;display:block;margin-bottom:14px}
.foto-comp{width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:12px;display:block}
.photos .ph img{background:var(--surface-3)}

/* Sesión de entreno */
.setrow button.n{border:0;cursor:pointer;transition:.15s}
.setrow.is-hecha button.n{background:var(--brand);color:var(--brand-ink)}
.setrow.is-hecha input{background:#effaf3}
.descanso{position:sticky;bottom:8px;z-index:5;background:#132118;color:#eafff2;border-radius:18px;padding:12px 14px;
  box-shadow:0 18px 40px -16px rgba(0,0,0,.55)}
.descanso__t{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:8px}
.descanso__t span{font-size:12.5px;color:#8fd7ab;font-weight:650}
.descanso__t b{font-size:26px;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.descanso .bar{background:rgba(255,255,255,.14)}
.descanso .bar i{background:#4ade80;transition:width .25s linear}
.descanso .btn--soft{background:rgba(255,255,255,.1);color:#eafff2}
.descanso.is-fin{background:#166534}
.descanso.is-fin .descanso__t b{font-size:18px}

.card--hoy{box-shadow:inset 0 0 0 2px var(--train),var(--shadow)}
.semana--mini{display:flex;gap:5px}
.semana--mini span,.semana--mini button{flex:1;text-align:center;font-size:11px;font-weight:700;padding:6px 0;border-radius:9px;
  background:var(--surface-2);color:var(--muted);box-shadow:none;display:block}
.semana--mini .is-on{background:#ffedd5;color:#c2410c}
.semana--mini span.is-hoy{outline:1.5px solid var(--text);outline-offset:-1.5px}
.semana--ed button{cursor:pointer}

label.check{display:flex;align-items:center;gap:9px;font-size:13.5px;margin:4px 0 14px;cursor:pointer}
label.check input{width:18px;height:18px;accent-color:var(--brand-d)}

/* Tabletas: la app sigue siendo la misma, con el contenido a un ancho cómodo. */
@media (min-width:700px){
  .screen>*{max-width:640px;margin-left:auto;margin-right:auto}
  .sheet{max-width:640px;margin:0 auto}
}

.login__api{position:relative}
.login__api input{padding-right:44px!important}
.login__api button{position:absolute;right:6px;top:50%;transform:translateY(calc(-50% + 4px));width:32px;height:32px;border-radius:50%;
  background:rgba(255,255,255,.12);color:#eafff2;font-size:13px}
/* Botones secundarios sueltos sobre el fondo gris: blancos, para que se vean como botones. */
.stack>.btn--soft,.section>.btn--soft,.grid2>.btn--soft,.stack>.row>.btn--soft{background:var(--surface);box-shadow:var(--shadow)}
.screen{scrollbar-width:none}
