/* Componentes. Sin estilos en linea (CSP): los valores dinamicos llegan como --p, --len o --drag. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Halo violeta fijo tras la cabecera, como un cielo a medianoche. */
body::before {
  content: "";
  position: fixed;
  inset: -120px 0 auto;
  height: 460px;
  background: radial-gradient(ellipse at 62% 0%, var(--glow), transparent 68%);
  pointer-events: none;
}

h1,
h2,
p,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#view:focus,
.sheet:focus {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ico {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: none;
}

/* Tonos: cada metrica conserva su color en todas las pantallas. */
.tone-sleep {
  --tone: var(--sleep);
}
.tone-water {
  --tone: var(--water);
}
.tone-move {
  --tone: var(--move);
}
.tone-food {
  --tone: var(--food);
}
.tone-pink {
  --tone: var(--pink);
}
.tone-status {
  --tone: var(--status);
}
.tone-muted {
  --tone: var(--muted);
}

.chip {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--tone, var(--muted));
  flex: none;
}

.chip .ico {
  width: 17px;
  height: 17px;
}

/* ---- Marco ---- */

.ensayo {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  padding-top: var(--safe-top);
  height: calc(var(--safe-top) + var(--band-h));
  display: grid;
  place-items: center;
  background: var(--amber);
  color: var(--amber-ink);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + var(--band-h) + 16px) 21px 16px;
}

.brand-tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(145deg, #222a54, #0c1423 78%);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 22px rgba(90, 76, 200, 0.22);
}

.brand-mark {
  width: 30px;
  height: 30px;
}

.brand-mark circle {
  stroke-width: 3.2;
  stroke-linecap: round;
}

.m-move {
  stroke: var(--move);
}
.m-water {
  stroke: var(--water);
}
.m-sleep {
  stroke: var(--sleep);
}

.brand {
  font-size: 19px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.05em;
}

.brand span {
  font-weight: 400;
  color: var(--muted);
}

.brand-sub {
  margin-top: 5px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}

.view {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 var(--gutter) calc(var(--tabbar-gap) + var(--tabbar-h) + 88px);
  animation: rise 0.28s var(--ease-out);
}

@keyframes rise {
  from {
    opacity: 0.6;
    transform: translateY(6px);
  }
}

.page-title {
  margin: 4px 0 16px;
  font-size: 33px;
  line-height: 1.08;
  font-weight: 780;
  letter-spacing: -0.05em;
}

.tabbar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: var(--tabbar-gap);
  transform: translateX(-50%);
  width: min(100% - 26px, 494px);
  height: var(--tabbar-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 5px;
  border-radius: 26px;
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: 0 14px 40px var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}

.tab {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border-radius: 21px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.tab[aria-current="page"] {
  color: var(--accent);
  background: var(--panel-3);
}

.tab-ico {
  width: 21px;
  height: 21px;
}

.fab {
  position: fixed;
  z-index: 31;
  right: max(21px, calc((100% - 520px) / 2 + 21px));
  bottom: calc(var(--tabbar-gap) + var(--tabbar-h) + 14px);
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #17142b;
  background: linear-gradient(145deg, #dcd6ff, #8d79ef 78%);
  box-shadow: 0 10px 28px rgba(123, 107, 240, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.16s var(--ease-out);
}

.fab .ico {
  width: 26px;
  height: 26px;
  stroke-width: 2.2;
}

.fab:active {
  transform: scale(0.92);
}

/* ---- Botones ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.14s var(--ease-out), opacity 0.14s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
}

.btn-ghost {
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.btn-accent {
  background: linear-gradient(145deg, #dcd6ff, #8d79ef 78%);
  color: #17142b;
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}

.iconbtn:disabled {
  color: var(--faint);
  opacity: 0.45;
}

/* ---- Tira de dias ---- */

.strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.strip-month {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.strip-month::first-letter {
  text-transform: uppercase;
}

.strip-nav {
  display: flex;
  gap: 6px;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 10px 0 14px;
}

.day {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 9px 0 8px;
  min-height: 72px;
  border-radius: 17px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.day-label {
  font-size: 10px;
  font-weight: 750;
}

.day-num {
  font-size: 17px;
  font-weight: 760;
  color: var(--text);
}

.day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
}

.day.has-data .day-dot {
  background: var(--status);
}

.day.is-today .day-label {
  color: var(--accent);
}

.day.selected {
  background: var(--panel-3);
  border-color: var(--border);
  box-shadow: 0 6px 16px var(--shadow);
}

.day:disabled {
  opacity: 0.32;
}

/* ---- Heroe y anillos ---- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 14px 20px 20px;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 115% -40%, rgba(177, 161, 255, 0.26), transparent 55%),
    linear-gradient(135deg, #1d284a 0%, #131e31 56%, #111b2b 100%);
  box-shadow: 0 12px 48px var(--shadow);
}

.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-title {
  margin-top: 6px;
  font-size: 36px;
  line-height: 1;
  font-weight: 790;
  letter-spacing: -0.055em;
}

.legend {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.legend-row {
  display: grid;
  grid-template-columns: 7px 1fr auto;
  align-items: baseline;
  gap: 7px;
  font-size: 13px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone);
  align-self: center;
}

.legend-label {
  color: var(--muted);
  font-weight: 600;
}

.legend-value {
  font-weight: 760;
}

.legend-none {
  color: var(--faint);
  font-size: 12px;
}

.rings {
  position: relative;
  width: 158px;
  height: 158px;
  flex: none;
}

.rings-svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-arc {
  fill: none;
  stroke-width: 12;
}

.ring-track {
  stroke: rgba(205, 217, 255, 0.085);
}

.ring-arc {
  stroke: var(--tone);
  stroke-linecap: round;
  animation: ring-in 0.8s var(--ease-out);
}

@keyframes ring-in {
  from {
    stroke-dashoffset: var(--len);
  }
}

.ring-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  line-height: 1;
}

.ring-core strong {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.ring-core span {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 359px) {
  .rings {
    width: 124px;
    height: 124px;
  }

  .hero-title {
    font-size: 30px;
  }
}

/* ---- Bloques y cuadros ---- */

.block {
  margin-top: 22px;
}

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 11px;
}

.sec-title {
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.sec-aside {
  font-size: 12px;
  color: var(--muted);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 8px 38px var(--shadow);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  display: flex;
  flex-direction: column;
  min-height: 134px;
  padding: 15px 14px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  font-size: 12px;
  font-weight: 640;
  color: var(--muted);
}

.stat-val {
  margin-top: 13px;
  font-size: 29px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
  white-space: nowrap;
}

.stat-val small {
  margin-left: 2px;
  font-size: 13px;
  font-weight: 620;
  letter-spacing: -0.02em;
  color: var(--muted);
}

.stat-none {
  margin-top: 19px;
  font-size: 14px;
  font-weight: 600;
  color: var(--faint);
}

.tinybar {
  height: 4px;
  margin-top: 11px;
  border-radius: 50px;
  background: var(--panel-3);
  overflow: hidden;
}

.tinybar i {
  display: block;
  width: var(--p, 0%);
  height: 100%;
  border-radius: 50px;
  background: var(--tone, var(--accent));
}

.stat-meta {
  margin-top: auto;
  padding-top: 9px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
}

.meta-stack {
  display: grid;
  gap: 3px;
}

.prov {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.prov-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: currentColor;
  align-self: flex-start;
  margin-top: 0.38em;
}

.prov-hollow .prov-dot {
  background: transparent;
}

.rows .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 11px 17px;
}

.rows .row + .row,
.rows .entry + .entry {
  border-top: 1px solid var(--border);
}

.row-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  flex: none;
}

.row-text {
  text-align: right;
  font-size: 14px;
  font-weight: 560;
  overflow-wrap: anywhere;
}

.row-none {
  font-size: 13px;
  color: var(--faint);
}

.pill {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.entry {
  display: flex;
  gap: 12px;
  padding: 13px 15px;
}

.entry-body {
  flex: 1;
  min-width: 0;
}

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.entry-head strong {
  font-weight: 700;
}

.entry-time {
  font-size: 12px;
  color: var(--faint);
}

.entry-text {
  margin-top: 3px;
  font-size: 14px;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- Estados ---- */

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 30px 26px 26px;
  text-align: center;
  border-radius: var(--r-lg);
  border: 1px dashed var(--border-strong);
  background: rgba(18, 27, 43, 0.55);
}

.empty-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  border-radius: 15px;
  background: var(--panel-2);
  color: var(--accent);
}

.empty-title {
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.empty-text {
  max-width: 270px;
  font-size: 13.5px;
  color: var(--muted);
}

.empty .btn {
  margin-top: 10px;
}

.insufficient {
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1px solid var(--border);
}

.insufficient-count {
  font-size: 15px;
  font-weight: 740;
}

.offer {
  display: flex;
  gap: 13px;
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1px solid var(--border-strong);
}

.offer-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--panel-2);
  color: var(--accent);
}

.offer-body {
  flex: 1;
  min-width: 0;
}

.offer-title {
  font-size: 15.5px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.offer-text {
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted);
}

.offer-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--faint);
}

.offer .btn {
  margin-top: 10px;
}

.more-actions {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 14px;
}

/* ---- Copias y formularios ---- */

.form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 5px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* iOS no hace zoom al enfocar con 16 px o mas */
}

.input-file {
  padding: 11px 12px;
  font-size: 14px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  font-size: 13.5px;
}

.check-row input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.warning-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--amber);
  background: rgba(245, 176, 66, 0.08);
  font-size: 13.5px;
}

.warning-box strong {
  color: var(--amber);
}

.form-error {
  font-size: 13.5px;
  font-weight: 620;
  color: var(--pink);
}

.form-error[hidden] {
  display: none;
}

.form-result:empty {
  display: none;
}

.form-result {
  margin-top: 14px;
}

.result-ok {
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
}

.result-title {
  margin: 0;
  font-size: 15px;
  font-weight: 760;
}

.result-text {
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--muted);
}

.count-rows {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 13.5px;
}

.count-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.count-row strong {
  font-weight: 760;
}

#backup-nudge {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--amber);
  background: rgba(245, 176, 66, 0.1);
  color: var(--amber);
  font-size: 13.5px;
  font-weight: 650;
}

.nudge-text {
  flex: 1;
  min-width: 0;
}

.nudge-link {
  color: var(--text);
  text-decoration: underline;
  font-weight: 700;
}

.backup .btn[hidden] {
  display: none;
}

/* ---- Hoja inferior ---- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(3, 6, 12, 0.6);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.sheet-backdrop.open {
  opacity: 1;
}

.sheet {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: var(--kb, 0px);
  width: min(100%, 520px);
  max-height: min(86dvh, calc(var(--vvh, 100dvh) - 12px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: calc(var(--safe-bottom) + 20px);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  box-shadow: 0 -20px 60px var(--shadow);
  transform: translate(-50%, 100%);
  transition: transform 0.42s var(--ease-sheet);
}

.sheet.open {
  transform: translate(-50%, var(--drag, 0px));
}

.sheet.dragging {
  transition: none;
}

.sheet-grab {
  display: grid;
  place-items: center;
  height: 26px;
  touch-action: none;
  cursor: grab;
}

.sheet-grab i {
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--panel-3);
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--muted);
}

.sheet-body {
  padding: 2px 20px 0;
}

.sheet-title {
  font-size: 24px;
  font-weight: 780;
  letter-spacing: -0.045em;
}

.sheet-note {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.reg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 16px;
}

.reg {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.reg:disabled .reg-label {
  color: var(--muted);
}

.reg:disabled .chip {
  opacity: 0.55;
}

.reg-wide {
  grid-column: 1 / -1;
}

.reg .chip {
  background: var(--panel-3);
}

/* ---- Avisos ---- */

.toast,
.update {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 26px, 494px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 14px 40px var(--shadow);
  font-size: 14px;
  font-weight: 620;
}

.toast {
  z-index: 55;
  bottom: calc(var(--tabbar-gap) + var(--tabbar-h) + 14px);
  min-height: 60px;
  animation: toast-in 0.26s var(--ease-out);
}

.toast-undo {
  min-width: 88px;
  min-height: 44px;
  border-radius: 14px;
  background: var(--panel-3);
  color: var(--accent);
  font-size: 14px;
  font-weight: 750;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

.update {
  z-index: 40;
  top: calc(var(--safe-top) + var(--band-h) + 10px);
}

/* ---- Guia de instalacion ---- */

.guide {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 14px;
  max-width: 460px;
  min-height: 100dvh;
  align-content: center;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 32px) 26px calc(var(--safe-bottom) + 32px);
}

.guide-mark {
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
}

.guide-mark circle {
  stroke-width: 3.2;
  stroke-linecap: round;
}

.guide-title {
  font-size: 34px;
  line-height: 1.06;
  font-weight: 790;
  letter-spacing: -0.05em;
}

.guide-lead {
  color: var(--muted);
  font-size: 15.5px;
}

.guide-steps {
  display: grid;
  gap: 2px;
  width: 100%;
  margin: 10px 0 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.guide-step {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  font-size: 14.5px;
  font-weight: 600;
}

.guide-step + .guide-step {
  border-top: 1px solid var(--border);
}

.guide-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--accent);
}

.guide-note {
  font-size: 12.5px;
  color: var(--faint);
}

/* Movimiento reducido: ni transiciones ni animaciones, en ningun elemento. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Semana: resumen de objetivos ----
   Misma familia que la tarjeta principal de Hoy: degradado nocturno, borde fuerte, texto a la
   izquierda y la figura a la derecha. La estrella es pequena y acompana; la cifra va en la lista. */
.week-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px 14px 18px 18px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 112% -30%, rgba(177, 161, 255, 0.24), transparent 55%),
    linear-gradient(135deg, #1d284a 0%, #131e31 56%, #111b2b 100%);
  box-shadow: 0 12px 48px var(--shadow);
}

.week-hero-text {
  min-width: 0;
}

.week-hero-title {
  margin-top: 6px;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.goal-rows {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.goal-row {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}

.goal-label {
  font-weight: 600;
  white-space: nowrap;
}

.goal-value {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.goal-row.is-off .legend-dot {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--tone);
}

.goal-row.is-off .goal-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
}

.week-hero-note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.star-svg {
  display: block;
  width: 118px;
  height: 118px;
}

.star-ring {
  fill: none;
  stroke: rgba(190, 209, 244, 0.14);
}

.star-ring-mid {
  stroke-dasharray: 2 4;
}

.axis {
  stroke: rgba(190, 209, 244, 0.2);
}

.axis-invalid {
  stroke-dasharray: 2 4;
  stroke: rgba(190, 209, 244, 0.12);
}

.star-area {
  fill: rgba(183, 167, 255, 0.24);
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.star-vertex {
  fill: var(--tone);
}

/* ---- Semana: media diaria por metrica, en las mismas fichas que Hoy ---- */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric.stat {
  min-height: 0;
}

.metric-wide {
  grid-column: 1 / -1;
}

.metric .stat-val {
  font-size: 26px;
}

.metric-sub {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.day-dots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  justify-items: center;
  margin-top: 12px;
}

.dd {
  width: 5px;
  height: 5px;
  margin: 2.5px 0;
  border-radius: 50%;
  background: var(--panel-3);
}

.dd-on {
  width: 10px;
  height: 10px;
  margin: 0;
  background: var(--tone, var(--accent));
}

.dd-on-hollow {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--tone, var(--accent));
}

.dd-on-live {
  opacity: 0.55;
}

/* ---- Panel de grafica de siete dias (Sueno, Entrenos) ---- */
.chart-panel {
  padding: 16px 16px 8px;
}

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.chart-title {
  font-size: 15px;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.chart-status {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.chart-value {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.chart-value small {
  margin-left: 2px;
  font-size: 13px;
  font-weight: 620;
  letter-spacing: -0.02em;
  color: var(--muted);
}

.chart-compare {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.chart {
  margin: 12px 0 0;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-track {
  stroke: rgba(190, 209, 244, 0.06);
  stroke-width: 12;
  stroke-linecap: round;
}

.chart-goal {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.6;
}

.pt {
  fill: var(--tone, var(--accent));
  stroke: var(--tone, var(--accent));
  stroke-width: 2;
}

.pt-hollow {
  fill: var(--panel);
}

.pt-live {
  opacity: 0.55;
}

.pt-zero {
  fill: var(--faint);
  stroke: none;
}

.chart-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.chart-day {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.chart-day.is-empty {
  color: var(--faint);
}

.chart-day[aria-pressed="true"] {
  background: var(--panel-2);
  color: var(--text);
}

.chart-day:disabled {
  opacity: 0.35;
}

.chart-detail {
  min-height: 34px;
  padding: 6px 2px 4px;
  font-size: 13px;
  color: var(--muted);
}

.chart-detail:empty::before {
  content: "Toca un día para ver su valor y su origen.";
  color: var(--faint);
}

/* ---- Contenido que pasa bajo la barra: se desvanece antes de llegar a ella ---- */
.tab-scrim {
  position: fixed;
  z-index: 29;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabbar-gap) + var(--tabbar-h) + 44px);
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(8, 13, 23, 0),
    rgba(8, 13, 23, 0.86) 48%,
    var(--bg) 78%
  );
}

.form-card {
  display: grid;
  padding: 2px 16px 18px;
}

.chev {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--faint);
}

.pane {
  display: contents;
}

.dd-zero {
  width: 8px;
  height: 8px;
  margin: 1px 0;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--faint);
}

.metric-wide .day-dots {
  max-width: 280px;
}

.lead-note {
  margin: -6px 0 16px;
  line-height: 1.45;
}

.hero-link {
  display: flex;
  width: fit-content;
  align-items: center;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 16px;
  font-size: 14px;
}

/* ==== AURA NEXT ===============================================================================
   Sistema visual de Core OS Daily. Medianoche con profundidad: dos luces ambientales fijas (sin
   desenfoques que repintar), superficies en capas con un filo de luz arriba, el color de cada
   metrica como identidad y movimiento corto (150-350 ms) solo en transform y opacidad.
   El movimiento reducido lo apaga todo con la regla global de mas arriba. */

/* ---- Luz ambiental ---- */
body::before {
  inset: -140px 0 auto;
  height: 520px;
  background:
    radial-gradient(ellipse 70% 60% at 70% 0%, rgba(155, 133, 255, 0.2), transparent 70%),
    radial-gradient(ellipse 50% 50% at 10% 10%, rgba(106, 191, 250, 0.07), transparent 70%);
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 -160px;
  height: 520px;
  z-index: -1;
  background:
    radial-gradient(ellipse at 8% 100%, rgba(106, 191, 250, 0.06), transparent 62%),
    radial-gradient(ellipse at 96% 70%, rgba(113, 216, 184, 0.04), transparent 58%);
  pointer-events: none;
}

/* ---- Superficies ---- */
.card,
.stat,
.surface {
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--lift), var(--elev-1);
}

.stat {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Halo del color de la metrica en la esquina de su ficha. */
.stat::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -64px;
  right: -64px;
  width: 156px;
  height: 156px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tone, var(--accent)), transparent 70%);
  opacity: 0.12;
  pointer-events: none;
}

.chip {
  background: color-mix(in srgb, var(--tone, var(--muted)) 14%, var(--panel-2));
}

/* ---- Entrada escalonada: cada bloque aparece un poco despues del anterior ---- */
.enter {
  animation: enter var(--dur-3) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Cada cambio de pantalla monta un panel nuevo: entra con un fundido corto. */
.view {
  animation: none;
}

.pane {
  display: block;
  animation: view-in var(--dur-2) var(--ease-out);
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---- Cabecera de pagina ---- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 14px;
}

.page-head-text {
  min-width: 0;
}

.page-head .page-title {
  margin: 4px 0 0;
}

.page-head .eyebrow {
  color: var(--accent);
}

/* ---- Respuesta al toque: lo que se pulsa cede un poco ---- */
.act:active,
.stat:active,
.rec:active,
.row-link:active,
.reg:active,
.tl-item:active,
.session:active,
.hub-row:active,
.slot:active {
  transform: scale(0.975);
}

.act,
.rec,
.row-link,
.reg,
.tl-item,
.session,
.hub-row,
.slot,
.stat {
  transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-2) ease,
    border-color var(--dur-2) ease;
}

/* ---- Barra inferior: indicador que se desliza a la pestana activa ---- */
.tabbar {
  background: rgba(13, 19, 32, 0.9);
  border-color: rgba(200, 215, 255, 0.1);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(214, 226, 255, 0.06);
}

.tab {
  position: relative;
  z-index: 1;
}

.tab[aria-current="page"] {
  background: none;
}

.tab-ind {
  position: absolute;
  z-index: 0;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px - 8px) / 5);
  border-radius: 21px;
  background: linear-gradient(180deg, rgba(183, 167, 255, 0.16), rgba(183, 167, 255, 0.07));
  box-shadow: inset 0 1px 0 rgba(214, 226, 255, 0.08), 0 0 24px rgba(183, 167, 255, 0.12);
  transform: translateX(calc(var(--tab, 0) * (100% + 2px)));
  transition: transform var(--dur-3) var(--ease-spring);
}

.tab-ind[hidden] {
  display: none;
}

.tab-ico {
  transition: transform var(--dur-2) var(--ease-spring);
}

.tab[aria-current="page"] .tab-ico {
  transform: translateY(-1px) scale(1.06);
}

/* ---- Boton +: se aparta al bajar por la pagina y con una hoja abierta ---- */
.fab {
  background: radial-gradient(circle at 30% 25%, #f1edff, #b7a7ff 45%, #7b6bf0 100%);
  box-shadow: 0 12px 30px rgba(123, 107, 240, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-1) ease;
}

.fab.is-away,
:root:has(.sheet.open) .fab {
  opacity: 0;
  transform: translateY(18px) scale(0.86);
  pointer-events: none;
}

/* ==== HOY ==================================================================================== */

/* Fecha compacta */
.today-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.today-title {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.055em;
}

.today-date {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.today-date::first-letter {
  text-transform: uppercase;
}

/* Tira de dias con la seleccion deslizante */
.days {
  position: relative;
  margin: 12px 0 14px;
  padding: 4px;
  gap: 0;
  border-radius: 22px;
  background: rgba(15, 23, 38, 0.72);
  border: 1px solid var(--hairline);
}

.day {
  position: relative;
  z-index: 1;
  min-height: 58px;
  padding: 7px 0 6px;
  gap: 3px;
  border-radius: 18px;
  border: 0;
  transition: color var(--dur-2) ease;
}

.day.selected {
  background: none;
  box-shadow: none;
}

.day.selected .day-label {
  color: var(--text);
}

.day-num {
  font-size: 16px;
}

.day-pill {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 7);
  border-radius: 18px;
  background: linear-gradient(180deg, #273556, #1b2741);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(214, 226, 255, 0.1);
  transform: translateX(calc(var(--d, 0) * 100%));
  transition: transform var(--dur-3) var(--ease-spring);
}

.day.has-data .day-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* Consola: los anillos y su leyenda */
.hero-aura {
  padding: 18px 14px 18px 18px;
  background:
    radial-gradient(circle at 88% 50%, rgba(177, 161, 255, 0.2), transparent 48%),
    radial-gradient(circle at 0% 0%, rgba(106, 191, 250, 0.1), transparent 50%),
    linear-gradient(140deg, #1d2a4f 0%, #121d31 58%, #0e1828 100%);
  box-shadow: inset 0 1px 0 rgba(214, 226, 255, 0.09), 0 20px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(183, 167, 255, 0.05);
}

.hero-aura .eyebrow {
  color: var(--accent);
}

.hero-cover {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.hero-aura .legend {
  margin-top: 12px;
  gap: 9px;
}

.legend-row {
  grid-template-columns: 7px minmax(0, 1fr) auto;
}

.legend-goal {
  grid-column: 2 / -1;
  margin-top: -5px;
  font-size: 11px;
  color: var(--faint);
}

.hero-aura .rings {
  width: 148px;
  height: 148px;
}

.ring-arc {
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--tone) 50%, transparent));
}

.ring-core strong {
  text-shadow: 0 0 18px rgba(183, 167, 255, 0.35);
}

/* Muelle de registro rapido: el agua, a un toque y con su cantidad */
.dock {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.act {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-height: 78px;
  padding: 10px 4px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: var(--lift);
  text-align: center;
}

.act-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 15%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--tone) 20%, transparent);
}

.act-ico .ico {
  width: 18px;
  height: 18px;
}

.act-text {
  display: grid;
  gap: 1px;
}

.act-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.act-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.act-primary {
  border-color: color-mix(in srgb, var(--tone) 35%, transparent);
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--tone) 22%, transparent), transparent
    70%),
    var(--surface);
}

.act-primary .act-sub {
  color: var(--tone);
}

/* Fichas del dia */
.stats {
  gap: 10px;
}

.stat {
  min-height: 128px;
}

.stat-val {
  margin-top: 12px;
}

/* Check-in: como me encuentro, con la escala declarada */
.checkin {
  display: grid;
  gap: 12px;
  padding: 15px 16px;
  border-radius: var(--r-lg);
}

.checkin-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.checkin-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.checkin-time {
  font-size: 12px;
  color: var(--faint);
}

.checkin-rows {
  display: grid;
  gap: 9px;
}

.checkin-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.checkin-row span:first-child {
  color: var(--muted);
  font-weight: 600;
}

.checkin-row strong {
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
}

.checkin-note {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.checkin-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.checkin-empty .btn {
  flex: none;
}

/* Escala de diez segmentos */
.meter {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  min-width: 0;
}

.meter i {
  height: 7px;
  border-radius: 3px;
  background: rgba(190, 209, 244, 0.1);
}

.meter i.on {
  background: var(--tone, var(--accent));
}

/* Comidas: cuatro franjas en una fila */
.slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.slot {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 92px;
  padding: 11px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface);
  text-align: left;
  min-width: 0;
}

.slot-name {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.slot-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: var(--food);
  background: color-mix(in srgb, var(--food) 15%, transparent);
}

.slot-mark .ico {
  width: 15px;
  height: 15px;
}

.slot-text {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 560;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.slot.is-empty {
  border-style: dashed;
  border-color: var(--border);
  background: rgba(18, 27, 43, 0.4);
  box-shadow: none;
}

.slot.is-empty .slot-mark {
  color: var(--faint);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
}

.slot.is-empty .slot-text {
  color: var(--faint);
}

.slot.is-skipped .slot-mark {
  color: var(--muted);
  background: var(--panel-2);
}

/* Cronologia: un rail con la hora a la izquierda */
.tl {
  position: relative;
  display: grid;
  padding: 6px 0;
}

.tl::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 70px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(183, 167, 255, 0.35), rgba(190, 209, 244, 0.08));
}

.tl-item {
  display: grid;
  grid-template-columns: 48px 14px minmax(0, 1fr);
  align-items: start;
  gap: 0 12px;
  min-height: 52px;
  padding: 10px 14px 10px 10px;
  text-align: left;
  width: 100%;
}

.tl-time {
  padding-top: 1px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.tl-node {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin-top: 3px;
  margin-left: 1px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 0 3px var(--panel), 0 0 10px color-mix(in srgb, var(--tone) 60%, transparent);
}

.tl-item.is-transcribed .tl-node {
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--tone), 0 0 0 3px var(--panel);
}

.tl-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tl-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.tl-title .ico {
  width: 15px;
  height: 15px;
  align-self: center;
  color: var(--tone);
}

.tl-text {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tl-item.is-new .tl-node {
  animation: saved 1.2s var(--ease-out);
}

@keyframes saved {
  0% {
    transform: scale(0.4);
  }
  40% {
    transform: scale(1.5);
  }
}

/* Un dato que acaba de entrar se ilumina una vez. */
.just-saved {
  animation: glow 1.1s var(--ease-out);
}

@keyframes glow {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone, var(--accent)) 60%, transparent);
  }
  100% {
    box-shadow: 0 0 0 14px transparent;
  }
}

/* ==== Piezas comunes ========================================================================= */

.big {
  font-size: 40px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.055em;
  white-space: nowrap;
}

.big small {
  margin-left: 3px;
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -0.02em;
  color: var(--muted);
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text);
  background: rgba(190, 209, 244, 0.08);
}

.delta-ico {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

.delta-flat {
  padding-left: 9px;
  color: var(--muted);
}

.gtag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.gtag-ico {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}

.gtag-none {
  color: var(--faint);
  box-shadow: inset 0 0 0 1px var(--border);
  font-weight: 600;
}

.gtag-empty,
.gtag-short {
  color: var(--muted);
  background: rgba(190, 209, 244, 0.06);
  box-shadow: inset 0 0 0 1px var(--border);
  font-weight: 600;
}

.gtag-open {
  color: var(--text);
  background: rgba(190, 209, 244, 0.1);
}

.gtag-met {
  color: #0d1c16;
  background: var(--status);
}

.hbar {
  display: block;
  height: 8px;
  border-radius: 8px;
  background: rgba(190, 209, 244, 0.07);
  overflow: hidden;
}

.hbar i {
  display: block;
  width: var(--p, 0%);
  height: 100%;
  border-radius: 8px;
  background: var(--tone, var(--accent));
  transform-origin: left;
  animation: grow-x var(--dur-3) var(--ease-out) both;
}

.hbar-dim i {
  opacity: 0.45;
}

@keyframes grow-x {
  from {
    transform: scaleX(0);
  }
}

.legend-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.legend-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.key-solid,
.key-hollow,
.key-none {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.key-hollow {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.key-none {
  width: 5px;
  height: 5px;
  margin: 0 2px;
  background: rgba(190, 209, 244, 0.2);
}

/* ==== SEMANA ================================================================================= */

.week-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.week-range {
  min-width: 0;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.week-hero {
  grid-template-columns: 1fr;
  justify-items: stretch;
  gap: 4px;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 30%, rgba(177, 161, 255, 0.18), transparent 55%),
    linear-gradient(160deg, #1d2a4f 0%, #121d31 60%, #0e1828 100%);
  box-shadow: inset 0 1px 0 rgba(214, 226, 255, 0.09), 0 20px 60px rgba(0, 0, 0, 0.45);
}

.week-hero-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.week-hero .eyebrow {
  color: var(--accent);
}

.star-wrap {
  display: grid;
  place-items: center;
  margin: 2px 0 4px;
}

.star-svg {
  width: min(100%, 236px);
  height: auto;
  overflow: visible;
}

.star-label {
  font-size: 7px;
  font-weight: 700;
  fill: var(--muted);
  letter-spacing: -0.01em;
}

.star-label.is-off {
  fill: var(--faint);
  font-weight: 600;
}

.star-area {
  fill: rgba(183, 167, 255, 0.22);
  stroke-width: 1.4;
  transform-origin: 0 0;
  animation: star-in 0.5s var(--ease-out) both;
}

@keyframes star-in {
  from {
    transform: scale(0.2);
    opacity: 0;
  }
}

.star-goal {
  fill: none;
  stroke: rgba(113, 216, 184, 0.45);
  stroke-width: 0.8;
}

.star-vertex {
  stroke: var(--panel);
  stroke-width: 1.2;
}

.goal-rows {
  gap: 2px;
  margin-top: 6px;
}

.goal-row {
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 2px;
  font-size: 13.5px;
}

.goal-row + .goal-row {
  border-top: 1px solid rgba(190, 209, 244, 0.07);
}

.goal-row .legend-dot {
  width: 9px;
  height: 9px;
}

.goal-meta {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
}

.week-hero-note {
  margin-top: 10px;
}

/* Cobertura: metricas por dias, para ver de un vistazo que falta */
.cov {
  padding: 14px 14px 12px;
}

.cov-grid {
  display: grid;
  grid-template-columns: 74px repeat(7, minmax(0, 1fr));
  align-items: center;
  row-gap: 8px;
}

.cov-day {
  font-size: 10.5px;
  font-weight: 750;
  color: var(--faint);
  text-align: center;
}

.cov-day.is-today {
  color: var(--accent);
}

.cov-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  min-width: 0;
}

.cov-name .ico {
  width: 14px;
  height: 14px;
  color: var(--tone);
}

.cov-cell {
  justify-self: center;
  width: 16px;
  height: 16px;
  border-radius: 6px;
  background: rgba(190, 209, 244, 0.06);
}

.cov-cell.on {
  background: var(--tone);
  box-shadow: 0 0 10px color-mix(in srgb, var(--tone) 35%, transparent);
}

.cov-cell.hollow {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--tone);
}

.cov-cell.live {
  opacity: 0.5;
}

.cov-cell.zero {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--faint);
}

.cov-cell.future {
  background: none;
  box-shadow: inset 0 0 0 1px rgba(190, 209, 244, 0.05);
}

.cov-foot {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

/* Fichas de media diaria con minibarras de los siete dias */
.metric .stat-val {
  font-size: 27px;
}

.day-dots {
  align-items: end;
  height: 34px;
  margin-top: 12px;
  gap: 4px;
}

.dd {
  justify-self: stretch;
  width: auto;
  height: 3px;
  margin: 0;
  border-radius: 3px;
  background: rgba(190, 209, 244, 0.09);
}

.dd-on {
  width: auto;
  height: var(--h, 100%);
  min-height: 5px;
  margin: 0;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--tone, var(--accent)),
    color-mix(in srgb, var(--tone, var(--accent)) 55%, transparent));
  transform-origin: bottom;
  animation: grow-y var(--dur-3) var(--ease-out) both;
}

.dd-on-hollow {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--tone, var(--accent));
}

.dd-zero {
  width: auto;
  height: 3px;
  margin: 0;
  background: var(--faint);
  box-shadow: none;
}

@keyframes grow-y {
  from {
    transform: scaleY(0);
  }
}

.metric-wide .day-dots {
  max-width: none;
}

.metric .delta {
  margin-top: 2px;
}

.sec-sub {
  margin: -6px 0 11px;
  font-size: 12px;
  color: var(--muted);
}

/* ==== Graficas de siete dias: piruletas con su valor escrito ================================= */

.chart-svg {
  overflow: visible;
}

.chart-col {
  fill: rgba(190, 209, 244, 0.035);
}

.chart-col.is-sel {
  fill: rgba(183, 167, 255, 0.1);
}

.stem {
  stroke: var(--tone, var(--accent));
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.45;
  transform-box: fill-box;
  transform-origin: bottom;
  animation: grow-y var(--dur-3) var(--ease-out) both;
}

.pt {
  stroke-width: 2.2;
}

.pt-label {
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--text);
  text-anchor: middle;
}

.pt-label.is-live {
  fill: var(--muted);
}

.chart-goal-label {
  font-size: 9px;
  font-weight: 650;
  fill: var(--muted);
  text-anchor: end;
}

.chart-goal {
  stroke: rgba(113, 216, 184, 0.6);
  opacity: 1;
}

.chart-base {
  stroke: rgba(190, 209, 244, 0.12);
  stroke-width: 1;
}

.chart-day {
  font-size: 11.5px;
}

.chart-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 4px;
}

/* ==== SUENO ================================================================================== */

.night {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 100% 0%, rgba(174, 149, 255, 0.28), transparent 52%),
    radial-gradient(circle at 0% 100%, rgba(106, 191, 250, 0.1), transparent 50%),
    linear-gradient(160deg, #1e2150 0%, #131a33 55%, #0d1426 100%);
  box-shadow: inset 0 1px 0 rgba(214, 226, 255, 0.09), 0 20px 60px rgba(0, 0, 0, 0.45);
}

.night-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.night .eyebrow {
  color: var(--sleep);
}

.night .big {
  margin-top: 10px;
}

.night-when {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.moon-orb {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3efff, #b9a6ff 48%, #6c58d8 100%);
  box-shadow: 0 0 40px rgba(174, 149, 255, 0.45), inset -8px -6px 0 rgba(30, 24, 80, 0.35);
}

.night-span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
}

.night-span small {
  display: block;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.night-span .end {
  text-align: right;
}

.night-line {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(174, 149, 255, 0.35), var(--sleep), rgba(106, 191, 250,
    0.7));
}

.night-facts {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(190, 209, 244, 0.1);
}

.fact {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.fact > span:first-child {
  color: var(--muted);
  font-weight: 600;
}

.fact strong {
  font-weight: 740;
  white-space: nowrap;
}

.night .act {
  margin-top: 16px;
}

.act-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 15px;
  width: 100%;
  justify-content: center;
  grid-auto-flow: column;
}

.act-row .act-ico {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

/* Calidad por noche */
.qrow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 4px;
}

.qcell {
  display: grid;
  place-items: center;
  min-height: 30px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
  color: var(--faint);
  background: rgba(190, 209, 244, 0.04);
}

.qcell.has {
  color: var(--text);
  background: color-mix(in srgb, var(--sleep) calc(var(--q, 0.5) * 34%), transparent);
}

.qhead {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Comparacion entre periodos */
.cmp {
  display: grid;
  gap: 10px;
  padding: 15px 16px;
}

.cmp-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.cmp-row span:first-child {
  color: var(--muted);
  font-weight: 600;
}

.cmp-row strong {
  font-weight: 760;
  white-space: nowrap;
}

.cmp-note {
  font-size: 12.5px;
  color: var(--muted);
}

/* Origen de los datos */
.src {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.src-cell {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-radius: var(--r-md);
}

.src-cell strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.src-cell span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}

/* ==== ENTRENOS =============================================================================== */

.sport-football {
  --tone: var(--sport-football);
}
.sport-gym {
  --tone: var(--sport-gym);
}
.sport-cardio {
  --tone: var(--sport-cardio);
}
.sport-other {
  --tone: var(--sport-other);
}

.wk-hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 100% 0%, rgba(113, 216, 184, 0.22), transparent 52%),
    linear-gradient(160deg, #142c35 0%, #10202e 50%, #0d1626 100%);
  box-shadow: inset 0 1px 0 rgba(214, 226, 255, 0.09), 0 20px 60px rgba(0, 0, 0, 0.45);
}

/* Lineas de campo, muy tenues: identidad deportiva sin ruido. */
.wk-hero::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 1.5px solid rgba(113, 216, 184, 0.12);
  box-shadow: 0 0 0 26px rgba(113, 216, 184, 0.03);
  pointer-events: none;
}

.wk-hero .eyebrow {
  color: var(--status);
}

.wk-hero-nums {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 22px;
  margin-top: 10px;
}

.wk-hero-sub {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.sport-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.sport-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 6px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: color-mix(in srgb, var(--tone) 13%, rgba(10, 16, 28, 0.6));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 28%, transparent);
}

.sport-chip .sport-ico {
  width: 22px;
  height: 22px;
}

.sport-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 18%, transparent);
}

.sport-ico .ico {
  width: 60%;
  height: 60%;
}

.wk-hero .act {
  margin-top: 16px;
}

/* Frecuencia: los siete dias con las sesiones de cada uno */
.freq {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 14px 12px 12px;
}

.freq-day {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-height: 92px;
}

.freq-label {
  font-size: 11px;
  font-weight: 750;
  color: var(--faint);
}

.freq-day.is-today .freq-label {
  color: var(--accent);
}

.freq-stack {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.freq-none {
  width: 6px;
  height: 6px;
  margin-top: 9px;
  border-radius: 50%;
  background: rgba(190, 209, 244, 0.12);
}

.freq-day.is-future .freq-none {
  background: none;
  box-shadow: inset 0 0 0 1px rgba(190, 209, 244, 0.1);
}

.freq-min {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

/* Tarjeta de sesion */
.sessions {
  display: grid;
  gap: 10px;
}

.session {
  position: relative;
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--tone) 14%, transparent), transparent
    55%),
    var(--surface);
  box-shadow: var(--lift), var(--elev-1);
  text-align: left;
  overflow: hidden;
}

.session::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--tone);
}

.session-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-top .sport-ico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.session-name {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.session-name strong {
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.session-name span {
  font-size: 12px;
  color: var(--muted);
}

.session-badge {
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.02em;
  color: #0d1c16;
  background: var(--tone);
}

.session-badge.is-soft {
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 15%, transparent);
}

.session-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.sstat {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sstat small {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.sstat strong {
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.sstat strong small {
  margin-left: 2px;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.sstat-wide {
  flex-basis: 100%;
}

.sstat .meter {
  width: 100%;
  max-width: 220px;
  margin-top: 3px;
}

.session-note {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
  padding-left: 10px;
  border-left: 2px solid rgba(190, 209, 244, 0.12);
}

/* ==== HISTORIAL ============================================================================== */

.history-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 6px;
}

.search {
  position: relative;
}

.search .ico {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.history-search {
  width: 100%;
  padding-left: 40px;
}

.chips {
  display: flex;
  gap: 7px;
}

.hscroll {
  overflow-x: auto;
  margin: 0 calc(-1 * var(--gutter));
  padding: 2px var(--gutter);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.hscroll::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  transition: background-color var(--dur-2) ease, color var(--dur-2) ease,
    border-color var(--dur-2) ease;
}

.chip-btn .ico {
  width: 15px;
  height: 15px;
  color: var(--tone, var(--muted));
}

.chip-btn[aria-checked="true"] {
  background: color-mix(in srgb, var(--tone, var(--accent)) 16%, var(--panel-2));
  border-color: color-mix(in srgb, var(--tone, var(--accent)) 40%, transparent);
  color: var(--text);
}

.history-count {
  font-size: 12px;
  color: var(--faint);
}

.day-group {
  margin-top: 18px;
}

.day-head {
  position: sticky;
  top: calc(var(--band-h) + var(--safe-top));
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 calc(-1 * var(--gutter)) 6px;
  padding: 10px var(--gutter) 8px;
  font-size: 13px;
  font-weight: 780;
  letter-spacing: -0.01em;
  background: linear-gradient(to bottom, var(--bg) 72%, rgba(6, 10, 18, 0));
}

.day-head span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--faint);
}

.history-none {
  margin-top: 18px;
}

/* ==== OBJETIVOS ============================================================================== */

.goal-cards {
  display: grid;
  gap: 10px;
}

.goal-card {
  display: grid;
  gap: 12px;
  padding: 15px 16px 16px;
  border-radius: var(--r-lg);
}

.goal-card-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.goal-card-name {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.goal-card-name strong {
  font-size: 15.5px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.goal-card-name span {
  font-size: 12px;
  color: var(--muted);
}

.stepper {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: end;
  gap: 8px;
}

.stepper .f {
  margin: 0;
}

.stepper .inp {
  text-align: center;
  font-size: 22px;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.step-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  border: 1px solid var(--hairline);
  background: var(--panel-2);
  color: var(--tone, var(--text));
  transition: transform var(--dur-1) var(--ease-out);
}

.step-btn:active {
  transform: scale(0.92);
}

.step-btn .ico {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.goal-card-note {
  font-size: 12px;
  color: var(--faint);
}

.goal-save {
  position: sticky;
  bottom: calc(var(--tabbar-gap) + var(--tabbar-h) + 14px);
  z-index: 5;
}

/* ==== MAS ==================================================================================== */

.data-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 16px 14px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 50% -20%, rgba(177, 161, 255, 0.2), transparent 60%),
    linear-gradient(160deg, #1b2747 0%, #121c30 60%, #0e1828 100%);
  box-shadow: inset 0 1px 0 rgba(214, 226, 255, 0.08), 0 16px 50px rgba(0, 0, 0, 0.4);
}

.data-num {
  display: grid;
  justify-items: center;
  gap: 3px;
  text-align: center;
  min-width: 0;
}

.data-num strong {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.data-num span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.hub {
  display: grid;
}

.hub-row {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 62px;
  padding: 10px 14px 10px 13px;
}

.hub-row + .hub-row {
  border-top: 1px solid var(--border);
}

.hub-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--tone, var(--accent));
  background: color-mix(in srgb, var(--tone, var(--accent)) 15%, var(--panel-2));
}

.hub-ico .ico {
  width: 19px;
  height: 19px;
}

.hub-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.hub-text strong {
  font-size: 15px;
  font-weight: 700;
}

.hub-text span {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.hub-row .chev {
  margin-left: 0;
}

.ensayo-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
  border-radius: var(--r-lg);
}

.ensayo-card .hub-text {
  gap: 3px;
}

.ensayo-card .btn {
  flex: none;
}

@media (max-width: 380px) {
  .dock {
    grid-template-columns: 1.25fr 1fr 1fr 1fr;
    gap: 6px;
  }

  .act-label {
    font-size: 12px;
  }

  .hero-aura .rings {
    width: 132px;
    height: 132px;
  }

  .slots {
    gap: 6px;
  }

  .slot {
    padding: 10px 8px;
  }
}

/* Cabecera de marca compacta: la pantalla empieza antes. */
.head {
  padding: calc(var(--safe-top) + var(--band-h) + 10px) 21px 8px;
  gap: 10px;
}

.brand-tile {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.brand-mark {
  width: 25px;
  height: 25px;
}

.brand {
  font-size: 17px;
}

.brand-sub {
  margin-top: 3px;
}

/* Acciones anchas dentro de una tarjeta protagonista: icono y texto en una fila. */
.night .act,
.wk-hero .act {
  grid-auto-flow: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 16px;
  padding: 6px 16px;
  background: rgba(10, 16, 28, 0.45);
}

.night .act-ico,
.wk-hero .act-ico {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.big-2 {
  font-size: 28px;
  color: var(--muted);
}

.big-2 small {
  font-size: 13px;
}

.big-none {
  font-size: 26px;
  color: var(--muted);
}

.fact-prov {
  font-size: 11.5px;
  color: var(--muted);
}

.qlabels {
  margin-top: 6px;
  justify-items: center;
}

.wk-hero .delta {
  margin-top: 10px;
}

.chart-panel .delta {
  margin-top: 8px;
}

.chart-key {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-bottom: 4px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
}

.key-goal {
  width: 16px;
  border-top: 1.5px dashed rgba(113, 216, 184, 0.8);
}

.rec .prov {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.freq-day {
  min-height: 0;
}

/* Objetivos: la etiqueta repite el titulo de la tarjeta; se queda para el lector de pantalla. */
.stepper {
  align-items: center;
}

.stepper .f-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.goal-save {
  justify-items: stretch;
  margin-right: 70px;
}

.goal-save .btn {
  width: 100%;
  min-height: 52px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

/* forms.css se carga despues: la busqueda necesita mas especificidad para dejar sitio a la lupa. */
.search .inp {
  padding-left: 42px;
}

/* Historial: filas compactas para cientos de registros. */
.day-group .rec {
  min-height: 52px;
  padding: 10px 14px;
  gap: 11px;
}

.day-group .rec .chip {
  width: 28px;
  height: 28px;
}

/* Un cero real es una raya: no se confunde con "sin dato" ni con "del reloj". */
.cov-cell.zero {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--muted);
  box-shadow: none;
}

.key-zero {
  width: 10px;
  height: 3px;
  border-radius: 2px;
  background: var(--muted);
}

/* ---- Integracion AURA NEXT: funciones de features/ en las pantallas ------------------------- */

/* Entrenos: sensaciones en palabras de la persona, separadas de las observaciones. */
.session-feeling small {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Hoy: cierre del dia, huecos sin registrar. Neutro: no es un aviso ni un reproche. */
.day-close {
  flex-wrap: wrap;
}
.chip-btn.is-static {
  cursor: default;
  opacity: 0.7;
}

/* Hoy: posible duplicado, solo señalado. */
/* La cronologia es una rejilla: sin esto cada etiqueta ocupa toda la fila. */
.tl-body > .tag {
  justify-self: start;
}
/* .tag.tag-dup: forms.css se carga despues y su .tag fijaria el color. */
.tag.tag-dup {
  color: var(--amber);
  border-color: var(--amber);
}

/* Semana: tendencias del check-in. */
.checkin-trends .trend-delta {
  font-size: 12px;
  font-weight: 560;
  color: var(--muted);
}

/* Comida: platos recientes y frecuentes. */
.meal-suggest-group + .meal-suggest-group {
  margin-top: 10px;
}
.meal-suggest .chip-btn {
  max-width: 78vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
